Fix a key repointing in various ciphers
authorNeil Horman <nhorman@openssl.org>
Tue, 12 Sep 2023 21:09:06 +0000 (17:09 -0400)
committerPauli <pauli@openssl.org>
Sun, 17 Sep 2023 11:02:58 +0000 (21:02 +1000)
commit0ca5cf989101cae6ffeaef3518e99839fbccb9ba
tree9ccdbfab977295ca262df97fa33e92923e349f54
parentbbb6d620f6014274cb00a8186225447a2a114543
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>
(Merged from https://github.com/openssl/openssl/pull/22102)
providers/implementations/ciphers/cipher_aes_gcm.c
providers/implementations/ciphers/cipher_aria_ccm.c
providers/implementations/ciphers/cipher_aria_gcm.c
providers/implementations/ciphers/cipher_sm4_ccm.c
providers/implementations/ciphers/cipher_sm4_gcm.c