Fix partial block encryption in cfb and ofb for s390x
authorHolger Dengler <dengler@linux.ibm.com>
Thu, 4 Jan 2024 08:37:39 +0000 (09:37 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 12 Jan 2024 09:35:45 +0000 (10:35 +0100)
commitaa24651e5c535cd3cbab95a5cc93b18929972664
tree6085b7cec0bb5c80733e380b3a345b9e0cd67092
parent0a12aba18f705c888d661d2e2da3848a392f70a5
Fix partial block encryption in cfb and ofb for s390x

Use the number of processed bytes information (num) from the generic
cipher context for the partial block handling in cfb and ofb, instead
of keep this information in the s390x-specific part of the cipher
context. The information in the generic context is reset properly,
even if the context is re-initialized without resetting the key or iv.

Fixes: #23175
Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23201)

(cherry picked from commit 576a3572bebf6115df1c03527114cbf74d06f861)
providers/implementations/ciphers/cipher_aes.h
providers/implementations/ciphers/cipher_aes_hw_s390x.inc