Skip to content

Commit

Permalink
crypto: check gnutls & gcrypt support the requested pbkdf hash
Browse files Browse the repository at this point in the history
Both gnutls and gcrypt can be configured to exclude support for certain
algorithms via a runtime check against system crypto policies. Thus it
is not sufficient to have a compile time test for hash support in their
pbkdf implementations.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Daniel P. Berrangé <[email protected]>
(cherry picked from commit e6c09ea)
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
berrange authored and Michael Tokarev committed Sep 25, 2024
1 parent ae2dc2a commit 0e8f3eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto/pbkdf-gcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
case QCRYPTO_HASH_ALG_SHA384:
case QCRYPTO_HASH_ALG_SHA512:
case QCRYPTO_HASH_ALG_RIPEMD160:
return true;
return qcrypto_hash_supports(hash);
default:
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/pbkdf-gnutls.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash)
case QCRYPTO_HASH_ALG_SHA384:
case QCRYPTO_HASH_ALG_SHA512:
case QCRYPTO_HASH_ALG_RIPEMD160:
return true;
return qcrypto_hash_supports(hash);
default:
return false;
}
Expand Down

0 comments on commit 0e8f3eb

Please sign in to comment.