mokutil/SOURCES/0003-Build-with-fshort-wchar-so-toggle-passwords-work-rig.patch

40 lines
1.4 KiB
Diff
Raw Normal View History

2022-06-16 13:11:34 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2019-05-07 10:17:12 +00:00
From: Peter Jones <pjones@redhat.com>
Date: Fri, 19 Jun 2015 16:53:36 -0400
2022-06-16 13:11:34 +00:00
Subject: [PATCH] Build with -fshort-wchar so toggle passwords work right.
2019-05-07 10:17:12 +00:00
This source tree uses:
typedef wchar_t efi_char16_t;
to define UEFI's UCS-2 character type. On many platforms, wchar_t is
32-bits by default. As a result, efichar_from_char winds up writing
4-byte characters instead of 2-byte characters. In the case where we
hash the password in mokutil, this works fine, because the same datatype
is used, and the values are the same. But for our feature toggles,
where we store the raw data and shim is interpretting the character
array, every other character winds up being L'\0', and verification
fails.
So always build with -fshort-wchar to ensure we get 2-byte character
storage.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
2022-06-16 13:11:34 +00:00
index fe28fb9..69d412a 100644
2019-05-07 10:17:12 +00:00
--- a/configure.ac
+++ b/configure.ac
@@ -37,7 +37,7 @@ else
default_strict=no
fi
-WARNINGFLAGS_C="$WARNINGFLAGS_C -std=gnu11"
+WARNINGFLAGS_C="$WARNINGFLAGS_C -std=gnu11 -fshort-wchar"
AC_ARG_ENABLE(strict, AS_HELP_STRING([--enable-strict],[Enable strict compilation options]), enable_strict=$enableval,
enable_strict=$default_strict)