8228757: Fail fast if the handshake type is unknown

Reviewed-by: jnimeh
This commit is contained in:
Xue-Lei Andrew Fan 2019-08-19 12:56:48 -07:00
parent 94130be62e
commit c299c4fd46
4 changed files with 39 additions and 3 deletions

View file

@ -497,6 +497,16 @@ enum SSLHandshake implements SSLConsumer, HandshakeProducer {
return "UNKNOWN-HANDSHAKE-MESSAGE(" + id + ")";
}
static boolean isKnown(byte id) {
for (SSLHandshake hs : SSLHandshake.values()) {
if (hs.id == id && id != NOT_APPLICABLE.id) {
return true;
}
}
return false;
}
static final void kickstart(HandshakeContext context) throws IOException {
if (context instanceof ClientHandshakeContext) {
// For initial handshaking, including session resumption,