From dd32ff2216c88624fff814247f33e991ec92ff6a Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 25 Dec 2023 21:30:53 +0000 Subject: [PATCH] Move the confusingly named EVP_PKEY_free_it() a bit up ok jsing --- lib/libcrypto/evp/p_lib.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index 2b409220bb7..bce4a0b526a 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.41 2023/12/25 21:27:03 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.42 2023/12/25 21:30:53 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -80,8 +80,6 @@ #include "asn1_local.h" #include "evp_local.h" -static void EVP_PKEY_free_it(EVP_PKEY *x); - int EVP_PKEY_bits(const EVP_PKEY *pkey) { @@ -216,6 +214,15 @@ EVP_PKEY_up_ref(EVP_PKEY *pkey) return CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY) > 0; } +static void +EVP_PKEY_free_it(EVP_PKEY *x) +{ + if (x->ameth && x->ameth->pkey_free) { + x->ameth->pkey_free(x); + x->pkey.ptr = NULL; + } +} + /* Setup a public key ASN1 method from a NID or a string. * If pkey is NULL just return 1 or 0 if the algorithm exists. */ @@ -592,15 +599,6 @@ EVP_PKEY_free(EVP_PKEY *x) free(x); } -static void -EVP_PKEY_free_it(EVP_PKEY *x) -{ - if (x->ameth && x->ameth->pkey_free) { - x->ameth->pkey_free(x); - x->pkey.ptr = NULL; - } -} - static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr) { -- 2.20.1