8212885: TLS 1.3 resumed session does not retain peer certificate chain

Reviewed-by: xuelei, wetmore
This commit is contained in:
Jamil Nimeh 2018-11-13 18:22:52 -08:00
parent 65dc116bf6
commit acd81b508e
5 changed files with 134 additions and 17 deletions

View file

@ -415,6 +415,16 @@ final class PreSharedKeyExtension {
result = false;
}
// Make sure that the server handshake context's localSupportedSignAlgs
// field is populated. This is particularly important when
// client authentication was used in an initial session and it is
// now being resumed.
if (shc.localSupportedSignAlgs == null) {
shc.localSupportedSignAlgs =
SignatureScheme.getSupportedAlgorithms(
shc.algorithmConstraints, shc.activeProtocols);
}
// Validate the required client authentication.
if (result &&
(shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED)) {
@ -763,7 +773,7 @@ final class PreSharedKeyExtension {
SecretKey earlySecret = hkdf.extract(zeros, psk, "TlsEarlySecret");
byte[] label = ("tls13 res binder").getBytes();
MessageDigest md = MessageDigest.getInstance(hashAlg.toString());;
MessageDigest md = MessageDigest.getInstance(hashAlg.name);
byte[] hkdfInfo = SSLSecretDerivation.createHkdfInfo(
label, md.digest(new byte[0]), hashAlg.hashLength);
return hkdf.expand(earlySecret,