openssl/include/crypto
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
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
aes_platform.h Update copyright year 2020-04-23 13:55:52 +01:00
aria.h
asn1_dsa.h
asn1.h Constify X509_PUBKEY_get(), X509_PUBKEY_get0(), and X509_PUBKEY_get0_param() 2020-05-26 09:35:05 +02:00
async.h
bn_conf.h.in
bn_dh.h Fix DH_get_nid() so that it does not cache values. 2020-04-20 11:07:38 +10:00
bn_srp.h
bn.h RSA generation: Use more bits of 1/sqrt(2) 2019-11-09 16:01:54 +01:00
chacha.h
cmll_platform.h CRYPTO: split cipher_platform.h into algorithm specific headers 2019-12-19 13:31:29 +01:00
cms.h crypto/cms: add CAdES-BES signed attributes validation 2020-05-27 13:16:30 +02:00
cryptlib.h
ctype.h
des_platform.h CRYPTO: split cipher_platform.h into algorithm specific headers 2019-12-19 13:31:29 +01:00
dh.h Add ACVP fips module tests 2020-06-17 11:33:16 +10:00
dsa.h Add ACVP fips module tests 2020-06-17 11:33:16 +10:00
dso_conf.h.in
ec.h Add more complete support for libctx/propq in the EC code 2020-06-19 10:34:58 +01:00
ecx.h Add the library ctx into an ECX_KEY 2020-05-04 09:30:55 +01:00
engine.h
err.h
ess.h crypto/cms: add CAdES-BES signed attributes validation 2020-05-27 13:16:30 +02:00
evp.h Make the naming scheme for dispatched functions more consistent 2020-06-24 22:01:22 +02:00
lhash.h
md32_common.h
modes.h Update copyright year 2020-04-23 13:55:52 +01:00
objects.h
poly1305.h Add ChaCha related ciphers to default provider 2019-10-16 16:18:42 +10:00
rand.h share rand_pool between libcrypto and providers 2020-06-24 20:05:41 +10:00
rsa.h Add ACVP fips module tests 2020-06-17 11:33:16 +10:00
security_bits.h Change DH_get_nid() to set the value of q if it is not already set 2020-03-07 07:47:58 +10:00
serializer.h SERIALIZER: New API for serialization of objects through providers 2019-11-29 20:54:48 +01:00
sha.h
siphash.h
siv.h Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
sm2.h
sm2err.h Update source files for deprecation at 3.0 2019-11-07 11:37:25 +01:00
sm4.h
sparse_array.h
store.h Update copyright year 2020-04-23 13:55:52 +01:00
x509.h Update copyright year 2020-04-23 13:55:52 +01:00
x509v3.h x509v3 subjectSignTool extention support 2020-02-28 18:01:16 +03:00