diff options
author | tb <> | 2023-12-25 21:30:53 +0000 |
---|---|---|
committer | tb <> | 2023-12-25 21:30:53 +0000 |
commit | aef50a7d0d902ea9c4396b4db94bdd9c5ad59347 (patch) | |
tree | d4ac9491d7690c12eb029f35023c0c40b94347f0 | |
parent | f91c8aaaffa17b5b5f5799a50c9c6a13878acba8 (diff) | |
download | openbsd-aef50a7d0d902ea9c4396b4db94bdd9c5ad59347.tar.gz openbsd-aef50a7d0d902ea9c4396b4db94bdd9c5ad59347.tar.bz2 openbsd-aef50a7d0d902ea9c4396b4db94bdd9c5ad59347.zip |
Move the confusingly named EVP_PKEY_free_it() a bit up
ok jsing
-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 | { |