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 +++ Library/PasswordLib/PicturePassword.c | 21 ++++ Library/VeraCryptLib/DcsProp | 182 ++++++++++++++++++++++++++++++++++ Library/VeraCryptLib/DcsVeraCrypt.c | 5 + Library/VeraCryptLib/DcsVeraCrypt.h | 2 + Library/VeraCryptLib/mklinks_src.bat | 2 + 6 files changed, 226 insertions(+) create mode 100644 Library/VeraCryptLib/DcsProp (limited to 'Library') 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(); diff --git a/Library/VeraCryptLib/DcsProp b/Library/VeraCryptLib/DcsProp new file mode 100644 index 0000000..e0b6691 --- /dev/null +++ b/Library/VeraCryptLib/DcsProp @@ -0,0 +1,182 @@ + + + + + + 0 + Password: + EFI\VeraCrypt\login.bmp + + + 1 + + 0 + + 0 + + + 10 + + 0 + + + Authorizing... + + Authorization failed. Wrong password, PIM or hash. + + + + + + 0 + + + + Pim: + 0 + 1 + + + + 0 + 0 + + + 0 + + + 0 + + 0 + + + 2 + + + 0 + + + 0 + + 0 + + + 1 + + + + + + + Exit + Exit + Exit + + + + + -1 + + + -1 + + + -1 + + + 1 + + + 0 + + + -1 + + + 1 + 100 + 0 + 1280 + + 1 + + + \ No newline at end of file diff --git a/Library/VeraCryptLib/DcsVeraCrypt.c b/Library/VeraCryptLib/DcsVeraCrypt.c index f4a1e27..5d9be88 100644 --- a/Library/VeraCryptLib/DcsVeraCrypt.c +++ b/Library/VeraCryptLib/DcsVeraCrypt.c @@ -66,6 +66,7 @@ char* gAuthStartMsg = NULL; INT32 gRUD = 0; int gAuthSecRegionSearch = 0; +int gSecRegionInfoDelay = 0; CHAR8* gPlatformKeyFile = NULL; UINTN gPlatformKeyFileSize = 0; @@ -146,6 +147,7 @@ VCAuthLoadConfig() gPasswordProgress = (UINT8)ConfigReadInt("AuthorizeProgress", 1); // print "*" gPasswordVisible = (UINT8)ConfigReadInt("AuthorizeVisible", 0); // show chars gPasswordShowMark = ConfigReadInt("AuthorizeMarkTouch", 1); // show touch points + gPasswordTimeout = (UINT8)ConfigReadInt("PasswordTimeout", 0); // If no password for => gDcsBootForce = ConfigReadInt("DcsBootForce", 1); // Ask password even if no USB marked found. @@ -165,8 +167,11 @@ VCAuthLoadConfig() gRndDefault = ConfigReadInt("Random", 0); gAuthSecRegionSearch = ConfigReadInt("SecRegionSearch", 0); + gSecRegionInfoDelay = ConfigReadInt("SecRegionInfoDelay", 0); + gPlatformLocked = ConfigReadInt("PlatformLocked", 0); gTPMLocked = ConfigReadInt("TPMLocked", 0); + gTPMLockedInfoDelay = ConfigReadInt("TPMLockedInfoDelay", 9); gSCLocked = ConfigReadInt("SCLocked", 0); // Actions for DcsInt diff --git a/Library/VeraCryptLib/DcsVeraCrypt.h b/Library/VeraCryptLib/DcsVeraCrypt.h index e6ee57c..f7a3c8f 100644 --- a/Library/VeraCryptLib/DcsVeraCrypt.h +++ b/Library/VeraCryptLib/DcsVeraCrypt.h @@ -53,9 +53,11 @@ extern char* gAuthErrorMsg; extern INT32 gRUD; extern int gAuthSecRegionSearch; +extern int gSecRegionInfoDelay; extern int gPlatformLocked; extern int gTPMLocked; +extern int gTPMLockedInfoDelay; extern int gSCLocked; extern int gAuthPwdCode; diff --git a/Library/VeraCryptLib/mklinks_src.bat b/Library/VeraCryptLib/mklinks_src.bat index 1126cfa..a62298e 100644 --- a/Library/VeraCryptLib/mklinks_src.bat +++ b/Library/VeraCryptLib/mklinks_src.bat @@ -1,6 +1,8 @@ @echo off pushd %~dp0 +if "%veracrypt_src%"=="" if exist %CD:~0,-28%\VeraCrypt\src set veracrypt_src=%CD:~0,-28%\VeraCrypt\src + call :select_path "%veracrypt_src%" "Select VeraCrypt directory:" set veracrypt_src=%select_path_result% -- cgit v1.2.3