8232581: Improve TLS verification

Reviewed-by: xuelei, rhalade, mschoene
This commit is contained in:
Jamil Nimeh 2019-10-30 13:15:21 -07:00
parent e6304dcaad
commit 740e70ba17
3 changed files with 19 additions and 3 deletions

View file

@ -90,6 +90,16 @@ final class ClientKeyExchange {
ServerHandshakeContext shc = (ServerHandshakeContext)context;
// clean up this consumer
shc.handshakeConsumers.remove(SSLHandshake.CLIENT_KEY_EXCHANGE.id);
// Check for an unprocessed client Certificate message. If that
// handshake consumer is still present then that expected message
// was not sent.
if (shc.handshakeConsumers.containsKey(
SSLHandshake.CERTIFICATE.id)) {
throw shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE,
"Unexpected ClientKeyExchange handshake message.");
}
SSLKeyExchange ke = SSLKeyExchange.valueOf(
shc.negotiatedCipherSuite.keyExchange,
shc.negotiatedProtocol);