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

Method authSuccess

lib/protocol/Protocol.js:1796–1818  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1794 sendPacket(this, this._packetRW.write.finalize(packet));
1795 }
1796 authSuccess() {
1797 if (!this._server)
1798 throw new Error('Server-only method called in client mode');
1799
1800 if (this._authsQueue.length === 0)
1801 throw new Error('No auth in progress');
1802
1803 const p = this._packetRW.write.allocStart;
1804 const packet = this._packetRW.write.alloc(1);
1805
1806 packet[p] = MESSAGE.USERAUTH_SUCCESS;
1807
1808 this._authsQueue.shift();
1809 this._authenticated = true;
1810
1811 this._debug && this._debug('Outbound: Sending USERAUTH_SUCCESS');
1812 sendPacket(this, this._packetRW.write.finalize(packet));
1813
1814 if (this._kex.negotiated.cs.compress === 'zlib@openssh.com')
1815 this._packetRW.read = new ZlibPacketReader();
1816 if (this._kex.negotiated.sc.compress === 'zlib@openssh.com')
1817 this._packetRW.write = new ZlibPacketWriter(this);
1818 }
1819 authPKOK(keyAlgo, key) {
1820 if (!this._server)
1821 throw new Error('Server-only method called in client mode');

Callers 1

onAuthDecideMethod · 0.80

Calls 2

allocMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected