src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java
changeset 52151 af6fb2cb82ae
parent 51812 30e6079a9a12
child 53064 103ed9569fc8
equal deleted inserted replaced
52150:f586d225bd0b 52151:af6fb2cb82ae
   408                         "for client certificate authentication");
   408                         "for client certificate authentication");
   409                 return null;    // make the compiler happy
   409                 return null;    // make the compiler happy
   410             }
   410             }
   411 
   411 
   412             // Produce the extension.
   412             // Produce the extension.
   413             if (shc.localSupportedSignAlgs == null) {
   413             List<SignatureScheme> sigAlgs =
   414                 shc.localSupportedSignAlgs =
       
   415                     SignatureScheme.getSupportedAlgorithms(
   414                     SignatureScheme.getSupportedAlgorithms(
   416                             shc.algorithmConstraints, shc.activeProtocols);
   415                             shc.algorithmConstraints,
   417             }
   416                             List.of(shc.negotiatedProtocol));
   418 
   417 
   419             int vectorLen = SignatureScheme.sizeInRecord() *
   418             int vectorLen = SignatureScheme.sizeInRecord() * sigAlgs.size();
   420                     shc.localSupportedSignAlgs.size();
       
   421             byte[] extData = new byte[vectorLen + 2];
   419             byte[] extData = new byte[vectorLen + 2];
   422             ByteBuffer m = ByteBuffer.wrap(extData);
   420             ByteBuffer m = ByteBuffer.wrap(extData);
   423             Record.putInt16(m, vectorLen);
   421             Record.putInt16(m, vectorLen);
   424             for (SignatureScheme ss : shc.localSupportedSignAlgs) {
   422             for (SignatureScheme ss : sigAlgs) {
   425                 Record.putInt16(m, ss.id);
   423                 Record.putInt16(m, ss.id);
   426             }
   424             }
   427 
   425 
   428             // Update the context.
   426             // Update the context.
   429             shc.handshakeExtensions.put(
   427             shc.handshakeExtensions.put(