Skip to content

Commit cfbacd2

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 19bef56 commit cfbacd2

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
@@ -67,6 +67,7 @@ public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = n
6767
throw new \RuntimeException('unable to load private key');
6868
}
6969
}
70+
$auth = $auth->withPassword('');
7071
$storage->setBackendOption('public_key_auth', $auth);
7172
}
7273

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = n
6868
if (!$auth instanceof RSA\PrivateKey) {
6969
throw new \RuntimeException('Loaded key is not a private key');
7070
}
71+
72+
$auth = $auth->withPassword('');
7173
$storage->setBackendOption('public_key_auth', $auth);
7274
}
7375
}

0 commit comments

Comments
 (0)