Skip to content

Commit 32f3405

Browse files
authored
Merge pull request #8 from nextcloud/fix-pbkdf2-iterations
fix PBKDF2 iteration selection
2 parents ece248a + 3d01eff commit 32f3405

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server-side-encryption/recover.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ function decryptPrivateKey($file, $password, $keyid) {
316316

317317
// if we need to generate the password then do it via PBKDF2 that matches the
318318
// required key length for the given cipher and the chosen iterations count
319-
if (0 <= $iterations) {
319+
if (0 < $iterations) {
320320
// required before PHP 8.2
321321
$salt = hash("sha256", $keyid.INSTANCEID.SECRET, true);
322322
if ((false !== $salt) && array_key_exists(strtoupper($header[HEADER_CIPHER]), CIPHER_SUPPORT)) {

0 commit comments

Comments
 (0)