1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-12 03:18:26 -06:00

Remove trailing whitespace

This commit is contained in:
David Foerster
2016-05-10 22:16:32 +02:00
parent 1910751558
commit 11716ed2da
408 changed files with 4420 additions and 4420 deletions

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -21,7 +21,7 @@ namespace VeraCrypt
{
public:
AboutDialog (wxWindow* parent);
void OnWebsiteHyperlinkClick (wxHyperlinkEvent& event) { Gui->OpenHomepageLink (this, L"main"); }
};
}

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -68,7 +68,7 @@ namespace VeraCrypt
wxBusyCursor busy;
Buffer buffer ((size_t) Gui->GetSelectedData <size_t> (BufferSizeChoice));
BenchmarkThreadRoutine routine(this, results, buffer);
Gui->ExecuteWaitThreadRoutine (this, &routine);
@@ -77,7 +77,7 @@ namespace VeraCrypt
foreach (const BenchmarkResult &result, results)
{
vector <wstring> fields (BenchmarkListCtrl->GetColumnCount());
fields[ColumnAlgorithm] = result.AlgorithmName;
fields[ColumnEncryption] = Gui->SpeedToString (result.EncryptionSpeed);
fields[ColumnDecryption] = Gui->SpeedToString (result.DecryptionSpeed);
@@ -85,10 +85,10 @@ namespace VeraCrypt
Gui->AppendToListCtrl (BenchmarkListCtrl, fields);
}
BenchmarkListCtrl->SetColumnWidth(0, wxLIST_AUTOSIZE);
}
void BenchmarkDialog::DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer)
{
try

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -42,7 +42,7 @@ namespace VeraCrypt
void DoBenchmark (list<BenchmarkResult>& results, Buffer& buffer);
void OnBenchmarkButtonClick (wxCommandEvent& event);
class BenchmarkThreadRoutine : public WaitThreadRoutine
{
public:

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -59,7 +59,7 @@ namespace VeraCrypt
NewPasswordPanel = new VolumePasswordPanel (this, NULL, newPassword, true, newKeyfiles, false, enableNewPassword, enableNewKeyfiles, enableNewPassword, enablePkcs5Prf);
NewPasswordPanel->UpdateEvent.Connect (EventConnector <ChangePasswordDialog> (this, &ChangePasswordDialog::OnPasswordPanelUpdate));
NewPasswordPanelSizer->Add (NewPasswordPanel, 1, wxALL | wxEXPAND);
if (mode == Mode::RemoveAllKeyfiles)
NewSizer->Show (false);
@@ -98,7 +98,7 @@ namespace VeraCrypt
CurrentPasswordPanel->SetFocusToPimTextCtrl();
return;
}
shared_ptr <VolumePassword> newPassword;
int newPim = 0;
if (DialogMode == Mode::ChangePasswordAndKeyfiles)
@@ -110,7 +110,7 @@ namespace VeraCrypt
catch (PasswordException& e)
{
Gui->ShowWarning (e);
NewPasswordPanel->SetFocusToPasswordTextCtrl();
NewPasswordPanel->SetFocusToPasswordTextCtrl();
return;
}
newPim = NewPasswordPanel->GetVolumePim();
@@ -126,7 +126,7 @@ namespace VeraCrypt
{
if (newPim > 0 && newPim < 485)
{
Gui->ShowError ("PIM_REQUIRE_LONG_PASSWORD");
Gui->ShowError ("PIM_REQUIRE_LONG_PASSWORD");
return;
}
@@ -235,7 +235,7 @@ namespace VeraCrypt
if (passwordEmpty && keyfilesEmpty)
ok = false;
if (CurrentPasswordPanel->GetVolumePim () == -1)
ok = false;
@@ -251,7 +251,7 @@ namespace VeraCrypt
ok = false;
if (DialogMode == Mode::ChangePasswordAndKeyfiles
&& ( (NewPasswordPanel->GetPassword()->IsEmpty() && newKeyfilesEmpty)
&& ( (NewPasswordPanel->GetPassword()->IsEmpty() && newKeyfilesEmpty)
|| !NewPasswordPanel->PasswordsMatch()
|| (NewPasswordPanel->GetVolumePim() == -1)
)
@@ -265,12 +265,12 @@ namespace VeraCrypt
}
OKButton->Enable (ok);
if (DialogMode == Mode::ChangePasswordAndKeyfiles)
{
bool pimChanged = (CurrentPasswordPanel->GetVolumePim() != NewPasswordPanel->GetVolumePim());
NewPasswordPanel->UpdatePimHelpText(pimChanged);
}
}
}

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -39,7 +39,7 @@ namespace VeraCrypt
DeviceListCtrl->InsertColumn (ColumnMountPoint, LangString["MOUNT_POINT"], wxLIST_FORMAT_LEFT, 1);
colPermilles.push_back (396);
#endif
wxImageList *imageList = new wxImageList (16, 12, true);
imageList->Add (Resources::GetDriveIconBitmap(), Resources::GetDriveIconMaskBitmap());
DeviceListCtrl->AssignImageList (imageList, wxIMAGE_LIST_SMALL);
@@ -65,13 +65,13 @@ namespace VeraCrypt
fields[ColumnMountPoint] = device.MountPoint;
#endif
fields[ColumnSize] = Gui->SizeToString (device.Size);
Gui->AppendToListCtrl (DeviceListCtrl, fields, 0, &device);
Gui->AppendToListCtrl (DeviceListCtrl, fields, 0, &device);
foreach_ref (HostDevice &partition, device.Partitions)
{
fields[ColumnDevice] =
fields[ColumnDevice] =
#ifndef TC_WINDOWS
wstring (L" ") +
wstring (L" ") +
#endif
wstring (partition.Path);
@@ -97,7 +97,7 @@ namespace VeraCrypt
StdButtonsOK->Disable();
StdButtonsOK->SetDefault();
}
void DeviceSelectionDialog::OnListItemActivated (wxListEvent& event)
{
if (StdButtonsOK->IsEnabled())

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -32,7 +32,7 @@ namespace VeraCrypt
}
EncryptionAlgorithmChoice->Select (0);
Hashes = Hash::GetAvailableAlgorithms();
foreach (shared_ptr <Hash> hash, Hashes)
{
@@ -117,7 +117,7 @@ namespace VeraCrypt
{
Gui->OpenHomepageLink (this, L"hashalgorithms");
}
void EncryptionOptionsWizardPage::OnTestButtonClick (wxCommandEvent& event)
{
EncryptionTestDialog dialog (this);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -46,7 +46,7 @@ namespace VeraCrypt
Buffer key;
GetTextCtrlData (KeyTextCtrl, key);
if (key.Size() != ea->GetKeySize())
throw_err (LangString["TEST_KEY_SIZE"]);
@@ -100,7 +100,7 @@ namespace VeraCrypt
Buffer sector (ENCRYPTION_DATA_UNIT_SIZE);
BufferPtr block = sector.GetRange (blockNumber * ea->GetMaxBlockSize(), ea->GetMaxBlockSize());
block.CopyFrom (data);
if (encrypt)
@@ -130,7 +130,7 @@ namespace VeraCrypt
{
return Gui->GetSelectedData <EncryptionAlgorithm> (EncryptionAlgorithmChoice)->GetNew();
}
void EncryptionTestDialog::GetTextCtrlData (wxTextCtrl *textCtrl, Buffer &buffer) const
{
vector <byte> data;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -32,7 +32,7 @@ namespace VeraCrypt
Layout();
Fit();
Center();
#ifdef TC_MACOSX
// wxMac cannot insert items to wxListCtrl due to a bug
MoveUpButton->Show (false);
@@ -46,7 +46,7 @@ namespace VeraCrypt
fields[ColumnVolumePath] = favorite->Path;
fields[ColumnMountPoint] = favorite->MountPoint;
Gui->AppendToListCtrl (FavoritesListCtrl, fields, -1, favorite.get());
if (++itemCount > Favorites.size() - newItemCount)
{
FavoritesListCtrl->SetItemState (itemCount - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
@@ -57,7 +57,7 @@ namespace VeraCrypt
UpdateButtons();
FavoritesListCtrl->SetFocus();
}
void FavoriteVolumesDialog::OnMoveDownButtonClick (wxCommandEvent& event)
{
FreezeScope freeze (this);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -35,7 +35,7 @@ namespace VeraCrypt
void OnRemoveAllButtonClick (wxCommandEvent& event);
void OnRemoveButtonClick (wxCommandEvent& event);
void UpdateButtons ();
enum
{
ColumnVolumePath = 0,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -17,10 +17,10 @@
namespace VeraCrypt
{
KeyfileGeneratorDialog::KeyfileGeneratorDialog (wxWindow* parent) : KeyfileGeneratorDialogBase (parent)
KeyfileGeneratorDialog::KeyfileGeneratorDialog (wxWindow* parent) : KeyfileGeneratorDialogBase (parent)
{
RandomNumberGenerator::Start();
Hashes = Hash::GetAvailableAlgorithms();
foreach (shared_ptr <Hash> hash, Hashes)
{
@@ -33,7 +33,7 @@ namespace VeraCrypt
HideBytes (RandomPoolStaticText, 24);
MouseStaticText->Wrap (Gui->GetCharWidth (MouseStaticText) * 70);
CollectedEntropy->SetRange (RNG_POOL_SIZE * 8);
MainSizer->SetMinSize (wxSize (-1, Gui->GetCharHeight (this) * 24));
@@ -41,7 +41,7 @@ namespace VeraCrypt
Layout();
Fit();
Center();
MouseEventsCounter = 0;
foreach (wxWindow *c, this->GetChildren())
@@ -57,36 +57,36 @@ namespace VeraCrypt
try
{
int keyfilesCount = NumberOfKeyfiles->GetValue();
int keyfilesSize = KeyfilesSize->GetValue();
int keyfilesSize = KeyfilesSize->GetValue();
bool useRandomSize = RandomSizeCheckBox->IsChecked();
wxString keyfileBaseName = KeyfilesBaseName->GetValue();
keyfileBaseName.Trim(true);
keyfileBaseName.Trim(false);
if (keyfileBaseName.IsEmpty())
{
Gui->ShowWarning("KEYFILE_EMPTY_BASE_NAME");
return;
}
wxFileName baseFileName = wxFileName::FileName (keyfileBaseName);
if (!baseFileName.IsOk())
{
Gui->ShowWarning("KEYFILE_INVALID_BASE_NAME");
return;
}
DirectoryPath keyfilesDir = Gui->SelectDirectory (Gui->GetActiveWindow(), LangString["SELECT_KEYFILE_GENERATION_DIRECTORY"], false);
if (keyfilesDir.IsEmpty())
return;
wxFileName dirFileName = wxFileName::DirName( wstring(keyfilesDir).c_str() );
if (!dirFileName.IsDirWritable ())
{
Gui->ShowWarning(L"You don't have write permission on the selected directory");
return;
}
wxBusyCursor busy;
for (int i = 0; i < keyfilesCount; i++)
{
@@ -95,26 +95,26 @@ namespace VeraCrypt
{
SecureBuffer sizeBuffer (sizeof(int));
RandomNumberGenerator::GetData (sizeBuffer, true);
memcpy(&bufferLen, sizeBuffer.Ptr(), sizeof(int));
/* since keyfilesSize < 1024 * 1024, we mask with 0x000FFFFF */
bufferLen = (long) (((unsigned long) bufferLen) & 0x000FFFFF);
bufferLen %= ((1024*1024 - 64) + 1);
bufferLen += 64;
bufferLen += 64;
}
else
bufferLen = keyfilesSize;
SecureBuffer keyfileBuffer (bufferLen);
RandomNumberGenerator::GetData (keyfileBuffer, true);
wstringstream convertStream;
convertStream << i;
wxString suffix = L"_";
suffix += convertStream.str().c_str();
wxString suffix = L"_";
suffix += convertStream.str().c_str();
wxFileName keyfileName;
if (i == 0)
{
@@ -131,12 +131,12 @@ namespace VeraCrypt
keyfileName.Assign(dirFileName.GetPath(), keyfileBaseName + suffix);
}
}
if (keyfileName.Exists())
{
wxString msg = wxString::Format(LangString["KEYFILE_ALREADY_EXISTS"], keyfileName.GetFullPath());
if (!Gui->AskYesNo (msg, false, true))
return;
return;
}
{
@@ -175,7 +175,7 @@ namespace VeraCrypt
ShowBytes (RandomPoolStaticText, RandomNumberGenerator::PeekPool().GetRange (0, 24));
else
HideBytes (RandomPoolStaticText, 24);
/* conservative estimate: 1 mouse move event brings 1 bit of entropy
* https://security.stackexchange.com/questions/32844/for-how-much-time-should-i-randomly-move-the-mouse-for-generating-encryption-key/32848#32848
*/
@@ -183,7 +183,7 @@ namespace VeraCrypt
if (MouseEventsCounter < (RNG_POOL_SIZE * 8))
CollectedEntropy->SetValue (++MouseEventsCounter);
}
void KeyfileGeneratorDialog::OnShowRandomPoolCheckBoxClicked (wxCommandEvent& event)
{
if (!event.IsChecked())
@@ -217,7 +217,7 @@ namespace VeraCrypt
str[i] = L'X';
}
}
void KeyfileGeneratorDialog::HideBytes (wxStaticText *textCtrl, size_t len)
{
wxString str;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -32,7 +32,7 @@ namespace VeraCrypt
void OnRandomSizeCheckBoxClicked( wxCommandEvent& event );
void ShowBytes (wxStaticText *textCtrl, const ConstBufferPtr &buffer, bool appendDots = true);
void HideBytes (wxStaticText *textCtrl, size_t len);
HashList Hashes;
int MouseEventsCounter;
Mutex AccessMutex;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -35,7 +35,7 @@ namespace VeraCrypt
Fit();
Center();
}
void KeyfilesDialog::OnCreateKeyfileButttonClick (wxCommandEvent& event)
{
Gui->CreateKeyfile();

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -84,7 +84,7 @@ namespace VeraCrypt
return keyfiles;
}
void KeyfilesPanel::OnAddDirectoryButtonClick (wxCommandEvent& event)
{
DirectoryPath dir = Gui->SelectDirectory (this, LangString["SELECT_KEYFILE_PATH"]);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -22,7 +22,7 @@ namespace VeraCrypt
LegalNoticesTextCtrl->SetMinSize (wxSize (
Gui->GetCharWidth (LegalNoticesTextCtrl) * 88,
Gui->GetCharHeight (LegalNoticesTextCtrl) * 28));
Layout();
Fit();
Center();

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -208,7 +208,7 @@ namespace VeraCrypt
wstring args = StringFormatter (repair ? L"/C echo {0} & chkdsk {1} /F /X & pause" : L"/C echo {0} & chkdsk {1} & pause",
StringFormatter (LangString[repair ? "REPAIRING_FS" : "CHECKING_FS"], mountPoint), mountPoint);
ShellExecute (static_cast <HWND> (GetHandle()),
ShellExecute (static_cast <HWND> (GetHandle()),
L"runas",
L"cmd.exe", args.c_str(), nullptr, SW_SHOW);
#else
@@ -260,7 +260,7 @@ namespace VeraCrypt
void MainFrame::InitControls ()
{
LogoBitmap->SetBitmap (Resources::GetLogoBitmap());
list <int> colPermilles;
#ifndef TC_WINDOWS
@@ -280,7 +280,7 @@ namespace VeraCrypt
MountAllDevicesButton->SetLabel (_("Mount All Devices"));
#endif
#ifdef TC_WINDOWS
#ifdef TC_WINDOWS
SlotListCtrl->InsertColumn (ColumnSlot, LangString["DRIVE"], wxLIST_FORMAT_LEFT, 1);
colPermilles.push_back (75);
#else
@@ -289,20 +289,20 @@ namespace VeraCrypt
#endif
SlotListCtrl->InsertColumn (ColumnPath, LangString["VOLUME"], wxLIST_FORMAT_LEFT, 1);
#ifdef TC_WINDOWS
#ifdef TC_WINDOWS
colPermilles.push_back (487);
#else
colPermilles.push_back (429);
#endif
SlotListCtrl->InsertColumn (ColumnSize, LangString["SIZE"], wxLIST_FORMAT_RIGHT, 1);
#ifdef TC_WINDOWS
#ifdef TC_WINDOWS
colPermilles.push_back (126);
#else
colPermilles.push_back (130);
#endif
#ifdef TC_WINDOWS
#ifdef TC_WINDOWS
SlotListCtrl->InsertColumn (ColumnEA, LangString["ENCRYPTION_ALGORITHM_LV"], wxLIST_FORMAT_LEFT, 1);
colPermilles.push_back (233);
#else
@@ -323,7 +323,7 @@ namespace VeraCrypt
#ifndef TC_WINDOWS
int screenHeight = wxSystemSettings::GetMetric (wxSYS_SCREEN_Y);
if (screenHeight < 480)
slotListRowCount = 1;
else if (screenHeight <= 600)
@@ -355,7 +355,7 @@ namespace VeraCrypt
SetMaxSize (GetSize());
Gui->SetListCtrlColumnWidths (SlotListCtrl, colPermilles);
UpdateVolumeList();
UpdateWipeCacheButton();
}
@@ -434,7 +434,7 @@ namespace VeraCrypt
{
MainFrame *frame = dynamic_cast <MainFrame *> (Gui->GetMainFrame());
PDEV_BROADCAST_HDR hdr = (PDEV_BROADCAST_HDR) lParam;
if (wParam == DBT_DEVICEREMOVECOMPLETE && hdr->dbch_devicetype == DBT_DEVTYP_VOLUME)
{
PDEV_BROADCAST_VOLUME vol = (PDEV_BROADCAST_VOLUME) lParam;
@@ -504,15 +504,15 @@ namespace VeraCrypt
}
wxMenu *CreatePopupMenu ()
{
{
auto_ptr <wxMenu> popup (new wxMenu);
Gui->AppendToMenu (*popup, LangString[Gui->IsInBackgroundMode() ? "SHOW_TC" : "HIDE_TC"], this, wxCommandEventHandler (TaskBarIcon::OnShowHideMenuItemSelected));
popup->AppendSeparator();
Gui->AppendToMenu (*popup, _("Mount All Favorite Volumes"), this, wxCommandEventHandler (TaskBarIcon::OnMountAllFavoritesMenuItemSelected))->Enable (!Busy);
Gui->AppendToMenu (*popup, _("Dismount All Mounted Volumes"), this, wxCommandEventHandler (TaskBarIcon::OnDismountAllMenuItemSelected))->Enable (!Busy);
// Favorite volumes
if (Gui->GetPreferences().BackgroundTaskMenuMountItemsEnabled && !Frame->FavoriteVolumesMenuMap.empty())
{
@@ -628,7 +628,7 @@ namespace VeraCrypt
Gui->SetPreferences (prefs);
NoHistoryCheckBox->SetValue (!prefs.SaveHistory);
}
void MainFrame::MountAllDevices ()
{
try
@@ -891,7 +891,7 @@ namespace VeraCrypt
}
void MainFrame::OnDefaultMountParametersMenuItemSelected(wxCommandEvent& event)
{
{
#ifdef TC_MACOSX
if (Gui->IsInBackgroundMode())
Gui->SetBackgroundMode (false);
@@ -921,7 +921,7 @@ namespace VeraCrypt
if (volume->Path.IsDevice() && !Core->IsDevicePresent (volume->Path))
removedVolumes.push_back (volume);
}
if (!removedVolumes.empty())
Gui->AutoDismountVolumes (removedVolumes, true);
}
@@ -1035,7 +1035,7 @@ namespace VeraCrypt
case Hotkey::Id::MountAllFavorites:
{
size_t mountedCount = Core->GetMountedVolumes().size();
if (event.GetId() == Hotkey::Id::MountAllDevices)
MountAllDevices();
else
@@ -1102,7 +1102,7 @@ namespace VeraCrypt
if (SelectedItemIndex > itemIndex)
--SelectedItemIndex;
}
void MainFrame::OnListItemDeselected (wxListEvent& event)
{
OnListItemSelectionChanged();
@@ -1155,7 +1155,7 @@ namespace VeraCrypt
else if (IsFreeSlotSelected())
{
Gui->AppendToMenu (popup, _("Mount Volume"), this, wxCommandEventHandler (MainFrame::OnMountVolumeMenuItemSelected));
popup.AppendSeparator();
Gui->AppendToMenu (popup, LangString["SELECT_FILE_AND_MOUNT"], this, wxCommandEventHandler (MainFrame::OnSelectFileAndMountMenuItemSelected));
@@ -1174,12 +1174,12 @@ namespace VeraCrypt
SelectedItemIndex = event.GetIndex();
OnListItemSelectionChanged();
}
void MainFrame::OnListItemSelectionChanged ()
{
if (SlotListCtrl->GetSelectedItemCount() < 1)
SelectedItemIndex = -1;
if (SelectedItemIndex >= 0)
SelectedSlotNumber = (VolumeSlotNumber) SlotListCtrl->GetItemData (SelectedItemIndex);
else
@@ -1187,7 +1187,7 @@ namespace VeraCrypt
UpdateControls();
}
void MainFrame::OnManageSecurityTokenKeyfilesMenuItemSelected (wxCommandEvent& event)
{
try
@@ -1280,7 +1280,7 @@ namespace VeraCrypt
SavePreferences();
}
void MainFrame::OnRestoreVolumeHeaderMenuItemSelected (wxCommandEvent& event)
{
if (!CheckVolumePathNotEmpty ())
@@ -1307,7 +1307,7 @@ namespace VeraCrypt
dialog.ShowModal();
}
void MainFrame::OnSelectDeviceAndMountMenuItemSelected (wxCommandEvent& event)
{
DevicePath path = Gui->SelectDevice (this);
@@ -1344,7 +1344,7 @@ namespace VeraCrypt
if (!path.IsEmpty())
SetVolumePath (path);
}
void MainFrame::OnTimer ()
{
try
@@ -1502,7 +1502,7 @@ namespace VeraCrypt
WipeCache();
Gui->ShowInfo ("PASSWORD_CACHE_WIPED");
}
void MainFrame::OpenSelectedVolume () const
{
shared_ptr <VolumeInfo> selectedVolume = GetSelectedVolume();
@@ -1577,7 +1577,7 @@ namespace VeraCrypt
}
return -1;
}
void MainFrame::UpdateControls ()
{
bool mounted = IsMountedSlotSelected();
@@ -1585,7 +1585,7 @@ namespace VeraCrypt
VolumeButton->SetLabel (mounted ? LangString["DISMOUNT"] : wxString (_("Mount")));
VolumePropertiesButton->Enable (mounted);
DismountVolumeMenuItem->Enable (mounted);
DismountVolumeMenuItem->Enable (mounted);
MountVolumeMenuItem->Enable (!mounted);
VolumePropertiesMenuItem->Enable (mounted);
AddToFavoritesMenuItem->Enable (mounted);
@@ -1601,7 +1601,7 @@ namespace VeraCrypt
bool listChanged = false;
MountedVolumes = Core->GetMountedVolumes();
map < VolumeSlotNumber, shared_ptr <VolumeInfo> > mountedVolumesMap;
foreach (shared_ptr <VolumeInfo> volume, MountedVolumes)
{
@@ -1632,7 +1632,7 @@ namespace VeraCrypt
fields[ColumnPath] = volume->Path;
fields[ColumnSize] = Gui->SizeToString (volume->Size);
fields[ColumnType] = Gui->VolumeTypeToString (volume->Type, volume->TrueCryptMode, volume->Protection);
if (volume->HiddenVolumeProtectionTriggered)
{
fields[ColumnType] += L"(!)";
@@ -1667,7 +1667,7 @@ namespace VeraCrypt
#else
fields[ColumnSlot] = StringConverter::FromNumber (slotNumber);
#endif
#ifdef TC_WINDOWS
if (Core->IsMountPointAvailable (fields[ColumnSlot]))
#else

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -87,7 +87,7 @@ namespace VeraCrypt
void OnCloseAllSecurityTokenSessionsMenuItemSelected (wxCommandEvent& event);
void OnDonateMenuItemSelected (wxCommandEvent& event) { Gui->OpenHomepageLink (this, L"donate"); }
void OnContactMenuItemSelected (wxCommandEvent& event) { Gui->OpenHomepageLink (this, L"contact"); }
void OnCreateKeyfileMenuItemSelected (wxCommandEvent& event)
void OnCreateKeyfileMenuItemSelected (wxCommandEvent& event)
{
#ifdef TC_MACOSX
if (Gui->IsInBackgroundMode())
@@ -161,7 +161,7 @@ namespace VeraCrypt
void UpdateVolumeList ();
void UpdateWipeCacheButton ();
void WipeCache ();
struct VolumeActivityMapEntry
{
VolumeActivityMapEntry () { }

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -85,21 +85,21 @@ namespace VeraCrypt
}
void MountOptionsDialog::OnOKButtonClick (wxCommandEvent& event)
{
{
bool bUnsupportedKdf = false;
/* verify that PIM values are valid before continuing*/
int Pim = PasswordPanel->GetVolumePim();
int ProtectionPim = (!ReadOnlyCheckBox->IsChecked() && ProtectionCheckBox->IsChecked())?
ProtectionPasswordPanel->GetVolumePim() : 0;
/* invalid PIM: set focus to PIM field and stop processing */
if (-1 == Pim || (PartitionInSystemEncryptionScopeCheckBox->IsChecked() && Pim > MAX_BOOT_PIM_VALUE))
{
PasswordPanel->SetFocusToPimTextCtrl();
return;
}
if (-1 == ProtectionPim || (PartitionInSystemEncryptionScopeCheckBox->IsChecked() && ProtectionPim > MAX_BOOT_PIM_VALUE))
{
ProtectionPasswordPanel->SetFocusToPimTextCtrl();
@@ -142,7 +142,7 @@ namespace VeraCrypt
Gui->ShowWarning (e);
return;
}
Options.Protection = VolumeProtection::HiddenVolumeReadOnly;
Options.Protection = VolumeProtection::HiddenVolumeReadOnly;
Options.ProtectionPim = ProtectionPim;
Options.ProtectionKdf = ProtectionPasswordPanel->GetPkcs5Kdf(Options.TrueCryptMode, bUnsupportedKdf);
if (bUnsupportedKdf)

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -52,16 +52,16 @@ namespace VeraCrypt
MountRemovableCheckBox->SetValidator (wxGenericValidator (&Preferences.DefaultMountOptions.Removable));
FilesystemOptionsTextCtrl->SetValue (Preferences.DefaultMountOptions.FilesystemOptions);
TrueCryptModeCheckBox->SetValidator (wxGenericValidator (&Preferences.DefaultMountOptions.TrueCryptMode));
int index, prfInitialIndex = 0;
Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);
Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);
foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms(false))
{
index = Pkcs5PrfChoice->Append (kdf.GetName());
if (Preferences.DefaultMountOptions.Kdf
if (Preferences.DefaultMountOptions.Kdf
&& (Preferences.DefaultMountOptions.Kdf->GetName() == kdf.GetName())
)
{
@@ -157,7 +157,7 @@ namespace VeraCrypt
colPermilles.push_back (358);
vector <wstring> fields (HotkeyListCtrl->GetColumnCount());
UnregisteredHotkeys = Preferences.Hotkeys;
Hotkey::UnregisterList (Gui->GetMainFrame(), UnregisteredHotkeys);
@@ -363,7 +363,7 @@ namespace VeraCrypt
#endif
if (!Validate())
return;
shared_ptr <Pkcs5Kdf> selectedKdf;
if (Pkcs5PrfChoice->GetSelection () != 0)
{
@@ -383,7 +383,7 @@ namespace VeraCrypt
Preferences.DefaultMountOptions.Protection = MountReadOnlyCheckBox->IsChecked() ? VolumeProtection::ReadOnly : VolumeProtection::None;
Preferences.DefaultMountOptions.FilesystemOptions = FilesystemOptionsTextCtrl->GetValue();
Preferences.DefaultKeyfiles = *DefaultKeyfilesPanel->GetKeyfiles();
Preferences.DefaultMountOptions.Kdf = selectedKdf;
Preferences.DefaultMountOptions.ProtectionKdf = selectedKdf;
@@ -403,7 +403,7 @@ namespace VeraCrypt
}
else
{
Gui->InitSecurityTokenLibrary();
Gui->InitSecurityTokenLibrary();
}
}
}
@@ -419,7 +419,7 @@ namespace VeraCrypt
EndModal (wxID_OK);
}
void PreferencesDialog::OnPreserveTimestampsCheckBoxClick (wxCommandEvent& event)
{
#ifdef TC_LINUX
@@ -504,7 +504,7 @@ namespace VeraCrypt
HotkeyAltCheckBox->SetValue (alt);
HotkeyWinCheckBox->SetValue (win);
HotkeyTextCtrl->ChangeValue (Hotkey::GetVirtualKeyCodeString (LastVirtualKeyPressed));
HotkeyTextCtrl->ChangeValue (Hotkey::GetVirtualKeyCodeString (LastVirtualKeyPressed));
UpdateHotkeyButtons();
return;
}

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -53,7 +53,7 @@ namespace VeraCrypt
};
KeyfilesPanel *DefaultKeyfilesPanel;
int LastVirtualKeyPressed;
int LastVirtualKeyPressed;
auto_ptr <wxTimer> mTimer;
UserPreferences Preferences;
bool RestoreValidatorBell;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -17,10 +17,10 @@
namespace VeraCrypt
{
RandomPoolEnrichmentDialog::RandomPoolEnrichmentDialog (wxWindow* parent) : RandomPoolEnrichmentDialogBase (parent)
RandomPoolEnrichmentDialog::RandomPoolEnrichmentDialog (wxWindow* parent) : RandomPoolEnrichmentDialogBase (parent)
{
RandomNumberGenerator::Start();
Hashes = Hash::GetAvailableAlgorithms();
foreach (shared_ptr <Hash> hash, Hashes)
{
@@ -35,7 +35,7 @@ namespace VeraCrypt
HideBytes (RandomPoolStaticText, 24);
MouseStaticText->Wrap (Gui->GetCharWidth (MouseStaticText) * 70);
CollectedEntropy->SetRange (RNG_POOL_SIZE * 8);
MainSizer->SetMinSize (wxSize (-1, Gui->GetCharHeight (this) * 24));
@@ -43,7 +43,7 @@ namespace VeraCrypt
Layout();
Fit();
Center();
MouseEventsCounter = 0;
foreach (wxWindow *c, this->GetChildren())
@@ -107,7 +107,7 @@ namespace VeraCrypt
str[i] = L'X';
}
}
void RandomPoolEnrichmentDialog::HideBytes (wxStaticText *textCtrl, size_t len)
{
wxString str;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -30,7 +30,7 @@ namespace VeraCrypt
void OnShowRandomPoolCheckBoxClicked (wxCommandEvent& event);
void ShowBytes (wxStaticText *textCtrl, const ConstBufferPtr &buffer);
void HideBytes (wxStaticText *textCtrl, size_t len);
HashList Hashes;
int MouseEventsCounter;
Mutex AccessMutex;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -65,7 +65,7 @@ namespace VeraCrypt
fields[ColumnSecurityTokenLabel] = key.Token.Label;
fields[ColumnSecurityTokenKeyfileLabel] = key.Id;
Gui->AppendToListCtrl (SecurityTokenKeyfileListCtrl, fields, 0, &SecurityTokenKeyfileList[i++]);
Gui->AppendToListCtrl (SecurityTokenKeyfileListCtrl, fields, 0, &SecurityTokenKeyfileList[i++]);
}
}
@@ -155,7 +155,7 @@ namespace VeraCrypt
{
wxBusyCursor busy;
SecurityToken::CreateKeyfile (newKeyfileDialog.GetSelectedSlotId(), keyfileData, StringConverter::ToSingle (newKeyfileDialog.GetKeyfileName()));
FillSecurityTokenKeyfileListCtrl();
}
}

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -25,7 +25,7 @@ namespace VeraCrypt
return false;
}
void SelectDirectoryWizardPage::OnBrowseButtonClick (wxCommandEvent& event)
{
DirectoryPath dir = Gui->SelectDirectory (this);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -54,7 +54,7 @@ namespace VeraCrypt
}
VolumeCreationProgressWizardPage *Page;
};
};
RandomPoolTimer.reset (dynamic_cast <wxTimer *> (new Timer (this)));
RandomPoolTimer->Start (30);
@@ -73,9 +73,9 @@ namespace VeraCrypt
{
if (!event.IsChecked())
{
ShowAsterisks (RandomPoolSampleStaticText);
ShowAsterisks (HeaderKeySampleStaticText);
ShowAsterisks (MasterKeySampleStaticText);
ShowAsterisks (RandomPoolSampleStaticText);
ShowAsterisks (HeaderKeySampleStaticText);
ShowAsterisks (MasterKeySampleStaticText);
}
else
{
@@ -84,7 +84,7 @@ namespace VeraCrypt
MasterKeySampleStaticText->SetLabel (L"");
}
}
void VolumeCreationProgressWizardPage::OnRandomPoolTimer ()
{
if (!VolumeCreatorRunning && DisplayKeysCheckBox->IsChecked())
@@ -187,7 +187,7 @@ namespace VeraCrypt
RealProgressBarRange = ProgressGauge->GetSize().GetWidth();
ProgressGauge->SetRange (RealProgressBarRange);
}
void VolumeCreationProgressWizardPage::IncrementEntropyProgress ()
{
ScopeLock lock (AccessMutex);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -69,7 +69,7 @@ namespace VeraCrypt
}
VolumeCreationWizard *Wizard;
};
};
RandomPoolUpdateTimer.reset (dynamic_cast <wxTimer *> (new Timer (this)));
RandomPoolUpdateTimer->Start (200);
@@ -129,11 +129,11 @@ namespace VeraCrypt
page->SetVolumePath (SelectedVolumePath);
return page;
}
case Step::EncryptionOptions:
{
EncryptionOptionsWizardPage *page = new EncryptionOptionsWizardPage (GetPageParent());
if (OuterVolume)
page->SetPageTitle (LangString["CIPHER_HIDVOL_HOST_TITLE"]);
else if (SelectedVolumeType == VolumeType::Hidden)
@@ -170,10 +170,10 @@ namespace VeraCrypt
}
VolumeSizeWizardPage *page = new VolumeSizeWizardPage (GetPageParent(), SelectedVolumePath, SectorSize, freeSpaceText);
page->SetPageTitle (pageTitle);
page->SetPageText (pageText);
if (!OuterVolume && SelectedVolumeType == VolumeType::Hidden)
page->SetMaxVolumeSize (MaxHiddenVolumeSize);
else
@@ -194,29 +194,29 @@ namespace VeraCrypt
VolumePasswordWizardPage *page = new VolumePasswordWizardPage (GetPageParent(), Password, Keyfiles);
page->EnableUsePim (); // force displaying "Use PIM"
page->SetPimSelected (Pim > 0);
if (OuterVolume)
page->SetPageTitle (LangString["PASSWORD_HIDVOL_HOST_TITLE"]);
else if (SelectedVolumeType == VolumeType::Hidden)
page->SetPageTitle (LangString["PASSWORD_HIDVOL_TITLE"]);
else
page->SetPageTitle (LangString["PASSWORD_TITLE"]);
page->SetPageText (LangString[OuterVolume ? "PASSWORD_HIDDENVOL_HOST_HELP" : "PASSWORD_HELP"]);
return page;
}
case Step::VolumePim:
{
VolumePimWizardPage *page = new VolumePimWizardPage (GetPageParent());
if (OuterVolume)
page->SetPageTitle (LangString["PIM_HIDVOL_HOST_TITLE"]);
else if (SelectedVolumeType == VolumeType::Hidden)
page->SetPageTitle (LangString["PIM_HIDVOL_TITLE"]);
else
page->SetPageTitle (LangString["PIM_TITLE"]);
page->SetPageText (LangString["PIM_HELP"]);
page->SetVolumePim (Pim);
return page;
@@ -244,14 +244,14 @@ namespace VeraCrypt
page->SetPageTitle (_("Format Options"));
page->SetFilesystemType (SelectedFilesystemType);
if (!OuterVolume && SelectedVolumeType == VolumeType::Hidden)
QuickFormatEnabled = true;
page->SetQuickFormat (QuickFormatEnabled);
return page;
}
case Step::CrossPlatformSupport:
{
SingleChoiceWizardPage <bool> *page = new SingleChoiceWizardPage <bool> (GetPageParent(), wxEmptyString, true);
@@ -289,7 +289,7 @@ namespace VeraCrypt
InfoWizardPage *page = new InfoWizardPage (GetPageParent());
page->SetPageTitle (LangString["FORMAT_FINISHED_TITLE"]);
page->SetPageText (LangString["FORMAT_FINISHED_HELP"]);
SetCancelButtonText (_("Exit"));
return page;
}
@@ -318,16 +318,16 @@ namespace VeraCrypt
Close();
return new InfoWizardPage (GetPageParent());
}
struct OpenOuterVolumeFunctor : public Functor
{
OpenOuterVolumeFunctor (const DirectoryPath &outerVolumeMountPoint) : OuterVolumeMountPoint (outerVolumeMountPoint) { }
virtual void operator() ()
{
Gui->OpenExplorerWindow (OuterVolumeMountPoint);
}
DirectoryPath OuterVolumeMountPoint;
};
@@ -335,11 +335,11 @@ namespace VeraCrypt
shared_ptr <Functor> (new OpenOuterVolumeFunctor (MountedOuterVolume->MountPoint)));
page->SetPageTitle (LangString["HIDVOL_HOST_FILLING_TITLE"]);
page->SetPageText (StringFormatter (
_("Outer volume has been successfully created and mounted as '{0}'. To this volume you should now copy some sensitive-looking files that you actually do NOT want to hide. The files will be there for anyone forcing you to disclose your password. You will reveal only the password for this outer volume, not for the hidden one. The files that you really care about will be stored in the hidden volume, which will be created later on. When you finish copying, click Next. Do not dismount the volume.\n\nNote: After you click Next, the outer volume will be analyzed to determine the size of uninterrupted area of free space whose end is aligned with the end of the volume. This area will accommodate the hidden volume, so it will limit its maximum possible size. The procedure ensures no data on the outer volume are overwritten by the hidden volume."),
wstring (MountedOuterVolume->MountPoint)));
return page;
}
@@ -373,12 +373,12 @@ namespace VeraCrypt
if (!IsWorkInProgress() && RandomNumberGenerator::IsRunning())
{
RandomNumberGenerator::AddToPool (ConstBufferPtr (reinterpret_cast <byte *> (&event), sizeof (event)));
long coord = event.GetX();
RandomNumberGenerator::AddToPool (ConstBufferPtr (reinterpret_cast <byte *> (&coord), sizeof (coord)));
coord = event.GetY();
RandomNumberGenerator::AddToPool (ConstBufferPtr (reinterpret_cast <byte *> (&coord), sizeof (coord)));
VolumeCreationProgressWizardPage *page = dynamic_cast <VolumeCreationProgressWizardPage *> (GetCurrentPage());
if (page)
{
@@ -386,7 +386,7 @@ namespace VeraCrypt
}
}
}
void VolumeCreationWizard::OnProgressTimer ()
{
if (!IsWorkInProgress())
@@ -408,7 +408,7 @@ namespace VeraCrypt
}
VolumeCreator::ProgressInfo progress = Creator->GetProgressInfo();
VolumeCreationProgressWizardPage *page = dynamic_cast <VolumeCreationProgressWizardPage *> (GetCurrentPage());
page->SetProgressValue (progress.SizeDone);
@@ -418,9 +418,9 @@ namespace VeraCrypt
OnVolumeCreatorFinished ();
}
}
void VolumeCreationWizard::OnRandomPoolUpdateTimer ()
{
{
if (!IsWorkInProgress())
{
wxLongLong time = wxGetLocalTimeMillis();
@@ -519,7 +519,7 @@ namespace VeraCrypt
if (SelectedFilesystemType == VolumeCreationOptions::FilesystemType::MacOsExt && VolumeSize >= 10 * BYTES_PER_MB)
args.push_back ("-J");
// Perform a quick NTFS formatting
if (SelectedFilesystemType == VolumeCreationOptions::FilesystemType::NTFS)
args.push_back ("-f");
@@ -566,7 +566,7 @@ namespace VeraCrypt
case Step::VolumeHostType:
{
SingleChoiceWizardPage <VolumeHostType::Enum> *page = dynamic_cast <SingleChoiceWizardPage <VolumeHostType::Enum> *> (GetCurrentPage());
try
{
SelectedVolumeHostType = page->GetSelection();
@@ -657,7 +657,7 @@ namespace VeraCrypt
try
{
mountPoint = Core->GetDeviceMountPoint (SelectedVolumePath);
if (!mountPoint.IsEmpty())
{
if (mountPoint == "/")
@@ -689,7 +689,7 @@ namespace VeraCrypt
return Step::EncryptionOptions;
}
case Step::EncryptionOptions:
{
EncryptionOptionsWizardPage *page = dynamic_cast <EncryptionOptionsWizardPage *> (GetCurrentPage());
@@ -704,7 +704,7 @@ namespace VeraCrypt
else
return Step::VolumeSize;
}
case Step::VolumeSize:
{
VolumeSizeWizardPage *page = dynamic_cast <VolumeSizeWizardPage *> (GetCurrentPage());
@@ -754,7 +754,7 @@ namespace VeraCrypt
Gui->ShowWarning (e);
return GetCurrentStep();
}
Kdf = page->GetPkcs5Kdf();
Keyfiles = page->GetKeyfiles();
@@ -768,7 +768,7 @@ namespace VeraCrypt
}
}
}
if (page->IsPimSelected ())
return Step::VolumePim;
else
@@ -776,7 +776,7 @@ namespace VeraCrypt
// Clear PIM
Pim = 0;
// Skip PIM
// Skip PIM
if (forward && OuterVolume)
{
// Use FAT to prevent problems with free space
@@ -815,7 +815,7 @@ namespace VeraCrypt
if (Pim > 0 && Pim < 485)
{
Gui->ShowError ("PIM_REQUIRE_LONG_PASSWORD");
return GetCurrentStep();
return GetCurrentStep();
}
}
else if (Pim > 0 && Pim < 485)
@@ -826,7 +826,7 @@ namespace VeraCrypt
}
}
}
if (forward && OuterVolume)
{
@@ -895,7 +895,7 @@ namespace VeraCrypt
}
if (forward && CrossPlatformSupport)
Gui->ShowWarning (StringFormatter (_("Please note that the volume will not be formatted with a FAT filesystem and, therefore, you may be required to install additional filesystem drivers on platforms other than {0}, which will enable you to mount the volume."), SystemInfo::GetPlatformName()));
Gui->ShowWarning (StringFormatter (_("Please note that the volume will not be formatted with a FAT filesystem and, therefore, you may be required to install additional filesystem drivers on platforms other than {0}, which will enable you to mount the volume."), SystemInfo::GetPlatformName()));
return Step::CreationProgress;
}
@@ -987,7 +987,7 @@ namespace VeraCrypt
}
VolumeCreationWizard *Wizard;
};
};
page->SetProgressRange (options->Size);
page->SetProgressState (true);
@@ -1055,7 +1055,7 @@ namespace VeraCrypt
uint64 reservedSize = outerVolume->GetSize() / 200;
if (reservedSize > 10 * BYTES_PER_MB)
reservedSize = 10 * BYTES_PER_MB;
if (MaxHiddenVolumeSize < reservedSize)
MaxHiddenVolumeSize = 0;
else

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -62,7 +62,7 @@ namespace VeraCrypt
catch (exception &e) { Gui->ShowError (e); }
}
}
void VolumeLocationWizardPage::OnPageChanging (bool forward)
{
if (forward)

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -43,7 +43,7 @@ namespace VeraCrypt
}
CacheCheckBox->Show (enableCache);
if (!enablePassword && enableKeyfiles)
{
Layout();
@@ -58,8 +58,8 @@ namespace VeraCrypt
PasswordStaticText->Show (enablePassword);
PasswordTextCtrl->Show (enablePassword);
DisplayPasswordCheckBox->Show (enablePassword);
EnablePimEntry = enablePassword && (!enableConfirmation || (enablePkcs5Prf && !isMountPassword));
PimCheckBox->Show (EnablePimEntry);
VolumePimStaticText->Show (false);
@@ -71,12 +71,12 @@ namespace VeraCrypt
ConfirmPasswordStaticText->Show (enableConfirmation);
ConfirmPasswordTextCtrl->Show (enableConfirmation);
UseKeyfilesCheckBox->Show (enableKeyfiles);
KeyfilesButton->Show (enableKeyfiles);
Pkcs5PrfStaticText->Show (enablePkcs5Prf);
Pkcs5PrfChoice->Show (enablePkcs5Prf);
Pkcs5PrfChoice->Show (enablePkcs5Prf);
TrueCryptModeCheckBox->Show (!disableTruecryptMode);
HeaderWipeCountText->Show (enablePkcs5Prf && !isMountPassword);
HeaderWipeCount->Show (enablePkcs5Prf && !isMountPassword);
@@ -104,20 +104,20 @@ namespace VeraCrypt
}
if (enablePkcs5Prf)
{
{
int index, prfInitialIndex = 0;
if (isMountPassword)
{
// case of password for mounting
Pkcs5PrfChoice->Delete (0);
Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);
Pkcs5PrfChoice->Append (LangString["AUTODETECTION"]);
}
foreach_ref (const Pkcs5Kdf &kdf, Pkcs5Kdf::GetAvailableAlgorithms(false))
{
if (!kdf.IsDeprecated() || isMountPassword)
{
index = Pkcs5PrfChoice->Append (kdf.GetName());
if (isMountPassword && options && options->Kdf
if (isMountPassword && options && options->Kdf
&& (options->Kdf->GetName() == kdf.GetName())
)
{
@@ -199,7 +199,7 @@ namespace VeraCrypt
int colspan = isPim? 1 : 2;
wxTextCtrl *newTextCtrl = new wxTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, display ? 0 : wxTE_PASSWORD);
newTextCtrl->SetMaxLength (isPim? MAX_PIM_DIGITS : VolumePassword::MaxSize);
newTextCtrl->SetMaxLength (isPim? MAX_PIM_DIGITS : VolumePassword::MaxSize);
newTextCtrl->SetValue ((*textCtrl)->GetValue());
newTextCtrl->SetMinSize ((*textCtrl)->GetSize());
@@ -270,7 +270,7 @@ namespace VeraCrypt
return shared_ptr <Pkcs5Kdf> ();
}
}
int VolumePasswordPanel::GetVolumePim () const
{
if (VolumePimTextCtrl->IsEnabled () && VolumePimTextCtrl->IsShown ())
@@ -279,7 +279,7 @@ namespace VeraCrypt
long pim = 0;
if (pimStr.IsEmpty())
return 0;
if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789")))
if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789")))
&& pimStr.ToLong (&pim)
&& pim <= MAX_PIM_VALUE)
return (int) pim;
@@ -288,7 +288,7 @@ namespace VeraCrypt
}
else
return 0;
}
}
void VolumePasswordPanel::SetVolumePim (int pim)
{
@@ -306,7 +306,7 @@ namespace VeraCrypt
{
return TrueCryptModeCheckBox->GetValue ();
}
int VolumePasswordPanel::GetHeaderWipeCount () const
{
try
@@ -393,10 +393,10 @@ namespace VeraCrypt
void VolumePasswordPanel::OnDisplayPasswordCheckBoxClick (wxCommandEvent& event)
{
DisplayPassword (event.IsChecked(), &PasswordTextCtrl, 1);
if (ConfirmPasswordTextCtrl->IsShown())
DisplayPassword (event.IsChecked(), &ConfirmPasswordTextCtrl, 2);
if (VolumePimTextCtrl->IsShown())
DisplayPassword (event.IsChecked(), &VolumePimTextCtrl, 3);
@@ -467,7 +467,7 @@ namespace VeraCrypt
VolumePimHelpStaticText->SetLabel(LangString["IDC_PIM_HELP"]);
guiUpdated = true;
}
if (guiUpdated)
{
Layout();
@@ -485,8 +485,8 @@ namespace VeraCrypt
PimCheckBox->Show (false);
VolumePimStaticText->Show (true);
VolumePimTextCtrl->Show (true);
VolumePimHelpStaticText->Show (true);
VolumePimHelpStaticText->Show (true);
if (DisplayPasswordCheckBox->IsChecked ())
DisplayPassword (true, &VolumePimTextCtrl, 3);
else
@@ -494,12 +494,12 @@ namespace VeraCrypt
Layout();
Fit();
}
GetParent()->Layout();
GetParent()->Fit();
}
}
void VolumePasswordPanel::OnTrueCryptModeChecked( wxCommandEvent& event )
{
bool bEnablePIM = !GetTrueCryptMode ();

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -35,7 +35,7 @@ namespace VeraCrypt
int GetHeaderWipeCount () const;
void SetCacheCheckBoxValidator (const wxGenericValidator &validator) { CacheCheckBox->SetValidator (validator); }
void SetFocusToPasswordTextCtrl () { PasswordTextCtrl->SetSelection (-1, -1); PasswordTextCtrl->SetFocus(); }
void SetFocusToPimTextCtrl () { VolumePimTextCtrl->SetSelection (-1, -1); VolumePimTextCtrl->SetFocus(); }
void SetFocusToPimTextCtrl () { VolumePimTextCtrl->SetSelection (-1, -1); VolumePimTextCtrl->SetFocus(); }
void SetVolumePim (int pim);
bool PasswordsMatch () const;
void EnableUsePim () { PimCheckBox->Enable (true); PimCheckBox->Show (true); }

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -29,7 +29,7 @@ namespace VeraCrypt
void EnableUsePim () { PasswordPanel->EnableUsePim (); }
bool IsPimSelected () const { return PasswordPanel->IsUsePimChecked ();}
void SetPimSelected (bool selected) const { PasswordPanel->SetUsePimChecked (selected);}
shared_ptr <Pkcs5Kdf> GetPkcs5Kdf () const { bool bUnsupportedKdf; return PasswordPanel->GetPkcs5Kdf(bUnsupportedKdf); }
bool IsValid ();
void SetMaxStaticTextWidth (int width) { InfoStaticText->Wrap (width); }

View File

@@ -10,8 +10,8 @@
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "System.h"
@@ -29,7 +29,7 @@ namespace VeraCrypt
VolumePimWizardPage::~VolumePimWizardPage ()
{
}
int VolumePimWizardPage::GetVolumePim () const
{
if (VolumePimTextCtrl->IsEnabled ())
@@ -38,7 +38,7 @@ namespace VeraCrypt
long pim = 0;
if (pimStr.IsEmpty())
return 0;
if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789")))
if (((size_t) wxNOT_FOUND == pimStr.find_first_not_of (wxT("0123456789")))
&& pimStr.ToLong (&pim))
return (int) pim;
else
@@ -66,7 +66,7 @@ namespace VeraCrypt
{
return true;
}
void VolumePimWizardPage::OnPimChanged (wxCommandEvent& event)
{
OnPimValueChanged (GetVolumePim ());
@@ -83,7 +83,7 @@ namespace VeraCrypt
{
VolumePimHelpStaticText->SetForegroundColour(*wxBLACK);
VolumePimHelpStaticText->SetLabel(LangString["IDC_PIM_HELP"]);
}
}
Fit();
Layout();
}
@@ -99,15 +99,15 @@ namespace VeraCrypt
void VolumePimWizardPage::OnDisplayPimCheckBoxClick( wxCommandEvent& event )
{
FreezeScope freeze (this);
bool display = event.IsChecked ();
wxTextCtrl *newTextCtrl = new wxTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, display ? 0 : wxTE_PASSWORD);
newTextCtrl->SetMaxLength (MAX_PIM_DIGITS);
newTextCtrl->SetMaxLength (MAX_PIM_DIGITS);
newTextCtrl->SetValue (VolumePimTextCtrl->GetValue());
newTextCtrl->SetMinSize (VolumePimTextCtrl->GetSize());
PimSizer->Replace (VolumePimTextCtrl, newTextCtrl);
PimSizer->Replace (VolumePimTextCtrl, newTextCtrl);
VolumePimTextCtrl->Show (false);
VolumePimTextCtrl->SetValue (wxString (L'X', VolumePimTextCtrl->GetLineLength(0)));
GetVolumePim ();

View File

@@ -10,8 +10,8 @@
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef VC_HEADER_Main_Forms_VolumePimWizardPage
@@ -33,7 +33,7 @@ namespace VeraCrypt
void SetMaxStaticTextWidth (int width) { InfoStaticText->Wrap (width); }
void SetPageText (const wxString &text) { InfoStaticText->SetLabel (text); }
void OnDisplayPimCheckBoxClick( wxCommandEvent& event );
protected:
void SetPimValidator ();
void OnPimChanged (wxCommandEvent& event);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -38,7 +38,7 @@ namespace VeraCrypt
AppendToList ("SIZE", Gui->SizeToString (volumeInfo.Size));
AppendToList ("TYPE", Gui->VolumeTypeToString (volumeInfo.Type, volumeInfo.TrueCryptMode, volumeInfo.Protection));
AppendToList ("READ_ONLY", LangString [volumeInfo.Protection == VolumeProtection::ReadOnly ? "UISTR_YES" : "UISTR_NO"]);
wxString protection;
if (volumeInfo.Type == VolumeType::Hidden)
protection = LangString["NOT_APPLICABLE_OR_NOT_AVAILABLE"];
@@ -84,7 +84,7 @@ namespace VeraCrypt
#ifdef TC_LINUX
}
#endif
Layout();
Fit();
Center();

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -22,7 +22,7 @@ namespace VeraCrypt
{
public:
VolumePropertiesDialog (wxWindow* parent, const VolumeInfo &volumeInfo);
void AppendToList (const string &name, const wxString &value);
};
}

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -74,7 +74,7 @@ namespace VeraCrypt
return 0;
prefixMult = reinterpret_cast <uint64> (VolumeSizePrefixChoice->GetClientData (selection));
uint64 val = StringConverter::ToUInt64 (wstring (VolumeSizeTextCtrl->GetValue()));
if (val <= 0x7fffFFFFffffFFFFull / prefixMult)
{
@@ -119,7 +119,7 @@ namespace VeraCrypt
VolumeSizeTextCtrl->SetValue (L"");
return;
}
if (size % (1024 * 1024 * 1024) == 0)
{
size /= 1024 * 1024 * 1024;

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -20,7 +20,7 @@ namespace VeraCrypt
DEFINE_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_SHOW_MSG)
wxThread::ExitCode WaitThread::Entry()
{
{
m_pRoutine->Execute();
wxQueueEvent (m_pHandler, new wxCommandEvent( wxEVT_COMMAND_WAITDIALOGTHREAD_COMPLETED,0));
return (wxThread::ExitCode)0; // success
@@ -59,7 +59,7 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (UserInterfaceException);
VC_CONVERT_EXCEPTION (MissingArgument);
VC_CONVERT_EXCEPTION (NoItemSelected);
VC_CONVERT_EXCEPTION (StringFormatterException);
VC_CONVERT_EXCEPTION (StringFormatterException);
VC_CONVERT_EXCEPTION (ExecutedProcessFailed);
VC_CONVERT_EXCEPTION (AlreadyInitialized);
VC_CONVERT_EXCEPTION (AssertionFailed);
@@ -77,7 +77,7 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (UnknownException);
VC_CONVERT_EXCEPTION (UserAbort)
VC_CONVERT_EXCEPTION (CipherInitError);
VC_CONVERT_EXCEPTION (WeakKeyDetected);
VC_CONVERT_EXCEPTION (WeakKeyDetected);
VC_CONVERT_EXCEPTION (HigherVersionRequired);
VC_CONVERT_EXCEPTION (KeyfilePathEmpty);
VC_CONVERT_EXCEPTION (MissingVolumeData);
@@ -92,7 +92,7 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (SecurityTokenLibraryNotInitialized);
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileAlreadyExists);
VC_CONVERT_EXCEPTION (SecurityTokenKeyfileNotFound);
VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
VC_CONVERT_EXCEPTION (UnsupportedAlgoInTrueCryptMode);
VC_CONVERT_EXCEPTION (UnsupportedTrueCryptFormat);
VC_CONVERT_EXCEPTION (SystemException);
VC_CONVERT_EXCEPTION (CipherException);

View File

@@ -21,7 +21,7 @@ namespace VeraCrypt
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_ADMIN_PASSWORD, -1);
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_PIN, -1);
DECLARE_LOCAL_EVENT_TYPE(wxEVT_COMMAND_WAITDIALOG_SHOW_MSG, -1);
class WaitDialog;
@@ -31,12 +31,12 @@ namespace VeraCrypt
public:
WaitThread(WaitDialog *handler, WaitThreadRoutine* pRoutine) : wxThread(wxTHREAD_DETACHED), m_pRoutine(pRoutine)
{
m_pHandler = handler;
m_pHandler = handler;
}
~WaitThread()
{
{
}
protected:
virtual ExitCode Entry();
WaitDialog *m_pHandler;
@@ -46,7 +46,7 @@ namespace VeraCrypt
class WaitDialog : public WaitDialogBase, public WaitThreadUI
{
public:
WaitDialog (wxWindow *parent, const wxString& label, WaitThreadRoutine* pRoutine)
WaitDialog (wxWindow *parent, const wxString& label, WaitThreadRoutine* pRoutine)
: WaitDialogBase(parent), WaitThreadUI(pRoutine), m_timer (this)
{
WaitStaticText->SetLabel (label);
@@ -58,11 +58,11 @@ namespace VeraCrypt
Connect( wxID_ANY, wxEVT_COMMAND_WAITDIALOG_ADMIN_PASSWORD, wxCommandEventHandler( WaitDialog::OnAdminPasswordRequest ) );
Connect( wxID_ANY, wxEVT_COMMAND_WAITDIALOG_PIN, wxCommandEventHandler( WaitDialog::OnPinRequest ) );
Connect( wxID_ANY, wxEVT_COMMAND_WAITDIALOG_SHOW_MSG, wxCommandEventHandler( WaitDialog::OnShowMsg ) );
Connect( wxEVT_TIMER, wxTimerEventHandler( WaitDialog::OnProgressTimer ), NULL, this );
m_thread = new WaitThread(this, pRoutine);
}
~WaitDialog()
{
Disconnect( wxEVT_TIMER, wxTimerEventHandler( WaitDialog::OnProgressTimer ));
@@ -73,7 +73,7 @@ namespace VeraCrypt
}
virtual void OnWaitDialogInit( wxInitDialogEvent& event )
{
{
m_thread->Run();
m_timer.Start(100);
}
@@ -114,7 +114,7 @@ namespace VeraCrypt
wxQueueEvent (this, pEvent);
m_queue.Receive (sResult);
sResult.ToLong(&lResult);
}
}
return (int) lResult;
}
@@ -143,7 +143,7 @@ namespace VeraCrypt
else
pin = wxT("");
}
// virtual void OnWaitDialogClose( wxCloseEvent& event ) { }
void OnThreadCompletion(wxCommandEvent &)
{
@@ -187,10 +187,10 @@ namespace VeraCrypt
}
int iResult = wxMessageBox (pParam->m_message, pParam->m_caption, pParam->m_style, this);
delete pParam;
delete pParam;
m_queue.Post(wxString::Format(wxT("%d"), iResult));
}
void OnProgressTimer(wxTimerEvent& event)
{
WaitProgessBar->Pulse();

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source
@@ -61,7 +61,7 @@ namespace VeraCrypt
Gui->SetActiveFrame (this);
event.Skip();
}
void WizardFrame::OnClose (wxCloseEvent& event)
{
if (WorkInProgress)
@@ -97,12 +97,12 @@ namespace VeraCrypt
SetStep (prevStep, false);
}
}
void WizardFrame::SetCancelButtonText (const wxString &text)
{
CancelButton->SetLabel (text.empty() ? wxString (_("Cancel")) : text);
}
void WizardFrame::SetImage (const wxBitmap &bitmap)
{
WizardBitmap->SetBitmap (bitmap);
@@ -143,7 +143,7 @@ namespace VeraCrypt
CurrentPage = GetPage (newStep);
CurrentPage->PageUpdatedEvent.Connect (EventConnector <WizardFrame> (this, &WizardFrame::OnPageUpdated));
CurrentPage->Connect (wxEVT_MOTION, wxMouseEventHandler (WizardFrame::OnMouseMotion), nullptr, this);
foreach (wxWindow *c, CurrentPage->GetChildren())
c->Connect (wxEVT_MOTION, wxMouseEventHandler (WizardFrame::OnMouseMotion), nullptr, this);

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source

View File

@@ -3,7 +3,7 @@
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
by the TrueCrypt License 3.0.
Modifications and additions to the original source code (contained in this file)
Modifications and additions to the original source code (contained in this file)
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
and are governed by the Apache License 2.0 the full text of which is
contained in the file License.txt included in VeraCrypt binary and source