VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/PasswordLib/ConsolePassword.c
diff options
context:
space:
mode:
Diffstat (limited to 'Library/PasswordLib/ConsolePassword.c')
-rw-r--r--Library/PasswordLib/ConsolePassword.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/Library/PasswordLib/ConsolePassword.c b/Library/PasswordLib/ConsolePassword.c
index 1d82fd0..797ee4a 100644
--- a/Library/PasswordLib/ConsolePassword.c
+++ b/Library/PasswordLib/ConsolePassword.c
@@ -59,8 +59,10 @@ AskConsolePwdInt(
for (i = 0; i < count; i++) {
OUT_PRINT(L"\b");
}
- for (i = 0; i < count; i++) {
- OUT_PRINT(L"*");
+ if (gPasswordProgress) {
+ for (i = 0; i < count; i++) {
+ OUT_PRINT(L"*");
+ }
}
}
}
@@ -98,7 +100,9 @@ AskConsolePwdInt(
continue;
}
else if (key.UnicodeChar == CHAR_BACKSPACE) {
- OUT_PRINT(L"\b \b");
+ if (gPasswordProgress || show) {
+ OUT_PRINT(L"\b \b");
+ }
if (asciiLine != NULL) asciiLine[--count] = '\0';
continue;
}
@@ -107,8 +111,7 @@ AskConsolePwdInt(
if (count < line_max - 1) {
if (show) {
OUT_PRINT(L"%c", key.UnicodeChar);
- }
- else {
+ } else if (gPasswordProgress) {
OUT_PRINT(L"*");
}
// save char
@@ -124,10 +127,12 @@ AskConsolePwdInt(
// Set end of line
if (asciiLine != NULL) {
asciiLine[count] = '\0';
- for (i = 0; i < count; i++) {
- OUT_PRINT(L"\b \b");
+ if (gPasswordProgress || show) {
+ for (i = 0; i < count; i++) {
+ OUT_PRINT(L"\b \b");
+ }
+ OUT_PRINT(L"*");
}
- OUT_PRINT(L"*");
}
OUT_PRINT(L"\n");
}