From cae12b7ffb7475414c7e36779c7cb4e51947a0aa Mon Sep 17 00:00:00 2001 From: sebastian-carpenter Date: Fri, 27 Mar 2026 13:22:28 -0600 Subject: [PATCH] mirror arg requirements from wc_HpkeContextSealBase --- wolfcrypt/src/hpke.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/hpke.c b/wolfcrypt/src/hpke.c index 8f16f66f70..52f2ad8fd7 100644 --- a/wolfcrypt/src/hpke.c +++ b/wolfcrypt/src/hpke.c @@ -1175,7 +1175,8 @@ int wc_HpkeContextOpenBase(Hpke* hpke, HpkeBaseContext* context, byte* aad, int ret; byte nonce[HPKE_Nn_MAX]; WC_DECLARE_VAR(aes, Aes, 1, 0); - if (hpke == NULL || context == NULL || ciphertext == NULL || out == NULL) { + if (hpke == NULL || context == NULL || (aad == NULL && aadSz > 0) || + ciphertext == NULL || out == NULL) { return BAD_FUNC_ARG; }