VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Core
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-07-27 01:29:45 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 22:21:49 (GMT)
commitcb6dad6bd21d66cd28b3ef47e3540316ee9913c3 (patch)
tree276b2329a3b0cb5a1f5ac8e49abcd5ad0ff8703b /src/Core
parent4d8d59c23d8f7ea0ad1f6dda0facd26dad1f7660 (diff)
downloadVeraCrypt-cb6dad6bd21d66cd28b3ef47e3540316ee9913c3.zip
VeraCrypt-cb6dad6bd21d66cd28b3ef47e3540316ee9913c3.tar.gz
Linux/MacOSX port of manual selection of number of passes for volume header over-write operation.
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/CoreBase.cpp10
-rw-r--r--src/Core/CoreBase.h5
2 files changed, 7 insertions, 8 deletions
diff --git a/src/Core/CoreBase.cpp b/src/Core/CoreBase.cpp
index 038640c..95e5c20 100644
--- a/src/Core/CoreBase.cpp
+++ b/src/Core/CoreBase.cpp
@@ -23,7 +23,7 @@ namespace VeraCrypt
{
}
- void CoreBase::ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf) const
+ void CoreBase::ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf, int wipeCount) const
{
if ((!newPassword || newPassword->Size() < 1) && (!newKeyfiles || newKeyfiles->empty()))
throw PasswordEmpty (SRC_POS);
@@ -48,9 +48,9 @@ namespace VeraCrypt
bool backupHeader = false;
while (true)
{
- for (int i = 1; i <= SecureWipePassCount; i++)
+ for (int i = 1; i <= wipeCount; i++)
{
- if (i == SecureWipePassCount)
+ if (i == wipeCount)
RandomNumberGenerator::GetData (newSalt);
else
RandomNumberGenerator::GetDataFast (newSalt);
@@ -68,10 +68,10 @@ namespace VeraCrypt
}
}
- void CoreBase::ChangePassword (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf) const
+ void CoreBase::ChangePassword (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf, int wipeCount) const
{
shared_ptr <Volume> volume = OpenVolume (volumePath, preserveTimestamps, password, keyfiles);
- ChangePassword (volume, newPassword, newKeyfiles, newPkcs5Kdf);
+ ChangePassword (volume, newPassword, newKeyfiles, newPkcs5Kdf, wipeCount);
}
void CoreBase::CoalesceSlotNumberAndMountPoint (MountOptions &options) const
diff --git a/src/Core/CoreBase.h b/src/Core/CoreBase.h
index 90a52db..6ebb76b 100644
--- a/src/Core/CoreBase.h
+++ b/src/Core/CoreBase.h
@@ -28,8 +28,8 @@ namespace VeraCrypt
public:
virtual ~CoreBase ();
- virtual void ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf = shared_ptr <Pkcs5Kdf> ()) const;
- virtual void ChangePassword (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf = shared_ptr <Pkcs5Kdf> ()) const;
+ virtual void ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf = shared_ptr <Pkcs5Kdf> (), int wipeCount = PRAND_HEADER_WIPE_PASSES) const;
+ virtual void ChangePassword (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf = shared_ptr <Pkcs5Kdf> (), int wipeCount = PRAND_HEADER_WIPE_PASSES) const;
virtual void CheckFilesystem (shared_ptr <VolumeInfo> mountedVolume, bool repair = false) const = 0;
virtual void CoalesceSlotNumberAndMountPoint (MountOptions &options) const;
virtual void CreateKeyfile (const FilePath &keyfilePath) const;
@@ -80,7 +80,6 @@ namespace VeraCrypt
protected:
CoreBase ();
- static const int SecureWipePassCount = PRAND_DISK_WIPE_PASSES;
bool DeviceChangeInProgress;
FilePath ApplicationExecutablePath;