diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-03-01 11:27:38 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-03-01 11:27:38 +0000 |
commit | d2b2decc15287a8b788071a28cd76325429c5af6 (patch) | |
tree | dbbf4d47c37c2624b2c340363390d97db5b6ec8a | |
parent | e7a94c6c345fed705d5cb40e985662840e18f358 (diff) |
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
-rw-r--r-- | lib/libcrypto/evp/cipher_method_lib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libcrypto/evp/cipher_method_lib.c b/lib/libcrypto/evp/cipher_method_lib.c index dc370504080..55dc6b788c3 100644 --- a/lib/libcrypto/evp/cipher_method_lib.c +++ b/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; |