mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Change PBKDF insterface to allow forced iterations (time cost) count.
Also move functions to separate utils_pbkdf.c file. PBKDF can be now set for any context. TODO: new setting is not covered by tests.
This commit is contained in:
@@ -292,10 +292,15 @@ int crypt_benchmark_pbkdf_internal(struct crypt_device *cd,
|
||||
|
||||
/* Already benchmarked */
|
||||
if (pbkdf->iterations) {
|
||||
log_dbg("Reusing PBKDF benchmark values.");
|
||||
log_dbg("Reusing PBKDF values.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pbkdf->flags & CRYPT_PBKDF_NO_BENCHMARK) {
|
||||
log_err(cd, _("PBKDF benchmark disabled but iterations not set.\n"));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!strcmp(pbkdf->type, CRYPT_KDF_PBKDF2)) {
|
||||
/*
|
||||
* For PBKDF2 it is enouch to run benchmark for only 1 second
|
||||
|
||||
Reference in New Issue
Block a user