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
e_aes_cbc_hmac_sha256.c
e_aes.c
e_aria.c
e_bf.c
e_camellia.c
e_cast.c
e_chacha20_poly1305.c
e_des3.c
e_des.c
e_idea.c
e_null.c
e_old.c
e_rc2.c
e_rc4_hmac_md5.c
e_rc4.c
e_rc5.c
e_seed.c
e_sm4.c
e_xcbc_d.c
encode.c
evp_cnf.c
evp_enc.c
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
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
kdf_meth.c
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
legacy_md2.c
legacy_md4.c
legacy_md5_sha1.c
legacy_md5.c
legacy_mdc2.c
legacy_meth.h
legacy_ripemd.c
legacy_sha.c
legacy_wp.c
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
mac_meth.c
names.c
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
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
p_seal.c
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