diff options
| author | Adam Langley <agl@golang.org> | 2012-04-20 15:17:42 -0400 |
|---|---|---|
| committer | Adam Langley <agl@golang.org> | 2012-04-20 15:17:42 -0400 |
| commit | 63f855d724c1fff8ec15a0191dcda32ec7761cc4 (patch) | |
| tree | 5f5614323b139c2a90b1b49ea0cf05c4ed54fdb5 /ssh/client_auth.go | |
| parent | 81e0b644eb2f05832b1801391bc9386a81e4fe45 (diff) | |
| download | go-x-crypto-63f855d724c1fff8ec15a0191dcda32ec7761cc4.tar.xz | |
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
Diffstat (limited to 'ssh/client_auth.go')
| -rw-r--r-- | ssh/client_auth.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ssh/client_auth.go b/ssh/client_auth.go index 7ae670f..8c030ac 100644 --- a/ssh/client_auth.go +++ b/ssh/client_auth.go @@ -213,7 +213,7 @@ func (p *publickeyAuth) auth(session []byte, user string, t *transport, rand io. } // manually wrap the serialized signature in a string s := serializeSignature(algoname, sign) - sig := make([]byte, stringLength(s)) + sig := make([]byte, stringLength(len(s))) marshalString(sig, s) msg := publickeyAuthMsg{ User: user, |
