[openssl/openssl] 8e60b9: Fix partial block encryption in cfb and ofb for s390x

Holger Dengler noreply at github.com
Fri Jan 12 09:37:00 UTC 2024


  Branch: refs/heads/openssl-3.0
  Home:   https://github.com/openssl/openssl
  Commit: 8e60b9dfefa8d97102e6f1c20affcaa86dfe0afb
      https://github.com/openssl/openssl/commit/8e60b9dfefa8d97102e6f1c20affcaa86dfe0afb
  Author: Holger Dengler <dengler at linux.ibm.com>
  Date:   2024-01-12 (Fri, 12 Jan 2024)

  Changed paths:
    M providers/implementations/ciphers/cipher_aes.h
    M providers/implementations/ciphers/cipher_aes_hw_s390x.inc

  Log Message:
  -----------
  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 at linux.ibm.com>

Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23201)

(cherry picked from commit 576a3572bebf6115df1c03527114cbf74d06f861)


  Commit: b1b3e6b923f38e3a3f38ef8e0fffe2a2dcba7611
      https://github.com/openssl/openssl/commit/b1b3e6b923f38e3a3f38ef8e0fffe2a2dcba7611
  Author: Holger Dengler <dengler at linux.ibm.com>
  Date:   2024-01-12 (Fri, 12 Jan 2024)

  Changed paths:
    M crypto/evp/e_aes.c

  Log Message:
  -----------
  Fix partial block encryption in cfb and ofb for s390x (legacy)

Use the number of processed bytes information (num) from the generic
cipher context for the partial block handling in cfb and ofb also in
s390x-legacy code. For more details see 4df92c1a14 ("Fix partial block
encryption in cfb and ofb for s390x").

Signed-off-by: Holger Dengler <dengler at linux.ibm.com>

Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23201)

(cherry picked from commit f9ccd209c3d121668c51a992613c698f2a774cb3)


  Commit: 1ce66c7fbad8abcc19aef1fffc07dd453722b98e
      https://github.com/openssl/openssl/commit/1ce66c7fbad8abcc19aef1fffc07dd453722b98e
  Author: Holger Dengler <dengler at linux.ibm.com>
  Date:   2024-01-12 (Fri, 12 Jan 2024)

  Changed paths:
    M test/evp_extra_test.c

  Log Message:
  -----------
  Add tests for re-using cipher contexts

Add test case for re-using a cipher context with the same key, iv and
cipher. It detects, if the hardware-specific cipher context is reset
correctly, like reported in issue #23175.

This test has encrypt and decrypt iterations for cfb128 and
ofb128. All iteations use the same key, iv and plaintext.

Signed-off-by: Holger Dengler <dengler at linux.ibm.com>

Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23201)

(cherry picked from commit 3cb1b51dddf4deaf5e3886b827f3245d81670bc7)


Compare: https://github.com/openssl/openssl/compare/41b16c82933d...1ce66c7fbad8


More information about the openssl-commits mailing list