diff options
Diffstat (limited to 'crypto/hash-glib.c')
-rw-r--r-- | crypto/hash-glib.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/hash-glib.c b/crypto/hash-glib.c index cb68a3b0d7..ec99ac9df9 100644 --- a/crypto/hash-glib.c +++ b/crypto/hash-glib.c @@ -57,8 +57,7 @@ int qcrypto_hash_bytesv(QCryptoHashAlgorithm alg, int i, ret; GChecksum *cs; - if (alg >= G_N_ELEMENTS(qcrypto_hash_alg_map) || - qcrypto_hash_alg_map[alg] == -1) { + if (!qcrypto_hash_supports(alg)) { error_setg(errp, "Unknown hash algorithm %d", alg); |