summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2021-05-20 10:59:07 +0200
committerDmitry Belyavskiy <beldmit@gmail.com>2021-05-21 13:07:28 +0200
commit819b94c0c0d338fbec0aee828f3b61d7878c3837 (patch)
tree037aa94173aa5e90e853f1fd31ce4738422dd33f /apps
parent6d3f798cba8075e700003aaf34f1e72bb930086c (diff)
HMAC doesn't work with a default digest
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15371)
Diffstat (limited to 'apps')
-rw-r--r--apps/dgst.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/dgst.c b/apps/dgst.c
index 15f9e2e685..7ac1013303 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -330,6 +330,8 @@ int dgst_main(int argc, char **argv)
}
if (hmac_key != NULL) {
+ if (md == NULL)
+ md = (EVP_MD *)EVP_sha256();
sigkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, impl,
(unsigned char *)hmac_key,
strlen(hmac_key));