changeset 16050:4407b0525631

8169229: RSAClientKeyExchange debug info is incorrect Reviewed-by: xuelei
author wetmore
date Tue, 08 Nov 2016 16:54:28 -0800
parents 9bb8dc7e972d
children 81eb4bd34611
files src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Tue Nov 08 15:55:11 2016 -0800
+++ b/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java	Tue Nov 08 16:54:28 2016 -0800
@@ -257,7 +257,13 @@
 
     @Override
     void print(PrintStream s) throws IOException {
-        s.println("*** ClientKeyExchange, RSA PreMasterSecret, " +
-                                                        protocolVersion);
+        String version = "version not available/extractable";
+
+        byte[] ba = preMaster.getEncoded();
+        if (ba != null && ba.length >= 2) {
+            version = ProtocolVersion.valueOf(ba[0], ba[1]).name;
+        }
+
+        s.println("*** ClientKeyExchange, RSA PreMasterSecret, " + version);
     }
 }