Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [email protected] support #132

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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 [email protected] 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.
Expand Down
22 changes: 22 additions & 0 deletions lib/ssh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('[email protected]', 5, 22, 'ascii');

writeUInt32BE(buf, chan, 27);

writeUInt32BE(buf, initWindow, 31);

writeUInt32BE(buf, maxPacket, 35);

this.debug('DEBUG: Outgoing: Writing CHANNEL_OPEN ('
+ chan
+ ', [email protected])');
return send(this, buf);
};
SSH2Stream.prototype.openssh_forwardedStreamLocal = function(chan, initWindow,
maxPacket, cfg) {
if (!this.server)
Expand Down