diff options
author | tb <> | 2023-03-04 06:25:42 +0000 |
---|---|---|
committer | tb <> | 2023-03-04 06:25:42 +0000 |
commit | 69faacd992fce32cb8d30f38074d008f457a4de9 (patch) | |
tree | 979721c86402543612420c990ffdc486cc9d09ef /src | |
parent | bcb80989756fa4295e3d1ed144b194817dd89497 (diff) | |
download | openbsd-69faacd992fce32cb8d30f38074d008f457a4de9.tar.gz openbsd-69faacd992fce32cb8d30f38074d008f457a4de9.tar.bz2 openbsd-69faacd992fce32cb8d30f38074d008f457a4de9.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
Diffstat (limited to 'src')
-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++) { |