diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c index 2ec13ef9d0e5..e6e0f1ec2df0 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c @@ -19,25 +19,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include - -typedef int time_t; - -// -// Structures Definitions -// -struct tm { - int tm_sec; /* seconds after the minute [0-60] */ - int tm_min; /* minutes after the hour [0-59] */ - int tm_hour; /* hours since midnight [0-23] */ - int tm_mday; /* day of the month [1-31] */ - int tm_mon; /* months since January [0-11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday [0-6] */ - int tm_yday; /* days since January 1 [0-365] */ - int tm_isdst; /* Daylight Savings Time flag */ - long tm_gmtoff; /* offset from CUT in seconds */ - char *tm_zone; /* timezone abbreviation */ -}; +#include // // -- Time Management Routines -- @@ -73,3 +55,16 @@ _time64 ( { return time (t); } + +long timezone; + +int +gettimeofday ( + struct timeval *tv, + struct timezone *tz + ) +{ + tv->tv_sec = 0; + tv->tv_usec = 0; + return 0; +} diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c index b7cd4d318194..949effc05614 100644 --- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c +++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c @@ -11,25 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include - -typedef int time_t; - -// -// Structures Definitions -// -struct tm { - int tm_sec; /* seconds after the minute [0-60] */ - int tm_min; /* minutes after the hour [0-59] */ - int tm_hour; /* hours since midnight [0-23] */ - int tm_mday; /* day of the month [1-31] */ - int tm_mon; /* months since January [0-11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday [0-6] */ - int tm_yday; /* days since January 1 [0-365] */ - int tm_isdst; /* Daylight Savings Time flag */ - long tm_gmtoff; /* offset from CUT in seconds */ - char *tm_zone; /* timezone abbreviation */ -}; +#include // // -- Time Management Routines -- @@ -196,3 +178,16 @@ _time64 ( { return time (t); } + +long timezone; + +int +gettimeofday ( + struct timeval *tv, + struct timezone *tz + ) +{ + tv->tv_sec = (long)time (NULL); + tv->tv_usec = 0; + return 0; +} \ No newline at end of file