diff --git a/src/ssl.c b/src/ssl.c index a802ae409..6ea012544 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -23051,11 +23051,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 310d5ce31..92ccb5500 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -6354,7 +6354,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/ssl.h b/wolfssl/ssl.h index d02deb24c..a25cdb8c3 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -918,9 +918,11 @@ WOLFSSL_API int wolfSSL_SetServerID(WOLFSSL*, const unsigned char*, int, int); WOLFSSL_API int wolfSSL_BIO_new_bio_pair(WOLFSSL_BIO**, size_t, WOLFSSL_BIO**, size_t); -WOLFSSL_API int wolfSSL_RSA_padding_add_PKCS1_PSS(WOLFSSL_RSA *rsa, unsigned char *EM, +WOLFSSL_API int wolfSSL_RSA_padding_add_PKCS1_PSS(WOLFSSL_RSA *rsa, + unsigned char *EM, const unsigned char *mHash, - const WOLFSSL_EVP_MD *Hash, int saltLen); + const WOLFSSL_EVP_MD *hashAlg, + int saltLen); WOLFSSL_API int wolfSSL_RSA_verify_PKCS1_PSS(WOLFSSL_RSA *rsa, const unsigned char *mHash, const WOLFSSL_EVP_MD *hashAlg, const unsigned char *EM, int saltLen); diff --git a/wolfssl/wolfcrypt/asn.h b/wolfssl/wolfcrypt/asn.h index b92c494ca..47e57f93f 100644 --- a/wolfssl/wolfcrypt/asn.h +++ b/wolfssl/wolfcrypt/asn.h @@ -1120,7 +1120,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/hmac.h b/wolfssl/wolfcrypt/hmac.h index f6744db64..06b9132ec 100644 --- a/wolfssl/wolfcrypt/hmac.h +++ b/wolfssl/wolfcrypt/hmac.h @@ -131,11 +131,11 @@ typedef union { #ifdef WOLFSSL_SHA3 wc_Sha3 sha3; #endif -} Hash; +} wc_Hmac_Hash; /* Hmac digest */ struct Hmac { - Hash hash; + wc_Hmac_Hash hash; word32 ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/ word32 opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; word32 innerHash[WC_MAX_DIGEST_SIZE / sizeof(word32)]; 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 */