diff options
Diffstat (limited to 'Library/PasswordLib')
-rw-r--r-- | Library/PasswordLib/ConsolePassword.c | 21 | ||||
-rw-r--r-- | Library/PasswordLib/PicturePassword.c | 21 |
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);
+ }
}
}
|