1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 19:38:26 -06:00

Windows Bootloader: Protect password/PIM length by filling the fields to their maximum length with '*' after ENTER is hit

This commit is contained in:
Mounir IDRASSI
2015-10-14 23:07:33 +02:00
parent 225acf4a22
commit 19483d2097
2 changed files with 22 additions and 4 deletions

View File

@@ -168,10 +168,19 @@ static byte AskPassword (Password &password, int& pim)
switch (scanCode)
{
case TC_BIOS_KEY_ENTER:
password.Length = pos;
if (hidePassword)
{
while (pos < MAX_PASSWORD)
{
PrintChar ('*');
pos++;
}
}
ClearBiosKeystrokeBuffer();
PrintEndl();
password.Length = pos;
break;
case TC_BIOS_KEY_BACKSPACE:
@@ -228,9 +237,18 @@ static byte AskPassword (Password &password, int& pim)
switch (scanCode)
{
case TC_BIOS_KEY_ENTER:
if (hidePassword)
{
while (pos < MAX_PIM)
{
PrintChar ('*');
pos++;
}
}
ClearBiosKeystrokeBuffer();
PrintEndl();
return TC_BIOS_KEY_ENTER;
case TC_BIOS_KEY_BACKSPACE: