diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-07-27 03:29:45 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-08 23:21:49 +0100 |
commit | cb6dad6bd21d66cd28b3ef47e3540316ee9913c3 (patch) | |
tree | 276b2329a3b0cb5a1f5ac8e49abcd5ad0ff8703b /src/Main | |
parent | 4d8d59c23d8f7ea0ad1f6dda0facd26dad1f7660 (diff) | |
download | VeraCrypt-cb6dad6bd21d66cd28b3ef47e3540316ee9913c3.tar.gz VeraCrypt-cb6dad6bd21d66cd28b3ef47e3540316ee9913c3.zip |
Linux/MacOSX port of manual selection of number of passes for volume header over-write operation.
Diffstat (limited to 'src/Main')
-rw-r--r-- | src/Main/Forms/ChangePasswordDialog.cpp | 2 | ||||
-rw-r--r-- | src/Main/Forms/Forms.cpp | 12 | ||||
-rw-r--r-- | src/Main/Forms/Forms.h | 2 | ||||
-rw-r--r-- | src/Main/Forms/TrueCrypt.fbp | 179 | ||||
-rw-r--r-- | src/Main/Forms/VolumePasswordPanel.cpp | 17 | ||||
-rw-r--r-- | src/Main/Forms/VolumePasswordPanel.h | 1 |
6 files changed, 210 insertions, 3 deletions
diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp index 2a46f1ab..f52e169d 100644 --- a/src/Main/Forms/ChangePasswordDialog.cpp +++ b/src/Main/Forms/ChangePasswordDialog.cpp | |||
@@ -124,7 +124,7 @@ namespace VeraCrypt | |||
124 | wxBusyCursor busy; | 124 | wxBusyCursor busy; |
125 | Core->ChangePassword (Path, Gui->GetPreferences().DefaultMountOptions.PreserveTimestamps, | 125 | Core->ChangePassword (Path, Gui->GetPreferences().DefaultMountOptions.PreserveTimestamps, |
126 | CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetKeyfiles(), | 126 | CurrentPasswordPanel->GetPassword(), CurrentPasswordPanel->GetKeyfiles(), |
127 | newPassword, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf()); | 127 | newPassword, newKeyfiles, NewPasswordPanel->GetPkcs5Kdf(), NewPasswordPanel->GetHeaderWipeCount()); |
128 | } | 128 | } |
129 | 129 | ||
130 | switch (DialogMode) | 130 | switch (DialogMode) |
diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp index e804889b..76080605 100644 --- a/src/Main/Forms/Forms.cpp +++ b/src/Main/Forms/Forms.cpp | |||
@@ -3150,10 +3150,20 @@ VolumePasswordPanelBase::VolumePasswordPanelBase( wxWindow* parent, wxWindowID i | |||
3150 | Pkcs5PrfChoice->SetSelection( 0 ); | 3150 | Pkcs5PrfChoice->SetSelection( 0 ); |
3151 | GridBagSizer->Add( Pkcs5PrfChoice, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); | 3151 | GridBagSizer->Add( Pkcs5PrfChoice, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); |
3152 | 3152 | ||
3153 | HeaderWipeCountText = new wxStaticText( this, wxID_ANY, _("Header Wipe:"), wxDefaultPosition, wxDefaultSize, 0 ); | ||
3154 | HeaderWipeCountText->Wrap( -1 ); | ||
3155 | GridBagSizer->Add( HeaderWipeCountText, wxGBPosition( 8, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 5 ); | ||
3156 | |||
3157 | wxString HeaderWipeCountChoices[] = { _("3-pass"), _("7-pass"), _("35-pass"), _("256-pass"), _("3") }; | ||
3158 | int HeaderWipeCountNChoices = sizeof( HeaderWipeCountChoices ) / sizeof( wxString ); | ||
3159 | HeaderWipeCount = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, HeaderWipeCountNChoices, HeaderWipeCountChoices, 0 ); | ||
3160 | HeaderWipeCount->SetSelection( 0 ); | ||
3161 | GridBagSizer->Add( HeaderWipeCount, wxGBPosition( 8, 1 ), wxGBSpan( 1, 1 ), wxALL, 5 ); | ||
3162 | |||
3153 | PasswordPlaceholderSizer = new wxBoxSizer( wxVERTICAL ); | 3163 | PasswordPlaceholderSizer = new wxBoxSizer( wxVERTICAL ); |
3154 | 3164 | ||
3155 | 3165 | ||
3156 | GridBagSizer->Add( PasswordPlaceholderSizer, wxGBPosition( 8, 1 ), wxGBSpan( 1, 2 ), wxTOP|wxEXPAND, 5 ); | 3166 | GridBagSizer->Add( PasswordPlaceholderSizer, wxGBPosition( 9, 1 ), wxGBSpan( 1, 2 ), wxTOP|wxEXPAND, 5 ); |
3157 | 3167 | ||
3158 | 3168 | ||
3159 | GridBagSizer->AddGrowableCol( 1 ); | 3169 | GridBagSizer->AddGrowableCol( 1 ); |
diff --git a/src/Main/Forms/Forms.h b/src/Main/Forms/Forms.h index 2ced284c..f20a7628 100644 --- a/src/Main/Forms/Forms.h +++ b/src/Main/Forms/Forms.h | |||
@@ -950,6 +950,8 @@ namespace VeraCrypt | |||
950 | wxBoxSizer* Pkcs5PrfSizer; | 950 | wxBoxSizer* Pkcs5PrfSizer; |
951 | wxStaticText* Pkcs5PrfStaticText; | 951 | wxStaticText* Pkcs5PrfStaticText; |
952 | wxChoice* Pkcs5PrfChoice; | 952 | wxChoice* Pkcs5PrfChoice; |
953 | wxStaticText* HeaderWipeCountText; | ||
954 | wxChoice* HeaderWipeCount; | ||
953 | wxBoxSizer* PasswordPlaceholderSizer; | 955 | wxBoxSizer* PasswordPlaceholderSizer; |
954 | 956 | ||
955 | // Virtual event handlers, overide them in your derived class | 957 | // Virtual event handlers, overide them in your derived class |
diff --git a/src/Main/Forms/TrueCrypt.fbp b/src/Main/Forms/TrueCrypt.fbp index 53dd452f..bc11db47 100644 --- a/src/Main/Forms/TrueCrypt.fbp +++ b/src/Main/Forms/TrueCrypt.fbp | |||
@@ -25297,10 +25297,187 @@ | |||
25297 | </object> | 25297 | </object> |
25298 | <object class="gbsizeritem" expanded="1"> | 25298 | <object class="gbsizeritem" expanded="1"> |
25299 | <property name="border">5</property> | 25299 | <property name="border">5</property> |
25300 | <property name="colspan">1</property> | ||
25301 | <property name="column">0</property> | ||
25302 | <property name="flag">wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT</property> | ||
25303 | <property name="row">8</property> | ||
25304 | <property name="rowspan">1</property> | ||
25305 | <object class="wxStaticText" expanded="1"> | ||
25306 | <property name="BottomDockable">1</property> | ||
25307 | <property name="LeftDockable">1</property> | ||
25308 | <property name="RightDockable">1</property> | ||
25309 | <property name="TopDockable">1</property> | ||
25310 | <property name="aui_layer"></property> | ||
25311 | <property name="aui_name"></property> | ||
25312 | <property name="aui_position"></property> | ||
25313 | <property name="aui_row"></property> | ||
25314 | <property name="best_size"></property> | ||
25315 | <property name="bg"></property> | ||
25316 | <property name="caption"></property> | ||
25317 | <property name="caption_visible">1</property> | ||
25318 | <property name="center_pane">0</property> | ||
25319 | <property name="close_button">1</property> | ||
25320 | <property name="context_help"></property> | ||
25321 | <property name="context_menu">1</property> | ||
25322 | <property name="default_pane">0</property> | ||
25323 | <property name="dock">Dock</property> | ||
25324 | <property name="dock_fixed">0</property> | ||
25325 | <property name="docking">Left</property> | ||
25326 | <property name="enabled">1</property> | ||
25327 | <property name="fg"></property> | ||
25328 | <property name="floatable">1</property> | ||
25329 | <property name="font"></property> | ||
25330 | <property name="gripper">0</property> | ||
25331 | <property name="hidden">0</property> | ||
25332 | <property name="id">wxID_ANY</property> | ||
25333 | <property name="label">Header Wipe:</property> | ||
25334 | <property name="max_size"></property> | ||
25335 | <property name="maximize_button">0</property> | ||
25336 | <property name="maximum_size"></property> | ||
25337 | <property name="min_size"></property> | ||
25338 | <property name="minimize_button">0</property> | ||
25339 | <property name="minimum_size"></property> | ||
25340 | <property name="moveable">1</property> | ||
25341 | <property name="name">HeaderWipeCountText</property> | ||
25342 | <property name="pane_border">1</property> | ||
25343 | <property name="pane_position"></property> | ||
25344 | <property name="pane_size"></property> | ||
25345 | <property name="permission">protected</property> | ||
25346 | <property name="pin_button">1</property> | ||
25347 | <property name="pos"></property> | ||
25348 | <property name="resize">Resizable</property> | ||
25349 | <property name="show">1</property> | ||
25350 | <property name="size"></property> | ||
25351 | <property name="style"></property> | ||
25352 | <property name="subclass"></property> | ||
25353 | <property name="toolbar_pane">0</property> | ||
25354 | <property name="tooltip"></property> | ||
25355 | <property name="window_extra_style"></property> | ||
25356 | <property name="window_name"></property> | ||
25357 | <property name="window_style"></property> | ||
25358 | <property name="wrap">-1</property> | ||
25359 | <event name="OnChar"></event> | ||
25360 | <event name="OnEnterWindow"></event> | ||
25361 | <event name="OnEraseBackground"></event> | ||
25362 | <event name="OnKeyDown"></event> | ||
25363 | <event name="OnKeyUp"></event> | ||
25364 | <event name="OnKillFocus"></event> | ||
25365 | <event name="OnLeaveWindow"></event> | ||
25366 | <event name="OnLeftDClick"></event> | ||
25367 | <event name="OnLeftDown"></event> | ||
25368 | <event name="OnLeftUp"></event> | ||
25369 | <event name="OnMiddleDClick"></event> | ||
25370 | <event name="OnMiddleDown"></event> | ||
25371 | <event name="OnMiddleUp"></event> | ||
25372 | <event name="OnMotion"></event> | ||
25373 | <event name="OnMouseEvents"></event> | ||
25374 | <event name="OnMouseWheel"></event> | ||
25375 | <event name="OnPaint"></event> | ||
25376 | <event name="OnRightDClick"></event> | ||
25377 | <event name="OnRightDown"></event> | ||
25378 | <event name="OnRightUp"></event> | ||
25379 | <event name="OnSetFocus"></event> | ||
25380 | <event name="OnSize"></event> | ||
25381 | <event name="OnUpdateUI"></event> | ||
25382 | </object> | ||
25383 | </object> | ||
25384 | <object class="gbsizeritem" expanded="1"> | ||
25385 | <property name="border">5</property> | ||
25386 | <property name="colspan">1</property> | ||
25387 | <property name="column">1</property> | ||
25388 | <property name="flag">wxALL</property> | ||
25389 | <property name="row">8</property> | ||
25390 | <property name="rowspan">1</property> | ||
25391 | <object class="wxChoice" expanded="1"> | ||
25392 | <property name="BottomDockable">1</property> | ||
25393 | <property name="LeftDockable">1</property> | ||
25394 | <property name="RightDockable">1</property> | ||
25395 | <property name="TopDockable">1</property> | ||
25396 | <property name="aui_layer"></property> | ||
25397 | <property name="aui_name"></property> | ||
25398 | <property name="aui_position"></property> | ||
25399 | <property name="aui_row"></property> | ||
25400 | <property name="best_size"></property> | ||
25401 | <property name="bg"></property> | ||
25402 | <property name="caption"></property> | ||
25403 | <property name="caption_visible">1</property> | ||
25404 | <property name="center_pane">0</property> | ||
25405 | <property name="choices">"3-pass" "7-pass" "35-pass" "256-pass" "3"</property> | ||
25406 | <property name="close_button">1</property> | ||
25407 | <property name="context_help"></property> | ||
25408 | <property name="context_menu">1</property> | ||
25409 | <property name="default_pane">0</property> | ||
25410 | <property name="dock">Dock</property> | ||
25411 | <property name="dock_fixed">0</property> | ||
25412 | <property name="docking">Left</property> | ||
25413 | <property name="enabled">1</property> | ||
25414 | <property name="fg"></property> | ||
25415 | <property name="floatable">1</property> | ||
25416 | <property name="font"></property> | ||
25417 | <property name="gripper">0</property> | ||
25418 | <property name="hidden">0</property> | ||
25419 | <property name="id">wxID_ANY</property> | ||
25420 | <property name="max_size"></property> | ||
25421 | <property name="maximize_button">0</property> | ||
25422 | <property name="maximum_size"></property> | ||
25423 | <property name="min_size"></property> | ||
25424 | <property name="minimize_button">0</property> | ||
25425 | <property name="minimum_size"></property> | ||
25426 | <property name="moveable">1</property> | ||
25427 | <property name="name">HeaderWipeCount</property> | ||
25428 | <property name="pane_border">1</property> | ||
25429 | <property name="pane_position"></property> | ||
25430 | <property name="pane_size"></property> | ||
25431 | <property name="permission">protected</property> | ||
25432 | <property name="pin_button">1</property> | ||
25433 | <property name="pos"></property> | ||
25434 | <property name="resize">Resizable</property> | ||
25435 | <property name="selection">0</property> | ||
25436 | <property name="show">1</property> | ||
25437 | <property name="size"></property> | ||
25438 | <property name="style"></property> | ||
25439 | <property name="subclass"></property> | ||
25440 | <property name="toolbar_pane">0</property> | ||
25441 | <property name="tooltip"></property> | ||
25442 | <property name="validator_data_type"></property> | ||
25443 | <property name="validator_style">wxFILTER_NONE</property> | ||
25444 | <property name="validator_type">wxDefaultValidator</property> | ||
25445 | <property name="validator_variable"></property> | ||
25446 | <property name="window_extra_style"></property> | ||
25447 | <property name="window_name"></property> | ||
25448 | <property name="window_style"></property> | ||
25449 | <event name="OnChar"></event> | ||
25450 | <event name="OnChoice"></event> | ||
25451 | <event name="OnEnterWindow"></event> | ||
25452 | <event name="OnEraseBackground"></event> | ||
25453 | <event name="OnKeyDown"></event> | ||
25454 | <event name="OnKeyUp"></event> | ||
25455 | <event name="OnKillFocus"></event> | ||
25456 | <event name="OnLeaveWindow"></event> | ||
25457 | <event name="OnLeftDClick"></event> | ||
25458 | <event name="OnLeftDown"></event> | ||
25459 | <event name="OnLeftUp"></event> | ||
25460 | <event name="OnMiddleDClick"></event> | ||
25461 | <event name="OnMiddleDown"></event> | ||
25462 | <event name="OnMiddleUp"></event> | ||
25463 | <event name="OnMotion"></event> | ||
25464 | <event name="OnMouseEvents"></event> | ||
25465 | <event name="OnMouseWheel"></event> | ||
25466 | <event name="OnPaint"></event> | ||
25467 | <event name="OnRightDClick"></event> | ||
25468 | <event name="OnRightDown"></event> | ||
25469 | <event name="OnRightUp"></event> | ||
25470 | <event name="OnSetFocus"></event> | ||
25471 | <event name="OnSize"></event> | ||
25472 | <event name="OnUpdateUI"></event> | ||
25473 | </object> | ||
25474 | </object> | ||
25475 | <object class="gbsizeritem" expanded="1"> | ||
25476 | <property name="border">5</property> | ||
25300 | <property name="colspan">2</property> | 25477 | <property name="colspan">2</property> |
25301 | <property name="column">1</property> | 25478 | <property name="column">1</property> |
25302 | <property name="flag">wxTOP|wxEXPAND</property> | 25479 | <property name="flag">wxTOP|wxEXPAND</property> |
25303 | <property name="row">8</property> | 25480 | <property name="row">9</property> |
25304 | <property name="rowspan">1</property> | 25481 | <property name="rowspan">1</property> |
25305 | <object class="wxBoxSizer" expanded="1"> | 25482 | <object class="wxBoxSizer" expanded="1"> |
25306 | <property name="minimum_size"></property> | 25483 | <property name="minimum_size"></property> |
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index 54bef90f..10e56f7a 100644 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp | |||
@@ -189,6 +189,23 @@ namespace VeraCrypt | |||
189 | return shared_ptr <Pkcs5Kdf> (); | 189 | return shared_ptr <Pkcs5Kdf> (); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | |||
193 | int VolumePasswordPanel::GetHeaderWipeCount () const | ||
194 | { | ||
195 | try | ||
196 | { | ||
197 | long wipeCount; | ||
198 | wxString wipeCountStrDesc = HeaderWipeCount->GetStringSelection(); | ||
199 | wxString wipeCountStr = wipeCountStrDesc.BeforeFirst(wxT("-")); | ||
200 | if (!wipeCountStr.ToLong(&wipeCount)) | ||
201 | wipeCount = PRAND_HEADER_WIPE_PASSES; | ||
202 | return (int) wipeCount; | ||
203 | } | ||
204 | catch (ParameterIncorrect&) | ||
205 | { | ||
206 | return PRAND_HEADER_WIPE_PASSES; | ||
207 | } | ||
208 | } | ||
192 | 209 | ||
193 | void VolumePasswordPanel::OnAddKeyfileDirMenuItemSelected (wxCommandEvent& event) | 210 | void VolumePasswordPanel::OnAddKeyfileDirMenuItemSelected (wxCommandEvent& event) |
194 | { | 211 | { |
diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h index 3ab7f95a..f7f6e7cb 100644 --- a/src/Main/Forms/VolumePasswordPanel.h +++ b/src/Main/Forms/VolumePasswordPanel.h | |||
@@ -25,6 +25,7 @@ namespace VeraCrypt | |||
25 | shared_ptr <KeyfileList> GetKeyfiles () const { return UseKeyfilesCheckBox->IsChecked() ? Keyfiles : shared_ptr <KeyfileList> (); } | 25 | shared_ptr <KeyfileList> GetKeyfiles () const { return UseKeyfilesCheckBox->IsChecked() ? Keyfiles : shared_ptr <KeyfileList> (); } |
26 | shared_ptr <VolumePassword> GetPassword () const; | 26 | shared_ptr <VolumePassword> GetPassword () const; |
27 | shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const; | 27 | shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const; |
28 | int GetHeaderWipeCount () const; | ||
28 | void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); } | 29 | void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); } |
29 | void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); } | 30 | void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); } |
30 | bool PasswordsMatch () const; | 31 | bool PasswordsMatch () const; |