VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2019-01-28 19:01:40 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2019-03-21 21:01:07 +0100
commit09db6bd29bdcd65eb5e124c58db5a36cf60cbfb2 (patch)
tree6467f626faa5360ef5ede507a4e553bdae631787
parentddaa8ae47a58317cf677a62c4beef62279d4a4da (diff)
downloadVeraCrypt-DCS-09db6bd29bdcd65eb5e124c58db5a36cf60cbfb2.tar.gz
VeraCrypt-DCS-09db6bd29bdcd65eb5e124c58db5a36cf60cbfb2.zip
Add specific handling when user cancel password prompt with ESC so that original Windows loader is called in this case
-rw-r--r--DcsBoot/DcsBoot.c5
-rw-r--r--DcsCfg/DcsCfgCrypt.c4
-rw-r--r--DcsInt/DcsInt.c6
-rw-r--r--Include/Library/CommonLib.h1
4 files changed, 11 insertions, 5 deletions
diff --git a/DcsBoot/DcsBoot.c b/DcsBoot/DcsBoot.c
index d4f4d56..18fb005 100644
--- a/DcsBoot/DcsBoot.c
+++ b/DcsBoot/DcsBoot.c
@@ -183,6 +183,11 @@ DcsBootMain(
{
EfiCpuHalt();
}
+ else if (res == EFI_DCS_USER_CANCELED)
+ {
+ /* If user cancels password prompt, call original Windows loader */
+ res = EfiExec(NULL, gEfiExecCmdDefault);
+ }
return res;
}
diff --git a/DcsCfg/DcsCfgCrypt.c b/DcsCfg/DcsCfgCrypt.c
index 2d5497b..53e03a1 100644
--- a/DcsCfg/DcsCfgCrypt.c
+++ b/DcsCfg/DcsCfgCrypt.c
@@ -167,7 +167,7 @@ ChangePassword(
ZeroMem(&confirmPassword, sizeof(newPassword));
VCAskPwd(AskPwdNew, &newPassword);
if (gAuthPwdCode == AskPwdRetCancel) {
- return EFI_NOT_READY;
+ return EFI_DCS_USER_CANCELED;
}
if (gAuthPwdCode == AskPwdRetTimeout) {
return EFI_TIMEOUT;
@@ -175,7 +175,7 @@ ChangePassword(
VCAskPwd(AskPwdConfirm, &confirmPassword);
if (gAuthPwdCode == AskPwdRetCancel) {
MEM_BURN(&newPassword, sizeof(newPassword));
- return EFI_NOT_READY;
+ return EFI_DCS_USER_CANCELED;
}
if (gAuthPwdCode == AskPwdRetTimeout) {
MEM_BURN(&newPassword, sizeof(newPassword));
diff --git a/DcsInt/DcsInt.c b/DcsInt/DcsInt.c
index 8b6c803..8133726 100644
--- a/DcsInt/DcsInt.c
+++ b/DcsInt/DcsInt.c
@@ -563,7 +563,7 @@ SecRegionChangePwd() {
ZeroMem(&confirmPassword, sizeof(newPassword));
VCAskPwd(AskPwdNew, &newPassword);
if (gAuthPwdCode == AskPwdRetCancel) {
- return EFI_NOT_READY;
+ return EFI_DCS_USER_CANCELED;
}
if (gAuthPwdCode == AskPwdRetTimeout) {
return EFI_TIMEOUT;
@@ -571,7 +571,7 @@ SecRegionChangePwd() {
VCAskPwd(AskPwdConfirm, &confirmPassword);
if (gAuthPwdCode == AskPwdRetCancel) {
MEM_BURN(&newPassword, sizeof(newPassword));
- return EFI_NOT_READY;
+ return EFI_DCS_USER_CANCELED;
}
if (gAuthPwdCode == AskPwdRetTimeout) {
MEM_BURN(&newPassword, sizeof(newPassword));
@@ -682,7 +682,7 @@ SecRegionTryDecrypt()
SecRegionOffset = 0;
VCAuthAsk();
if (gAuthPwdCode == AskPwdRetCancel) {
- return EFI_NOT_READY;
+ return EFI_DCS_USER_CANCELED;
}
if (gAuthPwdCode == AskPwdRetTimeout) {
return EFI_TIMEOUT;
diff --git a/Include/Library/CommonLib.h b/Include/Library/CommonLib.h
index d0db41f..4d207ca 100644
--- a/Include/Library/CommonLib.h
+++ b/Include/Library/CommonLib.h
@@ -31,6 +31,7 @@ https://opensource.org/licenses/LGPL-3.0
#define EFI_DCS_SHUTDOWN_REQUESTED ENCODE_ERROR(0xDC50001)
#define EFI_DCS_REBOOT_REQUESTED ENCODE_ERROR(0xDC50002)
#define EFI_DCS_HALT_REQUESTED ENCODE_ERROR(0xDC50003)
+#define EFI_DCS_USER_CANCELED ENCODE_ERROR(0xDC50004)
//////////////////////////////////////////////////////////////////////////
// Check error