Skip to content

Commit

Permalink
apps/dgst.c: Set digestname from argv[0] if it is a builtin hash name
Browse files Browse the repository at this point in the history
Fixes #19589

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from #19606)

(cherry picked from commit 1e5780d)
  • Loading branch information
t8m committed Nov 7, 2022
1 parent db30d8f commit 0391198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/dgst.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0391198

Please sign in to comment.