diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-06-11 12:02:11 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-25 16:08:35 +0000 |
commit | 0ec54d8d0c8fb3069ca290c4e7b265f5ddff8583 (patch) | |
tree | 1f74e03ca6b8dfaf22ed292cef19e7079cdc5040 /CryptoPkg | |
parent | af73d37741efa54044a795e22dda48f612547874 (diff) | |
download | edk2-0ec54d8d0c8fb3069ca290c4e7b265f5ddff8583.tar.gz edk2-0ec54d8d0c8fb3069ca290c4e7b265f5ddff8583.tar.bz2 edk2-0ec54d8d0c8fb3069ca290c4e7b265f5ddff8583.zip |
CrtLibSupport: add mktime()
Will be needed by openssl-3.2.x
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'CryptoPkg')
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c | 8 | ||||
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c | 18 | ||||
-rw-r--r-- | CryptoPkg/Library/Include/CrtLibSupport.h | 5 |
3 files changed, 31 insertions, 0 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c index b625246bda..224e3c3642 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c @@ -43,6 +43,14 @@ gmtime ( return NULL;
}
+time_t
+mktime (
+ struct tm *t
+ )
+{
+ return 0;
+}
+
unsigned int
sleep (
unsigned int seconds
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c index 2e83041cf8..21b79acccd 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c @@ -141,6 +141,24 @@ time ( return CalTime;
}
+time_t
+mktime (
+ struct tm *t
+ )
+{
+ EFI_TIME Time = {
+ .Year = (UINT16)t->tm_year,
+ .Month = (UINT8)t->tm_mon,
+ .Day = (UINT8)t->tm_mday,
+ .Hour = (UINT8)t->tm_hour,
+ .Minute = (UINT8)t->tm_min,
+ .Second = (UINT8)t->tm_sec,
+ .TimeZone = EFI_UNSPECIFIED_TIMEZONE,
+ };
+
+ return CalculateTimeT (&Time);
+}
+
//
// Convert a time value from type time_t to struct tm.
//
diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h index f81f490734..e3e8781d16 100644 --- a/CryptoPkg/Library/Include/CrtLibSupport.h +++ b/CryptoPkg/Library/Include/CrtLibSupport.h @@ -348,6 +348,11 @@ gettimeofday ( struct timezone *tz
);
+time_t
+mktime (
+ struct tm *t
+ );
+
uid_t
getuid (
void
|