Skip to content

Commit 5099e6e

Browse files
add macro guard on use of time_t
1 parent 01442a1 commit 5099e6e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

wolfcrypt/src/asn.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16579,7 +16579,7 @@ int wc_ValidateDate(const byte* date, byte format, int dateType)
1657916579
}
1658016580

1658116581
int wc_ValidateDateWithTime(const byte* date, byte format, int dateType,
16582-
time_t check_time)
16582+
time_t checkTime)
1658316583
{
1658416584
time_t ltime;
1658516585
struct tm certTime;
@@ -16597,9 +16597,9 @@ int wc_ValidateDateWithTime(const byte* date, byte format, int dateType,
1659716597
#endif
1659816598
(void)tmpTime;
1659916599

16600-
/* Use check_time if provided (non-zero), otherwise use current time */
16601-
if (check_time != 0) {
16602-
ltime = check_time;
16600+
/* Use checkTime if provided (non-zero), otherwise use current time */
16601+
if (checkTime != 0) {
16602+
ltime = checkTime;
1660316603
}
1660416604
else {
1660516605
ltime = wc_Time(0);

wolfssl/wolfcrypt/asn.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2255,8 +2255,10 @@ WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format,
22552255
wolfssl_tm* certTime, int* idx);
22562256
WOLFSSL_LOCAL int DateGreaterThan(const struct tm* a, const struct tm* b);
22572257
WOLFSSL_LOCAL int wc_ValidateDate(const byte* date, byte format, int dateType);
2258+
#ifndef NO_ASN_TIME
22582259
WOLFSSL_LOCAL int wc_ValidateDateWithTime(const byte* date, byte format,
2259-
int dateType, time_t check_time);
2260+
int dateType, time_t checkTime);
2261+
#endif
22602262
WOLFSSL_TEST_VIS int wc_AsnSetSkipDateCheck(int skip_p);
22612263
WOLFSSL_LOCAL int wc_AsnGetSkipDateCheck(void);
22622264

0 commit comments

Comments
 (0)