openssl/crypto/evp
Richard Levitte b305452f69 Redesign the KEYMGMT libcrypto <-> provider interface - the basics
The KEYMGMT libcrypto <-> provider interface currently makes a few
assumptions:

1.  provider side domain parameters and key data isn't mutable. In
    other words, as soon as a key has been created in any (loaded,
    imported data, ...), it's set in stone.
2.  provider side domain parameters can be strictly separated from the
    key data.

This does work for the most part, but there are places where that's a
bit too rigid for the functionality that the EVP_PKEY API delivers.
Key data needs to be mutable to allow the flexibility that functions
like EVP_PKEY_copy_parameters promise, as well as to provide the
combinations of data that an EVP_PKEY is generally assumed to be able
to hold:

- domain parameters only
- public key only
- public key + private key
- domain parameters + public key
- domain parameters + public key + private key

To remedy all this, we:

1.  let go of the distinction between domain parameters and key
    material proper in the libcrypto <-> provider interface.

    As a consequence, functions that still need it gain a selection
    argument, which is a set of bits that indicate what parts of the
    key object are to be considered in a specific call.  This allows
    a reduction of very similar functions into one.

2.  Rework the libcrypto <-> provider interface so provider side key
    objects are created and destructed with a separate function, and
    get their data filled and extracted in through import and export.

(future work will see other key object constructors and other
functions to fill them with data)

Fixes #10979

squash! Redesign the KEYMGMT libcrypto <-> provider interface - the basics

Remedy 1 needs a rewrite:

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11006)
2020-02-07 09:37:56 +01:00
..
bio_b64.c
bio_enc.c
bio_md.c Don't use internal knowledge about EVP_MD_CTX in and MD BIO 2019-10-11 11:42:43 +01:00
bio_ok.c
build.info Add RSA key validation to default provider 2020-01-29 20:32:32 +10:00
c_allc.c
c_alld.c Restore MD5-SHA1 in legacy method database 2019-10-14 16:07:41 +02:00
cmeth_lib.c
digest.c EVP_MD_CTX_ctrl(): Remove unnecessary control 2020-02-04 19:32:37 +01:00
e_aes_cbc_hmac_sha1.c Deprecate the low level AES functions 2020-01-06 15:09:57 +00:00
e_aes_cbc_hmac_sha256.c Deprecate the low level AES functions 2020-01-06 15:09:57 +00:00
e_aes.c Deprecate the low level AES functions 2020-01-06 15:09:57 +00: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 Deprecate Low Level Blowfish APIs 2020-01-08 11:25:25 +00:00
e_camellia.c Deprecate Low Level Camellia APIs 2020-01-13 13:38:20 +00:00
e_cast.c Deprecate the Low Level CAST APIs 2020-01-13 13:44:27 +00:00
e_chacha20_poly1305.c
e_des3.c Deprecate the low level DES functions. 2020-01-25 09:30:59 +10:00
e_des.c Deprecate the low level DES functions. 2020-01-25 09:30:59 +10:00
e_idea.c Deprecate the low level IDEA functions. 2020-01-19 10:38:49 +10:00
e_null.c
e_old.c Update source files for pre-3.0 deprecation 2019-11-07 11:37:25 +01:00
e_rc2.c Deprecate the low level RC2 functions 2020-01-16 07:07:27 +10:00
e_rc4_hmac_md5.c Deprecate the low level MD5 functions. 2020-01-19 10:14:39 +10:00
e_rc4.c Deprecate the low level RC4 functions 2020-01-16 07:07:27 +10:00
e_rc5.c Deprecate the low level RC5 functions 2020-01-16 07:07:27 +10:00
e_seed.c Deprecate the low level SEED functions 2020-01-16 07:06:14 +10:00
e_sm4.c
e_xcbc_d.c Deprecate the low level DES functions. 2020-01-25 09:30:59 +10:00
encode.c
evp_cnf.c
evp_enc.c Implement the NULL cipher in the default provider 2020-01-20 15:28:39 +00:00
evp_err.c Replumbing: make it possible for providers to specify multiple names 2019-10-03 15:47:25 +02:00
evp_fetch.c Modify EVP_CIPHER_is_a() and EVP_MD_is_a() to handle legacy methods too 2020-01-17 08:59:41 +01:00
evp_key.c
evp_lib.c Modify EVP_CIPHER_is_a() and EVP_MD_is_a() to handle legacy methods too 2020-01-17 08:59:41 +01:00
evp_local.h Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01: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
evp_utils.c
exchange.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
kdf_lib.c Modify EVP_CIPHER_is_a() and EVP_MD_is_a() to handle legacy methods too 2020-01-17 08:59:41 +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 Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
keymgmt_meth.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
legacy_blake2.c Cleanup legacy digest methods. 2019-12-18 14:46:01 +10:00
legacy_md2.c Deprecate the low level MD2 functions. 2020-01-12 12:02:17 +10:00
legacy_md4.c Deprecate the low level MD4 functions. 2020-01-12 12:02:17 +10:00
legacy_md5_sha1.c Deprecate the low level MD5 functions. 2020-01-19 10:14:39 +10:00
legacy_md5.c Deprecate the low level MD5 functions. 2020-01-19 10:14:39 +10:00
legacy_mdc2.c Deprecate the low level MDC2 functions. 2020-01-12 12:02:17 +10:00
legacy_meth.h Cleanup legacy digest methods. 2019-12-18 14:46:01 +10:00
legacy_ripemd.c Deprecate the low level RIPEMD160 functions. 2020-01-12 12:00:31 +10:00
legacy_sha.c Deprecate the low level SHA functions. 2020-01-19 10:14:39 +10:00
legacy_wp.c Deprecate the low level Whirlpool functions. 2020-01-12 12:05:04 +10:00
m_null.c
m_sigver.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
mac_lib.c Modify EVP_CIPHER_is_a() and EVP_MD_is_a() to handle legacy methods too 2020-01-17 08:59:41 +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 Params: change UTF8 construct calls to avoid explicit strlen(3) calls. 2020-02-06 16:22:00 +10:00
p5_crpt.c Avoid leak in error path of PKCS5_PBE_keyivgen 2020-01-22 18:29:39 +01:00
p_dec.c
p_enc.c
p_lib.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
p_open.c EVP: Adapt EVP_PKEY Seal and Open for provider keys 2020-01-25 13:16:09 +01:00
p_seal.c EVP: Adapt EVP_PKEY Seal and Open for provider keys 2020-01-25 13:16:09 +01:00
p_sign.c
p_verify.c
pbe_scrypt.c
pkey_kdf.c Params: change UTF8 construct calls to avoid explicit strlen(3) calls. 2020-02-06 16:22:00 +10:00
pkey_mac.c
pmeth_check.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
pmeth_fn.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
pmeth_gn.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00
pmeth_lib.c Params: change UTF8 construct calls to avoid explicit strlen(3) calls. 2020-02-06 16:22:00 +10:00
signature.c Redesign the KEYMGMT libcrypto <-> provider interface - the basics 2020-02-07 09:37:56 +01:00