diff options
| author | tb <> | 2023-12-25 21:30:53 +0000 |
|---|---|---|
| committer | tb <> | 2023-12-25 21:30:53 +0000 |
| commit | cead9d0d392b5f66c5d193eab66e0356ca1284cd (patch) | |
| tree | d4ac9491d7690c12eb029f35023c0c40b94347f0 /src | |
| parent | 140fe69ae660c4fe9893e5e2b8707d69c37dc969 (diff) | |
| download | openbsd-cead9d0d392b5f66c5d193eab66e0356ca1284cd.tar.gz openbsd-cead9d0d392b5f66c5d193eab66e0356ca1284cd.tar.bz2 openbsd-cead9d0d392b5f66c5d193eab66e0356ca1284cd.zip | |
Move the confusingly named EVP_PKEY_free_it() a bit up
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/evp/p_lib.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 2b409220bb..bce4a0b526 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: p_lib.c,v 1.41 2023/12/25 21:27:03 tb Exp $ */ | 1 | /* $OpenBSD: p_lib.c,v 1.42 2023/12/25 21:30:53 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -80,8 +80,6 @@ | |||
| 80 | #include "asn1_local.h" | 80 | #include "asn1_local.h" |
| 81 | #include "evp_local.h" | 81 | #include "evp_local.h" |
| 82 | 82 | ||
| 83 | static void EVP_PKEY_free_it(EVP_PKEY *x); | ||
| 84 | |||
| 85 | int | 83 | int |
| 86 | EVP_PKEY_bits(const EVP_PKEY *pkey) | 84 | EVP_PKEY_bits(const EVP_PKEY *pkey) |
| 87 | { | 85 | { |
| @@ -216,6 +214,15 @@ EVP_PKEY_up_ref(EVP_PKEY *pkey) | |||
| 216 | return CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY) > 0; | 214 | return CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY) > 0; |
| 217 | } | 215 | } |
| 218 | 216 | ||
| 217 | static void | ||
| 218 | EVP_PKEY_free_it(EVP_PKEY *x) | ||
| 219 | { | ||
| 220 | if (x->ameth && x->ameth->pkey_free) { | ||
| 221 | x->ameth->pkey_free(x); | ||
| 222 | x->pkey.ptr = NULL; | ||
| 223 | } | ||
| 224 | } | ||
| 225 | |||
| 219 | /* Setup a public key ASN1 method from a NID or a string. | 226 | /* Setup a public key ASN1 method from a NID or a string. |
| 220 | * If pkey is NULL just return 1 or 0 if the algorithm exists. | 227 | * If pkey is NULL just return 1 or 0 if the algorithm exists. |
| 221 | */ | 228 | */ |
| @@ -592,15 +599,6 @@ EVP_PKEY_free(EVP_PKEY *x) | |||
| 592 | free(x); | 599 | free(x); |
| 593 | } | 600 | } |
| 594 | 601 | ||
| 595 | static void | ||
| 596 | EVP_PKEY_free_it(EVP_PKEY *x) | ||
| 597 | { | ||
| 598 | if (x->ameth && x->ameth->pkey_free) { | ||
| 599 | x->ameth->pkey_free(x); | ||
| 600 | x->pkey.ptr = NULL; | ||
| 601 | } | ||
| 602 | } | ||
| 603 | |||
| 604 | static int | 602 | static int |
| 605 | unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr) | 603 | unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr) |
| 606 | { | 604 | { |
