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:40:41 +0000 (14:40 +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)

apps/dgst.c

index cbd4b4e2bec367fac2a7a151d86283ef029dc22d..9d00c064721423b79c0fe5d6222fbea3b59fc27b 100644 (file)
@@ -488,8 +488,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) {