List also non-fetchable hashes in openssl dgst -list
authorGauriSpears <Gauri@nextmail.ru>
Thu, 30 Mar 2023 11:30:59 +0000 (16:30 +0500)
committerTomas Mraz <tomas@openssl.org>
Fri, 14 Apr 2023 12:41:03 +0000 (14:41 +0200)
CLA: trivial

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20651)

(cherry picked from commit 7eab7680ee61c64b2ae7acd9dd199ab6734f3d1f)

apps/dgst.c

index 1042d940f49ce232dccfbb2ef56395c4563cd770..213470da79a5df7d4cc3fdaff79f664e212c3236 100644 (file)
@@ -487,8 +487,11 @@ static void show_digests(const OBJ_NAME *name, void *arg)
 
     /* Filter out message digests that we cannot use */
     md = EVP_MD_fetch(app_get0_libctx(), name->name, app_get0_propq());
-    if (md == NULL)
-        return;
+    if (md == NULL) {
+        md = EVP_get_digestbyname(name->name);
+        if (md == NULL)
+            return;
+    }
 
     BIO_printf(dec->bio, "-%-25s", name->name);
     if (++dec->n == 3) {