Skip to content

Commit dbe9d8a

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

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
@@ -49,6 +49,10 @@ public function manipulateStorageConfig(StorageConfig &$storage, ?IUser $user =
4949
throw new \RuntimeException('unable to load private key');
5050
}
5151
}
52+
53+
if (!$auth instanceof RSA\PrivateKey) {
54+
throw new \RuntimeException('Loaded key is not a private key');
55+
}
5256
$storage->setBackendOption('public_key_auth', $auth);
5357
}
5458
}

0 commit comments

Comments
 (0)