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:22 +0100 |
commit | 03c5381b41d39882de2aef74c02900c58b4989aa (patch) | |
tree | d50ff099a6b0f8511726840b86b7522739081b2d /apps | |
parent | 76962505be68b32826208fe3ccad4069daf848db (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) { |