< prev index next >

src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java

Print this page

        

*** 66,76 **** @SuppressWarnings("deprecation") RSAClientKeyExchange(ProtocolVersion protocolVersion, ProtocolVersion maxVersion, SecureRandom generator, PublicKey publicKey) throws IOException { if (publicKey.getAlgorithm().equals("RSA") == false) { ! throw new SSLKeyException("Public key not of type RSA"); } this.protocolVersion = protocolVersion; try { String s = protocolVersion.useTLS12PlusSpec() ? --- 66,77 ---- @SuppressWarnings("deprecation") RSAClientKeyExchange(ProtocolVersion protocolVersion, ProtocolVersion maxVersion, SecureRandom generator, PublicKey publicKey) throws IOException { if (publicKey.getAlgorithm().equals("RSA") == false) { ! throw new SSLKeyException("Public key not of type RSA: " + ! publicKey.getAlgorithm()); } this.protocolVersion = protocolVersion; try { String s = protocolVersion.useTLS12PlusSpec() ?
*** 98,108 **** ProtocolVersion maxVersion, SecureRandom generator, HandshakeInStream input, int messageSize, PrivateKey privateKey) throws IOException { if (privateKey.getAlgorithm().equals("RSA") == false) { ! throw new SSLKeyException("Private key not of type RSA"); } if (currentVersion.useTLS10PlusSpec()) { encrypted = input.getBytes16(); } else { --- 99,110 ---- ProtocolVersion maxVersion, SecureRandom generator, HandshakeInStream input, int messageSize, PrivateKey privateKey) throws IOException { if (privateKey.getAlgorithm().equals("RSA") == false) { ! throw new SSLKeyException("Private key not of type RSA: " + ! privateKey.getAlgorithm()); } if (currentVersion.useTLS10PlusSpec()) { encrypted = input.getBytes16(); } else {
*** 159,170 **** preMaster = (SecretKey)cipher.unwrap(encrypted, "TlsRsaPremasterSecret", Cipher.SECRET_KEY); } } catch (InvalidKeyException ibk) { // the message is too big to process with RSA ! throw new SSLProtocolException( ! "Unable to process PreMasterSecret, may be too big"); } catch (Exception e) { // unlikely to happen, otherwise, must be a provider exception if (debug != null && Debug.isOn("handshake")) { System.out.println("RSA premaster secret decryption error:"); e.printStackTrace(System.out); --- 161,172 ---- preMaster = (SecretKey)cipher.unwrap(encrypted, "TlsRsaPremasterSecret", Cipher.SECRET_KEY); } } catch (InvalidKeyException ibk) { // the message is too big to process with RSA ! throw new SSLException( ! "Unable to process PreMasterSecret", ibk); } catch (Exception e) { // unlikely to happen, otherwise, must be a provider exception if (debug != null && Debug.isOn("handshake")) { System.out.println("RSA premaster secret decryption error:"); e.printStackTrace(System.out);
< prev index next >