From af8a6206b3e3e0a75a81fc11512920e152223e40 Mon Sep 17 00:00:00 2001 From: Brett Nicholas <7547222+bigbrett@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:55:05 -0600 Subject: [PATCH] AES GCM: remove null check on optional output arg so wolfCrypt GHASH tests can pass --- src/wh_client_crypto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wh_client_crypto.c b/src/wh_client_crypto.c index 254d7cfc9..8c89cdc10 100644 --- a/src/wh_client_crypto.c +++ b/src/wh_client_crypto.c @@ -692,7 +692,7 @@ int wh_Client_AesGcm(whClientContext* ctx, Aes* aes, int enc, const uint8_t* in, if ((ctx == NULL) || (aes == NULL) || ((in == NULL) && (len > 0)) || ((iv == NULL) && (iv_len > 0)) || ((authin == NULL) && (authin_len > 0)) || - ((enc == 0) && (dec_tag == NULL)) || (out == NULL)) { + ((enc == 0) && (dec_tag == NULL))) { return WH_ERROR_BADARGS; } @@ -811,7 +811,7 @@ int wh_Client_AesGcm(whClientContext* ctx, Aes* aes, int enc, const uint8_t* in, res->authTagSz); } #endif - /* copy the response result */ + /* copy the response result if present */ if (out != NULL && res->sz == len) { memcpy(out, res_out, res->sz); } @@ -859,7 +859,7 @@ int wh_Client_AesGcmDma(whClientContext* ctx, Aes* aes, int enc, uint32_t keyLen = 0; uint16_t reqLen; - if (ctx == NULL || aes == NULL || out == NULL) { + if (ctx == NULL || aes == NULL) { return WH_ERROR_BADARGS; }