Fix a key repointing in various ciphers
authorNeil Horman <nhorman@openssl.org>
Tue, 12 Sep 2023 21:09:06 +0000 (17:09 -0400)
committerTomas Mraz <tomas@openssl.org>
Fri, 5 Jan 2024 16:15:45 +0000 (17:15 +0100)
commit780b38cae957c52a524b6fd9d5558c31e0a2ea22
tree83f37503813b26fdb2160d6dbbeedee3e6514554
parent291796b3d0c2f215f9aa5ce3ad5d611068638cfb
Fix a key repointing in various ciphers

In the dupctx fixups I missed a pointer that needed to be repointed to
the surrounding structures AES_KEY structure for the sm4/aes/aria
ccm/gcm variants.  This caused a colliding use of the key and possible
use after free issues.

Fixes #22076

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23102)

(cherry picked from commit 0398bc20080de037a8433fe81cfdef3ba0ec9d4c)
providers/implementations/ciphers/cipher_aes_gcm.c
providers/implementations/ciphers/cipher_aria_ccm.c
providers/implementations/ciphers/cipher_aria_gcm.c