8214418: half-closed SSLEngine status may cause application dead loop

Reviewed-by: jnimeh, dfuchs, chegar
This commit is contained in:
Xue-Lei Andrew Fan 2019-01-14 10:00:45 -08:00
parent 70ba959a4b
commit d81c4896a8
3 changed files with 15 additions and 10 deletions

View file

@ -577,13 +577,7 @@ class TransportContext implements ConnectionContext {
} else if (!isOutboundClosed()) {
// Special case that the inbound was closed, but outbound open.
return HandshakeStatus.NEED_WRAP;
}
} else if (isOutboundClosed() && !isInboundClosed()) {
// Special case that the outbound was closed, but inbound open.
return HandshakeStatus.NEED_UNWRAP;
} else if (!isOutboundClosed() && isInboundClosed()) {
// Special case that the inbound was closed, but outbound open.
return HandshakeStatus.NEED_WRAP;
} // Otherwise, both inbound and outbound are closed.
}
return HandshakeStatus.NOT_HANDSHAKING;