lcp / mokutil

The utility to manipulate machine owner keys
GNU General Public License v3.0
67 stars 37 forks source link

Build with -fshort-wchar so toggle passwords work right. #5

Closed vathpela closed 9 years ago

vathpela commented 9 years ago

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