From 9913af3a8ed61333cafd0e611f214f7c86652423 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 24 Jun 2015 14:14:34 +0200 Subject: Linux/MacOSX: first dynamic mode implementation --- src/Volume/Volume.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/Volume/Volume.cpp') diff --git a/src/Volume/Volume.cpp b/src/Volume/Volume.cpp index 51ebf300..ff373029 100755 --- a/src/Volume/Volume.cpp +++ b/src/Volume/Volume.cpp @@ -24,7 +24,8 @@ namespace VeraCrypt TopWriteOffset (0), TotalDataRead (0), TotalDataWritten (0), - TrueCryptMode (false) + TrueCryptMode (false), + Pim (0) { } @@ -63,7 +64,7 @@ namespace VeraCrypt return EA->GetMode(); } - void Volume::Open (const VolumePath &volumePath, bool preserveTimestamps, shared_ptr password, shared_ptr kdf, bool truecryptMode, shared_ptr keyfiles, VolumeProtection::Enum protection, shared_ptr protectionPassword, shared_ptr protectionKdf, shared_ptr protectionKeyfiles, bool sharedAccessAllowed, VolumeType::Enum volumeType, bool useBackupHeaders, bool partitionInSystemEncryptionScope) + void Volume::Open (const VolumePath &volumePath, bool preserveTimestamps, shared_ptr password, int pim, shared_ptr kdf, bool truecryptMode, shared_ptr keyfiles, VolumeProtection::Enum protection, shared_ptr protectionPassword, int protectionPim, shared_ptr protectionKdf, shared_ptr protectionKeyfiles, bool sharedAccessAllowed, VolumeType::Enum volumeType, bool useBackupHeaders, bool partitionInSystemEncryptionScope) { make_shared_auto (File, file); @@ -94,10 +95,10 @@ namespace VeraCrypt throw; } - return Open (file, password, kdf, truecryptMode, keyfiles, protection, protectionPassword, protectionKdf,protectionKeyfiles, volumeType, useBackupHeaders, partitionInSystemEncryptionScope); + return Open (file, password, pim, kdf, truecryptMode, keyfiles, protection, protectionPassword, protectionPim, protectionKdf,protectionKeyfiles, volumeType, useBackupHeaders, partitionInSystemEncryptionScope); } - void Volume::Open (shared_ptr volumeFile, shared_ptr password, shared_ptr kdf, bool truecryptMode, shared_ptr keyfiles, VolumeProtection::Enum protection, shared_ptr protectionPassword, shared_ptr protectionKdf,shared_ptr protectionKeyfiles, VolumeType::Enum volumeType, bool useBackupHeaders, bool partitionInSystemEncryptionScope) + void Volume::Open (shared_ptr volumeFile, shared_ptr password, int pim, shared_ptr kdf, bool truecryptMode, shared_ptr keyfiles, VolumeProtection::Enum protection, shared_ptr protectionPassword, int protectionPim, shared_ptr protectionKdf,shared_ptr protectionKeyfiles, VolumeType::Enum volumeType, bool useBackupHeaders, bool partitionInSystemEncryptionScope) { if (!volumeFile) throw ParameterIncorrect (SRC_POS); @@ -187,7 +188,7 @@ namespace VeraCrypt shared_ptr header = layout->GetHeader(); - if (header->Decrypt (headerBuffer, *passwordKey, kdf, truecryptMode, layout->GetSupportedKeyDerivationFunctions(truecryptMode), layoutEncryptionAlgorithms, layoutEncryptionModes)) + if (header->Decrypt (headerBuffer, *passwordKey, pim, kdf, truecryptMode, layout->GetSupportedKeyDerivationFunctions(truecryptMode), layoutEncryptionAlgorithms, layoutEncryptionModes)) { // Header decrypted @@ -200,6 +201,7 @@ namespace VeraCrypt } TrueCryptMode = truecryptMode; + Pim = pim; Type = layout->GetType(); SectorSize = header->GetSectorSize(); @@ -237,9 +239,9 @@ namespace VeraCrypt Volume protectedVolume; protectedVolume.Open (VolumeFile, - protectionPassword, protectionKdf, truecryptMode, protectionKeyfiles, + protectionPassword, protectionPim, protectionKdf, truecryptMode, protectionKeyfiles, VolumeProtection::ReadOnly, - shared_ptr (), shared_ptr (),shared_ptr (), + shared_ptr (), 0, shared_ptr (),shared_ptr (), VolumeType::Hidden, useBackupHeaders); -- cgit v1.2.3