diff --git a/README.md b/README.md index 2d0d2f11..32241cbc 100644 --- a/README.md +++ b/README.md @@ -552,6 +552,8 @@ SSH2Stream methods * **x11**(< _integer_ >channel, < _integer_ >initWindow, < _integer_ >maxPacket, < _object_ >info) - _boolean_ - Writes an X11 channel open packet. `info` must contain `originAddr` and `originPort`. Returns `false` if you should wait for the `continue` event before sending any more traffic. +* **openssh_authAgent**(< _integer_ >channel, < _integer_ >initWindow, < _integer_ >maxPacket) - _boolean_ - Writes an auth-agent@openssh.com channel open packet. Returns `false` if you should wait for the `continue` event before sending any more traffic. + * **openssh_forwardedStreamLocal**(< _integer_ >channel, < _integer_ >initWindow, < _integer_ >maxPacket, < _object_ >info) - _boolean_ - Writes an forwarded-streamlocal@openssh.com channel open packet. `info` must contain `socketPath`. Returns `false` if you should wait for the `continue` event before sending any more traffic. * **exitStatus**(< _integer_ >channel, < _integer_ >exitCode) - _boolean_ - Writes an exit status channel request packet. Returns `false` if you should wait for the `continue` event before sending any more traffic. diff --git a/lib/ssh.js b/lib/ssh.js index 8b4aefa9..1f32bbb6 100644 --- a/lib/ssh.js +++ b/lib/ssh.js @@ -1967,6 +1967,28 @@ SSH2Stream.prototype.x11 = function(chan, initWindow, maxPacket, cfg) { + ', x11)'); return send(this, buf); }; +SSH2Stream.prototype.openssh_authAgent = function(chan, initWindow, maxPacket) { + if (!this.server) + throw new Error('Server-only method called in client mode'); + + var buf = Buffer.allocUnsafe(1 + 4 + 22 + 4 + 4 + 4); + + buf[0] = MESSAGE.CHANNEL_OPEN; + + writeUInt32BE(buf, 22, 1); + buf.write('auth-agent@openssh.com', 5, 22, 'ascii'); + + writeUInt32BE(buf, chan, 27); + + writeUInt32BE(buf, initWindow, 31); + + writeUInt32BE(buf, maxPacket, 35); + + this.debug('DEBUG: Outgoing: Writing CHANNEL_OPEN (' + + chan + + ', auth-agent@openssh.com)'); + return send(this, buf); +}; SSH2Stream.prototype.openssh_forwardedStreamLocal = function(chan, initWindow, maxPacket, cfg) { if (!this.server)