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

Method authNone

lib/protocol/Protocol.js:868–891  ·  view source on GitHub ↗
(username)

Source from the content-addressed store, hash-verified

866 sendPacket(this, this._packetRW.write.finalize(packet));
867 }
868 authNone(username) {
869 if (this._server)
870 throw new Error('Client-only method called in server mode');
871
872 const userLen = Buffer.byteLength(username);
873 let p = this._packetRW.write.allocStart;
874 const packet = this._packetRW.write.alloc(1 + 4 + userLen + 4 + 14 + 4 + 4);
875
876 packet[p] = MESSAGE.USERAUTH_REQUEST;
877
878 writeUInt32BE(packet, userLen, ++p);
879 packet.utf8Write(username, p += 4, userLen);
880
881 writeUInt32BE(packet, 14, p += userLen);
882 packet.utf8Write('ssh-connection', p += 4, 14);
883
884 writeUInt32BE(packet, 4, p += 14);
885 packet.utf8Write('none', p += 4, 4);
886
887 this._authsQueue.push('none');
888
889 this._debug && this._debug('Outbound: Sending USERAUTH_REQUEST (none)');
890 sendPacket(this, this._packetRW.write.finalize(packet));
891 }
892 authInfoRes(responses) {
893 if (this._server)
894 throw new Error('Client-only method called in server mode');

Callers 1

doNextAuthMethod · 0.80

Calls 4

writeUInt32BEFunction · 0.85
pushMethod · 0.80
allocMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected