VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/PasswordLib
diff options
context:
space:
mode:
authorkavsrf <kavsrf@gmail.com>2017-02-26 11:42:59 +0300
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-05 17:37:36 +0200
commit10ddedbbac7acb326fb9447c6a1c5f1706017e4b (patch)
tree26993016e4b1cb9ab71bf046a1cfab7e348738c0 /Library/PasswordLib
parentfdfe9f849c15dc4b864a72fcbc5266edb68171c1 (diff)
downloadVeraCrypt-DCS-10ddedbbac7acb326fb9447c6a1c5f1706017e4b.tar.gz
VeraCrypt-DCS-10ddedbbac7acb326fb9447c6a1c5f1706017e4b.zip
PasswordTimeout and infodelay keys in DcsProp
DcsProp documented included in VeraCrypt Beta2 patch 1
Diffstat (limited to 'Library/PasswordLib')
-rw-r--r--Library/PasswordLib/ConsolePassword.c14
-rw-r--r--Library/PasswordLib/PicturePassword.c21
2 files changed, 35 insertions, 0 deletions
diff --git a/Library/PasswordLib/ConsolePassword.c b/Library/PasswordLib/ConsolePassword.c
index 797ee4a..6894b50 100644
--- a/Library/PasswordLib/ConsolePassword.c
+++ b/Library/PasswordLib/ConsolePassword.c
@@ -31,6 +31,20 @@ AskConsolePwdInt(
UINTN i;
gST->ConOut->EnableCursor(gST->ConOut, TRUE);
+ if (gPasswordTimeout) {
+ EFI_EVENT InputEvents[2];
+ UINTN EventIndex = 0;
+ InputEvents[0] = gST->ConIn->WaitForKey;
+ gBS->CreateEvent(EVT_TIMER, 0, (EFI_EVENT_NOTIFY)NULL, NULL, &InputEvents[1]);
+ gBS->SetTimer(InputEvents[1], TimerPeriodic, 10000000 * gPasswordTimeout);
+ gBS->WaitForEvent(2, InputEvents, &EventIndex);
+ gPasswordTimeout = 0;
+ gBS->CloseEvent(InputEvents[1]);
+ if (EventIndex == 1) {
+ *retCode = AskPwdRetCancel;
+ return ;
+ }
+ }
do {
key = GetKey();
diff --git a/Library/PasswordLib/PicturePassword.c b/Library/PasswordLib/PicturePassword.c
index c3831ad..4e46f47 100644
--- a/Library/PasswordLib/PicturePassword.c
+++ b/Library/PasswordLib/PicturePassword.c
@@ -31,9 +31,11 @@ UINTN gPasswordPictureCharsLen = 95;
UINT8 gPasswordVisible = 0;
int gPasswordShowMark = 1;
UINT8 gPasswordProgress = 1;
+int gPasswordTimeout = 0;
int gPlatformLocked = 0;
int gTPMLocked = 0;
+int gTPMLockedInfoDelay = 9;
int gSCLocked = 0;
@@ -282,6 +284,25 @@ AskPictPwdInt(
UINTN pwdAction = PwdActNone;
CHAR8 pwdNewChar = 0;
+ if (gPasswordTimeout) {
+ UINTN EventIndex = 0;
+ InputEvents[0] = gST->ConIn->WaitForKey;
+ eventsCount = 2;
+ if (gTouchPointer != NULL) {
+ eventsCount = 3;
+ InputEvents[2] = gTouchPointer->WaitForInput;
+ }
+ gBS->CreateEvent(EVT_TIMER, 0, (EFI_EVENT_NOTIFY)NULL, NULL, &InputEvents[1]);
+ gBS->SetTimer(InputEvents[1], TimerPeriodic, 10000000 * gPasswordTimeout);
+ gBS->WaitForEvent(eventsCount, InputEvents, &EventIndex);
+ gPasswordTimeout = 0;
+ gBS->CloseEvent(InputEvents[1]);
+ if (EventIndex == 1) {
+ *retCode = AskPwdRetCancel;
+ return;
+ }
+ }
+
InitConsoleControl();
if (gBeepEnabled) {
InitSpeaker();