8169229: RSAClientKeyExchange debug info is incorrect

Reviewed-by: xuelei
This commit is contained in:
Bradford Wetmore 2016-11-08 16:54:28 -08:00
parent 31c4b07045
commit 5e03e2fcd5

View File

@ -257,7 +257,13 @@ final class RSAClientKeyExchange extends HandshakeMessage {
@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);
}
}