diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-19 18:18:23 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-12-19 18:41:41 +0100 |
commit | 07156b6c09165cf61a6bd499d26151d1f32bf3a9 (patch) | |
tree | 165e39c03eaff470c42ef8e3af8f2c3de03b6465 /src/Core/MountOptions.cpp | |
parent | 18dc75ee629c5f7af61bf8393dbb693cdd78b235 (diff) | |
download | VeraCrypt-07156b6c09165cf61a6bd499d26151d1f32bf3a9.tar.gz VeraCrypt-07156b6c09165cf61a6bd499d26151d1f32bf3a9.zip |
Linux/MacOSX: Enhance performance by implementing the possibility to choose the correct hash algorithm of volumes during various operations (mount, change password...), both using the GUI and the command line.
Diffstat (limited to 'src/Core/MountOptions.cpp')
-rwxr-xr-x[-rw-r--r--] | src/Core/MountOptions.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Core/MountOptions.cpp b/src/Core/MountOptions.cpp index a09879d8..fb813bf0 100644..100755 --- a/src/Core/MountOptions.cpp +++ b/src/Core/MountOptions.cpp @@ -26,11 +26,21 @@ namespace VeraCrypt TC_CLONE (NoHardwareCrypto); TC_CLONE (NoKernelCrypto); TC_CLONE_SHARED (VolumePassword, Password); + if (other.Kdf) + { + Kdf.reset(other.Kdf->Clone()); + } + else + Kdf.reset(); TC_CLONE_SHARED (VolumePath, Path); TC_CLONE (PartitionInSystemEncryptionScope); TC_CLONE (PreserveTimestamps); TC_CLONE (Protection); TC_CLONE_SHARED (VolumePassword, ProtectionPassword); + if (other.ProtectionKdf) + ProtectionKdf.reset(other.ProtectionKdf->Clone()); + else + ProtectionKdf.reset(); TC_CLONE_SHARED (KeyfileList, ProtectionKeyfiles); TC_CLONE (Removable); TC_CLONE (SharedAccessAllowed); @@ -41,6 +51,7 @@ namespace VeraCrypt void MountOptions::Deserialize (shared_ptr <Stream> stream) { Serializer sr (stream); + wstring nameValue; sr.Deserialize ("CachePassword", CachePassword); sr.Deserialize ("FilesystemOptions", FilesystemOptions); @@ -61,6 +72,14 @@ namespace VeraCrypt Password = Serializable::DeserializeNew <VolumePassword> (stream); else Password.reset(); + + if (!sr.DeserializeBool ("KdfNull")) + { + sr.Deserialize ("Kdf", nameValue); + Kdf = Pkcs5Kdf::GetAlgorithm (nameValue); + } + else + Kdf.reset(); if (!sr.DeserializeBool ("PathNull")) Path.reset (new VolumePath (sr.DeserializeWString ("Path"))); @@ -77,6 +96,14 @@ namespace VeraCrypt else ProtectionPassword.reset(); + if (!sr.DeserializeBool ("ProtectionKdfNull")) + { + sr.Deserialize ("ProtectionKdf", nameValue); + ProtectionKdf = Pkcs5Kdf::GetAlgorithm (nameValue); + } + else + ProtectionKdf.reset(); + ProtectionKeyfiles = Keyfile::DeserializeList (stream, "ProtectionKeyfiles"); sr.Deserialize ("Removable", Removable); sr.Deserialize ("SharedAccessAllowed", SharedAccessAllowed); @@ -106,6 +133,10 @@ namespace VeraCrypt if (Password) Password->Serialize (stream); + sr.Serialize ("KdfNull", Kdf == nullptr); + if (Kdf) + sr.Serialize ("Kdf", Kdf->GetName()); + sr.Serialize ("PathNull", Path == nullptr); if (Path) sr.Serialize ("Path", wstring (*Path)); @@ -118,6 +149,10 @@ namespace VeraCrypt if (ProtectionPassword) ProtectionPassword->Serialize (stream); + sr.Serialize ("ProtectionKdfNull", ProtectionKdf == nullptr); + if (ProtectionKdf) + sr.Serialize ("ProtectionKdf", ProtectionKdf->GetName()); + Keyfile::SerializeList (stream, "ProtectionKeyfiles", ProtectionKeyfiles); sr.Serialize ("Removable", Removable); sr.Serialize ("SharedAccessAllowed", SharedAccessAllowed); |