diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-03-04 06:25:43 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-03-04 06:25:43 +0000 |
commit | 15c506a50ffe77babc596e7ddd1afc8b62efd262 (patch) | |
tree | b16ad9d9143bda5681b016deea561039e4bd58cc /usr.bin/openssl | |
parent | 80bb4760cba8cd40f533044b489c499a472cd3fb (diff) |
openssl/req: garbage collect a pointless EVP_MD_CTX_init()
Before do_sign_init(), the ctx is always allocated by EVP_MD_CTX_new()
aka calloc(). There is no point in doing EVP_MD_CTX_init(), aka bzero().
ok jsing
Diffstat (limited to 'usr.bin/openssl')
-rw-r--r-- | usr.bin/openssl/req.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/openssl/req.c b/usr.bin/openssl/req.c index abf1c53e1f2..1fa7e368b94 100644 --- a/usr.bin/openssl/req.c +++ b/usr.bin/openssl/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.24 2022/11/11 17:07:39 joshua Exp $ */ +/* $OpenBSD: req.c,v 1.25 2023/03/04 06:25:42 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1737,7 +1737,7 @@ do_sign_init(BIO * err, EVP_MD_CTX * ctx, EVP_PKEY * pkey, { EVP_PKEY_CTX *pkctx = NULL; int i; - EVP_MD_CTX_init(ctx); + if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey)) return 0; for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) { |