diff options
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/evp/p_lib.c | 13 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index c7942cc12a..a48b81c915 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp.h,v 1.100 2022/05/05 08:48:50 tb Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.101 2022/06/27 12:36:05 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 | * |
@@ -769,6 +769,9 @@ int EVP_PKEY_type(int type); | |||
769 | int EVP_PKEY_id(const EVP_PKEY *pkey); | 769 | int EVP_PKEY_id(const EVP_PKEY *pkey); |
770 | int EVP_PKEY_base_id(const EVP_PKEY *pkey); | 770 | int EVP_PKEY_base_id(const EVP_PKEY *pkey); |
771 | int EVP_PKEY_bits(const EVP_PKEY *pkey); | 771 | int EVP_PKEY_bits(const EVP_PKEY *pkey); |
772 | #ifdef LIBRESSL_INTERNAL | ||
773 | int EVP_PKEY_security_bits(const EVP_PKEY *pkey); | ||
774 | #endif | ||
772 | int EVP_PKEY_size(const EVP_PKEY *pkey); | 775 | int EVP_PKEY_size(const EVP_PKEY *pkey); |
773 | int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); | 776 | int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); |
774 | int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); | 777 | int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); |
@@ -931,6 +934,10 @@ void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, | |||
931 | void (*pkey_free)(EVP_PKEY *pkey)); | 934 | void (*pkey_free)(EVP_PKEY *pkey)); |
932 | void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, | 935 | void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, |
933 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)); | 936 | int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2)); |
937 | #ifdef LIBRESSL_INTERNAL | ||
938 | void EVP_PKEY_asn1_set_security_bits(EVP_PKEY_ASN1_METHOD *ameth, | ||
939 | int (*pkey_security_bits)(const EVP_PKEY *pkey)); | ||
940 | #endif | ||
934 | 941 | ||
935 | void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, | 942 | void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth, |
936 | int (*pkey_check)(const EVP_PKEY *pk)); | 943 | int (*pkey_check)(const EVP_PKEY *pk)); |
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 @@ | |||
1 | /* $OpenBSD: p_lib.c,v 1.28 2022/01/20 11:06:24 inoguchi Exp $ */ | 1 | /* $OpenBSD: p_lib.c,v 1.29 2022/06/27 12:36:05 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 | * |
@@ -95,6 +95,17 @@ EVP_PKEY_bits(const EVP_PKEY *pkey) | |||
95 | } | 95 | } |
96 | 96 | ||
97 | int | 97 | int |
98 | EVP_PKEY_security_bits(const EVP_PKEY *pkey) | ||
99 | { | ||
100 | if (pkey == NULL) | ||
101 | return 0; | ||
102 | if (pkey->ameth == NULL || pkey->ameth->pkey_security_bits == NULL) | ||
103 | return -2; | ||
104 | |||
105 | return pkey->ameth->pkey_security_bits(pkey); | ||
106 | } | ||
107 | |||
108 | int | ||
98 | EVP_PKEY_size(const EVP_PKEY *pkey) | 109 | EVP_PKEY_size(const EVP_PKEY *pkey) |
99 | { | 110 | { |
100 | if (pkey && pkey->ameth && pkey->ameth->pkey_size) | 111 | if (pkey && pkey->ameth && pkey->ameth->pkey_size) |