Check outgoing extensions
@@ -138,6 +138,9 @@ protected ServerHello generate13HelloRetryRequest(ClientHello clientHello) throw
TlsExtensionsUtils.addCookieExtension(serverHelloExtensions, retryCookie);
}
+ TlsUtils.checkExtensionData13(serverHelloExtensions, HandshakeType.hello_retry_request,
+ AlertDescription.internal_error);
+
return new ServerHello(clientHello.getSessionID(), securityParameters.getCipherSuite(), serverHelloExtensions);
}
@@ -369,6 +372,9 @@ else if (NamedGroup.refersToASpecificFiniteField(namedGroup))
applyMaxFragmentLengthExtension(securityParameters.getMaxFragmentLength());
+ TlsUtils.checkExtensionData13(serverHelloExtensions, HandshakeType.server_hello,
+ AlertDescription.internal_error);
+
return new ServerHello(serverLegacyVersion, securityParameters.getServerRandom(), legacy_session_id,
securityParameters.getCipherSuite(), serverHelloExtensions);
}
