VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/PasswordLib
diff options
context:
space:
mode:
authorkavsrf <kavsrf@gmail.com>2016-12-31 13:49:59 +0300
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-05 17:36:51 +0200
commitf2e878683655b885f8ab2d365a40993ef942dea7 (patch)
tree22dbf411fc9d99a7ad23aae489eb491bb37fe387 /Library/PasswordLib
parent659af8b2c1ee88a9ee78dd1b1a5fa7cae2302984 (diff)
downloadVeraCrypt-DCS-f2e878683655b885f8ab2d365a40993ef942dea7.tar.gz
VeraCrypt-DCS-f2e878683655b885f8ab2d365a40993ef942dea7.zip
DcsProp configuration keys
AutoLogin AutoPassword AuthorizeProgress AuthStartMsg AuthErrorMsg Random Authorization retry bug fix
Diffstat (limited to 'Library/PasswordLib')
-rw-r--r--Library/PasswordLib/ConsolePassword.c21
-rw-r--r--Library/PasswordLib/PicturePassword.c21
2 files changed, 25 insertions, 17 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");
}
diff --git a/Library/PasswordLib/PicturePassword.c b/Library/PasswordLib/PicturePassword.c
index e737a99..f40b095 100644
--- a/Library/PasswordLib/PicturePassword.c
+++ b/Library/PasswordLib/PicturePassword.c
@@ -30,6 +30,7 @@ UINTN gPasswordPictureCharsLen = 95;
UINT8 gPasswordVisible = 0;
int gPasswordShowMark = 1;
+UINT8 gPasswordProgress = 1;
int gPlatformLocked = 0;
int gTPMLocked = 0;
@@ -172,15 +173,17 @@ DrawPwdZone(
{
INT32 pwdGrphMaxLen = (INT32)(sWidth - 2 * step);
BltFill(bltScrn, gColorBlack, 0, 0, (INT32)(sWidth - 2 * step), (INT32)(posPictY));
- if (gPasswordVisible) {
- BltText(bltScrn, &ctxCell, 0, 0, 256, pwd);
- }
- else {
- INT32 pwdGrphLen = (INT32)(pwdGrphMaxLen * picPwdIdx / pwdMax);
- INT32 pwdGrphHeight = (INT32)(posPictY) / 2;
- INT32 pwdGrphTop = (INT32)(posPictY) / 4;
- BltFill(bltScrn, gColorGreen, 0, pwdGrphTop, pwdGrphLen, pwdGrphHeight + pwdGrphTop);
- BltFill(bltScrn, gColorBlack, pwdGrphLen, pwdGrphTop, pwdGrphMaxLen, pwdGrphHeight + pwdGrphTop);
+ if (gPasswordProgress || gPasswordVisible) {
+ if (gPasswordVisible) {
+ BltText(bltScrn, &ctxCell, 0, 0, 256, pwd);
+ }
+ else {
+ INT32 pwdGrphLen = (INT32)(pwdGrphMaxLen * picPwdIdx / pwdMax);
+ INT32 pwdGrphHeight = (INT32)(posPictY) / 2;
+ INT32 pwdGrphTop = (INT32)(posPictY) / 4;
+ BltFill(bltScrn, gColorGreen, 0, pwdGrphTop, pwdGrphLen, pwdGrphHeight + pwdGrphTop);
+ BltFill(bltScrn, gColorBlack, pwdGrphLen, pwdGrphTop, pwdGrphMaxLen, pwdGrphHeight + pwdGrphTop);
+ }
}
}