From 10ddedbbac7acb326fb9447c6a1c5f1706017e4b Mon Sep 17 00:00:00 2001 From: kavsrf Date: Sun, 26 Feb 2017 11:42:59 +0300 Subject: PasswordTimeout and infodelay keys in DcsProp DcsProp documented included in VeraCrypt Beta2 patch 1 --- Library/PasswordLib/ConsolePassword.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Library/PasswordLib/ConsolePassword.c') 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(); -- cgit v1.2.3