-/* $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.
*
#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)
{
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.
*/
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)
{