summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-11-04 12:20:08 +0100
committerTomas Mraz <tomas@openssl.org>2022-11-07 14:40:09 +0100
commit1e5780dbc79dab14c1ec1584313755fc2fd2cf55 (patch)
treee272caadd9b6acfd0d35dd391814ff70429d3ef3
parent351ad225b3758f96a5875eb11ac3acda006a1c00 (diff)
downloadopenssl-new-1e5780dbc79dab14c1ec1584313755fc2fd2cf55.tar.gz
apps/dgst.c: Set digestname from argv[0] if it is a builtin hash name
Fixes #19589 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/19606)
-rw-r--r--apps/dgst.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/dgst.c b/apps/dgst.c
index b6363eb534..cbd4b4e2be 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -114,6 +114,8 @@ int dgst_main(int argc, char **argv)
buf = app_malloc(BUFSIZE, "I/O buffer");
md = (EVP_MD *)EVP_get_digestbyname(argv[0]);
+ if (md != NULL)
+ digestname = argv[0];
opt_set_unknown_name("digest");
prog = opt_init(argc, argv, dgst_options);