Skip to content

Commit 0e74ba0

Browse files
committed
Merge branch 'main' of gitlab.cryptoworkshop.com:root/bc-java
2 parents 541da67 + 6759453 commit 0e74ba0

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

tls/src/main/java/org/bouncycastle/tls/DTLSClientProtocol.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,10 @@ protected boolean establishSession(ClientHandshakeState state, TlsSession sessio
620620
return false;
621621
}
622622

623-
boolean isEMS = sessionParameters.isExtendedMasterSecret();
624-
if (!TlsUtils.isExtendedMasterSecretOptional(sessionVersion))
623+
if (!sessionParameters.isExtendedMasterSecret() &&
624+
!TlsUtils.isExtendedMasterSecretOptional(sessionVersion))
625625
{
626-
if (!isEMS)
627-
{
628-
return false;
629-
}
626+
return false;
630627
}
631628

632629
TlsCrypto crypto = state.clientContext.getCrypto();

tls/src/main/java/org/bouncycastle/tls/DTLSServerProtocol.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -751,13 +751,10 @@ protected boolean establishSession(ServerHandshakeState state, TlsSession sessio
751751
return false;
752752
}
753753

754-
boolean isEMS = sessionParameters.isExtendedMasterSecret();
755-
if (!TlsUtils.isExtendedMasterSecretOptional(sessionVersion))
754+
if (!sessionParameters.isExtendedMasterSecret() &&
755+
!TlsUtils.isExtendedMasterSecretOptional(sessionVersion))
756756
{
757-
if (!isEMS)
758-
{
759-
return false;
760-
}
757+
return false;
761758
}
762759

763760
TlsCrypto crypto = state.serverContext.getCrypto();

tls/src/main/java/org/bouncycastle/tls/TlsProtocol.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,17 +1582,9 @@ protected boolean establishSession(TlsSession sessionToResume)
15821582
return false;
15831583
}
15841584

1585-
boolean isEMS = sessionParameters.isExtendedMasterSecret();
1586-
if (sessionVersion.isSSL())
1585+
if (!TlsUtils.isExtendedMasterSecretOptional(sessionVersion))
15871586
{
1588-
if (isEMS)
1589-
{
1590-
return false;
1591-
}
1592-
}
1593-
else if (!TlsUtils.isExtendedMasterSecretOptional(sessionVersion))
1594-
{
1595-
if (!isEMS)
1587+
if (sessionParameters.isExtendedMasterSecret() == sessionVersion.isSSL())
15961588
{
15971589
return false;
15981590
}

0 commit comments

Comments
 (0)