8213782: NullPointerException in sun.security.ssl.OutputRecord.changeWriteCiphers

Reviewed-by: ascarpino
This commit is contained in:
Xue-Lei Andrew Fan 2018-12-14 17:51:02 -08:00
parent 516a3b3ec1
commit e44207a9f6
4 changed files with 140 additions and 29 deletions

View file

@ -223,6 +223,16 @@ final class KeyUpdate {
Authenticator.valueOf(hc.conContext.protocolVersion),
hc.conContext.protocolVersion, key, ivSpec,
hc.sslContext.getSecureRandom());
if (rc == null) {
hc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
"Illegal cipher suite (" + hc.negotiatedCipherSuite +
") and protocol version (" + hc.negotiatedProtocol +
")");
return;
}
rc.baseSecret = nplus1;
hc.conContext.inputRecord.changeReadCiphers(rc);
if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
@ -303,6 +313,14 @@ final class KeyUpdate {
return null;
}
if (wc == null) {
hc.conContext.fatal(Alert.ILLEGAL_PARAMETER,
"Illegal cipher suite (" + hc.negotiatedCipherSuite +
") and protocol version (" + hc.negotiatedProtocol + ")");
return null;
}
// Output the handshake message and change the write cipher.
//
// The KeyUpdate handshake message SHALL be delivered in the