MCPcopy Create free account
hub / github.com/mscdex/ssh2 / sendExtInfo

Function sendExtInfo

lib/protocol/Protocol.js:2111–2134  ·  view source on GitHub ↗
(proto)

Source from the content-addressed store, hash-verified

2109}
2110
2111function sendExtInfo(proto) {
2112 let serverSigAlgs =
2113 'ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521'
2114 + 'rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss';
2115 if (eddsaSupported)
2116 serverSigAlgs = `ssh-ed25519,${serverSigAlgs}`;
2117 const algsLen = Buffer.byteLength(serverSigAlgs);
2118
2119 let p = proto._packetRW.write.allocStart;
2120 const packet = proto._packetRW.write.alloc(1 + 4 + 4 + 15 + 4 + algsLen);
2121
2122 packet[p] = MESSAGE.EXT_INFO;
2123
2124 writeUInt32BE(packet, 1, ++p);
2125
2126 writeUInt32BE(packet, 15, p += 4);
2127 packet.utf8Write('server-sig-algs', p += 4, 15);
2128
2129 writeUInt32BE(packet, algsLen, p += 15);
2130 packet.utf8Write(serverSigAlgs, p += 4, algsLen);
2131
2132 proto._debug && proto._debug('Outbound: Sending EXT_INFO');
2133 sendPacket(proto, proto._packetRW.write.finalize(packet));
2134}
2135
2136module.exports = Protocol;

Callers 1

constructorMethod · 0.85

Calls 3

writeUInt32BEFunction · 0.85
allocMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…