]> git.proxmox.com Git - mirror_edk2.git/blobdiff - CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
Fix SmmCryptLib issue when calling time() in RealTimeClock.c
[mirror_edk2.git] / CryptoPkg / Library / BaseCryptLib / SysCall / ConstantTimeClock.c
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
new file mode 100644 (file)
index 0000000..0a19a69
--- /dev/null
@@ -0,0 +1,41 @@
+/** @file\r
+  C Run-Time Libraries (CRT) Time Management Routines Wrapper Implementation\r
+  for OpenSSL-based Cryptographic Library.\r
+\r
+  This C file implements constant time value for time() and NULL for gmtime()\r
+  thus should not be used in library instances which require functionality\r
+  of following APIs which need system time support:\r
+  1)  RsaGenerateKey\r
+  2)  RsaCheckKey\r
+  3)  RsaPkcs1Sign\r
+  4)  Pkcs7Sign\r
+  5)  DhGenerateParameter\r
+  6)  DhGenerateKey\r
+\r
+Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <OpenSslSupport.h>\r
+\r
+//\r
+// -- Time Management Routines --\r
+//\r
+\r
+time_t time (time_t *timer)\r
+{\r
+  *timer = 0;\r
+  return *timer;\r
+}\r
+\r
+struct tm * gmtime (const time_t *timer)\r
+{\r
+  return NULL;\r
+}
\ No newline at end of file