From aa70ac0be27bbbae8387b281cff8d0a865a3cde3 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 25 Feb 2019 14:40:19 +0100 Subject: [PATCH] Added defines to force OCSP nonce check and omit OCSP date before check. --- wolfcrypt/src/asn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index a6e5cb41e..ec2f5d195 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -14137,8 +14137,10 @@ static int DecodeSingleResponse(byte* source, return ASN_PARSE_E; #ifndef NO_ASN_TIME +#ifndef WOLFSSL_NO_OCSP_DATE_BEFORE_CHECK if (!XVALIDATE_DATE(cs->thisDate, cs->thisDateFormat, BEFORE)) return ASN_BEFORE_DATE_E; +#endif #endif /* The following items are optional. Only check for them if there is more @@ -14744,7 +14746,11 @@ int CompareOcspReqResp(OcspRequest* req, OcspResponse* resp) /* Nonces are not critical. The responder may not necessarily add * the nonce to the response. */ - if (resp->nonceSz != 0) { + if (req->nonceSz +#ifndef WOLFSSL_FORCE_OCSP_NONCE_CHECK + && resp->nonceSz != 0 +#endif + ) { cmp = req->nonceSz - resp->nonceSz; if (cmp != 0) {