diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-30 17:01:49 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-30 17:06:20 +0100 |
commit | c178e325b807258199ae45b2c50c265b4d7ce7af (patch) | |
tree | 905297a12e86b71d4611ff13d1df7e99c1e20b61 /src/Core/CoreBase.cpp | |
parent | 8d787dcd7128fce554f473da62e20162b0b6c9c4 (diff) | |
download | VeraCrypt-c178e325b807258199ae45b2c50c265b4d7ce7af.tar.gz VeraCrypt-c178e325b807258199ae45b2c50c265b4d7ce7af.zip |
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.
Diffstat (limited to 'src/Core/CoreBase.cpp')
-rw-r--r--[-rwxr-xr-x] | src/Core/CoreBase.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Core/CoreBase.cpp b/src/Core/CoreBase.cpp index 0137e204..8dcee144 100755..100644 --- 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> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr <Pkcs5Kdf> kdf, shared_ptr <KeyfileList> keyfiles, shared_ptr <VolumePassword> newPassword, shared_ptr <KeyfileList> newKeyfiles, shared_ptr <Pkcs5Kdf> newPkcs5Kdf, int wipeCount) const + void CoreBase::ChangePassword (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr <Pkcs5Kdf> kdf, bool truecryptMode, 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, kdf, keyfiles); + shared_ptr <Volume> 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 <Volume> CoreBase::OpenVolume (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr<Pkcs5Kdf> kdf, shared_ptr <KeyfileList> keyfiles, VolumeProtection::Enum protection, shared_ptr <VolumePassword> protectionPassword, shared_ptr<Pkcs5Kdf> protectionKdf, shared_ptr <KeyfileList> protectionKeyfiles, bool sharedAccessAllowed, VolumeType::Enum volumeType, bool useBackupHeaders, bool partitionInSystemEncryptionScope) const + shared_ptr <Volume> CoreBase::OpenVolume (shared_ptr <VolumePath> volumePath, bool preserveTimestamps, shared_ptr <VolumePassword> password, shared_ptr<Pkcs5Kdf> kdf, bool truecryptMode, shared_ptr <KeyfileList> keyfiles, VolumeProtection::Enum protection, shared_ptr <VolumePassword> protectionPassword, shared_ptr<Pkcs5Kdf> protectionKdf, shared_ptr <KeyfileList> 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; } |