diff options
Diffstat (limited to 'src/Core')
-rw-r--r-- | src/Core/CoreBase.cpp | 10 | ||||
-rw-r--r-- | src/Core/CoreBase.h | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/Core/CoreBase.cpp b/src/Core/CoreBase.cpp index 038640ca..95e5c206 100644 --- a/src/Core/CoreBase.cpp +++ b/src/Core/CoreBase.cpp | |||
@@ -23,7 +23,7 @@ namespace VeraCrypt | |||
23 | { | 23 | { |
24 | } | 24 | } |
25 | 25 | ||
26 | void CoreBase::ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf) const | 26 | void CoreBase::ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf, int wipeCount) const |
27 | { | 27 | { |
28 | if ((!newPassword || newPassword->Size() < 1) && (!newKeyfiles || newKeyfiles->empty())) | 28 | if ((!newPassword || newPassword->Size() < 1) && (!newKeyfiles || newKeyfiles->empty())) |
29 | throw PasswordEmpty (SRC_POS); | 29 | throw PasswordEmpty (SRC_POS); |
@@ -48,9 +48,9 @@ namespace VeraCrypt | |||
48 | bool backupHeader = false; | 48 | bool backupHeader = false; |
49 | while (true) | 49 | while (true) |
50 | { | 50 | { |
51 | for (int i = 1; i <= SecureWipePassCount; i++) | 51 | for (int i = 1; i <= wipeCount; i++) |
52 | { | 52 | { |
53 | if (i == SecureWipePassCount) | 53 | if (i == wipeCount) |
54 | RandomNumberGenerator::GetData (newSalt); | 54 | RandomNumberGenerator::GetData (newSalt); |
55 | else | 55 | else |
56 | RandomNumberGenerator::GetDataFast (newSalt); | 56 | RandomNumberGenerator::GetDataFast (newSalt); |
@@ -68,10 +68,10 @@ namespace VeraCrypt | |||
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
71 | 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 | 71 | 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 |
72 | { | 72 | { |
73 | shared_ptr <Volume> volume = OpenVolume (volumePath, preserveTimestamps, password, keyfiles); | 73 | shared_ptr <Volume> volume = OpenVolume (volumePath, preserveTimestamps, password, keyfiles); |
74 | ChangePassword (volume, newPassword, newKeyfiles, newPkcs5Kdf); | 74 | ChangePassword (volume, newPassword, newKeyfiles, newPkcs5Kdf, wipeCount); |
75 | } | 75 | } |
76 | 76 | ||
77 | void CoreBase::CoalesceSlotNumberAndMountPoint (MountOptions &options) const | 77 | void CoreBase::CoalesceSlotNumberAndMountPoint (MountOptions &options) const |
diff --git a/src/Core/CoreBase.h b/src/Core/CoreBase.h index 90a52dbe..6ebb76b7 100644 --- a/src/Core/CoreBase.h +++ b/src/Core/CoreBase.h | |||
@@ -28,8 +28,8 @@ namespace VeraCrypt | |||
28 | public: | 28 | public: |
29 | virtual ~CoreBase (); | 29 | virtual ~CoreBase (); |
30 | 30 | ||
31 | virtual void ChangePassword (shared_ptr <Volume> openVolume, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf = shared_ptr <Pkcs5Kdf> ()) const; | 31 | 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; |
32 | 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; | 32 | 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; |
33 | virtual void CheckFilesystem (shared_ptr <VolumeInfo> mountedVolume, bool repair = false) const = 0; | 33 | virtual void CheckFilesystem (shared_ptr <VolumeInfo> mountedVolume, bool repair = false) const = 0; |
34 | virtual void CoalesceSlotNumberAndMountPoint (MountOptions &options) const; | 34 | virtual void CoalesceSlotNumberAndMountPoint (MountOptions &options) const; |
35 | virtual void CreateKeyfile (const FilePath &keyfilePath) const; | 35 | virtual void CreateKeyfile (const FilePath &keyfilePath) const; |
@@ -80,7 +80,6 @@ namespace VeraCrypt | |||
80 | protected: | 80 | protected: |
81 | CoreBase (); | 81 | CoreBase (); |
82 | 82 | ||
83 | static const int SecureWipePassCount = PRAND_DISK_WIPE_PASSES; | ||
84 | bool DeviceChangeInProgress; | 83 | bool DeviceChangeInProgress; |
85 | FilePath ApplicationExecutablePath; | 84 | FilePath ApplicationExecutablePath; |
86 | 85 | ||