From 169544314c1b6f10a1e032e67166ac186d6b3ba8 Mon Sep 17 00:00:00 2001 From: tb Date: Sat, 4 Mar 2023 06:25:42 +0000 Subject: [PATCH] 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 --- usr.bin/openssl/req.c | 4 ++-- 1 file 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++) { -- 2.20.1