summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-12-25 21:30:53 +0000
committertb <>2023-12-25 21:30:53 +0000
commitaef50a7d0d902ea9c4396b4db94bdd9c5ad59347 (patch)
treed4ac9491d7690c12eb029f35023c0c40b94347f0
parentf91c8aaaffa17b5b5f5799a50c9c6a13878acba8 (diff)
downloadopenbsd-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.c22
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
83static void EVP_PKEY_free_it(EVP_PKEY *x);
84
85int 83int
86EVP_PKEY_bits(const EVP_PKEY *pkey) 84EVP_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
217static void
218EVP_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
595static void
596EVP_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
604static int 602static int
605unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr) 603unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr)
606{ 604{