Skip to content

Commit

Permalink
acert: pacify sanitizer in tests/api.c.
Browse files Browse the repository at this point in the history
  • Loading branch information
philljj committed Nov 8, 2024
1 parent b54950b commit e9bc672
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -14144,19 +14144,32 @@ static int test_wolfSSL_X509_ACERT_asn(void)
ExpectNotNull(acert->holderIssuerName);
ExpectNotNull(acert->holderEntityName);

ExpectIntEQ(acert->holderIssuerName->len, sizeof(holderIssuerName));
ExpectIntEQ(acert->holderEntityName->len, sizeof(holderEntityName));

ExpectIntEQ(acert->holderIssuerName->type, ASN_DIR_TYPE);
ExpectIntEQ(acert->holderEntityName->type, ASN_DIR_TYPE);

n_diff = XMEMCMP(acert->holderIssuerName->name, holderIssuerName,
sizeof(holderIssuerName));
ExpectIntEQ(n_diff, 0);
if ((acert->holderIssuerName != NULL) &&
(acert->holderEntityName != NULL)) {
ExpectNotNull(acert->holderEntityName->name);
ExpectNotNull(acert->holderIssuerName->name);
}

n_diff = XMEMCMP(acert->holderEntityName->name, holderEntityName,
sizeof(holderEntityName));
ExpectIntEQ(n_diff, 0);
if ((acert->holderIssuerName != NULL) &&
(acert->holderEntityName != NULL) &&
(acert->holderIssuerName->name != NULL) &&
(acert->holderEntityName->name != NULL)) {
ExpectIntEQ(acert->holderIssuerName->len,
sizeof(holderIssuerName));
ExpectIntEQ(acert->holderEntityName->len,
sizeof(holderEntityName));

ExpectIntEQ(acert->holderIssuerName->type, ASN_DIR_TYPE);
ExpectIntEQ(acert->holderEntityName->type, ASN_DIR_TYPE);

n_diff = XMEMCMP(acert->holderIssuerName->name, holderIssuerName,
sizeof(holderIssuerName));
ExpectIntEQ(n_diff, 0);

n_diff = XMEMCMP(acert->holderEntityName->name, holderEntityName,
sizeof(holderEntityName));
ExpectIntEQ(n_diff, 0);
}

wc_FreeDecodedAcert(acert);
}
Expand All @@ -14170,6 +14183,7 @@ static int test_wolfSSL_X509_ACERT_asn(void)

if (der != NULL) {
wc_FreeDer(&der);
der = NULL;
}

#endif
Expand Down

0 comments on commit e9bc672

Please sign in to comment.