From aeeaa6d404f5501d00147554b3f67daf71404372 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 9 Feb 2024 07:43:52 +0000 Subject: [PATCH] Remove a useless EVP_MD_CTX_init() call The hash was just created with EVP_MD_CTX_new(), so we memset a calloced piece of memory to 0. --- lib/libcrypto/sm2/sm2_crypt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/libcrypto/sm2/sm2_crypt.c b/lib/libcrypto/sm2/sm2_crypt.c index b51161d640f..63fe1e6ab9e 100644 --- a/lib/libcrypto/sm2/sm2_crypt.c +++ b/lib/libcrypto/sm2/sm2_crypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sm2_crypt.c,v 1.2 2022/11/26 16:08:54 tb Exp $ */ +/* $OpenBSD: sm2_crypt.c,v 1.3 2024/02/09 07:43:52 tb Exp $ */ /* * Copyright (c) 2017, 2019 Ribose Inc * @@ -203,7 +203,6 @@ sm2_kdf(uint8_t *key, size_t key_len, uint8_t *secret, size_t secret_len, goto err; } - EVP_MD_CTX_init(hash); while ((key_len > 0) && (ctr != 0)) { if (!EVP_DigestInit_ex(hash, digest, NULL)) { SM2error(ERR_R_EVP_LIB); -- 2.20.1