mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8270344: Session resumption errors
Reviewed-by: xuelei
This commit is contained in:
parent
d85560ed0f
commit
04a806ec86
4 changed files with 164 additions and 23 deletions
|
@ -402,9 +402,6 @@ final class ClientHello {
|
|||
// clean up this producer
|
||||
chc.handshakeProducers.remove(SSLHandshake.CLIENT_HELLO.id);
|
||||
|
||||
// the max protocol version this client is supporting.
|
||||
ProtocolVersion maxProtocolVersion = chc.maximumActiveProtocol;
|
||||
|
||||
// session ID of the ClientHello message
|
||||
SessionId sessionId = new SessionId(new byte[0]);
|
||||
|
||||
|
@ -538,14 +535,6 @@ final class ClientHello {
|
|||
if (!session.getProtocolVersion().useTLS13PlusSpec()) {
|
||||
sessionId = session.getSessionId();
|
||||
}
|
||||
if (!maxProtocolVersion.equals(sessionVersion)) {
|
||||
maxProtocolVersion = sessionVersion;
|
||||
|
||||
// Update protocol version number in underlying socket and
|
||||
// handshake output stream, so that the output records
|
||||
// (at the record layer) have the correct version
|
||||
chc.setVersion(sessionVersion);
|
||||
}
|
||||
|
||||
// If no new session is allowed, force use of the previous
|
||||
// session ciphersuite, and add the renegotiation SCSV if
|
||||
|
@ -580,7 +569,7 @@ final class ClientHello {
|
|||
"no existing session can be resumed");
|
||||
}
|
||||
|
||||
if (maxProtocolVersion.useTLS13PlusSpec() &&
|
||||
if (chc.maximumActiveProtocol.useTLS13PlusSpec() &&
|
||||
SSLConfiguration.useCompatibilityMode) {
|
||||
// In compatibility mode, the TLS 1.3 legacy_session_id
|
||||
// field MUST be non-empty, so a client not offering a
|
||||
|
@ -623,7 +612,7 @@ final class ClientHello {
|
|||
}
|
||||
|
||||
// Create the handshake message.
|
||||
ProtocolVersion clientHelloVersion = maxProtocolVersion;
|
||||
ProtocolVersion clientHelloVersion = chc.maximumActiveProtocol;
|
||||
if (clientHelloVersion.useTLS13PlusSpec()) {
|
||||
// In (D)TLS 1.3, the client indicates its version preferences
|
||||
// in the "supported_versions" extension and the client_version
|
||||
|
|
|
@ -534,15 +534,6 @@ abstract class HandshakeContext implements ConnectionContext {
|
|||
return activeProtocols.contains(protocolVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the active protocol version and propagate it to the SSLSocket
|
||||
* and our handshake streams. Called from ClientHandshaker
|
||||
* and ServerHandshaker with the negotiated protocol version.
|
||||
*/
|
||||
void setVersion(ProtocolVersion protocolVersion) {
|
||||
this.conContext.protocolVersion = protocolVersion;
|
||||
}
|
||||
|
||||
private static boolean isActivatable(CipherSuite suite,
|
||||
AlgorithmConstraints algorithmConstraints,
|
||||
Map<NamedGroupSpec, Boolean> cachedStatus) {
|
||||
|
|
|
@ -81,7 +81,6 @@ final class TransportContext implements ConnectionContext {
|
|||
boolean needHandshakeFinishedStatus = false;
|
||||
boolean hasDelegatedFinished = false;
|
||||
|
||||
|
||||
// negotiated security parameters
|
||||
SSLSessionImpl conSession;
|
||||
ProtocolVersion protocolVersion;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue