openssl/crypto/evp
Shane Lontis 90409da6a5 Fix provider cipher reinit issue
Fixes #12405
Fixes #12377

Calling Init()/Update() and then Init()/Update() again gave a different result when using the same key and iv.
Cipher modes that were using ctx->num were not resetting this value, this includes OFB, CFB & CTR.
The fix is to reset this value during the ciphers einit() and dinit() methods.
Most ciphers go thru a generic method so one line fixes most cases.

Add test for calling EVP_EncryptInit()/EVP_EncryptUpdate() multiple times for all ciphers.
Ciphers should return the same value for both updates.
DES3-WRAP does not since it uses a random in the update.
CCM modes currently also fail on the second update (This also happens in 1_1_1).

Fix memory leak in AES_OCB cipher if EVP_EncryptInit is called multiple times.

Fix AES_SIV cipher dup_ctx and init.
Calling EVP_CIPHER_init multiple times resulted in a memory leak in the siv.
Fixing this leak also showed that the dup ctx was not working for siv mode.
Note: aes_siv_cleanup() can not be used by aes_siv_dupctx() as it clears data
that is required for the decrypt (e.g the tag).

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12413)
2020-07-22 10:40:55 +10: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 Add and use internal header that implements endianness check 2020-07-11 10:00:33 +02:00
build.info CTR, HASH and HMAC DRBGs in provider 2020-06-24 20:05:42 +10:00
c_allc.c
c_alld.c
cmeth_lib.c
digest.c deprecate engines in libcrypto 2020-07-16 09:12:27 +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 Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
e_aria.c
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 Update copyright year 2020-07-16 14:47:04 +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
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
e_xcbc_d.c Update copyright year 2020-04-23 13:55:52 +01:00
encode.c Update copyright year 2020-06-25 14:13:12 +01:00
evp_cnf.c Update copyright year 2020-05-15 14:09:49 +01:00
evp_enc.c deprecate engines in libcrypto 2020-07-16 09:12:27 +02:00
evp_err.c rand: core APIs for provider friendly random. 2020-06-24 20:05:41 +10:00
evp_fetch.c CORE: Add an internal function to distinguish the global default context 2020-06-28 10:55:52 +02:00
evp_key.c
evp_lib.c Make EVP_PKEY_CTX_[get|set]_group_name work for DH too 2020-06-19 10:19:31 +01:00
evp_local.h rand: avoid caching RNG parameters. 2020-07-05 13:18:08 +10:00
evp_pbe.c
evp_pkey.c Update copyright year 2020-04-23 13:55:52 +01:00
evp_rand.c rand: avoid caching RNG parameters. 2020-07-05 13:18:08 +10:00
evp_utils.c
exchange.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
kdf_lib.c Revert "kdf: make function naming consistent." 2020-07-16 14:21:07 +02:00
kdf_meth.c Update copyright year 2020-06-25 14:13:12 +01:00
keymgmt_lib.c Always create a key when importing 2020-06-05 11:04:11 +01:00
keymgmt_meth.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
legacy_blake2.c
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
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
m_sigver.c EVP: For SIGNATURE operations, pass the propquery early 2020-05-14 12:16:35 +02:00
mac_lib.c mac: always pass a non-NULL output size pointer to providers. 2020-07-18 16:54:53 +10:00
mac_meth.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
names.c
p5_crpt2.c Revert "kdf: make function naming consistent." 2020-07-16 14:21:07 +02: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 Revert "The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*" 2020-07-16 14:21:07 +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
p_verify.c
pbe_scrypt.c Revert "kdf: make function naming consistent." 2020-07-16 14:21:07 +02:00
pkey_kdf.c Revert "kdf: make function naming consistent." 2020-07-16 14:21:07 +02:00
pkey_mac.c Revert "The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*" 2020-07-16 14:21:07 +02:00
pmeth_check.c Rename FIPS_MODE to FIPS_MODULE 2020-04-28 15:37:37 +02:00
pmeth_fn.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
pmeth_gn.c Make EVP_PKEY_CTX_[get|set]_ec_paramgen_curve_name more generic 2020-06-19 10:19:31 +01:00
pmeth_lib.c Make EVP_PKEY_CTX_[get|set]_group_name work for DH too 2020-06-19 10:19:31 +01:00
signature.c Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00