mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Do not allow PBKDF benchmark over maximum allowed threads.
Unfortunatelly the benchmark function cannot return corrected parallel cost, so it must fail. Note that some backends (like OpenSSL) also limits maximal thread count, so currently it was clapped at 4 for luksFormat and 8 for benchmark. This patch set it all to PBKDF internal parallel limit.
This commit is contained in:
@@ -408,6 +408,9 @@ int crypt_pbkdf_perf(const char *kdf, const char *hash,
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (parallel_threads > pbkdf_limits.max_parallel)
|
||||
return -EINVAL;
|
||||
|
||||
min_memory = pbkdf_limits.min_bench_memory;
|
||||
if (min_memory > max_memory_kb)
|
||||
min_memory = max_memory_kb;
|
||||
|
||||
Reference in New Issue
Block a user