summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/bio/b_print.c
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2015-10-27 12:00:13 +0800
committerPeter Jones <pjones@redhat.com>2015-11-09 09:50:50 -0500
commit5a49bad020792483b5abd137861f906c55bf9dca (patch)
treec52c4a6cfde6d31ae5c345183fb3c3ee0ecf33f9 /Cryptlib/OpenSSL/crypto/bio/b_print.c
parente22a7b5b772dba6588dd955dc017e572f7e29784 (diff)
downloadefi-boot-shim-5a49bad020792483b5abd137861f906c55bf9dca.tar.gz
efi-boot-shim-5a49bad020792483b5abd137861f906c55bf9dca.zip
Cryptlib: Define the va functions for EFIAPI
It turned out that my previous crash fix(*) was wrong. We actually always used the gcc built-in va functions instead of the "real" va functions for EFIAPI, and we are just lucky that ERR_add_error_data didn't crash before. This commit copies the va functions from MdePkg/Include/Base.h in edk2 and introdues NO_BUILTIN_VA_FUNCS for x86_64, so that all the x86_64 build will adopt the new va functions. For safety, I also added EFIAPI to all the functions which use va_* to avoid the potential trouble. (*) a7f4b26cc35204165bd04e75c34e8e7aa2a87ecc Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/bio/b_print.c')
-rw-r--r--Cryptlib/OpenSSL/crypto/bio/b_print.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Cryptlib/OpenSSL/crypto/bio/b_print.c b/Cryptlib/OpenSSL/crypto/bio/b_print.c
index 9091d56d..4695827e 100644
--- a/Cryptlib/OpenSSL/crypto/bio/b_print.c
+++ b/Cryptlib/OpenSSL/crypto/bio/b_print.c
@@ -751,7 +751,11 @@ doapr_outch(char **sbuffer,
/***************************************************************************/
+#if defined(OPENSSL_SYS_UEFI)
+int EFIAPI BIO_printf(BIO *bio, const char *format, ...)
+#else
int BIO_printf(BIO *bio, const char *format, ...)
+#endif
{
va_list args;
int ret;
@@ -795,7 +799,11 @@ int BIO_vprintf(BIO *bio, const char *format, va_list args)
* closely related to BIO_printf, and we need *some* name prefix ... (XXX the
* function should be renamed, but to what?)
*/
+#if defined(OPENSSL_SYS_UEFI)
+int EFIAPI BIO_snprintf(char *buf, size_t n, const char *format, ...)
+#else
int BIO_snprintf(char *buf, size_t n, const char *format, ...)
+#endif
{
va_list args;
int ret;