]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix aes_gcm_siv dupctx function
authorNeil Horman <nhorman@openssl.org>
Fri, 1 Sep 2023 16:13:19 +0000 (12:13 -0400)
committerTomas Mraz <tomas@openssl.org>
Tue, 12 Sep 2023 13:59:11 +0000 (15:59 +0200)
This cipher family has a dupctx function, but was failing because it was
attempting to memdup a field only if it was null

Fix the conditional check to get it working again

Fixes #21887

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

providers/implementations/ciphers/cipher_aes_gcm_siv.c

index 64f7f95039b66e488982a3191c7ebecbf8e5d1a9..2d4fd886583e50bea3baf26e1093be8e5026a4b6 100644 (file)
@@ -71,7 +71,7 @@ static void *ossl_aes_gcm_siv_dupctx(void *vctx)
     ret->aad = NULL;
     ret->ecb_ctx = NULL;
 
-    if (in->aad == NULL) {
+    if (in->aad != NULL) {
         if ((ret->aad = OPENSSL_memdup(in->aad, UP16(ret->aad_len))) == NULL)
             goto err;
     }