Skip to content

Commit

Permalink
Update variable name from new to avoid g++ name clash
Browse files Browse the repository at this point in the history
  • Loading branch information
ColtonWilley committed Nov 18, 2024
1 parent 55be503 commit d65c17b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
9 changes: 5 additions & 4 deletions src/crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static int AddCRL(WOLFSSL_CRL* crl, DecodedCRL* dcrl, const byte* buff,
CRL_Entry* prev = NULL;
#ifdef HAVE_CRL_UPDATE_CB
CrlInfo old;
CrlInfo new;
CrlInfo cnew;
#endif

WOLFSSL_ENTER("AddCRL");
Expand Down Expand Up @@ -646,8 +646,8 @@ static int AddCRL(WOLFSSL_CRL* crl, DecodedCRL* dcrl, const byte* buff,
#ifdef HAVE_CRL_UPDATE_CB
if (crl->cm && crl->cm->cbUpdateCRL != NULL) {
SetCrlInfo(curr, &old);
SetCrlInfo(crle, &new);
crl->cm->cbUpdateCRL(&old, &new);
SetCrlInfo(crle, &cnew);
crl->cm->cbUpdateCRL(&old, &cnew);
}
#endif

Expand Down Expand Up @@ -791,7 +791,8 @@ int GetCRLInfo(WOLFSSL_CRL* crl, CrlInfo* info, const byte* buff,
}

#ifdef WOLFSSL_SMALL_STACK
dcrl = (DecodedCRL*)XMALLOC(sizeof(DecodedCRL), NULL, DYNAMIC_TYPE_TMP_BUFFER);
dcrl = (DecodedCRL*)XMALLOC(sizeof(DecodedCRL), NULL,
DYNAMIC_TYPE_TMP_BUFFER);
if (dcrl == NULL) {
FreeDer(&der);
return MEMORY_E;
Expand Down
22 changes: 11 additions & 11 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -89764,7 +89764,7 @@ static int test_wolfSSL_CTX_LoadCRL(void)
defined(HAVE_CRL_UPDATE_CB)
int crlUpdateTestStatus = 0;
WOLFSSL_CERT_MANAGER* updateCrlTestCm = NULL;
static void updateCrlCb(CrlInfo* old, CrlInfo* new)
static void updateCrlCb(CrlInfo* old, CrlInfo* cnew)
{
const char* crl1 = "./certs/crl/crl.pem";
const char* crlRevoked = "./certs/crl/crl.revoked";
Expand All @@ -89779,7 +89779,7 @@ static void updateCrlCb(CrlInfo* old, CrlInfo* new)
CrlInfo crlRevInfo;

crlUpdateTestStatus = 0;
if (old == NULL || new == NULL) {
if (old == NULL || cnew == NULL) {
return;
}

Expand Down Expand Up @@ -89825,18 +89825,18 @@ static void updateCrlCb(CrlInfo* old, CrlInfo* new)
crl1Info.nextDate, old->nextDate, old->nextDateMaxLen), 0);

/* Newer entry should match crl revoked */
AssertIntEQ(crlRevInfo.issuerHashLen, new->issuerHashLen);
AssertIntEQ(crlRevInfo.lastDateMaxLen, new->lastDateMaxLen);
AssertIntEQ(crlRevInfo.lastDateFormat, new->lastDateFormat);
AssertIntEQ(crlRevInfo.nextDateMaxLen, new->nextDateMaxLen);
AssertIntEQ(crlRevInfo.nextDateFormat, new->nextDateFormat);
AssertIntEQ(crlRevInfo.crlNumber, new->crlNumber);
AssertIntEQ(crlRevInfo.issuerHashLen, cnew->issuerHashLen);
AssertIntEQ(crlRevInfo.lastDateMaxLen, cnew->lastDateMaxLen);
AssertIntEQ(crlRevInfo.lastDateFormat, cnew->lastDateFormat);
AssertIntEQ(crlRevInfo.nextDateMaxLen, cnew->nextDateMaxLen);
AssertIntEQ(crlRevInfo.nextDateFormat, cnew->nextDateFormat);
AssertIntEQ(crlRevInfo.crlNumber, cnew->crlNumber);
AssertIntEQ(XMEMCMP(
crlRevInfo.issuerHash, new->issuerHash, new->issuerHashLen), 0);
crlRevInfo.issuerHash, cnew->issuerHash, cnew->issuerHashLen), 0);
AssertIntEQ(XMEMCMP(
crlRevInfo.lastDate, new->lastDate, new->lastDateMaxLen), 0);
crlRevInfo.lastDate, cnew->lastDate, cnew->lastDateMaxLen), 0);
AssertIntEQ(XMEMCMP(
crlRevInfo.nextDate, new->nextDate, new->nextDateMaxLen), 0);
crlRevInfo.nextDate, cnew->nextDate, cnew->nextDateMaxLen), 0);

XFREE(crl1Buff, NULL, DYNAMIC_TYPE_FILE);
XFREE(crlRevBuff, NULL, DYNAMIC_TYPE_FILE);
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3504,7 +3504,7 @@ typedef struct CrlInfo {
sword32 crlNumber;
} CrlInfo;

typedef void (*CbUpdateCRL)(CrlInfo* old, CrlInfo* new);
typedef void (*CbUpdateCRL)(CrlInfo* old, CrlInfo* cnew);
#endif

/* User Atomic Record Layer CallBacks */
Expand Down

0 comments on commit d65c17b

Please sign in to comment.