C Run-Time Libraries (CRT) Time Management Routines Wrapper Implementation\r
for OpenSSL-based Cryptographic Library (used in DXE & RUNTIME).\r
\r
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2018, 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
// )\r
time_t time (time_t *timer)\r
{\r
- EFI_TIME Time;\r
- time_t CalTime;\r
- UINTN Year;\r
+ EFI_STATUS Status;\r
+ EFI_TIME Time;\r
+ time_t CalTime;\r
+ UINTN Year;\r
\r
//\r
// Get the current time and date information\r
//\r
- gRT->GetTime (&Time, NULL);\r
+ Status = gRT->GetTime (&Time, NULL);\r
+ if (EFI_ERROR (Status) || (Time.Year < 1970)) {\r
+ return 0;\r
+ }\r
\r
//\r
// Years Handling\r