Followup fix for PSS changes
@@ -2302,7 +2302,7 @@ static int getPRFAlgorithm13(int cipherSuite)
TlsHash h = algorithm == null
? new CombinedHash(crypto)
- : createHash(crypto, algorithm.getHash());
+ : createHash(crypto, algorithm);
SecurityParameters sp = context.getSecurityParametersHandshake();
// NOTE: The implicit copy here is intended (and important)
@@ -4504,6 +4504,14 @@ private static TlsHash createHash(TlsCrypto crypto, short hashAlgorithm)
return crypto.createHash(cryptoHashAlgorithm);
}
+ private static TlsHash createHash(TlsCrypto crypto, SignatureAndHashAlgorithm signatureAndHashAlgorithm)
+ {
+ int signatureScheme = SignatureScheme.from(signatureAndHashAlgorithm);
+ int cryptoHashAlgorithm = SignatureScheme.getCryptoHashAlgorithm(signatureScheme);
+
+ return crypto.createHash(cryptoHashAlgorithm);
+ }
+
private static TlsKeyExchange createKeyExchangeClient(TlsClient client, int keyExchange) throws IOException
{
TlsKeyExchangeFactory factory = client.getKeyExchangeFactory();
