mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Move PBKDF2 into crypto backend wrapper.
Implement new KDF bechmark check. Use internal openssl kdf (and prepare gcrypt one).
This commit is contained in:
@@ -298,3 +298,17 @@ int crypt_backend_rng(char *buffer, size_t length, int quality, int fips)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* PBKDF */
|
||||
int crypt_pbkdf(const char *kdf, const char *hash,
|
||||
const char *password, size_t password_length,
|
||||
const char *salt, size_t salt_length,
|
||||
char *key, size_t key_length,
|
||||
unsigned int iterations)
|
||||
{
|
||||
if (!kdf || strncmp(kdf, "pbkdf2", 6))
|
||||
return -EINVAL;
|
||||
|
||||
return pkcs5_pbkdf2(hash, password, password_length, salt, salt_length,
|
||||
iterations, key_length, key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user