Skip to content

Commit bf8ad96

Browse files
committed
Server: fix new OpenSSH key usage
Fixes: #766
1 parent 6c3c02f commit bf8ad96

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/server.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ function Server(cfg, listener) {
4747
privateKey = parseKey(hostKeys_[i].key, hostKeys_[i].passphrase);
4848
if (privateKey instanceof Error)
4949
throw new Error('Cannot parse privateKey: ' + privateKey.message);
50+
if (Array.isArray(privateKey))
51+
privateKey = privateKey[0]; // OpenSSH's newer format only stores 1 key for now
5052
if (privateKey.getPrivatePEM() === null)
5153
throw new Error('privateKey value contains an invalid private key');
5254
if (hostKeys[privateKey.type])

0 commit comments

Comments
 (0)