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.
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