]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
crypto: Support SHA384 hash when using glib
authorDorjoy Chowdhury <dorjoychy111@gmail.com>
Thu, 5 Sep 2024 19:57:29 +0000 (01:57 +0600)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 9 Sep 2024 14:13:38 +0000 (15:13 +0100)
QEMU requires minimum glib version 2.66.0 as per the root meson.build
file and per glib documentation[1] G_CHECKSUM_SHA384 is available since
2.51.

[1] https://docs.gtk.org/glib/enum.ChecksumType.html

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dorjoy Chowdhury <dorjoychy111@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
crypto/hash-glib.c

index 82de9db705c4d79e3eaa4aee288282105eca75ff..18e64faa9c5e63ae5f922fe23197d9e017dbcefe 100644 (file)
@@ -29,7 +29,7 @@ static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG__MAX] = {
     [QCRYPTO_HASH_ALG_SHA1] = G_CHECKSUM_SHA1,
     [QCRYPTO_HASH_ALG_SHA224] = -1,
     [QCRYPTO_HASH_ALG_SHA256] = G_CHECKSUM_SHA256,
-    [QCRYPTO_HASH_ALG_SHA384] = -1,
+    [QCRYPTO_HASH_ALG_SHA384] = G_CHECKSUM_SHA384,
     [QCRYPTO_HASH_ALG_SHA512] = G_CHECKSUM_SHA512,
     [QCRYPTO_HASH_ALG_RIPEMD160] = -1,
 };