From 031e5cce385d3f96b1caa1d53495332a7eb03749 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Tue, 23 Mar 2021 23:49:46 +0000 Subject: New upstream version 15.3 --- lib/print_crypto.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/print_crypto.c (limited to 'lib/print_crypto.c') diff --git a/lib/print_crypto.c b/lib/print_crypto.c new file mode 100644 index 00000000..ccdb65b1 --- /dev/null +++ b/lib/print_crypto.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: BSD-2-Clause-Patent +/* + * Copyright 2019 SUSE LLC + */ +#include "shim.h" + +#include +#include +#include +#include + +static int +print_errors_cb(const char *str, size_t len, void *u UNUSED) +{ + console_print(L"%a", str); + + return len; +} + +EFI_STATUS +print_crypto_errors(EFI_STATUS efi_status, + char *file, const char *func, int line) +{ + if (!(verbose && EFI_ERROR(efi_status))) + return efi_status; + + console_print(L"SSL Error: %a:%d %a(): %r\n", file, line, func, + efi_status); + ERR_print_errors_cb(print_errors_cb, NULL); + + return efi_status; +} -- cgit v1.2.3