Fix provider cipher reinit after init/update with a partial update block.
authorShane Lontis <shane.lontis@oracle.com>
Tue, 4 Aug 2020 22:45:29 +0000 (08:45 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Tue, 4 Aug 2020 22:45:29 +0000 (08:45 +1000)
commit914f97eecc9166fbfdb50c2d04e2b9f9d0c52198
tree1eb588c4623b923dcffc417a611724673eb2947e
parentc5b356d5d6cfca1128b35f235dfdb893f2888027
Fix provider cipher reinit after init/update with a partial update block.

The test added previously used a 16 byte block during the update which does not cause internal buffering in the provider.
Some internal variables related to the buffering were not being cleared in the init, which meant that the second
update would use the buffered data from the first update.
Added test for this scenario with exclusions for ciphers that do not support partial block updates.

Found by guidovranken.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12523)
providers/implementations/ciphers/cipher_aes_ocb.c
providers/implementations/ciphers/cipher_des.c
providers/implementations/ciphers/cipher_tdes_common.c
providers/implementations/ciphers/ciphercommon.c
test/evp_libctx_test.c