@@ -1960,30 +1960,6 @@ private static TlsSecret update13TrafficSecret(SecurityParameters securityParame
19601960 EMPTY_BYTES , securityParameters .getPRFHashLength ());
19611961 }
19621962
1963- /**
1964- * @deprecated Will be removed. {@link TlsCryptoUtils#getHashForPRF(int)} should be a useful alternative.
1965- */
1966- public static short getHashAlgorithmForPRFAlgorithm (int prfAlgorithm )
1967- {
1968- switch (prfAlgorithm )
1969- {
1970- case PRFAlgorithm .ssl_prf_legacy :
1971- case PRFAlgorithm .tls_prf_legacy :
1972- throw new IllegalArgumentException ("legacy PRF not a valid algorithm" );
1973- case PRFAlgorithm .tls_prf_sha256 :
1974- case PRFAlgorithm .tls13_hkdf_sha256 :
1975- return HashAlgorithm .sha256 ;
1976- case PRFAlgorithm .tls_prf_sha384 :
1977- case PRFAlgorithm .tls13_hkdf_sha384 :
1978- return HashAlgorithm .sha384 ;
1979- // TODO[RFC 8998]
1980- // case PRFAlgorithm.tls13_hkdf_sm3:
1981- // return HashAlgorithm.sm3;
1982- default :
1983- throw new IllegalArgumentException ("unknown PRFAlgorithm: " + PRFAlgorithm .getText (prfAlgorithm ));
1984- }
1985- }
1986-
19871963 public static ASN1ObjectIdentifier getOIDForHashAlgorithm (short hashAlgorithm )
19881964 {
19891965 switch (hashAlgorithm )
@@ -5360,7 +5336,7 @@ private static void collectKeyShares(TlsClientContext clientContext, int[] suppo
53605336 }
53615337
53625338 TlsAgreement agreement = null ;
5363- if (NamedGroup .refersToASpecificCurve (supportedGroup ))
5339+ if (NamedGroup .refersToAnECDHCurve (supportedGroup ))
53645340 {
53655341 if (crypto .hasECDHAgreement ())
53665342 {
@@ -5433,7 +5409,7 @@ static KeyShareEntry selectKeyShare(TlsCrypto crypto, ProtocolVersion negotiated
54335409 continue ;
54345410 }
54355411
5436- if ((NamedGroup .refersToASpecificCurve (group ) && !crypto .hasECDHAgreement ()) ||
5412+ if ((NamedGroup .refersToAnECDHCurve (group ) && !crypto .hasECDHAgreement ()) ||
54375413 (NamedGroup .refersToASpecificFiniteField (group ) && !crypto .hasDHAgreement ()) ||
54385414 (NamedGroup .refersToASpecificKem (group ) && !crypto .hasKemAgreement ()))
54395415 {
@@ -5470,7 +5446,7 @@ static int selectKeyShareGroup(TlsCrypto crypto, ProtocolVersion negotiatedVersi
54705446 continue ;
54715447 }
54725448
5473- if ((NamedGroup .refersToASpecificCurve (group ) && !crypto .hasECDHAgreement ()) ||
5449+ if ((NamedGroup .refersToAnECDHCurve (group ) && !crypto .hasECDHAgreement ()) ||
54745450 (NamedGroup .refersToASpecificFiniteField (group ) && !crypto .hasDHAgreement ()) ||
54755451 (NamedGroup .refersToASpecificKem (group ) && !crypto .hasKemAgreement ()))
54765452 {
@@ -5622,7 +5598,6 @@ static void negotiatedCipherSuite(SecurityParameters securityParameters, int cip
56225598 case PRFAlgorithm .tls_prf_legacy :
56235599 {
56245600 securityParameters .prfCryptoHashAlgorithm = -1 ;
5625- securityParameters .prfHashAlgorithm = -1 ;
56265601 securityParameters .prfHashLength = -1 ;
56275602 break ;
56285603 }
@@ -5631,7 +5606,6 @@ static void negotiatedCipherSuite(SecurityParameters securityParameters, int cip
56315606 int prfCryptoHashAlgorithm = TlsCryptoUtils .getHashForPRF (prfAlgorithm );
56325607
56335608 securityParameters .prfCryptoHashAlgorithm = prfCryptoHashAlgorithm ;
5634- securityParameters .prfHashAlgorithm = getHashAlgorithmForPRFAlgorithm (prfAlgorithm );
56355609 securityParameters .prfHashLength = TlsCryptoUtils .getHashOutputSize (prfCryptoHashAlgorithm );
56365610 break ;
56375611 }
0 commit comments