diff options
-rw-r--r-- | src/usr.bin/openssl/req.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/usr.bin/openssl/req.c b/src/usr.bin/openssl/req.c index 0994d0b288..b75ba92f74 100644 --- a/src/usr.bin/openssl/req.c +++ b/src/usr.bin/openssl/req.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: req.c,v 1.27 2023/03/06 14:32:06 tb Exp $ */ | 1 | /* $OpenBSD: req.c,v 1.28 2023/07/02 07:05:14 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -1736,8 +1736,15 @@ do_sign_init(BIO * err, EVP_MD_CTX * ctx, EVP_PKEY * pkey, | |||
1736 | const EVP_MD * md, STACK_OF(OPENSSL_STRING) * sigopts) | 1736 | const EVP_MD * md, STACK_OF(OPENSSL_STRING) * sigopts) |
1737 | { | 1737 | { |
1738 | EVP_PKEY_CTX *pkctx = NULL; | 1738 | EVP_PKEY_CTX *pkctx = NULL; |
1739 | int default_nid; | ||
1739 | int i; | 1740 | int i; |
1740 | 1741 | ||
1742 | if (EVP_PKEY_get_default_digest_nid(pkey, &default_nid) == 2 && | ||
1743 | default_nid == NID_undef) { | ||
1744 | /* The digest is required to be EVP_md_null() (EdDSA). */ | ||
1745 | md = EVP_md_null(); | ||
1746 | } | ||
1747 | |||
1741 | if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey)) | 1748 | if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey)) |
1742 | return 0; | 1749 | return 0; |
1743 | for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) { | 1750 | for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) { |