summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2024-02-09 07:43:52 +0000
committertb <>2024-02-09 07:43:52 +0000
commit781054a53ec7008a185d859893c2db0e4f599f8a (patch)
tree2c7534992eafa2b80ffb2b18991f8efe7449f925 /src/lib
parent7f6b4891a06591c93acf91389031cef7f7e6a153 (diff)
downloadopenbsd-781054a53ec7008a185d859893c2db0e4f599f8a.tar.gz
openbsd-781054a53ec7008a185d859893c2db0e4f599f8a.tar.bz2
openbsd-781054a53ec7008a185d859893c2db0e4f599f8a.zip
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.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/sm2/sm2_crypt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/sm2/sm2_crypt.c b/src/lib/libcrypto/sm2/sm2_crypt.c
index b51161d640..63fe1e6ab9 100644
--- a/src/lib/libcrypto/sm2/sm2_crypt.c
+++ b/src/lib/libcrypto/sm2/sm2_crypt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sm2_crypt.c,v 1.2 2022/11/26 16:08:54 tb Exp $ */ 1/* $OpenBSD: sm2_crypt.c,v 1.3 2024/02/09 07:43:52 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2017, 2019 Ribose Inc 3 * Copyright (c) 2017, 2019 Ribose Inc
4 * 4 *
@@ -203,7 +203,6 @@ sm2_kdf(uint8_t *key, size_t key_len, uint8_t *secret, size_t secret_len,
203 goto err; 203 goto err;
204 } 204 }
205 205
206 EVP_MD_CTX_init(hash);
207 while ((key_len > 0) && (ctr != 0)) { 206 while ((key_len > 0) && (ctr != 0)) {
208 if (!EVP_DigestInit_ex(hash, digest, NULL)) { 207 if (!EVP_DigestInit_ex(hash, digest, NULL)) {
209 SM2error(ERR_R_EVP_LIB); 208 SM2error(ERR_R_EVP_LIB);