Commit Graph
20 Commits
Author SHA1 Message Date
Dave Cheney 58afe880f1 go.crypto/ssh: server_test should bind to localhost only
Hopefully fix build error under windows.

Binding to the wildcard is poor form for our darwin users
as it triggers the firewall popup. Dialing the wildcard
looks like it's implementation specific as well.

R=agl, kardianos
CC=golang-dev
https://golang.org/cl/6104046
2012-04-21 10:44:56 +10:00
Adam Langley 63f855d724 ssh: cosmetic cleanups
These are the cosmetic cleanups from the bits of code that I
rereviewed.

1) stringLength now takes a int; the length of the string. Too many
   callers were allocating with stringLength([]byte(s)) and
   stringLength only needs to call len().

2) agent.go now has sendAndReceive to remove logic that was
   duplicated.

3) We now reject negative DH values

4) We now reject empty packets rather than crashing.

R=dave, jonathan.mark.pittman
CC=golang-dev
https://golang.org/cl/6061052
2012-04-20 15:17:42 -04:00
Daniel Theophanes 81e0b644eb go.crypt/ssh: Add additional test for server.
R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/6075046
2012-04-19 16:46:46 -04:00
Adam Langley cfd75bc309 crypto/ssh: fix several logic errors.
These are the obvious mistakes from my read through. I'll save the
more cosmetic changes for a later CL.

R=dave, kardianos
CC=golang-dev
https://golang.org/cl/6049050
2012-04-19 11:16:57 -04:00
Dave Cheney bd686358fc go.crypto/ssh: replace window channel with an atomic variable and condition
Fixes golang/go#3479.

Using a channel to model window size was a mistake. Unlike stdin and
stdout, which are streams of data, window size is an variable and
should be modeled as such.

R=golang-dev, agl, gustav.paul, kardianos, dvyukov
CC=golang-dev
https://golang.org/cl/5986053
2012-04-15 20:30:45 +10:00
Dave Cheney 15577f9df4 go.crypto/ssh: improve error message when no authentication methods remain
R=golang-dev
CC=golang-dev
https://golang.org/cl/5960044
2012-04-01 10:50:09 -04:00
David Symonds 521edf84a0 go.crypto: add exp/terminal as code.google.com/p/go.crypto/ssh/terminal.
This removes the sole "exp/foo" import in the Go subrepos.
A separate CL will remove exp/terminal from the standard Go repository.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/5966045
2012-03-30 15:27:01 +11:00
Fazlul Shahriar df1b4d2fcd go.crypto/ssh: fix example in documentation
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/5905048
2012-03-27 14:40:42 -04:00
Daniel Theophanes 452b645a37 go.crypto/ssh: respect adjust window msg on server.
R=golang-dev
CC=agl, golang-dev
https://golang.org/cl/5908048
2012-03-26 12:44:23 -04:00
Daniel Theophanes 36a967d321 go.crypto/ssh: add support for diffie-hellman-group1-sha1.
Fixes golang/go#2903.

R=golang-dev
CC=agl, golang-dev
https://golang.org/cl/5755054
2012-03-06 11:25:32 -05:00
Dave Cheney 79d53bd55e go.crypto/ssh: improve marshal performance
Atom N450, 6g

benchmark                         old ns/op    new ns/op    delta
BenchmarkMarshalKexInitMsg            96446        66675  -30.87%
BenchmarkUnmarshalKexInitMsg         155341       142715   -8.13%
BenchmarkMarshalKexDHInitMsg           9499         8340  -12.20%
BenchmarkUnmarshalKexDHInitMsg         4973         5145   +3.46%

Intel E3-1270, 6g

benchmark                         old ns/op    new ns/op    delta
BenchmarkMarshalKexInitMsg            23218        16903  -27.20%
BenchmarkUnmarshalKexInitMsg          31384        31640   +0.82%
BenchmarkMarshalKexDHInitMsg           1943         1661  -14.51%
BenchmarkUnmarshalKexDHInitMsg          915          941   +2.84%

R=agl, minux.ma, remyoudompheng
CC=golang-dev
https://golang.org/cl/5728053
2012-03-04 14:34:24 -08:00
Dave Cheney 73a4e109cb go.crypto/ssh: add benchmarks for marshal and unmarshal
R=agl
CC=golang-dev
https://golang.org/cl/5730045
2012-03-04 14:01:23 -08:00
Jonathan Pittman 67456e2aa3 go.crypto/ssh: Initial checkin of ssh agent support.
R=agl, dave, djm
CC=golang-dev
https://golang.org/cl/5695081
2012-03-02 14:16:57 -05:00
Dave Cheney 6de97b525f go.crypto/ssh: improve support for MAC algorithms
Also, add support for hmac-sha1.

At the suggestion of AGL hmac-md5, and hmac-md5-96
support was not included.

Fixes golang/go#3095.

R=golang-dev, agl, huin
CC=golang-dev
https://golang.org/cl/5696065
2012-02-27 19:40:52 -05:00
Jonathan Pittman 9b05c27191 go.crypto/ssh: add client support for OpenSSH certificates
Refactor key parsing, marshaling, and serialization to be a bit more flexible

R=agl, dave, djm
CC=golang-dev
https://golang.org/cl/5650067
2012-02-24 12:52:06 -05:00
Adam Langley d33bbf2cb3 ssh: use *rsa.PublicKey or *dsa.PublicKey in interfaces.
Everywhere else in the code base, when we have an interface{} which is
a stand in for a public key, we use *foo.PublicKey rather than
foo.PublicKey. This change makes ssh reflect that.

R=dave, r
CC=golang-dev
https://golang.org/cl/5686067
2012-02-23 10:42:21 -05:00
Daniel Theophanes 6c548e9506 go.crypto/ssh: add Stderr() in Channel interface.
Adds support for piping Stderr to the client.

R=golang-dev, dave, agl
CC=golang-dev
https://golang.org/cl/5674081
2012-02-20 10:42:43 -05:00
Adam Langley 7f524f2468 ssh: fix locking in channel.Write
Since a lock is retaken before sync.Cond.Wait returns, this could
deadlock when the for loop attempts to take the lock again. (Reported
by sanjay.m.)

theirWindow was used outside of the lock, therefore concurrent writers
could overrun the window.

theirWindow was never updated to reflect the data written.

R=dave, balasanjay
CC=golang-dev
https://golang.org/cl/5671084
2012-02-18 13:49:50 -05:00
Daniel Theophanes 2b43ac23a9 go.crypto/ssh: add User to ServerConn and pass *ServerConn to callbacks.
R=golang-dev, dave, agl
CC=golang-dev
https://golang.org/cl/5577070
2012-01-30 15:30:11 -05:00
Russ Cox 470549d502 go.crypto: initial code
Manual edits to README.
Moved from main Go repository, deleted Makefiles, ran gofix -r go1rename.

Tested with: go test code.google.com/p/go.crypto/...

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5564059
2012-01-25 15:31:12 -05:00