Skip to content

Commit

Permalink
Add server-side auth-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
131 committed Sep 16, 2019
1 parent bcb32bc commit c85ed55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,8 @@ You can find more examples in the `examples` directory of this repository.

* **forwardOut**(< _string_ >boundAddr, < _integer_ >boundPort, < _string_ >remoteAddr, < _integer_ >remotePort, < _function_ >callback) - _boolean_ - Alert the client of an incoming TCP connection on `boundAddr` on port `boundPort` from `remoteAddr` on port `remotePort`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic.

* **openssh_authAgent**(< _function_ >callback) - _boolean_ - Alert the client of an incoming `ssh-agent` socket connection. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic.

* **openssh_forwardOutStreamLocal**(< _string_ >socketPath, < _function_ >callback) - _boolean_ - Alert the client of an incoming UNIX domain socket connection on `socketPath`. `callback` has 2 parameters: < _Error_ >err, < _Channel_ >stream. Returns `false` if you should wait for the `continue` event before sending any more traffic.

* **rekey**([< _function_ >callback]) - _boolean_ - Initiates a rekeying with the client. If `callback` is supplied, it is added as a one-time handler for the `rekey` event. Returns `false` if you should wait for the `continue` event before sending any more traffic.
Expand Down
6 changes: 6 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,10 @@ Client.prototype.forwardOut = function(boundAddr, boundPort, remoteAddr,
return openChannel(this, 'forwarded-tcpip', opts, cb);
};

Client.prototype.openssh_authAgent = function(cb) {
return openChannel(this, '[email protected]', cb);
};

Client.prototype.openssh_forwardOutStreamLocal = function(socketPath, cb) {
var opts = {
socketPath: socketPath
Expand Down Expand Up @@ -1123,6 +1127,8 @@ function openChannel(self, type, opts, cb) {
ret = sshstream.forwardedTcpip(localChan, initWindow, maxPacket, opts);
else if (type === 'x11')
ret = sshstream.x11(localChan, initWindow, maxPacket, opts);
else if (type === '[email protected]')
ret = sshstream.openssh_authAgent(localChan, initWindow, maxPacket);
else if (type === '[email protected]') {
ret = sshstream.openssh_forwardedStreamLocal(localChan,
initWindow,
Expand Down

0 comments on commit c85ed55

Please sign in to comment.