From 682b6f67472c22ad2e750c3398d0c49b13c7f5dd Mon Sep 17 00:00:00 2001 From: Patrick Steuer Date: Wed, 18 Sep 2019 20:43:02 +0200 Subject: [PATCH] Fix aes ofb, cfb and cfb8 for s390x ..which was broken since e1178600. Signed-off-by: Patrick Steuer Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/9939) --- providers/common/ciphers/cipher_aes_hw_s390x.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/common/ciphers/cipher_aes_hw_s390x.inc b/providers/common/ciphers/cipher_aes_hw_s390x.inc index cefaa1c583..805fa91e5f 100644 --- a/providers/common/ciphers/cipher_aes_hw_s390x.inc +++ b/providers/common/ciphers/cipher_aes_hw_s390x.inc @@ -55,7 +55,7 @@ static int s390x_aes_ofb128_initkey(PROV_CIPHER_CTX *dat, { PROV_AES_CTX *adat = (PROV_AES_CTX *)dat; - memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->blocksize); + memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen); memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen); adat->plat.s390x.fc = S390X_AES_FC(keylen); adat->plat.s390x.res = 0; @@ -114,7 +114,7 @@ static int s390x_aes_cfb128_initkey(PROV_CIPHER_CTX *dat, adat->plat.s390x.fc |= S390X_DECRYPT; adat->plat.s390x.res = 0; - memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->blocksize); + memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen); memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen); return 1; } @@ -175,7 +175,7 @@ static int s390x_aes_cfb8_initkey(PROV_CIPHER_CTX *dat, if (!dat->enc) adat->plat.s390x.fc |= S390X_DECRYPT; - memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->blocksize); + memcpy(adat->plat.s390x.param.kmo_kmf.cv, dat->iv, dat->ivlen); memcpy(adat->plat.s390x.param.kmo_kmf.k, key, keylen); return 1; } -- 2.40.0