mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-05-23 04:51:32 +00:00
Linux/macOS: Implement missing Argon2 KDF support on Unix
This commit is contained in:
@@ -143,7 +143,9 @@ namespace VeraCrypt
|
||||
SecureBuffer backupHeaderSalt (VolumeHeader::GetSaltSize());
|
||||
RandomNumberGenerator::GetData (backupHeaderSalt);
|
||||
|
||||
Options->VolumeHeaderKdf->DeriveKey (HeaderKey, *PasswordKey, Options->Pim, backupHeaderSalt);
|
||||
int derivationResult = Options->VolumeHeaderKdf->DeriveKey (HeaderKey, *PasswordKey, Options->Pim, backupHeaderSalt);
|
||||
if (derivationResult != 0)
|
||||
throw ExternalException (SRC_POS, Options->VolumeHeaderKdf->GetDerivationFailureMessage (derivationResult));
|
||||
|
||||
Layout->GetHeader()->EncryptNew (backupHeader, backupHeaderSalt, HeaderKey, Options->VolumeHeaderKdf);
|
||||
|
||||
@@ -316,7 +318,9 @@ namespace VeraCrypt
|
||||
// Header key
|
||||
HeaderKey.Allocate (VolumeHeader::GetLargestSerializedKeySize());
|
||||
PasswordKey = Keyfile::ApplyListToPassword (options->Keyfiles, options->Password, options->EMVSupportEnabled);
|
||||
options->VolumeHeaderKdf->DeriveKey (HeaderKey, *PasswordKey, options->Pim, salt);
|
||||
int derivationResult = options->VolumeHeaderKdf->DeriveKey (HeaderKey, *PasswordKey, options->Pim, salt);
|
||||
if (derivationResult != 0)
|
||||
throw ExternalException (SRC_POS, options->VolumeHeaderKdf->GetDerivationFailureMessage (derivationResult));
|
||||
headerOptions.HeaderKey = HeaderKey;
|
||||
|
||||
header->Create (headerBuffer, headerOptions);
|
||||
|
||||
Reference in New Issue
Block a user