mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -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:
@@ -17,7 +17,7 @@
|
|||||||
#include "BootDefs.h"
|
#include "BootDefs.h"
|
||||||
|
|
||||||
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
|
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
|
||||||
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0113
|
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0116
|
||||||
|
|
||||||
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
||||||
|
|
||||||
|
|||||||
@@ -168,10 +168,19 @@ static byte AskPassword (Password &password, int& pim)
|
|||||||
switch (scanCode)
|
switch (scanCode)
|
||||||
{
|
{
|
||||||
case TC_BIOS_KEY_ENTER:
|
case TC_BIOS_KEY_ENTER:
|
||||||
|
password.Length = pos;
|
||||||
|
if (hidePassword)
|
||||||
|
{
|
||||||
|
while (pos < MAX_PASSWORD)
|
||||||
|
{
|
||||||
|
PrintChar ('*');
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ClearBiosKeystrokeBuffer();
|
ClearBiosKeystrokeBuffer();
|
||||||
PrintEndl();
|
PrintEndl();
|
||||||
|
|
||||||
password.Length = pos;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TC_BIOS_KEY_BACKSPACE:
|
case TC_BIOS_KEY_BACKSPACE:
|
||||||
@@ -228,6 +237,15 @@ static byte AskPassword (Password &password, int& pim)
|
|||||||
switch (scanCode)
|
switch (scanCode)
|
||||||
{
|
{
|
||||||
case TC_BIOS_KEY_ENTER:
|
case TC_BIOS_KEY_ENTER:
|
||||||
|
if (hidePassword)
|
||||||
|
{
|
||||||
|
while (pos < MAX_PIM)
|
||||||
|
{
|
||||||
|
PrintChar ('*');
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ClearBiosKeystrokeBuffer();
|
ClearBiosKeystrokeBuffer();
|
||||||
PrintEndl();
|
PrintEndl();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user