openssl/crypto/evp
Richard Levitte 5e5bc836fb Re-introduce legacy EVP_PKEY types for provided keys
EVP_PKEYs with provider side internal keys got the key type
EVP_PKEY_NONE.  This turned out to be too disruptive, so we try
instead to find a matching EVP_PKEY_ASN1_METHOD and use whatever
EVP_PKEY type it uses.

To make internal coding easier, we introduce a few internal macros to
distinguish what can be expected from a EVP_PKEY:

- evp_pkey_is_blank(), to detect an unassigned EVP_PKEY.
- evp_pkey_is_typed(), to detect that an EVP_PKEY has been assigned a
  type, which may be an old style type number or a EVP_KEYMGMT method.
- evp_pkey_is_assigned(), to detect that an EVP_PKEY has been assigned
  an key value.
- evp_pkey_is_legacy(), to detect that the internal EVP_PKEY key is a
  legacy one, i.e. will be handled via an EVP_PKEY_ASN1_METHOD and an
  EVP_PKEY_METHOD.
- evp_pkey_is_provided(), to detect that the internal EVP_PKEY key is
  a provider side one, i.e. will be handdled via an EVP_KEYMGMT and
  other provider methods.

This also introduces EVP_PKEY_KEYMGMT, to indicate that this EVP_PKEY
contains a provider side key for which there are no known
EVP_PKEY_ASN1_METHODs or EVP_PKEY_METHODs, i.e. these can only be
handled via EVP_KEYMGMT and other provider methods.

Fixes #11823

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11913)
2020-05-23 21:11:09 +02:00
..
bio_b64.c Update copyright year 2020-04-23 13:55:52 +01:00
bio_enc.c Update copyright year 2020-04-23 13:55:52 +01:00
bio_md.c Update copyright year 2020-04-23 13:55:52 +01:00
bio_ok.c Update copyright year 2020-04-23 13:55:52 +01:00
build.info Use build.info, not ifdef for crypto modules 2020-04-16 13:52:22 +02:00
c_allc.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
c_alld.c Restore MD5-SHA1 in legacy method database 2019-10-14 16:07:41 +02:00
cmeth_lib.c Reorganize local header files 2019-09-28 20:26:35 +02:00
digest.c Rename FIPS_MODE to FIPS_MODULE 2020-04-28 15:37:37 +02:00
e_aes_cbc_hmac_sha1.c Update copyright year 2020-04-23 13:55:52 +01:00
e_aes_cbc_hmac_sha256.c Update copyright year 2020-04-23 13:55:52 +01:00
e_aes.c Rename FIPS_MODE to FIPS_MODULE 2020-04-28 15:37:37 +02:00
e_aria.c Allow specifying the tag after AAD in CCM mode (2) 2019-11-20 10:40:55 +01:00
e_bf.c Update copyright year 2020-04-23 13:55:52 +01:00
e_camellia.c Update copyright year 2020-04-23 13:55:52 +01:00
e_cast.c Update copyright year 2020-04-23 13:55:52 +01:00
e_chacha20_poly1305.c Reorganize local header files 2019-09-28 20:26:35 +02:00
e_des3.c Update copyright year 2020-04-23 13:55:52 +01:00
e_des.c Update copyright year 2020-04-23 13:55:52 +01:00
e_idea.c Update copyright year 2020-04-23 13:55:52 +01:00
e_null.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
e_old.c Update copyright year 2020-04-23 13:55:52 +01:00
e_rc2.c Update copyright year 2020-04-23 13:55:52 +01:00
e_rc4_hmac_md5.c Update copyright year 2020-04-23 13:55:52 +01:00
e_rc4.c Update copyright year 2020-04-23 13:55:52 +01:00
e_rc5.c Update copyright year 2020-04-23 13:55:52 +01:00
e_seed.c Update copyright year 2020-04-23 13:55:52 +01:00
e_sm4.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
e_xcbc_d.c Update copyright year 2020-04-23 13:55:52 +01:00
encode.c Reorganize local header files 2019-09-28 20:26:35 +02:00
evp_cnf.c Update copyright year 2020-05-15 14:09:49 +01:00
evp_enc.c Remove cipher table lookup from EVP_CipherInit_ex 2020-05-07 15:25:48 +10:00
evp_err.c Add default property API's to enable and test for fips 2020-05-02 14:17:54 +10:00
evp_fetch.c CORE: query for operations only once per provider (unless no_store is true) 2020-05-19 11:02:41 +02:00
evp_key.c crypto/evp/evp_key.c: #define BUFSIZ if <stdio.h> doesn't #define it 2019-05-27 08:01:50 +10:00
evp_lib.c Rename FIPS_MODE to FIPS_MODULE 2020-04-28 15:37:37 +02:00
evp_local.h Remove gen_get_params & gen_gettable_params from keygen operation 2020-05-07 15:31:05 +10:00
evp_pbe.c Explicitly test against NULL; do not use !p or similar 2019-10-09 21:32:15 +02:00
evp_pkey.c Update copyright year 2020-04-23 13:55:52 +01:00
evp_utils.c Reorganize local header files 2019-09-28 20:26:35 +02:00
exchange.c EVP: when setting the operation to EVP_PKEY_OP_UNDEFINED, clean up! 2020-05-08 15:15:16 +02:00
kdf_lib.c Update copyright year 2020-04-23 13:55:52 +01:00
kdf_meth.c Final cleanup after move to leaner EVP_PKEY methods 2019-11-10 05:00:28 +01:00
keymgmt_lib.c EVP: Fix evp_keymgmt_util_copy() for to->keymgmt == NULL 2020-04-29 15:35:02 +02:00
keymgmt_meth.c Remove gen_get_params & gen_gettable_params from keygen operation 2020-05-07 15:31:05 +10:00
legacy_blake2.c Cleanup legacy digest methods. 2019-12-18 14:46:01 +10:00
legacy_md2.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_md4.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_md5_sha1.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_md5.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_mdc2.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_meth.h Cleanup legacy digest methods. 2019-12-18 14:46:01 +10:00
legacy_ripemd.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_sha.c Update copyright year 2020-04-23 13:55:52 +01:00
legacy_wp.c Update copyright year 2020-04-23 13:55:52 +01:00
m_null.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
m_sigver.c EVP: For SIGNATURE operations, pass the propquery early 2020-05-14 12:16:35 +02:00
mac_lib.c Update copyright year 2020-04-23 13:55:52 +01:00
mac_meth.c Final cleanup after move to leaner EVP_PKEY methods 2019-11-10 05:00:28 +01:00
names.c Ensure EVP_get_digestbyname() and EVP_get_cipherbyname() know all aliases 2019-11-06 10:11:31 +00:00
p5_crpt2.c Update copyright year 2020-04-23 13:55:52 +01:00
p5_crpt.c Update copyright year 2020-04-23 13:55:52 +01:00
p_dec.c Update copyright year 2020-04-23 13:55:52 +01:00
p_enc.c Update copyright year 2020-04-23 13:55:52 +01:00
p_lib.c Re-introduce legacy EVP_PKEY types for provided keys 2020-05-23 21:11:09 +02:00
p_open.c Update copyright year 2020-04-23 13:55:52 +01:00
p_seal.c Update copyright year 2020-04-23 13:55:52 +01:00
p_sign.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
p_verify.c Reorganize private crypto header files 2019-09-28 20:26:34 +02:00
pbe_scrypt.c Usages of KDFs converted to use the name macros 2019-09-11 10:22:49 +10:00
pkey_kdf.c Update copyright year 2020-04-23 13:55:52 +01:00
pkey_mac.c EVP: Only use the engine when one is defined, in pkey_mac_ctrl() 2020-05-14 10:05:29 +02:00
pmeth_check.c Rename FIPS_MODE to FIPS_MODULE 2020-04-28 15:37:37 +02:00
pmeth_fn.c EVP: when setting the operation to EVP_PKEY_OP_UNDEFINED, clean up! 2020-05-08 15:15:16 +02:00
pmeth_gn.c EVP: when setting the operation to EVP_PKEY_OP_UNDEFINED, clean up! 2020-05-08 15:15:16 +02:00
pmeth_lib.c Re-introduce legacy EVP_PKEY types for provided keys 2020-05-23 21:11:09 +02:00
signature.c EVP: For SIGNATURE operations, pass the propquery early 2020-05-14 12:16:35 +02:00