diff options
author | tb <> | 2023-03-04 06:25:42 +0000 |
---|---|---|
committer | tb <> | 2023-03-04 06:25:42 +0000 |
commit | 4a3fed04f5f73d8364ee7afcae6fe40132f47c20 (patch) | |
tree | 979721c86402543612420c990ffdc486cc9d09ef | |
parent | f64585e4837c33f2db5540b28f8388a3608e38e6 (diff) | |
download | openbsd-4a3fed04f5f73d8364ee7afcae6fe40132f47c20.tar.gz openbsd-4a3fed04f5f73d8364ee7afcae6fe40132f47c20.tar.bz2 openbsd-4a3fed04f5f73d8364ee7afcae6fe40132f47c20.zip |
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
-rw-r--r-- | src/usr.bin/openssl/req.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/req.c b/src/usr.bin/openssl/req.c index abf1c53e1f..1fa7e368b9 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.24 2022/11/11 17:07:39 joshua Exp $ */ | 1 | /* $OpenBSD: req.c,v 1.25 2023/03/04 06:25:42 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 | * |
@@ -1737,7 +1737,7 @@ do_sign_init(BIO * err, EVP_MD_CTX * ctx, EVP_PKEY * pkey, | |||
1737 | { | 1737 | { |
1738 | EVP_PKEY_CTX *pkctx = NULL; | 1738 | EVP_PKEY_CTX *pkctx = NULL; |
1739 | int i; | 1739 | int i; |
1740 | EVP_MD_CTX_init(ctx); | 1740 | |
1741 | if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey)) | 1741 | if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey)) |
1742 | return 0; | 1742 | return 0; |
1743 | for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) { | 1743 | for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) { |