diff options
author | tb <> | 2021-12-03 14:19:57 +0000 |
---|---|---|
committer | tb <> | 2021-12-03 14:19:57 +0000 |
commit | 40cbc758c79bfc275f06d4fb3761a882fe316ebf (patch) | |
tree | d28d648a8431ae9709ab9816611102993908421a /src | |
parent | 3a616b37697e883a646f8587fdb0e5f838e0b41a (diff) | |
download | openbsd-40cbc758c79bfc275f06d4fb3761a882fe316ebf.tar.gz openbsd-40cbc758c79bfc275f06d4fb3761a882fe316ebf.tar.bz2 openbsd-40cbc758c79bfc275f06d4fb3761a882fe316ebf.zip |
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 'src')
-rw-r--r-- | src/lib/libcrypto/evp/pmeth_lib.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/src/lib/libcrypto/evp/pmeth_lib.c b/src/lib/libcrypto/evp/pmeth_lib.c index 359e57d74c..33924dbd66 100644 --- a/src/lib/libcrypto/evp/pmeth_lib.c +++ b/src/lib/libcrypto/evp/pmeth_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pmeth_lib.c,v 1.17 2021/12/03 14:18:06 tb Exp $ */ | 1 | /* $OpenBSD: pmeth_lib.c,v 1.18 2021/12/03 14:19:57 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -224,39 +224,12 @@ EVP_PKEY_meth_new(int id, int flags) | |||
224 | { | 224 | { |
225 | EVP_PKEY_METHOD *pmeth; | 225 | EVP_PKEY_METHOD *pmeth; |
226 | 226 | ||
227 | pmeth = calloc(1, sizeof(EVP_PKEY_METHOD)); | 227 | if ((pmeth = calloc(1, sizeof(EVP_PKEY_METHOD))) == NULL) |
228 | if (!pmeth) | ||
229 | return NULL; | 228 | return NULL; |
230 | 229 | ||
231 | pmeth->pkey_id = id; | 230 | pmeth->pkey_id = id; |
232 | pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC; | 231 | pmeth->flags = flags | EVP_PKEY_FLAG_DYNAMIC; |
233 | 232 | ||
234 | pmeth->init = 0; | ||
235 | pmeth->copy = 0; | ||
236 | pmeth->cleanup = 0; | ||
237 | pmeth->paramgen_init = 0; | ||
238 | pmeth->paramgen = 0; | ||
239 | pmeth->keygen_init = 0; | ||
240 | pmeth->keygen = 0; | ||
241 | pmeth->sign_init = 0; | ||
242 | pmeth->sign = 0; | ||
243 | pmeth->verify_init = 0; | ||
244 | pmeth->verify = 0; | ||
245 | pmeth->verify_recover_init = 0; | ||
246 | pmeth->verify_recover = 0; | ||
247 | pmeth->signctx_init = 0; | ||
248 | pmeth->signctx = 0; | ||
249 | pmeth->verifyctx_init = 0; | ||
250 | pmeth->verifyctx = 0; | ||
251 | pmeth->encrypt_init = 0; | ||
252 | pmeth->encrypt = 0; | ||
253 | pmeth->decrypt_init = 0; | ||
254 | pmeth->decrypt = 0; | ||
255 | pmeth->derive_init = 0; | ||
256 | pmeth->derive = 0; | ||
257 | pmeth->ctrl = 0; | ||
258 | pmeth->ctrl_str = 0; | ||
259 | |||
260 | return pmeth; | 233 | return pmeth; |
261 | } | 234 | } |
262 | 235 | ||