From 6462986bf27d3aad2f1d56de2e2f4cfe9655dca8 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Tue, 19 Mar 2024 09:13:28 -0700 Subject: [PATCH] OCSP Extension Encoding Fix 1. Removed redundant check for the output being NULL in `EncodeOcspRequestExtensions()`. The chuck of code being protected only cared about the value of ret, not the pointer. The code was supposed to calculate the size of the data without writing it. --- wolfcrypt/src/asn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index db564e479..ac5099587 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -36642,7 +36642,7 @@ word32 EncodeOcspRequestExtensions(OcspRequest* req, byte* output, word32 size) CALLOC_ASNSETDATA(dataASN, ocspNonceExtASN_Length, ret, req->heap); - if ((ret == 0) && (output != NULL)) { + if (ret == 0) { /* Set nonce extension OID and nonce. */ SetASN_Buffer(&dataASN[OCSPNONCEEXTASN_IDX_EXT_OID], NonceObjId, sizeof(NonceObjId));