]> git.proxmox.com Git - mirror_qemu.git/blobdiff - crypto/hash-nettle.c
main-loop: Acquire main_context lock around os_host_main_loop_wait.
[mirror_qemu.git] / crypto / hash-nettle.c
index 4c6f50b65d8d33ffafaece63a9cf515e8ef725d0..6a206dcb18c9ae2523881bf4a9df1d58838de9bd 100644 (file)
@@ -113,8 +113,7 @@ int qcrypto_hash_bytesv(QCryptoHashAlgorithm alg,
     int i;
     union qcrypto_hash_ctx ctx;
 
-    if (alg >= G_N_ELEMENTS(qcrypto_hash_alg_map) ||
-        qcrypto_hash_alg_map[alg].init == NULL) {
+    if (!qcrypto_hash_supports(alg)) {
         error_setg(errp,
                    "Unknown hash algorithm %d",
                    alg);