8229733: TLS message handling improvements

Reviewed-by: jnimeh, rhalade, ahgross
This commit is contained in:
Xue-Lei Andrew Fan 2019-10-20 13:42:44 -07:00
parent 9efd3d7f20
commit 123febeb98
3 changed files with 37 additions and 11 deletions

View file

@ -164,12 +164,13 @@ final class TransportContext implements ConnectionContext {
" message: " +
SSLHandshake.nameOf(type));
}
if (type == SSLHandshake.KEY_UPDATE.id &&
!protocolVersion.useTLS13PlusSpec()) {
if (!PostHandshakeContext.isConsumable(this, type)) {
throw fatal(Alert.UNEXPECTED_MESSAGE,
"Unexpected post-handshake message: " +
SSLHandshake.nameOf(type));
}
handshakeContext = new PostHandshakeContext(this);
} else {
handshakeContext = sslConfig.isClientMode ?