openssl/crypto/evp
Richard Levitte a5ce329eb4 EVP: Don't call digest_custom() quite so early
A huge problem with calling digest_custom() already in the
initialization of DigestSign, DigestVerify etc, is that it force all
callers to know that certain controls must be performed before Init
and the rest after.  This has lead to quite interesting hacks in our
own openssl app, where the SM2 ID had to get special treatment instead
of just being another sign option or verification option among others.

This change moves the call of digest_custom() to the Update and Final
functions, to be done exactly once, subject to a flag that's set in
the Init function.  Seeing to the process of data, through these
operations, this makes no difference at all.  Seeing to making it
possible to perform all controls after the Init call, this makes a
huge difference.

Fixes #11293

Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/11302)
2020-03-15 19:42:04 +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 CORE: Add the key object generator libcrypto<->provider interface 2020-03-12 10:43:58 +01: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 new domparams and key generation functionality 2020-03-12 10:44:01 +01:00
keymgmt_meth.c CORE: Add the key object generator libcrypto<->provider interface 2020-03-12 10:43:58 +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: Don't call digest_custom() quite so early 2020-03-15 19:42:04 +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 new domparams and key generation functionality 2020-03-12 10:44:01 +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 EVP: Add new domparams and key generation functionality 2020-03-12 10:44:01 +01:00
pmeth_lib.c Fix legacy_ctrl_to_param() to pay better attention to keytype 2020-03-15 10:07:58 +01:00
signature.c EVP: Check that key methods aren't foreign when exporting 2020-03-09 10:54:01 +01:00