forked from wolfSSL/wolfssl
fix NO_ASN_TIME build with --enable-wpas
This commit is contained in:
14
src/crl.c
14
src/crl.c
@ -177,13 +177,17 @@ int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert)
|
|||||||
doNextDate = 0; /* skip */
|
doNextDate = 0; /* skip */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (doNextDate && !ValidateDate(crle->nextDate,
|
if (doNextDate) {
|
||||||
crle->nextDateFormat, AFTER)) {
|
#ifndef NO_ASN_TIME
|
||||||
WOLFSSL_MSG("CRL next date is no longer valid");
|
if (!ValidateDate(crle->nextDate,crle->nextDateFormat, AFTER)) {
|
||||||
ret = ASN_AFTER_DATE_E;
|
WOLFSSL_MSG("CRL next date is no longer valid");
|
||||||
|
ret = ASN_AFTER_DATE_E;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
if (ret == 0) {
|
||||||
foundEntry = 1;
|
foundEntry = 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
crle = crle->next;
|
crle = crle->next;
|
||||||
|
@ -219,9 +219,11 @@ static int GetOcspStatus(WOLFSSL_OCSP* ocsp, OcspRequest* request,
|
|||||||
ret = OCSP_INVALID_STATUS;
|
ret = OCSP_INVALID_STATUS;
|
||||||
}
|
}
|
||||||
else if (*status) {
|
else if (*status) {
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
if (ValidateDate((*status)->thisDate, (*status)->thisDateFormat, BEFORE)
|
if (ValidateDate((*status)->thisDate, (*status)->thisDateFormat, BEFORE)
|
||||||
&& ((*status)->nextDate[0] != 0)
|
&& ((*status)->nextDate[0] != 0)
|
||||||
&& ValidateDate((*status)->nextDate, (*status)->nextDateFormat, AFTER))
|
&& ValidateDate((*status)->nextDate, (*status)->nextDateFormat, AFTER))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
ret = xstat2err((*status)->status);
|
ret = xstat2err((*status)->status);
|
||||||
|
|
||||||
|
@ -9510,8 +9510,11 @@ static int DecodeSingleResponse(byte* source,
|
|||||||
if (GetBasicDate(source, &idx, cs->thisDate,
|
if (GetBasicDate(source, &idx, cs->thisDate,
|
||||||
&cs->thisDateFormat, size) < 0)
|
&cs->thisDateFormat, size) < 0)
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
if (!XVALIDATE_DATE(cs->thisDate, cs->thisDateFormat, BEFORE))
|
if (!XVALIDATE_DATE(cs->thisDate, cs->thisDateFormat, BEFORE))
|
||||||
return ASN_BEFORE_DATE_E;
|
return ASN_BEFORE_DATE_E;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The following items are optional. Only check for them if there is more
|
/* The following items are optional. Only check for them if there is more
|
||||||
* unprocessed data in the singleResponse wrapper. */
|
* unprocessed data in the singleResponse wrapper. */
|
||||||
@ -9528,8 +9531,11 @@ static int DecodeSingleResponse(byte* source,
|
|||||||
if (GetBasicDate(source, &idx, cs->nextDate,
|
if (GetBasicDate(source, &idx, cs->nextDate,
|
||||||
&cs->nextDateFormat, size) < 0)
|
&cs->nextDateFormat, size) < 0)
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
|
#ifndef NO_ASN_TIME
|
||||||
if (!XVALIDATE_DATE(cs->nextDate, cs->nextDateFormat, AFTER))
|
if (!XVALIDATE_DATE(cs->nextDate, cs->nextDateFormat, AFTER))
|
||||||
return ASN_AFTER_DATE_E;
|
return ASN_AFTER_DATE_E;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (((int)(idx - prevIndex) < wrapperSz) &&
|
if (((int)(idx - prevIndex) < wrapperSz) &&
|
||||||
(source[idx] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1)))
|
(source[idx] == (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 1)))
|
||||||
@ -10369,10 +10375,13 @@ int ParseCRL(DecodedCRL* dcrl, const byte* buff, word32 sz, void* cm)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doNextDate && !XVALIDATE_DATE(dcrl->nextDate, dcrl->nextDateFormat,
|
if (doNextDate) {
|
||||||
AFTER)) {
|
#ifndef NO_ASN_TIME
|
||||||
WOLFSSL_MSG("CRL after date is no longer valid");
|
if (!XVALIDATE_DATE(dcrl->nextDate, dcrl->nextDateFormat, AFTER)) {
|
||||||
return ASN_AFTER_DATE_E;
|
WOLFSSL_MSG("CRL after date is no longer valid");
|
||||||
|
return ASN_AFTER_DATE_E;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idx != dcrl->sigIndex && buff[idx] != CRL_EXTENSIONS) {
|
if (idx != dcrl->sigIndex && buff[idx] != CRL_EXTENSIONS) {
|
||||||
|
Reference in New Issue
Block a user