diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2021-12-03 14:19:58 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2021-12-03 14:19:58 +0000 |
commit | 58e70f143d8f9efea0f72436c41cad4fbc6812a9 (patch) | |
tree | 0ba8c96292e91fee7708a965898a02038580e0f9 /lib/libcrypto | |
parent | abb1f635436df402fe5ed8463c42581c77f10038 (diff) |
Use calloc() in EVP_PKEY_meth_new() instead of malloc() and setting
almost all members to 0. Just set the two things that need setting.
ok jsing
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/evp/pmeth_lib.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/libcrypto/evp/pmeth_lib.c b/lib/libcrypto/evp/pmeth_lib.c index 359e57d74c5..33924dbd663 100644 --- a/lib/libcrypto/evp/pmeth_lib.c +++ b/lib/libcrypto/evp/pmeth_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmeth_lib.c,v 1.17 2021/12/03 14:18:06 tb Exp $ */ +/* $OpenBSD: pmeth_lib.c,v 1.18 2021/12/03 14:19:57 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -224,39 +224,12 @@ EVP_PKEY_meth_new(int id, int flags) { EVP_PKEY_METHOD *pmeth; - pmeth = calloc(1, sizeof(EVP_PKEY_METHOD)); - if (!pmeth) + if ((pmeth = calloc(1, sizeof(EVP_PKEY_METHOD))) == NULL) return NULL; pmeth->pkey_id = id; pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC; - pmeth->init = 0; - pmeth->copy = 0; - pmeth->cleanup = 0; - pmeth->paramgen_init = 0; - pmeth->paramgen = 0; - pmeth->keygen_init = 0; - pmeth->keygen = 0; - pmeth->sign_init = 0; - pmeth->sign = 0; - pmeth->verify_init = 0; - pmeth->verify = 0; - pmeth->verify_recover_init = 0; - pmeth->verify_recover = 0; - pmeth->signctx_init = 0; - pmeth->signctx = 0; - pmeth->verifyctx_init = 0; - pmeth->verifyctx = 0; - pmeth->encrypt_init = 0; - pmeth->encrypt = 0; - pmeth->decrypt_init = 0; - pmeth->decrypt = 0; - pmeth->derive_init = 0; - pmeth->derive = 0; - pmeth->ctrl = 0; - pmeth->ctrl_str = 0; - return pmeth; } |