diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/asn1/ameth_lib.c | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/src/lib/libcrypto/asn1/ameth_lib.c b/src/lib/libcrypto/asn1/ameth_lib.c index d1798cf4f6..50d8735ea7 100644 --- a/src/lib/libcrypto/asn1/ameth_lib.c +++ b/src/lib/libcrypto/asn1/ameth_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ameth_lib.c,v 1.17 2018/05/13 06:40:55 tb Exp $ */ | 1 | /* $OpenBSD: ameth_lib.c,v 1.18 2018/05/24 07:49:46 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 | */ |
| @@ -309,59 +309,26 @@ EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info) | |||
| 309 | { | 309 | { |
| 310 | EVP_PKEY_ASN1_METHOD *ameth; | 310 | EVP_PKEY_ASN1_METHOD *ameth; |
| 311 | 311 | ||
| 312 | ameth = calloc(1, sizeof(EVP_PKEY_ASN1_METHOD)); | 312 | if ((ameth = calloc(1, sizeof(EVP_PKEY_ASN1_METHOD))) == NULL) |
| 313 | if (!ameth) | ||
| 314 | return NULL; | 313 | return NULL; |
| 315 | 314 | ||
| 316 | ameth->pkey_id = id; | 315 | ameth->pkey_id = id; |
| 317 | ameth->pkey_base_id = id; | 316 | ameth->pkey_base_id = id; |
| 318 | ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; | 317 | ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC; |
| 319 | 318 | ||
| 320 | if (info) { | 319 | if (info != NULL) { |
| 321 | ameth->info = strdup(info); | 320 | if ((ameth->info = strdup(info)) == NULL) |
| 322 | if (!ameth->info) | ||
| 323 | goto err; | 321 | goto err; |
| 324 | } else | 322 | } |
| 325 | ameth->info = NULL; | ||
| 326 | 323 | ||
| 327 | if (pem_str) { | 324 | if (pem_str != NULL) { |
| 328 | ameth->pem_str = strdup(pem_str); | 325 | if ((ameth->pem_str = strdup(pem_str)) == NULL) |
| 329 | if (!ameth->pem_str) | ||
| 330 | goto err; | 326 | goto err; |
| 331 | } else | 327 | } |
| 332 | ameth->pem_str = NULL; | ||
| 333 | |||
| 334 | ameth->pub_decode = 0; | ||
| 335 | ameth->pub_encode = 0; | ||
| 336 | ameth->pub_cmp = 0; | ||
| 337 | ameth->pub_print = 0; | ||
| 338 | |||
| 339 | ameth->priv_decode = 0; | ||
| 340 | ameth->priv_encode = 0; | ||
| 341 | ameth->priv_print = 0; | ||
| 342 | |||
| 343 | ameth->old_priv_encode = 0; | ||
| 344 | ameth->old_priv_decode = 0; | ||
| 345 | |||
| 346 | ameth->item_verify = 0; | ||
| 347 | ameth->item_sign = 0; | ||
| 348 | |||
| 349 | ameth->pkey_size = 0; | ||
| 350 | ameth->pkey_bits = 0; | ||
| 351 | |||
| 352 | ameth->param_decode = 0; | ||
| 353 | ameth->param_encode = 0; | ||
| 354 | ameth->param_missing = 0; | ||
| 355 | ameth->param_copy = 0; | ||
| 356 | ameth->param_cmp = 0; | ||
| 357 | ameth->param_print = 0; | ||
| 358 | |||
| 359 | ameth->pkey_free = 0; | ||
| 360 | ameth->pkey_ctrl = 0; | ||
| 361 | 328 | ||
| 362 | return ameth; | 329 | return ameth; |
| 363 | 330 | ||
| 364 | err: | 331 | err: |
| 365 | EVP_PKEY_asn1_free(ameth); | 332 | EVP_PKEY_asn1_free(ameth); |
| 366 | return NULL; | 333 | return NULL; |
| 367 | } | 334 | } |
| @@ -390,6 +357,7 @@ EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst, const EVP_PKEY_ASN1_METHOD *src) | |||
| 390 | dst->param_copy = src->param_copy; | 357 | dst->param_copy = src->param_copy; |
| 391 | dst->param_cmp = src->param_cmp; | 358 | dst->param_cmp = src->param_cmp; |
| 392 | dst->param_print = src->param_print; | 359 | dst->param_print = src->param_print; |
| 360 | dst->sig_print = src->sig_print; | ||
| 393 | 361 | ||
| 394 | dst->pkey_free = src->pkey_free; | 362 | dst->pkey_free = src->pkey_free; |
| 395 | dst->pkey_ctrl = src->pkey_ctrl; | 363 | dst->pkey_ctrl = src->pkey_ctrl; |
