From 89b19fa26965d5b4d261248d57a3cd0650dc01e1 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 27 Jun 2022 12:36:06 +0000 Subject: Prepare to provide EVP_PKEY_security_bits() This also provides a pkey_security_bits member to the PKEY ASN.1 methods and a corresponding setter EVP_PKEY_asn1_set_security_bits(). ok beck jsing --- src/lib/libcrypto/evp/p_lib.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/evp/p_lib.c') diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index cdd38e4e30..b6cef5a14c 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.28 2022/01/20 11:06:24 inoguchi Exp $ */ +/* $OpenBSD: p_lib.c,v 1.29 2022/06/27 12:36:05 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -94,6 +94,17 @@ EVP_PKEY_bits(const EVP_PKEY *pkey) return 0; } +int +EVP_PKEY_security_bits(const EVP_PKEY *pkey) +{ + if (pkey == NULL) + return 0; + if (pkey->ameth == NULL || pkey->ameth->pkey_security_bits == NULL) + return -2; + + return pkey->ameth->pkey_security_bits(pkey); +} + int EVP_PKEY_size(const EVP_PKEY *pkey) { -- cgit v1.2.3-55-g6feb