summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2016-03-17 15:07:04 +0800
committerPeter Jones <pjones@redhat.com>2016-09-06 15:05:36 -0400
commit7b9281af14930040ec6cb333de2d64e0ff91cf3c (patch)
tree5aac021d808feaf82230421578b958f7ddcb5a2d
parente769628e0d23cf4e3da71cae4b38c5d274d090e0 (diff)
downloadefi-boot-shim-7b9281af14930040ec6cb333de2d64e0ff91cf3c.tar.gz
efi-boot-shim-7b9281af14930040ec6cb333de2d64e0ff91cf3c.zip
Update the CryptLib
Update to the edk2 commit 5e2318dd37a51948aaf845c7d920b11f47cdcfe6 Signed-off-by: Gary Lin <glin@suse.com>
-rw-r--r--Cryptlib/SysCall/BaseMemAllocation.c8
-rw-r--r--Cryptlib/SysCall/CrtWrapper.c4
-rw-r--r--Cryptlib/SysCall/TimerWrapper.c29
3 files changed, 26 insertions, 15 deletions
diff --git a/Cryptlib/SysCall/BaseMemAllocation.c b/Cryptlib/SysCall/BaseMemAllocation.c
index 75da1dd2..792b29e8 100644
--- a/Cryptlib/SysCall/BaseMemAllocation.c
+++ b/Cryptlib/SysCall/BaseMemAllocation.c
@@ -38,5 +38,11 @@ void *realloc (void *ptr, size_t size)
/* De-allocates or frees a memory block */
void free (void *ptr)
{
- FreePool (ptr);
+ //
+ // In Standard C, free() handles a null pointer argument transparently. This
+ // is not true of FreePool() below, so protect it.
+ //
+ if (ptr != NULL) {
+ FreePool (ptr);
+ }
}
diff --git a/Cryptlib/SysCall/CrtWrapper.c b/Cryptlib/SysCall/CrtWrapper.c
index 5a8322d7..3a852b9e 100644
--- a/Cryptlib/SysCall/CrtWrapper.c
+++ b/Cryptlib/SysCall/CrtWrapper.c
@@ -2,7 +2,7 @@
C Run-Time Libraries (CRT) Wrapper Implementation for OpenSSL-based
Cryptographic Library.
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -22,7 +22,7 @@ FILE *stdin = NULL;
FILE *stdout = NULL;
typedef
-INTN
+int
(*SORT_COMPARE)(
IN VOID *Buffer1,
IN VOID *Buffer2
diff --git a/Cryptlib/SysCall/TimerWrapper.c b/Cryptlib/SysCall/TimerWrapper.c
index cee72ba5..27ac44a3 100644
--- a/Cryptlib/SysCall/TimerWrapper.c
+++ b/Cryptlib/SysCall/TimerWrapper.c
@@ -2,7 +2,7 @@
C Run-Time Libraries (CRT) Time Management Routines Wrapper Implementation
for OpenSSL-based Cryptographic Library (used in DXE & RUNTIME).
-Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -71,6 +71,7 @@ UINTN CumulativeDays[2][14] = {
time_t time (time_t *timer)
{
EFI_TIME Time;
+ time_t CalTime;
UINTN Year;
//
@@ -82,22 +83,26 @@ time_t time (time_t *timer)
// Years Handling
// UTime should now be set to 00:00:00 on Jan 1 of the current year.
//
- for (Year = 1970, *timer = 0; Year != Time.Year; Year++) {
- *timer = *timer + (time_t)(CumulativeDays[IsLeap(Year)][13] * SECSPERDAY);
+ for (Year = 1970, CalTime = 0; Year != Time.Year; Year++) {
+ CalTime = CalTime + (time_t)(CumulativeDays[IsLeap(Year)][13] * SECSPERDAY);
}
//
// Add in number of seconds for current Month, Day, Hour, Minute, Seconds, and TimeZone adjustment
//
- *timer = *timer +
- (time_t)((Time.TimeZone != EFI_UNSPECIFIED_TIMEZONE) ? (Time.TimeZone * 60) : 0) +
- (time_t)(CumulativeDays[IsLeap(Time.Year)][Time.Month] * SECSPERDAY) +
- (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) +
- (time_t)(Time.Hour * SECSPERHOUR) +
- (time_t)(Time.Minute * 60) +
- (time_t)Time.Second;
-
- return *timer;
+ CalTime = CalTime +
+ (time_t)((Time.TimeZone != EFI_UNSPECIFIED_TIMEZONE) ? (Time.TimeZone * 60) : 0) +
+ (time_t)(CumulativeDays[IsLeap(Time.Year)][Time.Month] * SECSPERDAY) +
+ (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) +
+ (time_t)(Time.Hour * SECSPERHOUR) +
+ (time_t)(Time.Minute * 60) +
+ (time_t)Time.Second;
+
+ if (timer != NULL) {
+ *timer = CalTime;
+ }
+
+ return CalTime;
}
//