- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
var buf = Buffer.allocUnsafe(kexInitSize);
var p = 17;
buf[0] = MESSAGE.KEXINIT;
if (myCookie !== false)
myCookie.copy(buf, 1);
writeUInt32BE(buf, kexBuf.length, p);
p += 4;
kexBuf.copy(buf, p);
p += kexBuf.length;
writeUInt32BE(buf, hostKeyBuf.length, p);
p += 4;
hostKeyBuf.copy(buf, p);
p += hostKeyBuf.length;
writeUInt32BE(buf, algos.cipherBuf.length, p);
p += 4;
algos.cipherBuf.copy(buf, p);
p += algos.cipherBuf.length;
writeUInt32BE(buf, algos.cipherBuf.length, p);
p += 4;
algos.cipherBuf.copy(buf, p);
p += algos.cipherBuf.length;
writeUInt32BE(buf, algos.hmacBuf.length, p);
p += 4;
algos.hmacBuf.copy(buf, p);
p += algos.hmacBuf.length;
writeUInt32BE(buf, algos.hmacBuf.length, p);
p += 4;
algos.hmacBuf.copy(buf, p);
p += algos.hmacBuf.length;
writeUInt32BE(buf, algos.compressBuf.length, p);
p += 4;
algos.compressBuf.copy(buf, p);
p += algos.compressBuf.length;
writeUInt32BE(buf, algos.compressBuf.length, p);
p += 4;
algos.compressBuf.copy(buf, p);
p += algos.compressBuf.length;
// Skip language lists, first_kex_packet_follows, and reserved bytes
buf.fill(0, buf.length - 13);