From 07156b6c09165cf61a6bd499d26151d1f32bf3a9 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 19 Dec 2014 18:18:23 +0100 Subject: 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. --- src/Volume/VolumeHeader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/Volume/VolumeHeader.cpp (limited to 'src/Volume/VolumeHeader.cpp') diff --git a/src/Volume/VolumeHeader.cpp b/src/Volume/VolumeHeader.cpp old mode 100644 new mode 100755 index e7a47d29..fbdece50 --- a/src/Volume/VolumeHeader.cpp +++ b/src/Volume/VolumeHeader.cpp @@ -78,7 +78,7 @@ namespace VeraCrypt EncryptNew (headerBuffer, options.Salt, options.HeaderKey, options.Kdf); } - bool VolumeHeader::Decrypt (const ConstBufferPtr &encryptedData, const VolumePassword &password, const Pkcs5KdfList &keyDerivationFunctions, const EncryptionAlgorithmList &encryptionAlgorithms, const EncryptionModeList &encryptionModes) + bool VolumeHeader::Decrypt (const ConstBufferPtr &encryptedData, const VolumePassword &password, shared_ptr kdf, const Pkcs5KdfList &keyDerivationFunctions, const EncryptionAlgorithmList &encryptionAlgorithms, const EncryptionModeList &encryptionModes) { if (password.Size() < 1) throw PasswordEmpty (SRC_POS); @@ -89,6 +89,9 @@ namespace VeraCrypt foreach (shared_ptr pkcs5, keyDerivationFunctions) { + if (kdf && (kdf->GetName() != pkcs5->GetName())) + continue; + pkcs5->DeriveKey (headerKey, password, salt); foreach (shared_ptr mode, encryptionModes) -- cgit v1.2.3