From: tb Date: Mon, 25 Dec 2023 21:30:53 +0000 (+0000) Subject: Move the confusingly named EVP_PKEY_free_it() a bit up X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dd32ff2216c88624fff814247f33e991ec92ff6a;p=openbsd Move the confusingly named EVP_PKEY_free_it() a bit up ok jsing --- 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) {