VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Volume/VolumeHeader.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-19 18:18:23 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-12-19 18:41:41 +0100
commit07156b6c09165cf61a6bd499d26151d1f32bf3a9 (patch)
tree165e39c03eaff470c42ef8e3af8f2c3de03b6465 /src/Volume/VolumeHeader.cpp
parent18dc75ee629c5f7af61bf8393dbb693cdd78b235 (diff)
downloadVeraCrypt-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/Volume/VolumeHeader.cpp')
-rwxr-xr-x[-rw-r--r--]src/Volume/VolumeHeader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Volume/VolumeHeader.cpp b/src/Volume/VolumeHeader.cpp
index e7a47d29..fbdece50 100644..100755
--- 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 <Pkcs5Kdf> 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 <Pkcs5Kdf> pkcs5, keyDerivationFunctions)
{
+ if (kdf && (kdf->GetName() != pkcs5->GetName()))
+ continue;
+
pkcs5->DeriveKey (headerKey, password, salt);
foreach (shared_ptr <EncryptionMode> mode, encryptionModes)