From: Patrick Steuer Date: Wed, 18 Sep 2019 18:43:02 +0000 (+0200) Subject: Fix aes ofb, cfb and cfb8 for s390x X-Git-Tag: openssl-3.0.0-alpha1~1325 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=682b6f67472c22ad2e750c3398d0c49b13c7f5dd;p=oweals%2Fopenssl.git 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) --- 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; }