From f2056854290f82a60b075b77604ced3acdb839f3 Mon Sep 17 00:00:00 2001
From: tb <>
Date: Wed, 1 Mar 2023 11:27:37 +0000
Subject: 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
---
 src/lib/libcrypto/evp/cipher_method_lib.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'src/lib')

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 @@
-/*	$OpenBSD: cipher_method_lib.c,v 1.7 2023/03/01 11:25:25 tb Exp $ */
+/*	$OpenBSD: cipher_method_lib.c,v 1.8 2023/03/01 11:27:37 tb Exp $ */
 /*
  * Written by Richard Levitte (levitte@openssl.org) for the OpenSSL project
  * 2015.
@@ -83,8 +83,7 @@ EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher)
 {
 	EVP_CIPHER *copy;
 
-	if ((copy = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size,
-	    cipher->key_len)) == NULL)
+	if ((copy = calloc(1, sizeof(*copy))) == NULL)
 		return NULL;
 
 	*copy = *cipher;
-- 
cgit v1.2.3-55-g6feb