Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
---
.../BaseCryptLibMbedTls/Rand/CryptRandTsc.c | 7 +++++++
.../SysCall/ConstantTimeClock.c | 14 --------------
.../BaseCryptLibMbedTls/SysCall/CrtWrapper.c | 5 -----
.../BaseCryptLibMbedTls/SysCall/TimerWrapper.c | 14 --------------
CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf | 1 +
5 files changed, 8 insertions(+), 33 deletions(-)
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c b/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c
index 96d18eb7aa..a4ece17680 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/Rand/CryptRandTsc.c
@@ -59,3 +59,10 @@ RandomBytes (
return TRUE;
}
+
+int myrand( void *rng_state, unsigned char *output, size_t len )
+{
+ RandomBytes (output, len);
+
+ return 0;
+}
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c
index 41a1fdd634..6c1d8a400d 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/ConstantTimeClock.c
@@ -59,17 +59,3 @@ struct tm * gmtime (const time_t *timer)
time_t _time64 (time_t* t) {
return time (t);
}
-
-struct tm *mbedtls_platform_gmtime_r( const time_t *tt,
- struct tm *tm_buf )
-{
- struct tm * lt;
-
- lt = gmtime (tt);
-
- if (lt != NULL) {
- CopyMem (tm_buf, lt, sizeof(struct tm));
- }
-
- return ((lt == NULL) ? NULL : tm_buf);
-}
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c
index c401dae861..25074d3bfb 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/CrtWrapper.c
@@ -31,11 +31,6 @@ int mbedtls_vsnprintf(char *str, size_t size, const char *format, ...)
return 0;
}
-void mbedtls_platform_zeroize( void *buf, unsigned int len )
-{
- ZeroMem (buf, len);
-}
-
int rand ()
{
// TBD
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c
index abb9a2226c..d940abb7f0 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/TimerWrapper.c
@@ -190,17 +190,3 @@ struct tm * gmtime (const time_t *timer)
time_t _time64 (time_t* t) {
return time (t);
}
-
-struct tm *mbedtls_platform_gmtime_r( const time_t *tt,
- struct tm *tm_buf )
-{
- struct tm * lt;
-
- lt = gmtime (tt);
-
- if (lt != NULL) {
- CopyMem (tm_buf, lt, sizeof(struct tm));
- }
-
- return ((lt == NULL) ? NULL : tm_buf);
-}
diff --git a/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf b/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf
index 69d712b9c6..e2fd9e6e1e 100644
--- a/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf
+++ b/CryptoPkg/Library/MbedTlsLib/MbedTlsLib.inf
@@ -109,6 +109,7 @@
mbedtls/library/x509_crt.c
mbedtls/library/x509_csr.c
mbedtls/library/pkcs7.c
+ mbedtls/library/platform_util.c
[Packages]
MdePkg/MdePkg.dec
--
2.26.2.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101324): https://edk2.groups.io/g/devel/message/101324
Mute This Topic: https://groups.io/mt/97669086/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-