Skip to content

Commit eef3f3a

Browse files
icewind1991backportbot[bot]
authored andcommitted
fix: fix sftp key loading
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent b84c9db commit eef3f3a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ 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+
if (!$auth instanceof RSA\PrivateKey) {
65+
throw new \RuntimeException('Loaded key is not a private key');
66+
}
6367
$storage->setBackendOption('public_key_auth', $auth);
6468
}
6569
}

0 commit comments

Comments
 (0)