Skip to content

Commit 8a65296

Browse files
icewind1991backportbot[bot]
authored andcommitted
fix: clear key password after loading key
fix: clear key password after loading key Signed-off-by: Robin Appelman <robin@icewind.nl> # Conflicts: # apps/files_external/lib/Lib/Auth/PublicKey/RSA.php # Conflicts: # apps/files_external/lib/Lib/Auth/PublicKey/RSA.php # apps/files_external/lib/Lib/Auth/PublicKey/RSAPrivateKey.php [skip ci]
1 parent eef3f3a commit 8a65296

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

apps/files_external/lib/Lib/Auth/PublicKey/RSA.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = n
6262
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
6363
throw new \RuntimeException('unable to load private key');
6464
}
65+
$auth = $auth->withPassword('');
6566
$storage->setBackendOption('public_key_auth', $auth);
6667
}
6768

apps/files_external/lib/Lib/Auth/PublicKey/RSAPrivateKey.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = n
6464
if (!$auth instanceof RSA\PrivateKey) {
6565
throw new \RuntimeException('Loaded key is not a private key');
6666
}
67+
68+
$auth = $auth->withPassword('');
6769
$storage->setBackendOption('public_key_auth', $auth);
6870
}
6971
}

0 commit comments

Comments
 (0)