null sanity check on arguments in wc_HpkeContextComputeNonce, CID 515543

This commit is contained in:
JacobBarthelmeh
2025-04-18 16:47:36 -06:00
parent f834b9b08a
commit 69a4607f84

View File

@@ -586,6 +586,10 @@ static int wc_HpkeContextComputeNonce(Hpke* hpke, HpkeBaseContext* context,
int ret;
byte seq_bytes[HPKE_Nn_MAX];
if (hpke == NULL || context == NULL) {
return BAD_FUNC_ARG;
}
/* convert the sequence into a byte string with the same length as the
* nonce */
ret = I2OSP(context->seq, (int)hpke->Nn, seq_bytes);