VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 0cfd9562..20f2bfdd 100644..100755
--- a/src/Main/Forms/Forms.cpp
+++ b/src/Main/Forms/Forms.cpp
@@ -3280,8 +3280,9 @@ VolumePasswordPanelBase::VolumePasswordPanelBase( wxWindow* parent, wxWindowID i
UseKeyfilesCheckBox->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( VolumePasswordPanelBase::OnUseKeyfilesCheckBoxClick ), NULL, this );
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()
{
@@ -3293,8 +3294,9 @@ VolumePasswordPanelBase::~VolumePasswordPanelBase()
UseKeyfilesCheckBox->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( VolumePasswordPanelBase::OnUseKeyfilesCheckBoxClick ), NULL, this );
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 );
}
VolumePasswordWizardPageBase::VolumePasswordWizardPageBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : WizardPage( parent, id, pos, size, style )
diff --git a/src/Main/Forms/Forms.h b/src/Main/Forms/Forms.h
index e2d462f0..358e937a 100644..100755
--- a/src/Main/Forms/Forms.h
+++ b/src/Main/Forms/Forms.h
@@ -982,8 +982,9 @@ namespace VeraCrypt
virtual void OnUseKeyfilesCheckBoxClick( wxCommandEvent& event ) { event.Skip(); }
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 24b98f19..8a7705da 100755
--- a/src/Main/Forms/TrueCrypt.fbp
+++ b/src/Main/Forms/TrueCrypt.fbp
@@ -26719,9 +26719,9 @@
<property name="window_extra_style"></property>
<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>
<event name="OnKeyUp"></event>
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index d4200b66..5385d6c8 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.cpp
+++ b/src/Main/Forms/VolumePasswordPanel.cpp
@@ -72,8 +72,14 @@ namespace VeraCrypt
if (options && !disableTruecryptMode)
{
TrueCryptModeCheckBox->SetValue (options->TrueCryptMode);
+ if (options->TrueCryptMode)
+ {
+ VolumePimStaticText->Enable (false);
+ VolumePimTextCtrl->Enable (false);
+ VolumePinHelpStaticText->Enable (false);
+ }
}
if (enablePkcs5Prf)
{
@@ -217,17 +223,22 @@ 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
{
return TrueCryptModeCheckBox->GetValue ();
@@ -383,5 +394,13 @@ namespace VeraCrypt
VolumePinHelpStaticText->SetLabel(LangString["IDC_PIM_HELP"]);
}
}
}
+
+ 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 45e0dd8c..f090a2bc 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.h
+++ b/src/Main/Forms/VolumePasswordPanel.h
@@ -49,8 +49,9 @@ namespace VeraCrypt
void OnPimChanged (wxCommandEvent& event);
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 190aaf76..50153eb9 100644..100755
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -443,9 +443,9 @@ namespace VeraCrypt
password = AskPassword ();
}
// current PIM
- if (!Preferences.NonInteractive && (pim < 0))
+ if (!truecryptMode && !Preferences.NonInteractive && (pim < 0))
{
pim = AskPim (_("Enter current PIM"));
}
@@ -1119,9 +1119,9 @@ 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)
options.Keyfiles = AskKeyfiles();
@@ -1197,9 +1197,9 @@ namespace VeraCrypt
ShowWarning ("UNSUPPORTED_CHARS_IN_PWD_RECOM");
}
}
- if (options.Pim < 0)
+ if (!options.TrueCryptMode && (options.Pim < 0))
{
options.Pim = AskPim (StringFormatter (_("Enter PIM for {0}"), wstring (*options.Path)));
}
@@ -1216,9 +1216,9 @@ namespace VeraCrypt
if (options.Protection == VolumeProtection::HiddenVolumeReadOnly)
{
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"));
}