go.crypto/ssh/test: improve diagnostics for test failing to get username.

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/8817043
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://codereview.appspot.com/8820043
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://codereview.appspot.com/8661045
go.crypto/ssh: More error reporting improvements.

R=golang-dev, kardianos, dave
CC=golang-dev
https://codereview.appspot.com/8596047
ssh: add Output and CombinedOutput helpers

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/9711043

Committer: Dave Cheney <dave@cheney.net>
go.crypto/ssh: fix test breakage

Followup CL for 9711043. The order that CombinedOutput returns data captured from stdout/stderr is not specified, so we have to test both variants.

Thanks to fullung for the bug report.

R=fullung, kr
CC=golang-dev
https://codereview.appspot.com/9921044
go.crypto/ssh: fix race on mock ssh network connection

Fixes issue 5138.
Fixes issue 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://codereview.appspot.com/9929043
go.crypto/ssh: add a error return to decode(), and avoid casting decode() output.

R=dave, kardianos, agl
CC=gobot, golang-dev
https://codereview.appspot.com/9738053

Committer: Adam Langley <agl@golang.org>
go.crypto/ssh: implement keyboard-interactive auth (RFC 4256), both
on client and server-side.

R=dave, agl
CC=gobot, golang-dev
https://codereview.appspot.com/9853050

Committer: Adam Langley <agl@golang.org>
ssh/terminal: support home, end, up and down keys.

R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/9777043
go.crypto: remove unreachable code.

I ran go vet over all of go.crypto and removed lots of panic("unreachable") that are no longer needed.

R=golang-dev, r, dgryski
CC=golang-dev
https://codereview.appspot.com/10113043
go.crypto: revert 7f5a59ff6b43.

This change reverts https://codereview.appspot.com/10113043/ because
some folks are stuck on 1.0 till 1.1.1 comes out.

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/10151043
go.crypto/nacl/secretbox: fix append behaviour.

secretbox is supposed to append to the given slice, like hash.Sum() and
append(). However, I had a complete brain-fart: I've really no idea what
I was thinking of at the time.

R=golang-dev, sfrithjof, rsc
CC=agl, golang-dev
https://codereview.appspot.com/10099043
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://codereview.appspot.com/9753044

Committer: Dave Cheney <dave@cheney.net>
go.crypto/ssh/test: Run sshd with -e, so the debug output goes onto stderr.

R=dave, agl
CC=golang-dev
https://codereview.appspot.com/10230043

Committer: Dave Cheney <dave@cheney.net>
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://codereview.appspot.com/10049045

Committer: Adam Langley <agl@golang.org>

--HG--
rename : ssh/test/forward_test.go => ssh/test/forward_unix_test.go
go.crypto/ocsp: allow cert-less responses and support making requests.

Some OCSP responses (notably COMODO's) don't use an intermediate
certificate to sign OCSP responses so this change allowed that.

Additionally, a CreateRequest function is added for creating OCSP
requests.

This change makes one API change: SerialNumber becomes a *big.Int to
match crypto/x509. The original code dates to before encoding/asn1
could cope with big.Ints and using a []byte was a workaround for that.

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/10402043
go.crypto/ssh: add hook for host key checking.

R=dave, agl
CC=gobot, golang-dev
https://codereview.appspot.com/9922043

Committer: Adam Langley <agl@golang.org>
go.crypto/ocsp: make the zero value of RequestOptions valid and documented.

R=bradfitz
CC=golang-dev
https://codereview.appspot.com/10431044
go.crypto/ssh/terminal: don't save passwords in history.

The history buffer would recall previously entered lines: including passwords. With this change, lines entered while echo is disabled are no longer put into the history.

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/10853043