diff options
Diffstat (limited to 'crypto/hash-gcrypt.c')
-rw-r--r-- | crypto/hash-gcrypt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/hash-gcrypt.c b/crypto/hash-gcrypt.c index ed6f842461..7690690f70 100644 --- a/crypto/hash-gcrypt.c +++ b/crypto/hash-gcrypt.c @@ -55,8 +55,7 @@ int qcrypto_hash_bytesv(QCryptoHashAlgorithm alg, gcry_md_hd_t md; unsigned char *digest; - if (alg >= G_N_ELEMENTS(qcrypto_hash_alg_map) || - qcrypto_hash_alg_map[alg] == GCRY_MD_NONE) { + if (!qcrypto_hash_supports(alg)) { error_setg(errp, "Unknown hash algorithm %d", alg); |