Skip to content

Commit e96a65a

Browse files
committed
An expired CRL should not override a successful match in other CRL
1 parent e1bd4dd commit e96a65a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/crl.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ static int CheckCertCRLList(WOLFSSL_CRL* crl, byte* issuerHash, byte* serial,
392392

393393
for (crle = crl->crlList; crle != NULL; crle = crle->next) {
394394
if (XMEMCMP(crle->issuerHash, issuerHash, CRL_DIGEST_SIZE) == 0) {
395+
int nextDateValid = 1;
396+
395397
WOLFSSL_MSG("Found CRL Entry on list");
396398

397399
if (crle->verified == 0) {
@@ -426,16 +428,18 @@ static int CheckCertCRLList(WOLFSSL_CRL* crl, byte* issuerHash, byte* serial,
426428
#if !defined(NO_ASN_TIME) && !defined(WOLFSSL_NO_CRL_DATE_CHECK)
427429
if (!XVALIDATE_DATE(crle->nextDate,crle->nextDateFormat, AFTER)) {
428430
WOLFSSL_MSG("CRL next date is no longer valid");
429-
ret = ASN_AFTER_DATE_E;
431+
nextDateValid = 0;
430432
}
431433
#endif
432434
}
433-
if (ret == 0) {
435+
if (nextDateValid) {
434436
foundEntry = 1;
435437
ret = FindRevokedSerial(crle->certs, serial, serialSz,
436438
serialHash, crle->totalCerts);
437439
if (ret != 0)
438440
break;
441+
} else if (foundEntry == 0) {
442+
ret = ASN_AFTER_DATE_E;
439443
}
440444
}
441445
}

0 commit comments

Comments
 (0)