Fix privateKey/publicKey casing in ssh2-streams

This commit is contained in:
Rafal Witczak
2018-11-15 11:14:43 +01:00
parent dbfa83b85e
commit aa58604c7a
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -659,8 +659,8 @@ export interface HostKeys {
}
export interface HostKey {
privatekey: ParsedKey;
publickey: ParsedKey;
privateKey: ParsedKey;
publicKey: ParsedKey;
}
/**
+3 -2
View File
@@ -2,16 +2,17 @@ import * as stream from "stream";
import * as ssh2 from "ssh2-streams";
declare const SERVER_KEY: string;
declare const HOST_KEYS: { 'ssh-rsa': ssh2.HostKey };
declare const HOST_KEY: { publicKey: ssh2.ParsedKey; privateKey: ssh2.ParsedKey };
declare const clientBufStream: stream.Transform & { buffer: string; };
declare const serverBufStream: stream.Transform & { buffer: string; };
declare const parsedKey: ssh2.ParsedKey;
declare const prompts: ssh2.Prompt[];
declare const buffer: Buffer;
const hostKeys = { 'ssh-rsa': HOST_KEY };
const algos = ['ssh-dss', 'ssh-rsa', 'ecdsa-sha2-nistp521'];
const client = new ssh2.SSH2Stream({ algorithms: { serverHostKey: algos } });
const server = new ssh2.SSH2Stream({ server: true, hostKeys: HOST_KEYS });
const server = new ssh2.SSH2Stream({ server: true, hostKeys: hostKeys });
client
.pipe(server)