diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-11-04 12:20:08 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-07 14:41:02 +0100 |
commit | 0391198f48f86170a866820b2eb58c3fd91f858c (patch) | |
tree | c8792c01be12f4e5c175cbb701b35a9f67196911 /apps | |
parent | db30d8f90d8d143d3c294b243af4f77babbb320f (diff) |
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)
(cherry picked from commit 1e5780dbc79dab14c1ec1584313755fc2fd2cf55)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dgst.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/dgst.c b/apps/dgst.c index 5f36cbcb77..1042d940f4 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]; prog = opt_init(argc, argv, dgst_options); while ((o = opt_next()) != OPT_EOF) { |