diff options
author | tb <> | 2022-01-10 11:52:43 +0000 |
---|---|---|
committer | tb <> | 2022-01-10 11:52:43 +0000 |
commit | a447c077ad67d6e81ed1a4fbe9003875add773c2 (patch) | |
tree | 1fec6a88d05f741604c6f6549798d45c11a3aef3 /src/lib/libcrypto/evp/evp_locl.h | |
parent | 0af4f789497e3f3ba6818138f64585c080464044 (diff) | |
download | openbsd-a447c077ad67d6e81ed1a4fbe9003875add773c2.tar.gz openbsd-a447c077ad67d6e81ed1a4fbe9003875add773c2.tar.bz2 openbsd-a447c077ad67d6e81ed1a4fbe9003875add773c2.zip |
Prepare to provide EVP_PKEY_check()
This allows checking the validity of an EVP_PKEY. Only RSA and EC keys
are supported. If a check function is set the EVP_PKEY_METHOD, it will
be used, otherwise the check function on the EVP_PKEY_ASN1_METHOD is
used. The default ASN.1 methods wrap RSA_check_key() and
EC_KEY_check_key(), respectively.
The corresponding setters are EVP_PKEY_{asn1,meth}_set_check().
It is unclear why the PKEY method has no const while the ASN.1 method
has const.
Requested by tobhe and used by PHP 8.1.
Based on OpenSSL commit 2aee35d3
ok inoguchi jsing
Diffstat (limited to 'src/lib/libcrypto/evp/evp_locl.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp_locl.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h index 5eef0b244f..3ff8e8ad99 100644 --- a/src/lib/libcrypto/evp/evp_locl.h +++ b/src/lib/libcrypto/evp/evp_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_locl.h,v 1.18 2022/01/09 15:15:25 tb Exp $ */ | 1 | /* $OpenBSD: evp_locl.h,v 1.19 2022/01/10 11:52:43 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -347,6 +347,8 @@ struct evp_pkey_method_st { | |||
347 | 347 | ||
348 | int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); | 348 | int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); |
349 | int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value); | 349 | int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value); |
350 | |||
351 | int (*check)(EVP_PKEY *pkey); | ||
350 | } /* EVP_PKEY_METHOD */; | 352 | } /* EVP_PKEY_METHOD */; |
351 | 353 | ||
352 | void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx); | 354 | void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx); |