summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-03-01 11:27:37 +0000
committertb <>2023-03-01 11:27:37 +0000
commitf2056854290f82a60b075b77604ced3acdb839f3 (patch)
tree98171da7cbf7e8d3c165c24eb994019b0c93a228 /src/lib
parent2ab231c6d07c8d22decb8b5154666eae3be871d1 (diff)
downloadopenbsd-f2056854290f82a60b075b77604ced3acdb839f3.tar.gz
openbsd-f2056854290f82a60b075b77604ced3acdb839f3.tar.bz2
openbsd-f2056854290f82a60b075b77604ced3acdb839f3.zip
Convert EVP_CIPHER_meth_dup() to using calloc()
There is no reason for this to call EVP_CIPHER_meth_new(), as the flags will be copied a line later anyway. Simplify this. Requested by jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/evp/cipher_method_lib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/cipher_method_lib.c b/src/lib/libcrypto/evp/cipher_method_lib.c
index dc37050408..55dc6b788c 100644
--- a/src/lib/libcrypto/evp/cipher_method_lib.c
+++ b/src/lib/libcrypto/evp/cipher_method_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cipher_method_lib.c,v 1.7 2023/03/01 11:25:25 tb Exp $ */ 1/* $OpenBSD: cipher_method_lib.c,v 1.8 2023/03/01 11:27:37 tb Exp $ */
2/* 2/*
3 * Written by Richard Levitte (levitte@openssl.org) for the OpenSSL project 3 * Written by Richard Levitte (levitte@openssl.org) for the OpenSSL project
4 * 2015. 4 * 2015.
@@ -83,8 +83,7 @@ EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher)
83{ 83{
84 EVP_CIPHER *copy; 84 EVP_CIPHER *copy;
85 85
86 if ((copy = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size, 86 if ((copy = calloc(1, sizeof(*copy))) == NULL)
87 cipher->key_len)) == NULL)
88 return NULL; 87 return NULL;
89 88
90 *copy = *cipher; 89 *copy = *cipher;