Skip to content

Commit

Permalink
Merge pull request wolfSSL#7476 from per-allansson/one-crl-to-rule-th…
Browse files Browse the repository at this point in the history
…em-all

An expired CRL should not override a successful match in other CRL
  • Loading branch information
SparkiDev authored and jefferyq2 committed Jun 9, 2024
1 parent a4d671f commit d9ac102
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ static int CheckCertCRLList(WOLFSSL_CRL* crl, byte* issuerHash, byte* serial,

for (crle = crl->crlList; crle != NULL; crle = crle->next) {
if (XMEMCMP(crle->issuerHash, issuerHash, CRL_DIGEST_SIZE) == 0) {
int nextDateValid = 1;

WOLFSSL_MSG("Found CRL Entry on list");

if (crle->verified == 0) {
Expand Down Expand Up @@ -426,17 +428,20 @@ static int CheckCertCRLList(WOLFSSL_CRL* crl, byte* issuerHash, byte* serial,
#if !defined(NO_ASN_TIME) && !defined(WOLFSSL_NO_CRL_DATE_CHECK)
if (!XVALIDATE_DATE(crle->nextDate,crle->nextDateFormat, AFTER)) {
WOLFSSL_MSG("CRL next date is no longer valid");
ret = ASN_AFTER_DATE_E;
nextDateValid = 0;
}
#endif
}
if (ret == 0) {
if (nextDateValid) {
foundEntry = 1;
ret = FindRevokedSerial(crle->certs, serial, serialSz,
serialHash, crle->totalCerts);
if (ret != 0)
break;
}
else if (foundEntry == 0) {
ret = ASN_AFTER_DATE_E;
}
}
}

Expand Down

0 comments on commit d9ac102

Please sign in to comment.