summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers/cipher_des.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/ciphers/cipher_des.c')
-rw-r--r--providers/implementations/ciphers/cipher_des.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/providers/implementations/ciphers/cipher_des.c b/providers/implementations/ciphers/cipher_des.c
index 9010ce9099..4563ea2edb 100644
--- a/providers/implementations/ciphers/cipher_des.c
+++ b/providers/implementations/ciphers/cipher_des.c
@@ -86,6 +86,9 @@ static int des_init(void *vctx, const unsigned char *key, size_t keylen,
if (iv != NULL) {
if (!ossl_cipher_generic_initiv(ctx, iv, ivlen))
return 0;
+ } else if (ctx->iv_set) {
+ /* reset IV to keep compatibility with 1.1.1 */
+ memcpy(ctx->iv, ctx->oiv, ctx->ivlen);
}
if (key != NULL) {