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 --- DcsInt/DcsInt.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'DcsInt') diff --git a/DcsInt/DcsInt.c b/DcsInt/DcsInt.c index 06f8841..3303c56 100644 --- a/DcsInt/DcsInt.c +++ b/DcsInt/DcsInt.c @@ -986,6 +986,32 @@ VCAuthLoadConfigUpdated(UINT8* secRegion, UINTN secRegionSize) { } } +VOID +Pause( + IN UINTN seconds + ) +{ + if (seconds) { + EFI_INPUT_KEY key; + key = KeyWait(L"%2d \r", seconds, 0, 0); + if (key.UnicodeChar != 0) { + GetKey(); + } + } +} + +VOID +PauseHandleInfo( + IN EFI_HANDLE hndle, + IN UINTN seconds) +{ + if (seconds) { + EfiPrintDevicePath(hndle); + Pause(seconds); + OUT_PRINT(L"\n"); + } +} + ////////////////////////////////////////////////////////////////////////// // Driver Entry Point ////////////////////////////////////////////////////////////////////////// @@ -1007,15 +1033,8 @@ UefiMain( if (gAuthSecRegionSearch) { res = PlatformGetAuthData(&SecRegionData, &SecRegionSize, &SecRegionHandle); if (!EFI_ERROR(res)) { - EFI_INPUT_KEY key; - EfiPrintDevicePath(SecRegionHandle); - OUT_PRINT(L"\n"); VCAuthLoadConfigUpdated(SecRegionData, SecRegionSize); - key = KeyWait(L"%2d \r", 2, 0, 0); - if (key.UnicodeChar != 0) { - GetKey(); - } - OUT_PRINT(L"\n"); + PauseHandleInfo(SecRegionHandle, gSecRegionInfoDelay); } } else if (gRUD != 0) { // RUD defined @@ -1028,10 +1047,10 @@ UefiMain( if (!EFI_ERROR(res) && id != NULL) { INT32 rud; rud = GetCrc32((unsigned char*)id, (int)AsciiStrLen(id)); - OUT_PRINT(L"%d ? %d\n", gRUD, rud); MEM_FREE(id); if (rud == gRUD) { devFound = TRUE; + PauseHandleInfo(SecRegionHandle, gSecRegionInfoDelay); break; } } @@ -1093,9 +1112,9 @@ UefiMain( if (gConfigBuffer != NULL) { TpmMeasure(gConfigBuffer, gConfigBufferSize); // Measure configuration } - if (gTpm->IsConfigured(gTpm) && !gTpm->IsOpen(gTpm)) { + if (gTpm->IsConfigured(gTpm) && !gTpm->IsOpen(gTpm) && gTPMLockedInfoDelay) { ERR_PRINT(L"TPM is configured but locked. Probably boot chain is modified!\n"); - KeyWait(L"%1d\r", 9, 0, 0); + Pause(gTPMLockedInfoDelay); } } -- cgit v1.2.3