summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers/cipher_des.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-05 08:45:29 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-08-05 08:45:29 +1000
commit914f97eecc9166fbfdb50c2d04e2b9f9d0c52198 (patch)
tree1eb588c4623b923dcffc417a611724673eb2947e /providers/implementations/ciphers/cipher_des.c
parentc5b356d5d6cfca1128b35f235dfdb893f2888027 (diff)
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)
Diffstat (limited to 'providers/implementations/ciphers/cipher_des.c')
-rw-r--r--providers/implementations/ciphers/cipher_des.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/providers/implementations/ciphers/cipher_des.c b/providers/implementations/ciphers/cipher_des.c
index 9a7c13902f..4974234efd 100644
--- a/providers/implementations/ciphers/cipher_des.c
+++ b/providers/implementations/ciphers/cipher_des.c
@@ -68,6 +68,7 @@ static int des_init(void *vctx, const unsigned char *key, size_t keylen,
PROV_CIPHER_CTX *ctx = (PROV_CIPHER_CTX *)vctx;
ctx->num = 0;
+ ctx->bufsz = 0;
ctx->enc = enc;
if (iv != NULL) {