From 63b1c7e07e515ef130ea46706c5b712174f08ff2 Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 28 Jul 2015 11:46:38 -0400 Subject: [PATCH] Openssl: Add EFIAPI for ERR_add_error_vdata Without declaring EFIAPI for ERR_add_error_vdata, shim would crash while verifying the loaded image. Signed-off-by: Gary Ching-Pang Lin --- Cryptlib/Include/openssl/err.h | 4 ++++ Cryptlib/OpenSSL/crypto/err/err.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Cryptlib/Include/openssl/err.h b/Cryptlib/Include/openssl/err.h index bbfdb95..da589f8 100644 --- a/Cryptlib/Include/openssl/err.h +++ b/Cryptlib/Include/openssl/err.h @@ -352,7 +352,11 @@ void EFIAPI ERR_add_error_data(int num, ...); void ERR_add_error_data(int num, ...); #endif +#if defined(OPENSSL_SYS_UEFI) +void EFIAPI ERR_add_error_vdata(int num, va_list args); +#else void ERR_add_error_vdata(int num, va_list args); +#endif void ERR_load_strings(int lib, ERR_STRING_DATA str[]); void ERR_unload_strings(int lib, ERR_STRING_DATA str[]); void ERR_load_ERR_strings(void); diff --git a/Cryptlib/OpenSSL/crypto/err/err.c b/Cryptlib/OpenSSL/crypto/err/err.c index f98cce6..108b83a 100644 --- a/Cryptlib/OpenSSL/crypto/err/err.c +++ b/Cryptlib/OpenSSL/crypto/err/err.c @@ -1085,7 +1085,11 @@ void ERR_add_error_data(int num, ...) va_end(args); } +#if defined(OPENSSL_SYS_UEFI) +void EFIAPI ERR_add_error_vdata(int num, va_list args) +#else void ERR_add_error_vdata(int num, va_list args) +#endif { int i, n, s; char *str, *p, *a;