2
0
mirror of https://github.com/openssl/openssl.git synced 2025-03-01 19:28:10 +08:00
openssl/crypto
Shane Lontis 90409da6a5 Fix provider cipher reinit issue
Fixes 
Fixes 

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
..
aes
aria
asn1
async
bf
bio
bn
buffer
camellia
cast
chacha
cmac
cmp
cms
comp
conf
crmf
ct
des
dh
dsa
dso
ec
engine
err
ess
evp Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
ffc
hmac
http
idea
include/internal
kdf
lhash
md2
md4
md5
mdc2
modes Fix provider cipher reinit issue 2020-07-22 10:40:55 +10:00
objects
ocsp
pem
perlasm
pkcs7
pkcs12
poly1305
property
rand
rc2
rc4
rc5
ripemd
rsa
seed
serializer
sha
siphash
sm2
sm3
sm4
srp
stack
store
ts
txt_db
ui
whrlpool
x509
alphacpuid.pl
arm64cpuid.pl
arm_arch.h
armcap.c
armv4cpuid.pl
asn1_dsa.c
bsearch.c
build.info
c64xpluscpuid.pl
context.c
core_algorithm.c
core_fetch.c
core_namemap.c
cpt_err.c
cryptlib.c
ctype.c
cversion.c
der_writer.c
dllmain.c
ebcdic.c
ex_data.c
getenv.c
ia64cpuid.S
info.c
init.c
initthread.c
LPdir_nyi.c
LPdir_unix.c
LPdir_vms.c
LPdir_win32.c
LPdir_win.c
LPdir_wince.c
mem_clr.c
mem_sec.c
mem.c
mips_arch.h
o_dir.c
o_fopen.c
o_init.c
o_str.c
o_time.c
packet.c
param_build_set.c
param_build.c
params_from_text.c
params.c
pariscid.pl
ppc_arch.h
ppccap.c
ppccpuid.pl
provider_conf.c
provider_core.c
provider_local.h
provider_predefined.c
provider.c
README-sparse_array.md
s390x_arch.h
s390xcap.c
s390xcpuid.pl
self_test_core.c
sparc_arch.h
sparccpuid.S
sparcv9cap.c
sparse_array.c
threads_none.c
threads_pthread.c
threads_win.c
trace.c
uid.c
vms_rms.h
x86_64cpuid.pl
x86cpuid.pl