VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/CommandLineInterface.cpp41
-rw-r--r--src/Main/CommandLineInterface.h9
-rw-r--r--src/Main/Forms/DeviceSelectionDialog.cpp40
-rw-r--r--src/Main/Forms/EncryptionOptionsWizardPage.cpp18
-rw-r--r--src/Main/Forms/EncryptionOptionsWizardPage.h6
-rw-r--r--src/Main/Forms/Forms.cpp21
-rw-r--r--src/Main/Forms/KeyfilesPanel.cpp2
-rw-r--r--src/Main/Forms/MainFrame.cpp2
-rw-r--r--src/Main/Forms/TrueCrypt.fbp24
-rw-r--r--src/Main/Forms/VolumeCreationWizard.cpp3
-rw-r--r--src/Main/Forms/VolumeFormatOptionsWizardPage.cpp4
-rw-r--r--src/Main/Forms/VolumePasswordPanel.cpp16
-rw-r--r--src/Main/Forms/VolumeSizeWizardPage.cpp10
-rw-r--r--src/Main/Forms/VolumeSizeWizardPage.h1
-rw-r--r--src/Main/Forms/WaitDialog.cpp2
-rwxr-xr-xsrc/Main/GraphicUserInterface.cpp2
-rw-r--r--src/Main/LanguageStrings.cpp2
-rwxr-xr-xsrc/Main/Main.make142
-rw-r--r--src/Main/TextUserInterface.cpp29
-rw-r--r--src/Main/TextUserInterface.h2
-rw-r--r--src/Main/UserInterface.cpp13
21 files changed, 260 insertions, 129 deletions
diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp
index 68d308f..b5f18dd 100644
--- a/src/Main/CommandLineInterface.cpp
+++ b/src/Main/CommandLineInterface.cpp
@@ -30,6 +30,11 @@ namespace VeraCrypt
ArgSize (0),
ArgVolumeType (VolumeType::Unknown),
ArgTrueCryptMode (false),
+ ArgDisableFileSizeCheck (false),
+ ArgUseLegacyPassword (false),
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ ArgUseDummySudoPassword (false),
+#endif
StartBackgroundTask (false)
{
wxCmdLineParser parser;
@@ -96,7 +101,11 @@ namespace VeraCrypt
parser.AddOption (L"", L"volume-type", _("Volume type"));
parser.AddParam ( _("Volume path"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
parser.AddParam ( _("Mount point"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
-
+ parser.AddSwitch (L"", L"no-size-check", _("Disable check of container size against disk free space."));
+ parser.AddSwitch (L"", L"legacy-password-maxlength", _("Use legacy maximum password length (64 UTF-8 bytes)"));
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ parser.AddSwitch (L"", L"use-dummy-sudo-password", _("Use dummy password in sudo to detect if it is already authenticated"));
+#endif
wxString str;
bool param1IsVolume = false;
bool param1IsMountedVolumeSpec = false;
@@ -319,6 +328,8 @@ namespace VeraCrypt
}
else if (str.IsSameAs (L"exFAT", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::exFAT;
+ else if (str.IsSameAs (L"APFS", false))
+ ArgFilesystem = VolumeCreationOptions::FilesystemType::APFS;
#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
else if (str.IsSameAs (L"UFS", false))
ArgFilesystem = VolumeCreationOptions::FilesystemType::UFS;
@@ -331,6 +342,11 @@ namespace VeraCrypt
ArgForce = parser.Found (L"force");
ArgTrueCryptMode = parser.Found (L"truecrypt");
+ ArgDisableFileSizeCheck = parser.Found (L"no-size-check");
+ ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength") || ArgTrueCryptMode;
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ ArgUseDummySudoPassword = parser.Found (L"use-dummy-sudo-password");
+#endif
#if !defined(TC_WINDOWS) && !defined(TC_MACOSX)
if (parser.Found (L"fs-options", &str))
@@ -402,7 +418,7 @@ namespace VeraCrypt
ArgNewKeyfiles = ToKeyfileList (str);
if (parser.Found (L"new-password", &str))
- ArgNewPassword = ToUTF8Password (str.c_str());
+ ArgNewPassword = ToUTF8Password (str.c_str(), -1, ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
if (parser.Found (L"new-pim", &str))
{
@@ -441,7 +457,7 @@ namespace VeraCrypt
{
if (Preferences.UseStandardInput)
throw_err (L"--password cannot be used with --stdin");
- ArgPassword = ToUTF8Password (str.c_str());
+ ArgPassword = ToUTF8Password (str.c_str(), -1, ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
}
if (parser.Found (L"pim", &str))
@@ -482,7 +498,7 @@ namespace VeraCrypt
if (parser.Found (L"protection-password", &str))
{
- ArgMountOptions.ProtectionPassword = ToUTF8Password (str.c_str());
+ ArgMountOptions.ProtectionPassword = ToUTF8Password (str.c_str(), -1, ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
ArgMountOptions.Protection = VolumeProtection::HiddenVolumeReadOnly;
}
@@ -596,7 +612,7 @@ namespace VeraCrypt
if (parser.Found (L"token-pin", &str) && !str.IsEmpty ())
{
- ArgTokenPin = ToUTF8Buffer (str.c_str(), str.Len ());
+ ArgTokenPin = ToUTF8Buffer (str.c_str(), str.Len (), ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
}
if (parser.Found (L"verbose"))
@@ -771,18 +787,18 @@ namespace VeraCrypt
return filteredVolumes;
}
- shared_ptr<VolumePassword> ToUTF8Password (const wchar_t* str, size_t charCount)
+ shared_ptr<VolumePassword> ToUTF8Password (const wchar_t* str, size_t charCount, size_t maxUtf8Len)
{
if (charCount > 0)
{
- shared_ptr<SecureBuffer> utf8Buffer = ToUTF8Buffer (str, charCount);
+ shared_ptr<SecureBuffer> utf8Buffer = ToUTF8Buffer (str, charCount, maxUtf8Len);
return shared_ptr<VolumePassword>(new VolumePassword (*utf8Buffer));
}
else
return shared_ptr<VolumePassword>(new VolumePassword ());
}
- shared_ptr<SecureBuffer> ToUTF8Buffer (const wchar_t* str, size_t charCount)
+ shared_ptr<SecureBuffer> ToUTF8Buffer (const wchar_t* str, size_t charCount, size_t maxUtf8Len)
{
if (charCount == (size_t) -1)
charCount = wcslen (str);
@@ -797,8 +813,13 @@ namespace VeraCrypt
ulen = utf8.FromWChar ((char*) (byte*) passwordBuf, ulen, str, charCount);
if (wxCONV_FAILED == ulen)
throw PasswordUTF8Invalid (SRC_POS);
- if (ulen > VolumePassword::MaxSize)
- throw PasswordUTF8TooLong (SRC_POS);
+ if (ulen > maxUtf8Len)
+ {
+ if (maxUtf8Len == VolumePassword::MaxLegacySize)
+ throw PasswordLegacyUTF8TooLong (SRC_POS);
+ else
+ throw PasswordUTF8TooLong (SRC_POS);
+ }
ConstBufferPtr utf8Buffer ((byte*) passwordBuf, ulen);
return shared_ptr<SecureBuffer>(new SecureBuffer (utf8Buffer));
diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h
index cc4c317..00dabfd 100644
--- a/src/Main/CommandLineInterface.h
+++ b/src/Main/CommandLineInterface.h
@@ -83,6 +83,11 @@ namespace VeraCrypt
VolumeType::Enum ArgVolumeType;
bool ArgTrueCryptMode;
shared_ptr<SecureBuffer> ArgTokenPin;
+ bool ArgDisableFileSizeCheck;
+ bool ArgUseLegacyPassword;
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ bool ArgUseDummySudoPassword;
+#endif
bool StartBackgroundTask;
UserPreferences Preferences;
@@ -97,8 +102,8 @@ namespace VeraCrypt
CommandLineInterface &operator= (const CommandLineInterface &);
};
- shared_ptr<VolumePassword> ToUTF8Password (const wchar_t* str, size_t charCount = (size_t) -1);
- shared_ptr<SecureBuffer> ToUTF8Buffer (const wchar_t* str, size_t charCount = (size_t) -1);
+ shared_ptr<VolumePassword> ToUTF8Password (const wchar_t* str, size_t charCount, size_t maxUtf8Len);
+ shared_ptr<SecureBuffer> ToUTF8Buffer (const wchar_t* str, size_t charCount, size_t maxUtf8Len);
extern auto_ptr <CommandLineInterface> CmdLine;
}
diff --git a/src/Main/Forms/DeviceSelectionDialog.cpp b/src/Main/Forms/DeviceSelectionDialog.cpp
index c3a3d84..c886e18 100644
--- a/src/Main/Forms/DeviceSelectionDialog.cpp
+++ b/src/Main/Forms/DeviceSelectionDialog.cpp
@@ -48,13 +48,31 @@ namespace VeraCrypt
foreach_ref (HostDevice &device, DeviceList)
{
- if (device.Size == 0)
- continue;
-
vector <wstring> fields (DeviceListCtrl->GetColumnCount());
-
+
if (DeviceListCtrl->GetItemCount() > 0)
Gui->AppendToListCtrl (DeviceListCtrl, fields);
+
+ // i.e. /dev/rdisk0 might have size = 0 in case open() fails because, for example on OSX,
+ // SIP is enabled on the machine ;
+ // This does not mean that it does not have partitions that have been successfully opened
+ // and have a size != 0 ;
+ // Therefore, we do not show the device ONLY if it does not have partitions with size != 0 ;
+ if (device.Size == 0)
+ {
+ bool bHasNonEmptyPartition = false;
+ foreach_ref (HostDevice &partition, device.Partitions)
+ {
+ if (partition.Size)
+ {
+ bHasNonEmptyPartition = true;
+ break;
+ }
+ }
+
+ if (!bHasNonEmptyPartition)
+ continue;
+ }
#ifdef TC_WINDOWS
fields[ColumnDevice] = StringFormatter (L"{0} {1}:", _("Harddisk"), device.SystemNumber);
@@ -64,11 +82,20 @@ namespace VeraCrypt
fields[ColumnDevice] = wstring (device.Path) + L":";
fields[ColumnMountPoint] = device.MountPoint;
#endif
- fields[ColumnSize] = Gui->SizeToString (device.Size);
+ // If the size of the device is 0, we do not show the size to avoid confusing the user ;
+ if (device.Size)
+ fields[ColumnSize] = Gui->SizeToString (device.Size);
+ else
+ fields[ColumnSize] = L"";
Gui->AppendToListCtrl (DeviceListCtrl, fields, 0, &device);
foreach_ref (HostDevice &partition, device.Partitions)
{
+ // If a partition's size is 0, there is no need to show it in the list
+ // since this means it is not usable (i.e on OSX, because of SIP enabled in the machine) ;
+ if (!partition.Size)
+ continue;
+
fields[ColumnDevice] =
#ifndef TC_WINDOWS
wstring (L" ") +
@@ -113,7 +140,8 @@ namespace VeraCrypt
void DeviceSelectionDialog::OnListItemSelected (wxListEvent& event)
{
HostDevice *device = (HostDevice *) (event.GetItem().GetData());
- if (device)
+ // If a device's size is 0, we do not enable the 'OK' button since it is not usable
+ if (device && device->Size)
{
SelectedDevice = *device;
StdButtonsOK->Enable();
diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.cpp b/src/Main/Forms/EncryptionOptionsWizardPage.cpp
index e20a659..0d899fb 100644
--- a/src/Main/Forms/EncryptionOptionsWizardPage.cpp
+++ b/src/Main/Forms/EncryptionOptionsWizardPage.cpp
@@ -24,6 +24,9 @@ namespace VeraCrypt
: EncryptionOptionsWizardPageBase (parent)
{
+#ifdef TC_MACOSX
+ EncryptionAlgorithmStaticText->Connect( wxEVT_SIZE, wxSizeEventHandler( EncryptionOptionsWizardPage::HandleOnSize ), NULL, this );
+#endif
EncryptionAlgorithms = EncryptionAlgorithm::GetAvailableAlgorithms();
foreach (shared_ptr <EncryptionAlgorithm> ea, EncryptionAlgorithms)
{
@@ -45,6 +48,21 @@ namespace VeraCrypt
}
+#ifdef TC_MACOSX
+ EncryptionOptionsWizardPage::~EncryptionOptionsWizardPage()
+ {
+ EncryptionAlgorithmStaticText->Disconnect( wxEVT_SIZE, wxSizeEventHandler( EncryptionOptionsWizardPage::HandleOnSize ), NULL, this );
+ }
+
+ void EncryptionOptionsWizardPage::HandleOnSize( wxSizeEvent& event )
+ {
+ int width, height;
+ EncryptionAlgorithmStaticText->GetClientSize (&width, &height);
+ EncryptionAlgorithmStaticText->Wrap (width);
+ event.Skip();
+ }
+#endif
+
shared_ptr <EncryptionAlgorithm> EncryptionOptionsWizardPage::GetEncryptionAlgorithm () const
{
return Gui->GetSelectedData <EncryptionAlgorithm> (EncryptionAlgorithmChoice)->GetNew();
diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.h b/src/Main/Forms/EncryptionOptionsWizardPage.h
index b8d42d7..fbc63f9 100644
--- a/src/Main/Forms/EncryptionOptionsWizardPage.h
+++ b/src/Main/Forms/EncryptionOptionsWizardPage.h
@@ -22,6 +22,9 @@ namespace VeraCrypt
public:
EncryptionOptionsWizardPage (wxPanel* parent);
+#ifdef TC_MACOSX
+ ~EncryptionOptionsWizardPage ();
+#endif
shared_ptr <EncryptionAlgorithm> GetEncryptionAlgorithm () const;
shared_ptr <Hash> GetHash () const;
bool IsValid () { return true; }
@@ -37,6 +40,9 @@ namespace VeraCrypt
void OnHashHyperlinkClick (wxHyperlinkEvent& event);
void OnTestButtonClick (wxCommandEvent& event);
+#ifdef TC_MACOSX
+ void HandleOnSize( wxSizeEvent& event );
+#endif
EncryptionAlgorithmList EncryptionAlgorithms;
HashList Hashes;
};
diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp
index ad1a3ee..c0a4070 100644
--- a/src/Main/Forms/Forms.cpp
+++ b/src/Main/Forms/Forms.cpp
@@ -328,7 +328,7 @@ MainFrameBase::MainFrameBase( wxWindow* parent, wxWindowID id, const wxString& t
VolumeStaticBoxSizer->Add( VolumeGridBagSizer, 1, wxEXPAND|wxALL, 4 );
- LowStaticBoxSizer->Add( VolumeStaticBoxSizer, 1, wxEXPAND, 5 );
+ LowStaticBoxSizer->Add( VolumeStaticBoxSizer, 1, wxEXPAND|wxALL, 5 );
LowStaticBoxSizer->Add( 0, 0, 0, 0, 5 );
@@ -344,46 +344,49 @@ MainFrameBase::MainFrameBase( wxWindow* parent, wxWindowID id, const wxString& t
VolumeButton->SetDefault();
VolumeButton->SetMinSize( wxSize( -1,32 ) );
- sbSizer4->Add( VolumeButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP, 2 );
+ sbSizer4->Add( VolumeButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 2 );
gSizer2->Add( sbSizer4, 1, wxEXPAND, 0 );
wxStaticBoxSizer* sbSizer41;
sbSizer41 = new wxStaticBoxSizer( new wxStaticBox( MainPanel, wxID_ANY, wxEmptyString ), wxVERTICAL );
+ sbSizer41->SetMinSize( wxSize( 139,-1 ) );
MountAllDevicesButton = new wxButton( MainPanel, wxID_ANY, _("&Auto-Mount Devices"), wxDefaultPosition, wxDefaultSize, 0 );
MountAllDevicesButton->SetMinSize( wxSize( -1,32 ) );
- sbSizer41->Add( MountAllDevicesButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP, 2 );
+ sbSizer41->Add( MountAllDevicesButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 2 );
- gSizer2->Add( sbSizer41, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
+ gSizer2->Add( sbSizer41, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer42;
sbSizer42 = new wxStaticBoxSizer( new wxStaticBox( MainPanel, wxID_ANY, wxEmptyString ), wxVERTICAL );
+ sbSizer42->SetMinSize( wxSize( 139,-1 ) );
DismountAllButton = new wxButton( MainPanel, wxID_ANY, _("Di&smount All"), wxDefaultPosition, wxDefaultSize, 0 );
DismountAllButton->SetMinSize( wxSize( -1,32 ) );
- sbSizer42->Add( DismountAllButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP, 2 );
+ sbSizer42->Add( DismountAllButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 2 );
- gSizer2->Add( sbSizer42, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
+ gSizer2->Add( sbSizer42, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer43;
sbSizer43 = new wxStaticBoxSizer( new wxStaticBox( MainPanel, wxID_ANY, wxEmptyString ), wxVERTICAL );
+ sbSizer43->SetMinSize( wxSize( 139,-1 ) );
ExitButton = new wxButton( MainPanel, wxID_ANY, _("E&xit"), wxDefaultPosition, wxDefaultSize, 0 );
ExitButton->SetMinSize( wxSize( -1,32 ) );
- sbSizer43->Add( ExitButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP, 2 );
+ sbSizer43->Add( ExitButton, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 2 );
- gSizer2->Add( sbSizer43, 1, wxALIGN_RIGHT|wxEXPAND, 5 );
+ gSizer2->Add( sbSizer43, 1, wxEXPAND, 5 );
- LowStaticBoxSizer->Add( gSizer2, 0, wxEXPAND, 5 );
+ LowStaticBoxSizer->Add( gSizer2, 0, wxEXPAND|wxALL, 5 );
bSizer48->Add( LowStaticBoxSizer, 0, wxEXPAND, 5 );
diff --git a/src/Main/Forms/KeyfilesPanel.cpp b/src/Main/Forms/KeyfilesPanel.cpp
index 71077e8..c1f26d8 100644
--- a/src/Main/Forms/KeyfilesPanel.cpp
+++ b/src/Main/Forms/KeyfilesPanel.cpp
@@ -59,10 +59,8 @@ namespace VeraCrypt
SetDropTarget (new FileDropTarget (this));
KeyfilesListCtrl->SetDropTarget (new FileDropTarget (this));
-#ifdef TC_MACOSX
foreach (wxWindow *c, GetChildren())
c->SetDropTarget (new FileDropTarget (this));
-#endif
UpdateButtons();
}
diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp
index ad5bf5b..9abe255 100644
--- a/src/Main/Forms/MainFrame.cpp
+++ b/src/Main/Forms/MainFrame.cpp
@@ -393,10 +393,8 @@ namespace VeraCrypt
};
SetDropTarget (new FileDropTarget (this));
-#ifdef TC_MACOSX
foreach (wxWindow *c, MainPanel->GetChildren())
c->SetDropTarget (new FileDropTarget (this));
-#endif
// Volume history
VolumeHistory::ConnectComboBox (VolumePathComboBox);
diff --git a/src/Main/Forms/TrueCrypt.fbp b/src/Main/Forms/TrueCrypt.fbp
index 7509f1e..d512ce8 100644
--- a/src/Main/Forms/TrueCrypt.fbp
+++ b/src/Main/Forms/TrueCrypt.fbp
@@ -1373,7 +1373,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxEXPAND</property>
+ <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
@@ -1989,7 +1989,7 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxEXPAND</property>
+ <property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxGridSizer" expanded="1">
<property name="cols">4</property>
@@ -2013,7 +2013,7 @@
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
- <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP</property>
+ <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@@ -2103,19 +2103,19 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
+ <property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"></property>
- <property name="minimum_size">-1,-1</property>
+ <property name="minimum_size">139,-1</property>
<property name="name">sbSizer41</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
- <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP</property>
+ <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@@ -2205,19 +2205,19 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND</property>
+ <property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"></property>
- <property name="minimum_size">-1,-1</property>
+ <property name="minimum_size">139,-1</property>
<property name="name">sbSizer42</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
- <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP</property>
+ <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
@@ -2307,19 +2307,19 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
- <property name="flag">wxALIGN_RIGHT|wxEXPAND</property>
+ <property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label"></property>
- <property name="minimum_size">-1,-1</property>
+ <property name="minimum_size">139,-1</property>
<property name="name">sbSizer43</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="1">
<property name="border">2</property>
- <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP</property>
+ <property name="flag">wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxButton" expanded="1">
<property name="BottomDockable">1</property>
diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp
index b28b1c3..b6d60f4 100644
--- a/src/Main/Forms/VolumeCreationWizard.cpp
+++ b/src/Main/Forms/VolumeCreationWizard.cpp
@@ -175,7 +175,7 @@ namespace VeraCrypt
else if (SelectedVolumeType == VolumeType::Hidden)
{
pageTitle = LangString["SIZE_HIDVOL_TITLE"];
- pageText = LangString["SIZE_HELP_HIDDEN_VOL"] + L"\n\n" + _("Please note that if your operating system does not allocate files from the beginning of the free space, the maximum possible hidden volume size may be much smaller than the size of the free space on the outer volume. This not a bug in VeraCrypt but a limitation of the operating system.");
+ pageText = LangString["SIZE_HELP_HIDDEN_VOL"] + L"\n\n" + _("Please note that if your operating system does not allocate files from the beginning of the free space, the maximum possible hidden volume size may be much smaller than the size of the free space on the outer volume. This is not a bug in VeraCrypt but a limitation of the operating system.");
freeSpaceText = StringFormatter (_("Maximum possible hidden volume size for this volume is {0}."), Gui->SizeToString (MaxHiddenVolumeSize));
}
else
@@ -475,6 +475,7 @@ namespace VeraCrypt
#elif defined (TC_MACOSX)
case VolumeCreationOptions::FilesystemType::MacOsExt: fsFormatter = "newfs_hfs"; break;
case VolumeCreationOptions::FilesystemType::exFAT: fsFormatter = "newfs_exfat"; break;
+ case VolumeCreationOptions::FilesystemType::APFS: fsFormatter = "newfs_apfs"; break;
#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
case VolumeCreationOptions::FilesystemType::UFS: fsFormatter = "newfs" ; break;
#endif
diff --git a/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp b/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp
index ec0d778..3865705 100644
--- a/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp
+++ b/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp
@@ -13,6 +13,7 @@
#include "System.h"
#include "Main/GraphicUserInterface.h"
#include "VolumeFormatOptionsWizardPage.h"
+#include <wx/platinfo.h>
namespace VeraCrypt
{
@@ -40,6 +41,8 @@ namespace VeraCrypt
#elif defined (TC_MACOSX)
FilesystemTypeChoice->Append (L"Mac OS Extended", (void *) VolumeCreationOptions::FilesystemType::MacOsExt);
FilesystemTypeChoice->Append (L"exFAT", (void *) VolumeCreationOptions::FilesystemType::exFAT);
+ if (wxPlatformInfo::Get().CheckOSVersion (10, 13))
+ FilesystemTypeChoice->Append (L"APFS", (void *) VolumeCreationOptions::FilesystemType::APFS);
#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
FilesystemTypeChoice->Append (L"UFS", (void *) VolumeCreationOptions::FilesystemType::UFS);
#endif
@@ -81,6 +84,7 @@ namespace VeraCrypt
case VolumeCreationOptions::FilesystemType::Ext3: FilesystemTypeChoice->SetStringSelection (L"Linux Ext3"); break;
case VolumeCreationOptions::FilesystemType::Ext4: FilesystemTypeChoice->SetStringSelection (L"Linux Ext4"); break;
case VolumeCreationOptions::FilesystemType::MacOsExt: FilesystemTypeChoice->SetStringSelection (L"Mac OS Extended"); break;
+ case VolumeCreationOptions::FilesystemType::APFS: FilesystemTypeChoice->SetStringSelection (L"APFS"); break;
case VolumeCreationOptions::FilesystemType::UFS: FilesystemTypeChoice->SetStringSelection (L"UFS"); break;
default:
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index 2859762..ac30075 100644
--- a/src/Main/Forms/VolumePasswordPanel.cpp
+++ b/src/Main/Forms/VolumePasswordPanel.cpp
@@ -21,6 +21,7 @@ namespace VeraCrypt
VolumePasswordPanel::VolumePasswordPanel (wxWindow* parent, MountOptions* options, shared_ptr <VolumePassword> password, bool disableTruecryptMode, shared_ptr <KeyfileList> keyfiles, bool enableCache, bool enablePassword, bool enableKeyfiles, bool enableConfirmation, bool enablePkcs5Prf, bool isMountPassword, const wxString &passwordLabel)
: VolumePasswordPanelBase (parent), Keyfiles (new KeyfileList), EnablePimEntry (true)
{
+ size_t maxPasswordLength = CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize;
if (keyfiles)
{
*Keyfiles = *keyfiles;
@@ -32,8 +33,8 @@ namespace VeraCrypt
UseKeyfilesCheckBox->SetValue (Gui->GetPreferences().UseKeyfiles && !Keyfiles->empty());
}
- PasswordTextCtrl->SetMaxLength (VolumePassword::MaxSize);
- ConfirmPasswordTextCtrl->SetMaxLength (VolumePassword::MaxSize);
+ PasswordTextCtrl->SetMaxLength (maxPasswordLength);
+ ConfirmPasswordTextCtrl->SetMaxLength (maxPasswordLength);
if (!passwordLabel.empty())
{
@@ -159,10 +160,8 @@ namespace VeraCrypt
if (enableKeyfiles)
{
SetDropTarget (new FileDropTarget (this));
-#ifdef TC_MACOSX
foreach (wxWindow *c, GetChildren())
c->SetDropTarget (new FileDropTarget (this));
-#endif
}
Layout();
@@ -197,9 +196,10 @@ namespace VeraCrypt
FreezeScope freeze (this);
bool isPim = (*textCtrl == VolumePimTextCtrl);
int colspan = isPim? 1 : 2;
+ size_t maxPasswordLength = CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize;
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 : maxPasswordLength);
newTextCtrl->SetValue ((*textCtrl)->GetValue());
newTextCtrl->SetMinSize ((*textCtrl)->GetSize());
@@ -228,12 +228,12 @@ namespace VeraCrypt
{
shared_ptr <VolumePassword> password;
wchar_t passwordBuf[VolumePassword::MaxSize + 1];
- size_t maxPasswordLength = bLegacyPassword? VolumePassword::MaxLegacySize: VolumePassword::MaxSize;
+ size_t maxPasswordLength = (bLegacyPassword || CmdLine->ArgUseLegacyPassword)? VolumePassword::MaxLegacySize: VolumePassword::MaxSize;
finally_do_arg (BufferPtr, BufferPtr (reinterpret_cast <byte *> (passwordBuf), sizeof (passwordBuf)), { finally_arg.Erase(); });
#ifdef TC_WINDOWS
int len = GetWindowText (static_cast <HWND> (textCtrl->GetHandle()), passwordBuf, VolumePassword::MaxSize + 1);
- password = ToUTF8Password (passwordBuf, len);
+ password = ToUTF8Password (passwordBuf, len, maxPasswordLength);
#else
wxString passwordStr (textCtrl->GetValue()); // A copy of the password is created here by wxWidgets, which cannot be erased
for (size_t i = 0; i < passwordStr.size() && i < maxPasswordLength; ++i)
@@ -241,7 +241,7 @@ namespace VeraCrypt
passwordBuf[i] = (wchar_t) passwordStr[i];
passwordStr[i] = L'X';
}
- password = ToUTF8Password (passwordBuf, passwordStr.size() <= maxPasswordLength ? passwordStr.size() : maxPasswordLength);
+ password = ToUTF8Password (passwordBuf, passwordStr.size() <= maxPasswordLength ? passwordStr.size() : maxPasswordLength, maxPasswordLength);
#endif
return password;
}
diff --git a/src/Main/Forms/VolumeSizeWizardPage.cpp b/src/Main/Forms/VolumeSizeWizardPage.cpp
index f404441..3781b05 100644
--- a/src/Main/Forms/VolumeSizeWizardPage.cpp
+++ b/src/Main/Forms/VolumeSizeWizardPage.cpp
@@ -21,7 +21,8 @@ namespace VeraCrypt
MaxVolumeSize (0),
MaxVolumeSizeValid (false),
MinVolumeSize (1),
- SectorSize (sectorSize)
+ SectorSize (sectorSize),
+ AvailableDiskSpace (0)
{
VolumeSizePrefixChoice->Append (LangString["KB"], reinterpret_cast <void *> (1024));
VolumeSizePrefixChoice->Append (LangString["MB"], reinterpret_cast <void *> (1024 * 1024));
@@ -34,6 +35,10 @@ namespace VeraCrypt
VolumeSizeTextCtrl->Disable();
VolumeSizeTextCtrl->SetValue (L"");
}
+ else
+ {
+ AvailableDiskSpace = (uint64) diskSpace.GetValue ();
+ }
FreeSpaceStaticText->SetFont (Gui->GetDefaultBoldFont (this));
@@ -97,7 +102,8 @@ namespace VeraCrypt
{
try
{
- if (GetVolumeSize() >= MinVolumeSize && (!MaxVolumeSizeValid || GetVolumeSize() <= MaxVolumeSize))
+ uint64 uiVolumeSize = GetVolumeSize();
+ if (uiVolumeSize >= MinVolumeSize && (!MaxVolumeSizeValid || uiVolumeSize <= MaxVolumeSize) && (CmdLine->ArgDisableFileSizeCheck || !AvailableDiskSpace || uiVolumeSize <= AvailableDiskSpace))
return true;
}
catch (...) { }
diff --git a/src/Main/Forms/VolumeSizeWizardPage.h b/src/Main/Forms/VolumeSizeWizardPage.h
index e12a5a7..aac41f9 100644
--- a/src/Main/Forms/VolumeSizeWizardPage.h
+++ b/src/Main/Forms/VolumeSizeWizardPage.h
@@ -49,6 +49,7 @@ namespace VeraCrypt
bool MaxVolumeSizeValid;
uint64 MinVolumeSize;
uint32 SectorSize;
+ uint64 AvailableDiskSpace;
};
}
diff --git a/src/Main/Forms/WaitDialog.cpp b/src/Main/Forms/WaitDialog.cpp
index d3372db..2976a6e 100644
--- a/src/Main/Forms/WaitDialog.cpp
+++ b/src/Main/Forms/WaitDialog.cpp
@@ -38,12 +38,14 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (PasswordEmpty);
VC_CONVERT_EXCEPTION (PasswordTooLong);
VC_CONVERT_EXCEPTION (PasswordUTF8TooLong);
+ VC_CONVERT_EXCEPTION (PasswordLegacyUTF8TooLong);
VC_CONVERT_EXCEPTION (PasswordUTF8Invalid);
VC_CONVERT_EXCEPTION (UnportablePassword);
VC_CONVERT_EXCEPTION (ElevationFailed);
VC_CONVERT_EXCEPTION (RootDeviceUnavailable);
VC_CONVERT_EXCEPTION (DriveLetterUnavailable);
VC_CONVERT_EXCEPTION (DriverError);
+ VC_CONVERT_EXCEPTION (DeviceSectorSizeMismatch);
VC_CONVERT_EXCEPTION (EncryptedSystemRequired);
VC_CONVERT_EXCEPTION (HigherFuseVersionRequired);
VC_CONVERT_EXCEPTION (KernelCryptoServiceTestFailed);
diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp
index 99b2caa..b7b4cf4 100755
--- a/src/Main/GraphicUserInterface.cpp
+++ b/src/Main/GraphicUserInterface.cpp
@@ -1309,7 +1309,7 @@ namespace VeraCrypt
#elif defined (TC_MACOSX)
htmlPath += L"/../Resources/doc/HTML/";
#elif defined (TC_UNIX)
- htmlPath = L"/usr/share/veracrypt/doc/HTML/";
+ htmlPath = L"/usr/share/doc/veracrypt/HTML/";
#else
localFile = false;
#endif
diff --git a/src/Main/LanguageStrings.cpp b/src/Main/LanguageStrings.cpp
index 93f9823..efc1bfe 100644
--- a/src/Main/LanguageStrings.cpp
+++ b/src/Main/LanguageStrings.cpp
@@ -75,7 +75,7 @@ namespace VeraCrypt
Map["CHECKING_FS"] = _("Checking the file system on the VeraCrypt volume mounted as {0}...");
Map["REPAIRING_FS"] = _("Attempting to repair the file system on the VeraCrypt volume mounted as {0}...");
Map["UNMOUNT_LOCK_FAILED"] = _("Volume \"{0}\" contains files or folders being used by applications or system.\n\nForce dismount?");
- Map["VOLUME_SIZE_HELP"] = _("Please specify the size of the container to create. Note that the minimum possible size of a volume is 292 KB.");
+ Map["VOLUME_SIZE_HELP"] = _("Please specify the size of the container to create. Note that the minimum possible size of a volume is 292 KiB.");
Map["ENCRYPTION_MODE_NOT_SUPPORTED_BY_KERNEL"] = _("The volume you have mounted uses a mode of operation that is not supported by the Linux kernel. You may experience slow performance when using this volume. To achieve full performance, you should move the data from this volume to a new volume created by VeraCrypt 5.0 or later.");
}
diff --git a/src/Main/Main.make b/src/Main/Main.make
index 581eb34..a154a84 100755
--- a/src/Main/Main.make
+++ b/src/Main/Main.make
@@ -191,74 +191,89 @@ prepare: $(APPNAME)
ifeq "$(TC_BUILD_CONFIG)" "Release"
ifdef TC_NO_GUI
- cp $(PWD)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
+ cp $(BASE_DIR)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
else
- cp $(PWD)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)
+ cp $(BASE_DIR)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)
endif
else
ifdef TC_NO_GUI
- -rm -f $(PWD)/Main/$(APPNAME)_console
- cp $(PWD)/Main/$(APPNAME) $(PWD)/Main/$(APPNAME)_console
- -ln -sf $(PWD)/Main/$(APPNAME)_console $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
+ -rm -f $(BASE_DIR)/Main/$(APPNAME)_console
+ cp $(BASE_DIR)/Main/$(APPNAME) $(BASE_DIR)/Main/$(APPNAME)_console
+ -ln -sf $(BASE_DIR)/Main/$(APPNAME)_console $(APPNAME).app/Contents/MacOS/$(APPNAME)_console
else
- -ln -sf $(PWD)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)
+ -ln -sf $(BASE_DIR)/Main/$(APPNAME) $(APPNAME).app/Contents/MacOS/$(APPNAME)
endif
endif
- cp $(PWD)/Resources/Icons/VeraCrypt.icns $(APPNAME).app/Contents/Resources
- cp $(PWD)/Resources/Icons/VeraCrypt_Volume.icns $(APPNAME).app/Contents/Resources
- cp $(PWD)/../doc/html/* $(APPNAME).app/Contents/Resources/doc/HTML
+ cp $(BASE_DIR)/Resources/Icons/VeraCrypt.icns $(APPNAME).app/Contents/Resources
+ cp $(BASE_DIR)/Resources/Icons/VeraCrypt_Volume.icns $(APPNAME).app/Contents/Resources
+ cp $(BASE_DIR)/../doc/html/* $(APPNAME).app/Contents/Resources/doc/HTML
echo -n APPLTRUE >$(APPNAME).app/Contents/PkgInfo
+ifdef VC_LEGACY_BUILD
+ sed -e 's/_VERSION_/$(patsubst %a,%.1,$(patsubst %b,%.2,$(TC_VERSION)))/' ../Build/Resources/MacOSX/Info.plist.legacy.xml >$(APPNAME).app/Contents/Info.plist
+else
sed -e 's/_VERSION_/$(patsubst %a,%.1,$(patsubst %b,%.2,$(TC_VERSION)))/' ../Build/Resources/MacOSX/Info.plist.xml >$(APPNAME).app/Contents/Info.plist
+endif
codesign -s "Developer ID Application: IDRIX (Z933746L2S)" --timestamp $(APPNAME).app
install: prepare
cp -R $(APPNAME).app /Applications/.
package: prepare
- /usr/local/bin/packagesbuild $(PWD)/Setup/MacOSX/veracrypt.pkgproj
- productsign --sign "Developer ID Installer: IDRIX (Z933746L2S)" --timestamp "$(PWD)/Setup/MacOSX/VeraCrypt $(TC_VERSION).pkg" $(PWD)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg
+ifdef VC_LEGACY_BUILD
+ /usr/local/bin/packagesbuild $(BASE_DIR)/Setup/MacOSX/veracrypt_Legacy.pkgproj
+ productsign --sign "Developer ID Installer: IDRIX (Z933746L2S)" --timestamp "$(BASE_DIR)/Setup/MacOSX/VeraCrypt Legacy $(TC_VERSION).pkg" $(BASE_DIR)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg
+ rm -f $(APPNAME)_Legacy_$(TC_VERSION).dmg
+else
+ /usr/local/bin/packagesbuild $(BASE_DIR)/Setup/MacOSX/veracrypt.pkgproj
+ productsign --sign "Developer ID Installer: IDRIX (Z933746L2S)" --timestamp "$(BASE_DIR)/Setup/MacOSX/VeraCrypt $(TC_VERSION).pkg" $(BASE_DIR)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg
rm -f $(APPNAME)_$(TC_VERSION).dmg
- rm -f "$(PWD)/Setup/MacOSX/template.dmg"
- rm -fr "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
- mkdir -p "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
- bunzip2 -k -f "$(PWD)/Setup/MacOSX/template.dmg.bz2"
- hdiutil attach "$(PWD)/Setup/MacOSX/template.dmg" -noautoopen -quiet -mountpoint "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
- cp "$(PWD)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg" "$(PWD)/Setup/MacOSX/VeraCrypt_dmg/VeraCrypt_Installer.pkg"
- hdiutil detach "$(PWD)/Setup/MacOSX/VeraCrypt_dmg" -quiet -force
- hdiutil convert "$(PWD)/Setup/MacOSX/template.dmg" -quiet -format UDZO -imagekey zlib-level=9 -o $(APPNAME)_$(TC_VERSION).dmg
- rm -f "$(PWD)/Setup/MacOSX/template.dmg"
- rm -fr "$(PWD)/Setup/MacOSX/VeraCrypt_dmg"
+endif
+ rm -f "$(BASE_DIR)/Setup/MacOSX/template.dmg"
+ rm -fr "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_dmg"
+ mkdir -p "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_dmg"
+ bunzip2 -k -f "$(BASE_DIR)/Setup/MacOSX/template.dmg.bz2"
+ hdiutil attach "$(BASE_DIR)/Setup/MacOSX/template.dmg" -noautoopen -quiet -mountpoint "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_dmg"
+ cp "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_$(TC_VERSION).pkg" "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_dmg/VeraCrypt_Installer.pkg"
+ hdiutil detach "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_dmg" -quiet -force
+ifdef VC_LEGACY_BUILD
+ hdiutil convert "$(BASE_DIR)/Setup/MacOSX/template.dmg" -quiet -format UDZO -imagekey zlib-level=9 -o $(APPNAME)_Legacy_$(TC_VERSION).dmg
+else
+ hdiutil convert "$(BASE_DIR)/Setup/MacOSX/template.dmg" -quiet -format UDZO -imagekey zlib-level=9 -o $(APPNAME)_$(TC_VERSION).dmg
+endif
+ rm -f "$(BASE_DIR)/Setup/MacOSX/template.dmg"
+ rm -fr "$(BASE_DIR)/Setup/MacOSX/VeraCrypt_dmg"
endif
ifeq "$(PLATFORM)" "Linux"
prepare: $(APPNAME)
- rm -fr $(PWD)/Setup/Linux/usr
- mkdir -p $(PWD)/Setup/Linux/usr/bin
- mkdir -p $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/HTML
- cp $(PWD)/Main/$(APPNAME) $(PWD)/Setup/Linux/usr/bin/$(APPNAME)
- cp $(PWD)/Setup/Linux/$(APPNAME)-uninstall.sh $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
- chmod +x $(PWD)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
- cp $(PWD)/License.txt $(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/License.txt
- cp $(PWD)/../doc/html/* "$(PWD)/Setup/Linux/usr/share/$(APPNAME)/doc/HTML"
+ rm -fr $(BASE_DIR)/Setup/Linux/usr
+ mkdir -p $(BASE_DIR)/Setup/Linux/usr/bin
+ mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/doc/$(APPNAME)/HTML
+ cp $(BASE_DIR)/Main/$(APPNAME) $(BASE_DIR)/Setup/Linux/usr/bin/$(APPNAME)
+ cp $(BASE_DIR)/Setup/Linux/$(APPNAME)-uninstall.sh $(BASE_DIR)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
+ chmod +x $(BASE_DIR)/Setup/Linux/usr/bin/$(APPNAME)-uninstall.sh
+ cp $(BASE_DIR)/License.txt $(BASE_DIR)/Setup/Linux/usr/share/doc/$(APPNAME)/License.txt
+ cp $(BASE_DIR)/../doc/html/* "$(BASE_DIR)/Setup/Linux/usr/share/doc/$(APPNAME)/HTML"
ifndef TC_NO_GUI
- mkdir -p $(PWD)/Setup/Linux/usr/share/applications
- mkdir -p $(PWD)/Setup/Linux/usr/share/pixmaps
- cp $(PWD)/Resources/Icons/VeraCrypt-256x256.xpm $(PWD)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
- cp $(PWD)/Setup/Linux/$(APPNAME).desktop $(PWD)/Setup/Linux/usr/share/applications/$(APPNAME).desktop
+ mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/applications
+ mkdir -p $(BASE_DIR)/Setup/Linux/usr/share/pixmaps
+ cp $(BASE_DIR)/Resources/Icons/VeraCrypt-256x256.xpm $(BASE_DIR)/Setup/Linux/usr/share/pixmaps/$(APPNAME).xpm
+ cp $(BASE_DIR)/Setup/Linux/$(APPNAME).desktop $(BASE_DIR)/Setup/Linux/usr/share/applications/$(APPNAME).desktop
endif
install: prepare
- cp -R $(CURDIR)/Setup/Linux/usr $(DESTDIR)/.
+ mkdir -p $(DESTDIR)
+ cp -R $(BASE_DIR)/Setup/Linux/usr $(DESTDIR)/
ifeq "$(TC_BUILD_CONFIG)" "Release"
package: prepare
- tar cfz $(PWD)/Setup/Linux/$(PACKAGE_NAME) --directory $(PWD)/Setup/Linux usr
+ tar cfz $(BASE_DIR)/Setup/Linux/$(PACKAGE_NAME) --directory $(BASE_DIR)/Setup/Linux usr
@rm -fr $(INTERNAL_INSTALLER_NAME)
@echo "#!/bin/sh" > $(INTERNAL_INSTALLER_NAME)
@@ -268,14 +283,14 @@ package: prepare
@echo "PACKAGE_START=1107" >> $(INTERNAL_INSTALLER_NAME)
@echo "INSTALLER_TYPE=$(INSTALLER_TYPE)" >> $(INTERNAL_INSTALLER_NAME)
- @cat $(PWD)/Setup/Linux/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
- @cat $(PWD)/Setup/Linux/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
+ @cat $(BASE_DIR)/Setup/Linux/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
+ @cat $(BASE_DIR)/Setup/Linux/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
chmod +x $(INTERNAL_INSTALLER_NAME)
- rm -fr $(PWD)/Setup/Linux/packaging
- mkdir -p $(PWD)/Setup/Linux/packaging
- cp $(INTERNAL_INSTALLER_NAME) $(PWD)/Setup/Linux/packaging/.
- makeself $(PWD)/Setup/Linux/packaging $(PWD)/Setup/Linux/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) Installer" ./$(INTERNAL_INSTALLER_NAME)
+ rm -fr $(BASE_DIR)/Setup/Linux/packaging
+ mkdir -p $(BASE_DIR)/Setup/Linux/packaging
+ cp $(INTERNAL_INSTALLER_NAME) $(BASE_DIR)/Setup/Linux/packaging/.
+ makeself $(BASE_DIR)/Setup/Linux/packaging $(BASE_DIR)/Setup/Linux/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) Installer" ./$(INTERNAL_INSTALLER_NAME)
endif
@@ -283,31 +298,32 @@ endif
ifeq "$(PLATFORM)" "FreeBSD"
prepare: $(APPNAME)
- rm -fr $(PWD)/Setup/FreeBSD/usr
- mkdir -p $(PWD)/Setup/FreeBSD/usr/bin
- mkdir -p $(PWD)/Setup/FreeBSD/usr/share/$(APPNAME)/doc/HTML
- cp $(PWD)/Main/$(APPNAME) $(PWD)/Setup/FreeBSD/usr/bin/$(APPNAME)
- cp $(PWD)/Setup/Linux/$(APPNAME)-uninstall.sh $(PWD)/Setup/FreeBSD/usr/bin/$(APPNAME)-uninstall.sh
- chmod +x $(PWD)/Setup/FreeBSD/usr/bin/$(APPNAME)-uninstall.sh
- cp $(PWD)/License.txt $(PWD)/Setup/FreeBSD/usr/share/$(APPNAME)/doc/License.txt
- cp $(PWD)/../doc/html/* "$(PWD)/Setup/FreeBSD/usr/share/$(APPNAME)/doc/HTML"
+ rm -fr $(BASE_DIR)/Setup/FreeBSD/usr
+ mkdir -p $(BASE_DIR)/Setup/FreeBSD/usr/bin
+ mkdir -p $(BASE_DIR)/Setup/FreeBSD/usr/share/doc/$(APPNAME)/HTML
+ cp $(BASE_DIR)/Main/$(APPNAME) $(BASE_DIR)/Setup/FreeBSD/usr/bin/$(APPNAME)
+ cp $(BASE_DIR)/Setup/Linux/$(APPNAME)-uninstall.sh $(BASE_DIR)/Setup/FreeBSD/usr/bin/$(APPNAME)-uninstall.sh
+ chmod +x $(BASE_DIR)/Setup/FreeBSD/usr/bin/$(APPNAME)-uninstall.sh
+ cp $(BASE_DIR)/License.txt $(BASE_DIR)/Setup/FreeBSD/usr/share/doc/$(APPNAME)/License.txt
+ cp $(BASE_DIR)/../doc/html/* "$(BASE_DIR)/Setup/FreeBSD/usr/share/doc/$(APPNAME)/HTML"
ifndef TC_NO_GUI
- mkdir -p $(PWD)/Setup/FreeBSD/usr/share/applications
- mkdir -p $(PWD)/Setup/FreeBSD/usr/share/pixmaps
- cp $(PWD)/Resources/Icons/VeraCrypt-256x256.xpm $(PWD)/Setup/FreeBSD/usr/share/pixmaps/$(APPNAME).xpm
- cp $(PWD)/Setup/Linux/$(APPNAME).desktop $(PWD)/Setup/FreeBSD/usr/share/applications/$(APPNAME).desktop
+ mkdir -p $(BASE_DIR)/Setup/FreeBSD/usr/share/applications
+ mkdir -p $(BASE_DIR)/Setup/FreeBSD/usr/share/pixmaps
+ cp $(BASE_DIR)/Resources/Icons/VeraCrypt-256x256.xpm $(BASE_DIR)/Setup/FreeBSD/usr/share/pixmaps/$(APPNAME).xpm
+ cp $(BASE_DIR)/Setup/Linux/$(APPNAME).desktop $(BASE_DIR)/Setup/FreeBSD/usr/share/applications/$(APPNAME).desktop
endif
- chown -R root:wheel $(PWD)/Setup/FreeBSD/usr
- chmod -R go-w $(PWD)/Setup/FreeBSD/usr
+ chown -R root:wheel $(BASE_DIR)/Setup/FreeBSD/usr
+ chmod -R go-w $(BASE_DIR)/Setup/FreeBSD/usr
install: prepare
- cp -R $(CURDIR)/Setup/FreeBSD/usr $(DESTDIR)/.
+ mkdir -p $(DESTDIR)
+ cp -R $(BASE_DIR)/Setup/FreeBSD/usr $(DESTDIR)/.
ifeq "$(TC_BUILD_CONFIG)" "Release"
package: prepare
- tar cfz $(PWD)/Setup/FreeBSD/$(PACKAGE_NAME) --directory $(PWD)/Setup/FreeBSD usr
+ tar cfz $(BASE_DIR)/Setup/FreeBSD/$(PACKAGE_NAME) --directory $(BASE_DIR)/Setup/FreeBSD usr
@rm -fr $(INTERNAL_INSTALLER_NAME)
@echo "#!/bin/sh" > $(INTERNAL_INSTALLER_NAME)
@@ -317,14 +333,14 @@ package: prepare
@echo "PACKAGE_START=1107" >> $(INTERNAL_INSTALLER_NAME)
@echo "INSTALLER_TYPE=$(INSTALLER_TYPE)" >> $(INTERNAL_INSTALLER_NAME)
- @cat $(PWD)/Setup/FreeBSD/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
- @cat $(PWD)/Setup/FreeBSD/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
+ @cat $(BASE_DIR)/Setup/FreeBSD/veracrypt_install_template.sh >> $(INTERNAL_INSTALLER_NAME)
+ @cat $(BASE_DIR)/Setup/FreeBSD/$(PACKAGE_NAME) >> $(INTERNAL_INSTALLER_NAME)
chmod +x $(INTERNAL_INSTALLER_NAME)
- rm -fr $(PWD)/Setup/FreeBSD/packaging
- mkdir -p $(PWD)/Setup/FreeBSD/packaging
- cp $(INTERNAL_INSTALLER_NAME) $(PWD)/Setup/FreeBSD/packaging/.
- makeself $(PWD)/Setup/FreeBSD/packaging $(PWD)/Setup/FreeBSD/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) $(SYSTEMNAME) Installer" ./$(INTERNAL_INSTALLER_NAME)
+ rm -fr $(BASE_DIR)/Setup/FreeBSD/packaging
+ mkdir -p $(BASE_DIR)/Setup/FreeBSD/packaging
+ cp $(INTERNAL_INSTALLER_NAME) $(BASE_DIR)/Setup/FreeBSD/packaging/.
+ makeself $(BASE_DIR)/Setup/FreeBSD/packaging $(BASE_DIR)/Setup/FreeBSD/$(INSTALLER_NAME) "VeraCrypt $(TC_VERSION) $(SYSTEMNAME) Installer" ./$(INTERNAL_INSTALLER_NAME)
endif
diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp
index 61b8b8a..4de2cb2 100644
--- a/src/Main/TextUserInterface.cpp
+++ b/src/Main/TextUserInterface.cpp
@@ -20,6 +20,7 @@
#include "Platform/Unix/Process.h"
#endif
+#include <wx/platinfo.h>
#include "Common/SecurityToken.h"
#include "Core/RandomNumberGenerator.h"
#include "Application.h"
@@ -40,7 +41,9 @@ namespace VeraCrypt
#endif
{
FInputStream.reset (new wxFFileInputStream (stdin));
- TextInputStream.reset (new wxTextInputStream (*FInputStream));
+ // Set fallback encoding of the stream converter to UTF-8
+ // to make sure we interpret multibyte symbols properly
+ TextInputStream.reset (new wxTextInputStream (*FInputStream, wxT(" \t"), wxConvAuto(wxFONTENCODING_UTF8)));
}
}
@@ -124,7 +127,7 @@ namespace VeraCrypt
if (verify && verPhase)
{
- shared_ptr <VolumePassword> verPassword = ToUTF8Password (passwordBuf, length);
+ shared_ptr <VolumePassword> verPassword = ToUTF8Password (passwordBuf, length, CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
if (*password != *verPassword)
{
@@ -135,7 +138,7 @@ namespace VeraCrypt
}
}
- password = ToUTF8Password (passwordBuf, length);
+ password = ToUTF8Password (passwordBuf, length, CmdLine->ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize);
if (!verPhase)
{
@@ -785,6 +788,10 @@ namespace VeraCrypt
#elif defined (TC_MACOSX)
ShowInfo (L" 3) Mac OS Extended"); filesystems.push_back (VolumeCreationOptions::FilesystemType::MacOsExt);
ShowInfo (L" 4) exFAT"); filesystems.push_back (VolumeCreationOptions::FilesystemType::exFAT);
+ if (wxPlatformInfo::Get().CheckOSVersion (10, 13))
+ {
+ ShowInfo (L" 5) APFS"); filesystems.push_back (VolumeCreationOptions::FilesystemType::APFS);
+ }
#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
ShowInfo (L" 3) UFS"); filesystems.push_back (VolumeCreationOptions::FilesystemType::UFS);
#endif
@@ -881,6 +888,7 @@ namespace VeraCrypt
#elif defined (TC_MACOSX)
case VolumeCreationOptions::FilesystemType::MacOsExt: fsFormatter = "newfs_hfs"; break;
case VolumeCreationOptions::FilesystemType::exFAT: fsFormatter = "newfs_exfat"; break;
+ case VolumeCreationOptions::FilesystemType::APFS: fsFormatter = "newfs_apfs"; break;
#elif defined (TC_FREEBSD) || defined (TC_SOLARIS)
case VolumeCreationOptions::FilesystemType::UFS: fsFormatter = "newfs" ; break;
#endif
@@ -1056,9 +1064,18 @@ namespace VeraCrypt
slotId = (CK_SLOT_ID) AskSelection (tokens.back().SlotId, tokens.front().SlotId);
}
- shared_ptr <KeyfileList> keyfiles = AskKeyfiles();
- if (keyfiles->empty())
- throw UserAbort();
+ shared_ptr <KeyfileList> keyfiles;
+
+ if (CmdLine->ArgKeyfiles.get() && !CmdLine->ArgKeyfiles->empty())
+ keyfiles = CmdLine->ArgKeyfiles;
+ else if (!Preferences.NonInteractive)
+ {
+ keyfiles = AskKeyfiles();
+ if (keyfiles->empty())
+ throw UserAbort();
+ }
+ else
+ throw MissingArgument (SRC_POS);
foreach_ref (const Keyfile &keyfilePath, *keyfiles)
{
diff --git a/src/Main/TextUserInterface.h b/src/Main/TextUserInterface.h
index 78874b8..95db02d 100644
--- a/src/Main/TextUserInterface.h
+++ b/src/Main/TextUserInterface.h
@@ -47,9 +47,7 @@ namespace VeraCrypt
virtual void ExportSecurityTokenKeyfile () const;
virtual shared_ptr <GetStringFunctor> GetAdminPasswordRequestHandler ();
virtual void ImportSecurityTokenKeyfiles () const;
-#ifndef TC_NO_GUI
virtual bool Initialize (int &argc, wxChar **argv) { return wxAppBase::Initialize(argc, argv); }
-#endif
virtual void InitSecurityTokenLibrary () const;
virtual void ListSecurityTokenKeyfiles () const;
virtual VolumeInfoList MountAllDeviceHostedVolumes (MountOptions &options) const;
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index 3939010..35396b4 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -444,6 +444,7 @@ namespace VeraCrypt
{
#define EX2MSG(exception, message) do { if (ex == typeid (exception)) return (message); } while (false)
EX2MSG (DriveLetterUnavailable, LangString["DRIVE_LETTER_UNAVAILABLE"]);
+ EX2MSG (DeviceSectorSizeMismatch, _("Storage device and VC volume sector size mismatch"));
EX2MSG (EncryptedSystemRequired, _("This operation must be performed only when the system hosted on the volume is running."));
EX2MSG (ExternalException, LangString["EXCEPTION_OCCURRED"]);
EX2MSG (InsufficientData, _("Not enough data available."));
@@ -464,6 +465,7 @@ namespace VeraCrypt
EX2MSG (PasswordOrMountOptionsIncorrect, LangString["PASSWORD_OR_KEYFILE_OR_MODE_WRONG"] + _("\n\nNote: If you are attempting to mount a partition located on an encrypted system drive without pre-boot authentication or to mount the encrypted system partition of an operating system that is not running, you can do so by selecting 'Options >' > 'Mount partition using system encryption'."));
EX2MSG (PasswordTooLong, StringFormatter (_("Password is longer than {0} characters."), (int) VolumePassword::MaxSize));
EX2MSG (PasswordUTF8TooLong, LangString["PASSWORD_UTF8_TOO_LONG"]);
+ EX2MSG (PasswordLegacyUTF8TooLong, LangString["LEGACY_PASSWORD_UTF8_TOO_LONG"]);
EX2MSG (PasswordUTF8Invalid, LangString["PASSWORD_UTF8_INVALID"]);
EX2MSG (PartitionDeviceRequired, _("Partition device required."));
EX2MSG (ProtectionPasswordIncorrect, _("Incorrect password to the protected hidden volume or the hidden volume does not exist."));
@@ -533,6 +535,10 @@ namespace VeraCrypt
Core->SetAdminPasswordCallback (shared_ptr <GetStringFunctor> (new AdminPasswordRequestHandler));
}
+#if defined(TC_LINUX ) || defined (TC_FREEBSD)
+ Core->ForceUseDummySudoPassword (CmdLine->ArgUseDummySudoPassword);
+#endif
+
Core->WarningEvent.Connect (EventConnector <UserInterface> (this, &UserInterface::OnWarning));
Core->VolumeMountedEvent.Connect (EventConnector <UserInterface> (this, &UserInterface::OnVolumeMounted));
@@ -908,7 +914,8 @@ namespace VeraCrypt
wstring pwdInput;
getline(wcin, pwdInput);
- cmdLine.ArgPassword = ToUTF8Password ( pwdInput.c_str (), pwdInput.size ());
+ size_t maxUtf8Len = cmdLine.ArgUseLegacyPassword? VolumePassword::MaxLegacySize : VolumePassword::MaxSize;
+ cmdLine.ArgPassword = ToUTF8Password ( pwdInput.c_str (), pwdInput.size (), maxUtf8Len);
}
switch (cmdLine.ArgCommand)
@@ -1265,7 +1272,7 @@ namespace VeraCrypt
"--size=SIZE[K|M|G|T]\n"
" Use specified size when creating a new volume. If no suffix is indicated,\n"
" then SIZE is interpreted in bytes. Suffixes K, M, G or T can be used to\n"
- " indicate a value in KB, MB, GB or TB respectively.\n"
+ " indicate a value in KiB, MiB, GiB or TiB respectively.\n"
"\n"
"-t, --text\n"
" Use text user interface. Graphical user interface is used by default if\n"
@@ -1575,12 +1582,14 @@ namespace VeraCrypt
VC_CONVERT_EXCEPTION (PasswordEmpty);
VC_CONVERT_EXCEPTION (PasswordTooLong);
VC_CONVERT_EXCEPTION (PasswordUTF8TooLong);
+ VC_CONVERT_EXCEPTION (PasswordLegacyUTF8TooLong);
VC_CONVERT_EXCEPTION (PasswordUTF8Invalid);
VC_CONVERT_EXCEPTION (UnportablePassword);
VC_CONVERT_EXCEPTION (ElevationFailed);
VC_CONVERT_EXCEPTION (RootDeviceUnavailable);
VC_CONVERT_EXCEPTION (DriveLetterUnavailable);
VC_CONVERT_EXCEPTION (DriverError);
+ VC_CONVERT_EXCEPTION (DeviceSectorSizeMismatch);
VC_CONVERT_EXCEPTION (EncryptedSystemRequired);
VC_CONVERT_EXCEPTION (HigherFuseVersionRequired);
VC_CONVERT_EXCEPTION (KernelCryptoServiceTestFailed);