VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/Forms.cpp2
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/Forms.h1
-rwxr-xr-xsrc/Main/Forms/TrueCrypt.fbp2
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/VolumePasswordPanel.cpp35
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/VolumePasswordPanel.h1
-rwxr-xr-x[-rw-r--r--]src/Main/TextUserInterface.cpp8
6 files changed, 36 insertions, 13 deletions
diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp
index 0cfd956..20f2bfd 100644..100755
--- a/src/Main/Forms/Forms.cpp
+++ b/src/Main/Forms/Forms.cpp
@@ -3281,6 +3281,7 @@ VolumePasswordPanelBase::VolumePasswordPanelBase( wxWindow* parent, wxWindowID i
KeyfilesButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VolumePasswordPanelBase::OnKeyfilesButtonClick ), NULL, this );
KeyfilesButton->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( VolumePasswordPanelBase::OnKeyfilesButtonRightDown ), NULL, this );
KeyfilesButton->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( VolumePasswordPanelBase::OnKeyfilesButtonRightClick ), NULL, this );
+ TrueCryptModeCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( VolumePasswordPanelBase::OnTrueCryptModeChecked ), NULL, this );
}
VolumePasswordPanelBase::~VolumePasswordPanelBase()
@@ -3294,6 +3295,7 @@ VolumePasswordPanelBase::~VolumePasswordPanelBase()
KeyfilesButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( VolumePasswordPanelBase::OnKeyfilesButtonClick ), NULL, this );
KeyfilesButton->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( VolumePasswordPanelBase::OnKeyfilesButtonRightDown ), NULL, this );
KeyfilesButton->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( VolumePasswordPanelBase::OnKeyfilesButtonRightClick ), NULL, this );
+ TrueCryptModeCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( VolumePasswordPanelBase::OnTrueCryptModeChecked ), NULL, this );
}
diff --git a/src/Main/Forms/Forms.h b/src/Main/Forms/Forms.h
index e2d462f..358e937 100644..100755
--- a/src/Main/Forms/Forms.h
+++ b/src/Main/Forms/Forms.h
@@ -983,6 +983,7 @@ namespace VeraCrypt
virtual void OnKeyfilesButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnKeyfilesButtonRightDown( wxMouseEvent& event ) { event.Skip(); }
virtual void OnKeyfilesButtonRightClick( wxMouseEvent& event ) { event.Skip(); }
+ virtual void OnTrueCryptModeChecked( wxCommandEvent& event ) { event.Skip(); }
public:
diff --git a/src/Main/Forms/TrueCrypt.fbp b/src/Main/Forms/TrueCrypt.fbp
index 24b98f1..8a7705d 100755
--- a/src/Main/Forms/TrueCrypt.fbp
+++ b/src/Main/Forms/TrueCrypt.fbp
@@ -26720,7 +26720,7 @@
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
- <event name="OnCheckBox"></event>
+ <event name="OnCheckBox">OnTrueCryptModeChecked</event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index d4200b6..5385d6c 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.cpp
+++ b/src/Main/Forms/VolumePasswordPanel.cpp
@@ -73,6 +73,12 @@ namespace VeraCrypt
if (options && !disableTruecryptMode)
{
TrueCryptModeCheckBox->SetValue (options->TrueCryptMode);
+ if (options->TrueCryptMode)
+ {
+ VolumePimStaticText->Enable (false);
+ VolumePimTextCtrl->Enable (false);
+ VolumePinHelpStaticText->Enable (false);
+ }
}
if (enablePkcs5Prf)
@@ -218,15 +224,20 @@ namespace VeraCrypt
int VolumePasswordPanel::GetVolumePim () const
{
- wxString pinStr (VolumePimTextCtrl->GetValue());
- long pin = 0;
- if (pinStr.IsEmpty())
- return 0;
- if (pinStr.ToLong (&pin))
- return (int) pin;
+ if (VolumePimTextCtrl->IsEnabled ())
+ {
+ wxString pinStr (VolumePimTextCtrl->GetValue());
+ long pin = 0;
+ if (pinStr.IsEmpty())
+ return 0;
+ if (pinStr.ToLong (&pin))
+ return (int) pin;
+ else
+ return -1;
+ }
else
- return -1;
- }
+ return 0;
+ }
bool VolumePasswordPanel::GetTrueCryptMode () const
{
@@ -384,4 +395,12 @@ namespace VeraCrypt
}
}
}
+
+ void VolumePasswordPanel::OnTrueCryptModeChecked( wxCommandEvent& event )
+ {
+ bool bEnablePIM = !GetTrueCryptMode ();
+ VolumePimStaticText->Enable (bEnablePIM);
+ VolumePimTextCtrl->Enable (bEnablePIM);
+ VolumePinHelpStaticText->Enable (bEnablePIM);
+ }
}
diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h
index 45e0dd8..f090a2b 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.h
+++ b/src/Main/Forms/VolumePasswordPanel.h
@@ -50,6 +50,7 @@ namespace VeraCrypt
void OnUpdate () { UpdateEvent.Raise(); }
void OnUseKeyfilesCheckBoxClick (wxCommandEvent& event) { OnUpdate(); }
void WipeTextCtrl (wxTextCtrl *textCtrl);
+ void OnTrueCryptModeChecked( wxCommandEvent& event );
shared_ptr <KeyfileList> Keyfiles;
shared_ptr <Functor> UpdateCallback;
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 190aaf7..50153eb 100644..100755
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -444,7 +444,7 @@ namespace VeraCrypt
}
// current PIM
- if (!Preferences.NonInteractive && (pim < 0))
+ if (!truecryptMode && !Preferences.NonInteractive && (pim < 0))
{
pim = AskPim (_("Enter current PIM"));
}
@@ -1120,7 +1120,7 @@ namespace VeraCrypt
if (!options.Password)
options.Password = AskPassword();
- if (options.Pim < 0)
+ if (!options.TrueCryptMode && (options.Pim < 0))
options.Pim = AskPim (_("Enter PIM"));
if (!options.Keyfiles)
@@ -1198,7 +1198,7 @@ namespace VeraCrypt
}
}
- if (options.Pim < 0)
+ if (!options.TrueCryptMode && (options.Pim < 0))
{
options.Pim = AskPim (StringFormatter (_("Enter PIM for {0}"), wstring (*options.Path)));
}
@@ -1217,7 +1217,7 @@ namespace VeraCrypt
{
if (!options.ProtectionPassword)
options.ProtectionPassword = AskPassword (_("Enter password for hidden volume"));
- if (options.ProtectionPim < 0)
+ if (!options.TrueCryptMode && (options.ProtectionPim < 0))
options.ProtectionPim = AskPim (_("Enter PIM for hidden volume"));
if (!options.ProtectionKeyfiles)
options.ProtectionKeyfiles = AskKeyfiles (_("Enter keyfile for hidden volume"));