Skip to content

Commit 19bef56

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

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
@@ -64,6 +64,10 @@ public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = n
6464
throw new \RuntimeException('unable to load private key');
6565
}
6666
}
67+
68+
if (!$auth instanceof RSA\PrivateKey) {
69+
throw new \RuntimeException('Loaded key is not a private key');
70+
}
6771
$storage->setBackendOption('public_key_auth', $auth);
6872
}
6973
}

0 commit comments

Comments
 (0)