Skip to content

Commit e6f6ee9

Browse files
committed
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.
1 parent 6b832b8 commit e6f6ee9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/crypto_backend/pbkdf_check.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ int crypt_pbkdf_perf(const char *kdf, const char *hash,
408408
if (r < 0)
409409
return r;
410410

411+
if (parallel_threads > pbkdf_limits.max_parallel)
412+
return -EINVAL;
413+
411414
min_memory = pbkdf_limits.min_bench_memory;
412415
if (min_memory > max_memory_kb)
413416
min_memory = max_memory_kb;

0 commit comments

Comments
 (0)