8211866: TLS 1.3 CertificateRequest message sometimes offers disallowed signature algorithms

Reviewed-by: xuelei
This commit is contained in:
Jamil Nimeh 2018-10-16 11:24:41 -07:00
parent b6e77e4285
commit 180a8773fb
2 changed files with 10 additions and 14 deletions

View file

@ -243,18 +243,16 @@ final class CertSignAlgsExtension {
}
// Produce the extension.
if (shc.localSupportedSignAlgs == null) {
shc.localSupportedSignAlgs =
List<SignatureScheme> sigAlgs =
SignatureScheme.getSupportedAlgorithms(
shc.algorithmConstraints, shc.activeProtocols);
}
shc.algorithmConstraints,
List.of(shc.negotiatedProtocol));
int vectorLen = SignatureScheme.sizeInRecord() *
shc.localSupportedSignAlgs.size();
int vectorLen = SignatureScheme.sizeInRecord() * sigAlgs.size();
byte[] extData = new byte[vectorLen + 2];
ByteBuffer m = ByteBuffer.wrap(extData);
Record.putInt16(m, vectorLen);
for (SignatureScheme ss : shc.localSupportedSignAlgs) {
for (SignatureScheme ss : sigAlgs) {
Record.putInt16(m, ss.id);
}