mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
bitlk: Fix unlocking bitlocker with multibyte utf8 characters
Fixes: #950 Co-authored-by: Thomas Lidén
This commit is contained in:
committed by
Milan Broz
parent
6c7c8d36bb
commit
04d307d9c0
@@ -982,6 +982,7 @@ static int bitlk_kdf(const char *password,
|
||||
struct crypt_hash *hd = NULL;
|
||||
int len = 0;
|
||||
char16_t *utf16Password = NULL;
|
||||
size_t utf16Len = 0;
|
||||
int i = 0;
|
||||
int r = 0;
|
||||
|
||||
@@ -1007,7 +1008,8 @@ static int bitlk_kdf(const char *password,
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
crypt_hash_write(hd, (char*)utf16Password, passwordLen * 2);
|
||||
utf16Len = crypt_char16_strlen(utf16Password);
|
||||
crypt_hash_write(hd, (char*)utf16Password, utf16Len * 2);
|
||||
r = crypt_hash_final(hd, kdf.initial_sha256, len);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user