diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-10-26 00:57:44 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-08 23:24:25 +0100 |
commit | 3f2e20e33941c51b3956adc4e653c2ec7457238e (patch) | |
tree | 7e7bb522b3eba823f1e0e30b03e5ccf386c8f204 /src/Common/Volumes.c | |
parent | 714a2ce0ae7e8b2cee32b0d6245a59e787758fc5 (diff) | |
download | VeraCrypt-3f2e20e33941c51b3956adc4e653c2ec7457238e.tar.gz VeraCrypt-3f2e20e33941c51b3956adc4e653c2ec7457238e.zip |
Simplify code handling iterations count: in boot mode, we'll set the correct iterations count inside derive_u_sha256 and derive_u_ripemd160 depending in the value of the iterations parameter. On normal mode, we use normal values of iterations count. Removes the special test parameter from RIPEMD160 functions.
Diffstat (limited to 'src/Common/Volumes.c')
-rw-r--r-- | src/Common/Volumes.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c index 1c0f2485..2bd870bc 100644 --- a/src/Common/Volumes.c +++ b/src/Common/Volumes.c @@ -302,7 +302,7 @@ KeyReady: ; switch (pkcs5_prf)
{
case RIPEMD160:
- derive_key_ripemd160 (TRUE, keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ derive_key_ripemd160 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
break;
@@ -566,10 +566,10 @@ int ReadVolumeHeader (BOOL bBoot, char *header, Password *password, PCRYPTO_INFO // PKCS5 PRF
#ifdef TC_WINDOWS_BOOT_SHA2
derive_key_sha256 (password->Text, (int) password->Length, header + HEADER_SALT_OFFSET,
- PKCS5_SALT_SIZE, bBoot ? 2000 : 5000, dk, sizeof (dk));
+ PKCS5_SALT_SIZE, bBoot, dk, sizeof (dk));
#else
- derive_key_ripemd160 (TRUE, password->Text, (int) password->Length, header + HEADER_SALT_OFFSET,
- PKCS5_SALT_SIZE, bBoot ? 16384 : 32767, dk, sizeof (dk));
+ derive_key_ripemd160 (password->Text, (int) password->Length, header + HEADER_SALT_OFFSET,
+ PKCS5_SALT_SIZE, bBoot, dk, sizeof (dk));
#endif
// Mode of operation
@@ -792,7 +792,7 @@ int CreateVolumeHeaderInMemory (BOOL bBoot, char *header, int ea, int mode, Pass break;
case RIPEMD160:
- derive_key_ripemd160 (TRUE, keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
+ derive_key_ripemd160 (keyInfo.userKey, keyInfo.keyLength, keyInfo.salt,
PKCS5_SALT_SIZE, keyInfo.noIterations, dk, GetMaxPkcs5OutSize());
break;
|