-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ssh: disable wantReply in some requests to comply with OpenSSH
The existing implementation does not comply with OpenSSH, where some requests is sent without wantReply flag. [email protected]: https://github.com/openssh/openssh-portable/blob/V_8_0_P1/ssh.c#L1815 (wantconfirm=0) env: https://github.com/openssh/openssh-portable/blob/V_8_0_P1/clientloop.c#L2299 cancel-tcpip-forward: https://github.com/openssh/openssh-portable/blob/V_8_0_P1/channels.c#L565 [email protected]: https://github.com/openssh/openssh-portable/blob/V_8_0_P1/channels.c#L4017
- Loading branch information
Showing
4 changed files
with
5 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,8 @@ import ( | |
// ForwardToAgent or ForwardToRemote should be called to route | ||
// the authentication requests. | ||
func RequestAgentForwarding(session *ssh.Session) error { | ||
ok, err := session.SendRequest("[email protected]", true, nil) | ||
if err != nil { | ||
return err | ||
} | ||
if !ok { | ||
return errors.New("forwarding request denied") | ||
} | ||
return nil | ||
_, err := session.SendRequest("[email protected]", false, nil) | ||
return err | ||
} | ||
|
||
// ForwardToAgent routes authentication requests to the given keyring. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,10 +100,7 @@ func (l *unixListener) Close() error { | |
m := streamLocalChannelForwardMsg{ | ||
l.socketPath, | ||
} | ||
ok, _, err := l.conn.SendRequest("[email protected]", true, Marshal(&m)) | ||
if err == nil && !ok { | ||
err = errors.New("ssh: [email protected] failed") | ||
} | ||
_, _, err := l.conn.SendRequest("[email protected]", false, Marshal(&m)) | ||
return err | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters