Skip to content

Commit 462368b

Browse files
authored
Merge pull request #62840 from nextcloud/backport/62806/stable24
[stable24] fix: clear key password after loading key
2 parents 29f367d + 9f3d39d commit 462368b

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->setPassword('');
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
@@ -60,6 +60,8 @@ public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = n
6060
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
6161
throw new \RuntimeException('unable to load private key');
6262
}
63+
64+
$auth->setPassword('');
6365
$storage->setBackendOption('public_key_auth', $auth);
6466
}
6567
}

0 commit comments

Comments
 (0)