From c178e325b807258199ae45b2c50c265b4d7ce7af Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 30 Dec 2014 17:01:49 +0100 Subject: Linux/MacOSX: Implement TrueCrypt conversion and loading support. Correct many GTK issues linked to multi-threaded origine of events by implementing an automatic mechanism for handling such requests in the main thread. --- src/Core/CoreBase.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) mode change 100755 => 100644 src/Core/CoreBase.cpp (limited to 'src/Core/CoreBase.cpp') diff --git a/src/Core/CoreBase.cpp b/src/Core/CoreBase.cpp old mode 100755 new mode 100644 index 0137e204..8dcee144 --- a/src/Core/CoreBase.cpp +++ b/src/Core/CoreBase.cpp @@ -29,7 +29,15 @@ namespace VeraCrypt throw PasswordEmpty (SRC_POS); if (!newPkcs5Kdf) - newPkcs5Kdf = openVolume->GetPkcs5Kdf(); + { + if (openVolume->GetPkcs5Kdf()->GetTrueCryptMode ()) + { + newPkcs5Kdf.reset (openVolume->GetPkcs5Kdf()->Clone()); + newPkcs5Kdf->SetTrueCryptMode (false); + } + else + newPkcs5Kdf = openVolume->GetPkcs5Kdf(); + } if ((openVolume->GetHeader()->GetFlags() & TC_HEADER_FLAG_ENCRYPTED_SYSTEM) != 0 && openVolume->GetType() == VolumeType::Hidden @@ -68,9 +76,9 @@ namespace VeraCrypt } } - void CoreBase::ChangePassword (shared_ptr volumePath, bool preserveTimestamps, shared_ptr password, shared_ptr kdf, shared_ptr keyfiles, shared_ptr newPassword, shared_ptr newKeyfiles, shared_ptr newPkcs5Kdf, int wipeCount) const + void CoreBase::ChangePassword (shared_ptr volumePath, bool preserveTimestamps, shared_ptr password, shared_ptr kdf, bool truecryptMode, shared_ptr keyfiles, shared_ptr newPassword, shared_ptr newKeyfiles, shared_ptr newPkcs5Kdf, int wipeCount) const { - shared_ptr volume = OpenVolume (volumePath, preserveTimestamps, password, kdf, keyfiles); + shared_ptr volume = OpenVolume (volumePath, preserveTimestamps, password, kdf, truecryptMode, keyfiles); ChangePassword (volume, newPassword, newKeyfiles, newPkcs5Kdf, wipeCount); } @@ -242,10 +250,10 @@ namespace VeraCrypt return GetMountedVolume (volumePath); } - shared_ptr CoreBase::OpenVolume (shared_ptr volumePath, bool preserveTimestamps, shared_ptr password, shared_ptr kdf, shared_ptr keyfiles, VolumeProtection::Enum protection, shared_ptr protectionPassword, shared_ptr protectionKdf, shared_ptr protectionKeyfiles, bool sharedAccessAllowed, VolumeType::Enum volumeType, bool useBackupHeaders, bool partitionInSystemEncryptionScope) const + shared_ptr CoreBase::OpenVolume (shared_ptr 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) const { make_shared_auto (Volume, volume); - volume->Open (*volumePath, preserveTimestamps, password, kdf, keyfiles, protection, protectionPassword, protectionKdf, protectionKeyfiles, sharedAccessAllowed, volumeType, useBackupHeaders, partitionInSystemEncryptionScope); + volume->Open (*volumePath, preserveTimestamps, password, kdf, truecryptMode, keyfiles, protection, protectionPassword, protectionKdf, protectionKeyfiles, sharedAccessAllowed, volumeType, useBackupHeaders, partitionInSystemEncryptionScope); return volume; } -- cgit v1.2.3