diff --git a/src/ssl.c b/src/ssl.c index f95ec4f1b..c1db4512b 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -22994,11 +22994,11 @@ int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx) afterDate = ctx->current_cert->notAfter.data; beforeDate = ctx->current_cert->notBefore.data; - if (ValidateDate(afterDate, (byte)ctx->current_cert->notAfter.type, + if (XVALIDATE_DATE(afterDate, (byte)ctx->current_cert->notAfter.type, AFTER) < 1) { error = X509_V_ERR_CERT_HAS_EXPIRED; } - else if (ValidateDate(beforeDate, + else if (XVALIDATE_DATE(beforeDate, (byte)ctx->current_cert->notBefore.type, BEFORE) < 1) { error = X509_V_ERR_CERT_NOT_YET_VALID; } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 9f04abb88..ad390e35b 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -6344,7 +6344,7 @@ static WC_INLINE int DateLessThan(const struct tm* a, const struct tm* b) /* like atoi but only use first byte */ /* Make sure before and after dates are valid */ -int ValidateDate(const byte* date, byte format, int dateType) +int wc_ValidateDate(const byte* date, byte format, int dateType) { time_t ltime; struct tm certTime; diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index 686d09c29..0e4845d34 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -1118,7 +1118,7 @@ WOLFSSL_LOCAL int GetAsnTimeString(void* currTime, byte* buf, word32 len); WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format, wolfssl_tm* certTime, int* idx); WOLFSSL_LOCAL int DateGreaterThan(const struct tm* a, const struct tm* b); -WOLFSSL_LOCAL int ValidateDate(const byte* date, byte format, int dateType); +WOLFSSL_LOCAL int wc_ValidateDate(const byte* date, byte format, int dateType); WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn); /* ASN.1 helper functions */ diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index da451d799..41e8bfe6d 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -688,7 +688,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void); #endif #if !defined(XVALIDATE_DATE) && !defined(HAVE_VALIDATE_DATE) #define USE_WOLF_VALIDDATE - #define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t)) + #define XVALIDATE_DATE(d, f, t) wc_ValidateDate((d), (f), (t)) #endif /* wolf struct tm and time_t */