VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/PasswordLib
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-11-28 18:36:36 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-11-30 23:39:58 +0100
commit1921b89c48680ec0a180adeaab26a23c3e5a3f72 (patch)
tree674c4ba7db427520f2f34237443d089b000138d7 /Library/PasswordLib
parent2d4d3ab4ed0ee86d46fe2b44ca1e56a3d2916f68 (diff)
downloadVeraCrypt-DCS-1921b89c48680ec0a180adeaab26a23c3e5a3f72.tar.gz
VeraCrypt-DCS-1921b89c48680ec0a180adeaab26a23c3e5a3f72.zip
Fix F5 showing previous password after failed authentication attempt. Ensure that even wrong password value are cleared from memory.VeraCrypt_1.24-Update2
Diffstat (limited to 'Library/PasswordLib')
-rw-r--r--Library/PasswordLib/ConsolePassword.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/Library/PasswordLib/ConsolePassword.c b/Library/PasswordLib/ConsolePassword.c
index 0b2d3c6..8588a19 100644
--- a/Library/PasswordLib/ConsolePassword.c
+++ b/Library/PasswordLib/ConsolePassword.c
@@ -29,6 +29,8 @@ AskConsolePwdInt(
EFI_INPUT_KEY key;
UINT32 count = 0;
UINTN i;
+
+ if ((asciiLine != NULL) && (line_max >= 1)) asciiLine[0] = '\0';
gST->ConOut->EnableCursor(gST->ConOut, TRUE);
if (gPasswordTimeout) {
@@ -63,19 +65,21 @@ AskConsolePwdInt(
if (key.ScanCode == SCAN_F5) {
show = show ? 0 : 1;
- if (show) {
- for (i = 0; i < count; i++) {
- OUT_PRINT(L"\b");
- }
- OUT_PRINT(L"%a", asciiLine);
- }
- else {
- for (i = 0; i < count; i++) {
- OUT_PRINT(L"\b");
+ if (count > 0) {
+ if (show) {
+ for (i = 0; i < count; i++) {
+ OUT_PRINT(L"\b");
+ }
+ OUT_PRINT(L"%a", asciiLine);
}
- if (gPasswordProgress) {
+ else {
for (i = 0; i < count; i++) {
- OUT_PRINT(L"*");
+ OUT_PRINT(L"\b");
+ }
+ if (gPasswordProgress) {
+ for (i = 0; i < count; i++) {
+ OUT_PRINT(L"*");
+ }
}
}
}