Skip to content

Commit 8d6b85a

Browse files
committed
Add server-side auth-agent
1 parent 3139ca8 commit 8d6b85a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,8 @@ You can find more examples in the `examples` directory of this repository.
941941

942942
* **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.
943943

944+
* **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.
945+
944946
* **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.
945947

946948
* **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.

lib/server.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ Client.prototype.forwardOut = function(boundAddr, boundPort, remoteAddr,
648648
return openChannel(this, 'forwarded-tcpip', opts, cb);
649649
};
650650

651+
Client.prototype.openssh_authAgent = function(cb) {
652+
return openChannel(this, 'auth-agent@openssh.com', cb);
653+
};
654+
651655
Client.prototype.openssh_forwardOutStreamLocal = function(socketPath, cb) {
652656
var opts = {
653657
socketPath: socketPath
@@ -1123,6 +1127,8 @@ function openChannel(self, type, opts, cb) {
11231127
ret = sshstream.forwardedTcpip(localChan, initWindow, maxPacket, opts);
11241128
else if (type === 'x11')
11251129
ret = sshstream.x11(localChan, initWindow, maxPacket, opts);
1130+
else if(type === 'auth-agent@openssh.com')
1131+
ret = sshstream.openssh_authAgent(localChan, initWindow, maxPacket);
11261132
else if (type === 'forwarded-streamlocal@openssh.com') {
11271133
ret = sshstream.openssh_forwardedStreamLocal(localChan,
11281134
initWindow,

0 commit comments

Comments
 (0)