ConstantTimeClock.c 833 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /** @file
  2. C Run-Time Libraries (CRT) Time Management Routines Wrapper Implementation
  3. for OpenSSL-based Cryptographic Library.
  4. This C file implements constant time value for time() and NULL for gmtime()
  5. thus should not be used in library instances which require functionality
  6. of following APIs which need system time support:
  7. 1) RsaGenerateKey
  8. 2) RsaCheckKey
  9. 3) RsaPkcs1Sign
  10. 4) Pkcs7Sign
  11. 5) DhGenerateParameter
  12. 6) DhGenerateKey
  13. Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>
  14. SPDX-License-Identifier: BSD-2-Clause-Patent
  15. **/
  16. #include <CrtLibSupport.h>
  17. //
  18. // -- Time Management Routines --
  19. //
  20. time_t time (time_t *timer)
  21. {
  22. if (timer != NULL) {
  23. *timer = 0;
  24. }
  25. return 0;
  26. }
  27. struct tm * gmtime (const time_t *timer)
  28. {
  29. return NULL;
  30. }