openssl/crypto/evp
Richard Levitte df13defd4f EVP: Check that key methods aren't foreign when exporting
The EVP_PKEY_ASN1_METHOD function export_to() must check that the key
we're trying to export has a known libcrypto method, i.e. is a built
in RSA_METHOD, DSA_METHOD, etc.  Otherwise, the method may be defined
by the calling application, by an engine, by another library, and we
simply cannot know all the quirks hidden behind that method, if we
have access to the key data, or much anything.

Such keys are simply deemed impossible to export to provider keys,
i.e. have export_to() return 0.  This cascades back to functions like
evp_pkey_export_to_provider() and evp_pkey_upgrade_to_provider() and
their callers.  In most cases, this is fine, but if these get mixed in
with provider side keys in any function, that function will fail.

Fixes #11179
Fixes #9915

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11193)
2020-03-09 10:54:01 +01:00
..
bio_b64.c Remove unneeded switch statement to fix warning 2020-02-20 18:53:50 +10:00
bio_enc.c Remove unneeded switch statement to fix warning 2020-02-20 18:53:50 +10:00
bio_md.c Remove unneeded switch statement to fix warning 2020-02-20 18:53:50 +10:00
bio_ok.c Remove unneeded switch statement to fix warning 2020-02-20 18:53:50 +10:00
build.info Adapt all build.info and test recipes to the new $disabled{'deprecated-x.y'} 2020-02-07 14:54:36 +01:00
c_allc.c
c_alld.c
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
evp_fetch.c Refactor evp_pkey_make_provided() to do legacy to provider export 2020-02-22 01:19:54 +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 Implement provider support for Ed25519 annd Ed448 2020-03-09 07:59:15 +00:00
evp_pbe.c
evp_pkey.c
evp_utils.c
exchange.c Rethink the EVP_PKEY cache of provider side keys 2020-02-29 05:39:43 +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 EVP: Add support for copying provided EVP_PKEYs 2020-03-02 03:27:03 +01:00
keymgmt_meth.c KEYMGMT: Add a keydata copy function 2020-03-02 03:27:03 +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 EVP: Check that key methods aren't foreign when exporting 2020-03-09 10:54:01 +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 Deprecate the low level RSA functions. 2020-02-20 18:58:40 +10:00
p_enc.c Deprecate the low level RSA functions. 2020-02-20 18:58:40 +10:00
p_lib.c EVP: Add support for copying provided EVP_PKEYs 2020-03-02 03:27:03 +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: add argument to the _from_text calls to indicate if the param exists. 2020-02-21 13:04:25 +01:00
pkey_mac.c Params: add argument to the _from_text calls to indicate if the param exists. 2020-02-21 13:04:25 +01:00
pmeth_check.c Rethink the EVP_PKEY cache of provider side keys 2020-02-29 05:39:43 +01:00
pmeth_fn.c EVP: Check that key methods aren't foreign when exporting 2020-03-09 10:54:01 +01:00
pmeth_gn.c Add Serializers for EC 2020-03-04 07:48:45 +10:00
pmeth_lib.c Add Serializers for EC 2020-03-04 07:48:45 +10:00
signature.c EVP: Check that key methods aren't foreign when exporting 2020-03-09 10:54:01 +01:00