Skip to content

Commit 8f0f285

Browse files
committed
Use clientHelloExtensions local in processServerHello
1 parent 0411027 commit 8f0f285

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ protected void process13ServerHelloCoda(ServerHello serverHello, boolean afterHe
11191119
protected void processServerHello(ServerHello serverHello)
11201120
throws IOException
11211121
{
1122+
Hashtable clientHelloExtensions = clientHello.getExtensions();
11221123
Hashtable serverHelloExtensions = serverHello.getExtensions();
11231124

11241125
final ProtocolVersion legacy_version = serverHello.getVersion();
@@ -1257,7 +1258,7 @@ protected void processServerHello(ServerHello serverHello)
12571258
* associated ClientHello, it MUST abort the handshake with an unsupported_extension
12581259
* fatal alert.
12591260
*/
1260-
if (null == TlsUtils.getExtensionData(this.clientExtensions, extType))
1261+
if (null == TlsUtils.getExtensionData(clientHelloExtensions, extType))
12611262
{
12621263
throw new TlsFatalAlert(AlertDescription.unsupported_extension,
12631264
"Unrequested extension in ServerHello: " + ExtensionType.getText(extType.intValue()));
@@ -1359,7 +1360,7 @@ protected void processServerHello(ServerHello serverHello)
13591360
{
13601361
boolean negotiatedEMS = false;
13611362

1362-
if (TlsExtensionsUtils.hasExtendedMasterSecretExtension(clientExtensions))
1363+
if (TlsExtensionsUtils.hasExtendedMasterSecretExtension(clientHelloExtensions))
13631364
{
13641365
negotiatedEMS = TlsExtensionsUtils.hasExtendedMasterSecretExtension(serverHelloExtensions);
13651366

@@ -1400,7 +1401,7 @@ protected void processServerHello(ServerHello serverHello)
14001401
securityParameters.applicationProtocol = TlsExtensionsUtils.getALPNExtensionServer(serverHelloExtensions);
14011402
securityParameters.applicationProtocolSet = true;
14021403

1403-
Hashtable sessionClientExtensions = clientExtensions, sessionServerExtensions = serverHelloExtensions;
1404+
Hashtable sessionClientExtensions = clientHelloExtensions, sessionServerExtensions = serverHelloExtensions;
14041405
if (securityParameters.isResumedSession())
14051406
{
14061407
sessionClientExtensions = null;

0 commit comments

Comments
 (0)