VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/DcsCfg
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-09-26 07:56:26 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 18:17:48 +0200
commitc97186ae96d4835841b02d377a9002d078a6f83b (patch)
tree80789b09c967f6b1aad9d36108bb729f216aebe4 /DcsCfg
parent224b1cc286122b8aca5002fec31ed0390b299403 (diff)
downloadVeraCrypt-DCS-c97186ae96d4835841b02d377a9002d078a6f83b.tar.gz
VeraCrypt-DCS-c97186ae96d4835841b02d377a9002d078a6f83b.zip
Ensure sensitive memory is correctly erased.
Diffstat (limited to 'DcsCfg')
-rw-r--r--DcsCfg/DcsCfgCrypt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/DcsCfg/DcsCfgCrypt.c b/DcsCfg/DcsCfgCrypt.c
index d031dcb..4b700b6 100644
--- a/DcsCfg/DcsCfgCrypt.c
+++ b/DcsCfg/DcsCfgCrypt.c
@@ -163,7 +163,14 @@ ChangePassword(
ZeroMem(&newPassword, sizeof(newPassword));
ZeroMem(&confirmPassword, sizeof(newPassword));
VCAskPwd(AskPwdNew, &newPassword);
+ if (gAuthPwdCode == AskPwdRetCancel) {
+ return EFI_NOT_READY;
+ }
VCAskPwd(AskPwdConfirm, &confirmPassword);
+ if (gAuthPwdCode == AskPwdRetCancel) {
+ burn(&newPassword, sizeof(newPassword));
+ return EFI_NOT_READY;
+ }
if (newPassword.Length == confirmPassword.Length) {
if (CompareMem(newPassword.Text, confirmPassword.Text, confirmPassword.Length) == 0) {
break;
@@ -191,6 +198,10 @@ ChangePassword(
cryptoInfo->HeaderFlags,
cryptoInfo->SectorSize,
FALSE);
+
+
+ burn(&newPassword, sizeof(newPassword));
+ burn(&confirmPassword, sizeof(confirmPassword));
if (vcres != 0) {
ERR_PRINT(L"header create error(%x)\n", vcres);