Commit Graph
19 Commits
Author SHA1 Message Date
Han-Wen Nienhuys 7f7cbbf18e go.crypto/ssh: close channel feeding tcpListener.
Close both on closing the listener, and on closing the
connection. Test the former case.

R=dave
CC=golang-dev
https://golang.org/cl/11349043
2013-07-22 21:50:13 +10:00
Han-Wen Nienhuys afdc305bc8 go.crypto/ssh: add hook for host key checking.
R=dave, agl
CC=gobot, golang-dev
https://golang.org/cl/9922043
2013-06-21 12:46:35 -04:00
Han-Wen Nienhuys 7cbb17fecb go.crypto/ssh: fix test breakages introduced by 125:40246d2ae2eb
* Remove special handling for dynamically allocated
  ports. This was a bug in OpenSSH 5.x sshd.

* Run the test with a preselected port number.

* Run TestPortForward only on unix platforms.

R=dave, agl
CC=golang-dev
https://golang.org/cl/10049045
2013-06-18 12:43:42 -04:00
Han-Wen Nienhuys b9b3892677 go.crypto/ssh/test: Run sshd with -e, so the debug output goes onto stderr.
R=dave, agl
CC=golang-dev
https://golang.org/cl/10230043
2013-06-18 21:50:58 +10:00
Han-Wen Nienhuys 0d8dc3cd6a go.crypto/ssh: fix and test port forwarding.
Set maxPacket in forwarded connection, and use the requested port
number as key in forwardList.

R=golang-dev, agl, dave
CC=golang-dev
https://golang.org/cl/9753044
2013-06-11 22:10:15 -04:00
Dave Cheney e8889f5e72 go.crypto/ssh: fix race on mock ssh network connection
Fixes golang/go#5138.
Fixes golang/go#4703.

This appears to pass my stress tests with and without the -race detector, but I'd like to see others hit it with their machines.

R=golang-dev, fullung, huin, kardianos, agl
CC=golang-dev
https://golang.org/cl/9929043
2013-06-05 11:19:21 +10:00
David Symonds ac9976b0b7 go.crypto/ssh: More error reporting improvements.
R=golang-dev, kardianos, dave
CC=golang-dev
https://golang.org/cl/8596047
2013-04-26 09:44:04 +10:00
David Symonds 41998200eb go.crypto/ssh/test: Replace FailNow with Fail where it is obvious that the test doesn't want to fail now.
Improve a couple of test error messages too.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/8661045
2013-04-23 12:15:38 +10:00
David Symonds 952dc41929 go.crypto/ssh/test: Fix distracting nil pointer dereference in a test.
If cgo is disabled (such as it appears to be on a subset of builders),
username() panics, and s.cmd is nil; let's not panic while recovering
from a different panic.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/8820043
2013-04-17 17:40:33 +10:00
David Symonds c7af4ef7d9 go.crypto/ssh/test: improve diagnostics for test failing to get username.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/8817043
2013-04-17 16:22:42 +10:00
Albert Strasheim 62eb5d3fac go.crypto/ssh/test: wait on sshd process in tests
R=dave
CC=golang-dev
https://golang.org/cl/8449043
2013-04-07 19:26:33 +10:00
Adam Langley dc703e91d7 ssh/test: deflake session test.
The session test previously had a one second timeout for the output of
stty and this was leading to flakiness. This change removes the timeout
since go test has a generic timeout mechanism.

Additionally, the test was looking for "-echo" in the output to test
the value of the echo flag. However, there are also typically "echoe",
"echok" and "echonl" flags, and "-echo" could be a prefix of any of
time. Thus we now also match a trailing space.

R=golang-dev, rsc, extraterrestrial.neighbour
CC=golang-dev
https://golang.org/cl/7579043
2013-03-08 10:09:40 -05:00
Alex Brainman 97c15b3da8 go.crypto/ssh/test: move some variables into common os source file to fix windows build
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6944048
2012-12-14 18:45:36 +11:00
Shawn Ledbetter 887809b6be ssh: add functions for public keys in wire & auth keys format.
This allows easy import/export of public keys in the format
expected by OpenSSH for authorized_keys files, as well as
allowing comparisons with ServerConfig's PublickeyCallback.
Fixes golang/go#3908.

R=agl, dave, golang-dev, bradfitz
CC=agl, golang-dev
https://golang.org/cl/6855107
2012-12-10 17:43:09 -05:00
Joel Sing ae58a7bde0 go.crypto/ssh: make tests work on non-cgo platforms.
user.Current() currently requires cgo - if an error is returned
attempt to get the username from the environment.

R=golang-dev, minux.ma, bradfitz, dave
CC=golang-dev
https://golang.org/cl/6819113
2012-11-12 02:50:33 +11:00
Ian Lance Taylor 153731a6de go.crypto/ssh/test: don't kill process if it was never started
This case arises if s.cmd.Start fails when called by
server.Dial.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/6821097
2012-11-08 09:08:33 -08:00
Dave Cheney 1582bf0781 go.crypto/ssh: never negotiate unsupported ciphers
Fixes golang/go#4285.

Adding a new cipher that is supported by the remote end, but not supported by our client causes that cipher to be considered a valid candidate. This fails later in setupKeys when there is no cipherModes configuration.

In summary, unsupported ciphers cannot be willed into existence by adding them to the client config. This change enforces this.

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6780047
2012-10-30 18:13:59 +11:00
Willem van der Schyff 2fccde5d00 go.crypto/ssh: add terminal modes to ssh.RequestPty()
R=dave, agl
CC=golang-dev
https://golang.org/cl/6655046
2012-10-21 16:16:55 +11:00
Dave Cheney 0b9766a68d go.crypto/ssh: new test subpackage
This proposal is an attempt to improve the state of functional testing in the ssh package. The previous functional tests required the user to give away some personal details, like their password and private key to run the tests, and so were probably not run as frequently as they should.

R=agl, gustav.paul, kardianos, fullung
CC=golang-dev
https://golang.org/cl/6601043
2012-10-05 11:11:10 +10:00