Commit Graph
225 Commits
Author SHA1 Message Date
Ian Lance Taylor 902e2dcb72 curve25519, poly1305: change last CL to build with Go 1.3
It also still works with Go 1.4.

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/154120043
2014-10-07 18:09:31 -07:00
Ian Lance Taylor 20b2ab3f62 curve25519, poly1305: mark constants as RODATA
Fixes tests when using Go tip.  Without this the link steps
fails with errors like:

missing Go type information for global symbol: google3/third_party/golang/go_crypto/curve25519/curve25519.REDMASK51 size 8

LGTM=agl
R=agl
CC=golang-codereviews
https://golang.org/cl/156810043
2014-10-07 16:59:07 -07:00
Han-Wen Nienhuys 72116d5c17 go.crypto/ssh: clean up address parsing in forward code.
LGTM=agl
R=agl, dave, jpsugar
CC=golang-codereviews
https://golang.org/cl/134700043
2014-09-16 12:34:31 -07:00
Han-Wen Nienhuys fc84ae5437 go.crypto/ssh: reuse packet buffer for channel writes.
Test that different extended data streams within a channel are
thread-safe.

benchmark             old MB/s     new MB/s     speedup
BenchmarkEndToEnd     79.26        87.98        1.11x

benchmark                          old allocs     new allocs     delta
BenchmarkEndToEnd                  110            73             -33.64%

benchmark                          old bytes     new bytes     delta
BenchmarkEndToEnd                  2605720       1299768       -50.12%

LGTM=dave, jpsugar
R=agl, dave, jpsugar
CC=golang-codereviews
https://golang.org/cl/136420043
2014-09-16 12:30:05 -07:00
Adam Langley 82442e0e95 go.crypto/sha3: use the go1.4 tag to register the hash functions.
Prior to Go 1.4, crypto didn't have the consts defined for SHA-3.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/133540043
2014-09-03 16:08:25 -07:00
David Leon Gil 1b32d8b50a go.crypto/sha3: update to sync with draft FIPS-202
1. API:

This exposes a minimal API: the SHA-3 functions implement hash.Hash. The
SHAKE functions implement a new "ShakeHash" interface that implements
io.Reader, io.Writer, and Reset().

(The previous Barrier() function has been removed.)

(Alternative proposal: Don't implement io.Reader, but instead provide a
"Digest(d []byte) error" function that performs a hash.Hash style copy.
Somewhat more minimal, but very easy to use incorrectly.)

2. Tests

Added the complete set of ShortMsgKATs from
   https://github.com/gvanas/KeccakCodePackage

3. Correctness

In sync with draft FIPS-202.

4. Documentation

A summary of the security properties of the SHA-3 and SHAKE functions is
provided in doc.go; some concrete recommendations as well.

Fixes 8563.

R=golang-codereviews, agl
CC=golang-codereviews
https://golang.org/cl/130950043
2014-09-03 12:04:00 -07:00
Adam Langley 18c283559e go.crypto/openpgp: fix clearsigned parsing of messages with leading blank lines.
Fixes golang/go#8508.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/128920043
2014-08-28 10:37:22 -07:00
Han-Wen Nienhuys 9e886ee4f2 go.crypto/ssh: skip tests that start ssh-agent.
Also stops leaking /tmp/ directories.

Fixes golang/go#8489.

LGTM=dave, minux
R=dave, minux, agl
CC=golang-codereviews
https://golang.org/cl/124010043
2014-08-13 10:56:59 -07:00
Adam Langley 3092f0d93b go.crypto/openpgp: return signature error rather than unknown issuer.
In the event that a detached signature fails to verify, the code would
continue trying to find other keys with the same key ID and eventually
conclude that the signature was issued by someone unknown
(ErrUnknownIssuer).

With this change, the signature verification error would be returned
instead. (Technically the last error if several keys had a matching key
id and neither verified.)

Fixes golang/go#8509.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/125030043
2014-08-11 15:41:56 -07:00
Dave Cheney ed03dad8de go.crypto/ssh/test: skip tests during -short mode
This proposal effectively disables all the ssh/test tests when run with the -short flag supplied.

For developers and users of this package, there should be no change unless they are in the habbit of always supplying -short, which I belive is untrue.

For the CI dashboard the effect should be that these tests, which are really not portable enough to run reliably on all our various builders, are disabled.

LGTM=adg
R=adg, agl, hanwen
CC=golang-codereviews
https://golang.org/cl/125860043
2014-08-08 11:42:28 +10:00
Dmitry Chestnykh b7f382b979 go.crypto/blowfish: support salts larger than 16 bytes.
Supporting larger salts makes it possible to implement bcrypt-pbkdf
(http://www.tedunangst.com/flak/post/bcrypt-pbkdf), which is used in
the latest OpenSSH versions to encrypt key files.

This change makes expandKeyWithSalt (and thus NewSaltedCipher) about
20% slower, but since it isn't used in the "heavy" phase of computation
in bcrypt (it uses ExpandKey, which didn't change), the effect on
bcrypt performance is negligible.

The 16-byte limit was an artifact of optimization and due to the fact
that it was enough for bcrypt; Eksblowfish spec or other
implementations don't limit the salt size.

Additionally, there was a bug in the previous implementation: it only
generated correct results for salts consisting of 4, 8, or 16 bytes, and panicked if salt had zero length.

LGTM=agl
R=golang-codereviews, gobot, agl
CC=golang-codereviews
https://golang.org/cl/102720045
2014-08-01 14:09:20 -07:00
Adam Langley 76cee1b7b1 go.crypto/ssh/terminal: better handling of window resizing.
There doesn't appear to be perfect behaviour for line editing
code in the face of terminal resizing. But this change works
pretty well on xterm and gnome-terminal and certainly a lot
better than it used to.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/105580043
2014-08-01 11:22:47 -07:00
Dave Cheney 2aff5f12d8 go.crypt/ssh/terminal: declare TCGETS, TCSETS constants locally.
Currently the ssh/terminal package cannot be compiled under gccgo. Even though gccgo may be running on linux, its syscall package is slightly different and does not contain these constants.

This proposal resolves the issue by declaring the two constants locally, as we've done for the *BSDs.

LGTM=hanwen, iant
R=hanwen, iant, gobot
CC=golang-codereviews
https://golang.org/cl/101670043
2014-07-07 10:24:36 +10:00
Adam Langley aeb0262c11 go.crypto/openpgp: fix hash presence checks.
At some point in the distant past, crypto.Hash.New() changed from
returning nil when a hash function wasn't provided, to panicing. Some
of the code in openpgp predates this and was still using the nil check.

LGTM=bradfitz
R=sburford, bradfitz
CC=golang-codereviews
https://golang.org/cl/104850045
2014-06-04 11:40:03 -07:00
Adam Langley 9fb3568646 go.crypto/ssh/terminal: support ^U, ^D and ^L.
LGTM=bradfitz
R=bradfitz, marios.nikolaou
CC=golang-codereviews
https://golang.org/cl/92220043
2014-05-27 19:45:07 -07:00
Dmitry Chestnykh ce1cf546ac go.crypto/hkdf: get rid of appends
LGTM=agl
R=golang-codereviews, bradfitz, agl
CC=golang-codereviews
https://golang.org/cl/95370044
2014-05-25 13:56:25 -07:00
Adam Langley c34e38ab9e go.crypto/ssh: fix authentication after all public keys are rejected by a server.
Validating a public key doesn't return any remaining methods so, if all public keys were rejected, a nil slice would be returned for the remaining methods and authentication would stop.

We could have validateKey return methods, but that wouldn't solve the problem of what to do if the callback returns no keys. In that case we don't have any keys to test.

So this change makes it possible for an AuthMethod to return a nil slice for the remaining methods (meaning "reuse the last list"). It also fixes a scoping bug.

Fixes golang/go#7787.

LGTM=hanwen
R=hanwen
CC=golang-codereviews
https://golang.org/cl/94350043
2014-05-13 10:51:53 -07:00
Adam Langley 84ca184138 go.crypto/openpgp: fix user id signing.
Entity.SignIdentity used the wrong signature function and produced invalid
certification signatures. Fixed.

VerifyUserIdSignature was used for checking the self-signature on an identity,
but didn't support anything but a self-signature. This change alters the
low-level API so that checking cross-signatures is possible.

Fixes golang/go#7371.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/96240043
2014-05-12 11:23:48 -07:00
Adam Langley 2dfe547928 go.crypto/ssh: use permissions from public key cache when accepting a key.
Fixes golang/go#7913.

LGTM=hanwen
R=hanwen
CC=golang-codereviews
https://golang.org/cl/96220043
2014-05-12 11:19:56 -07:00
Han-Wen Nienhuys 6f0540ef5e go.crypto/ssh: try authentication methods in ClientConfig order.
LGTM=jpsugar, agl
R=agl, jpsugar
CC=golang-codereviews
https://golang.org/cl/92240045
2014-05-12 11:16:49 -07:00
Mikio Hara f8eacb97ce go.crypto/ssh/test: enable test cases on dragonfly
LGTM=agl
R=golang-codereviews, agl
CC=golang-codereviews
https://golang.org/cl/98840043
2014-05-05 12:10:24 -07:00
Mikio Hara b71337fce2 go.crypto/ssh/terminal: add support for BSD variants
LGTM=agl
R=golang-codereviews, agl
CC=golang-codereviews
https://golang.org/cl/97850043
2014-05-05 12:07:22 -07:00
Dmitry Chestnykh c261757620 go.crypto/blowfish: no need for key in initCipher
LGTM=robert.hencke
R=golang-codereviews, robert.hencke
CC=golang-codereviews
https://golang.org/cl/84860043
2014-05-05 11:42:21 -07:00
Adam Langley aa3adaf1aa go.crypto/openpgp: check for revoked keys.
R=agl
CC=golang-codereviews
https://golang.org/cl/95050043
2014-05-05 11:41:50 -07:00
David Calavera df2851958a ssh/forward: Fix reference to the functions to call to route authentication requests.
R=agl
CC=golang-codereviews, hanwen
https://golang.org/cl/95910043
2014-05-02 10:55:29 -07:00
Han-Wen Nienhuys 7c7765c32f go.crypto/ssh/agent: add key type to testAgentInterface failure messages.
R=agl, dave, jpsugar
CC=golang-codereviews
https://golang.org/cl/88260043
2014-04-15 13:48:43 -07:00
Han-Wen Nienhuys 15264ff7c7 go.crypto/ssh/agent: prefix errors with "agent".
R=agl, dave, jpsugar
CC=golang-codereviews
https://golang.org/cl/87810047
2014-04-15 13:42:07 -07:00
Han-Wen Nienhuys dac81c328b go.crypto/ssh: fix messages_test.go on 32-bit platforms.
LGTM=dave
R=agl, dave
CC=golang-codereviews
https://golang.org/cl/88060043
2014-04-15 09:09:03 -07:00
Yan Zou e1b0d6c49f go.crypto/ssh: Add support for the pre-2006 RC4 cipher mode.
LGTM=hanwen
R=agl, hanwen
CC=golang-codereviews
https://golang.org/cl/86600044
2014-04-14 10:43:20 -07:00
Han-Wen Nienhuys 058f0eec52 go.crypto/ssh: only offset channel IDs when debugMux is
set.

Otherwise, the package leaks data about total number of
connections established through its channel IDs.

R=agl, jpsugar
CC=golang-codereviews
https://golang.org/cl/87280043
2014-04-14 09:23:18 -07:00
David du Colombier 7e43632730 go.crypto/ssh: build test_unix_test on Plan 9
LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/86630043
2014-04-12 22:07:48 +02:00
Adam Langley 43c4f8a896 go.crypto/ssh: remove old files.
In c0fc595a2cb5, hg didn't notice the files that had been removed from
the working directory. These, old files are breaking the build.

CC=golang-codereviews
https://golang.org/cl/86240043
2014-04-09 14:37:07 -07:00
Adam Langley fa50e7408b go.crypto/ssh: import gosshnew.
See https://groups.google.com/d/msg/Golang-nuts/AoVxQ4bB5XQ/i8kpMxdbVlEJ

R=hanwen
CC=golang-codereviews
https://golang.org/cl/86190043
2014-04-09 13:57:52 -07:00
Adam Langley 8f45c680ce go.crypto/blowfish: allow shorter passwords.
bcrypt didn't allow one, two and three letter passwords which is a
policy decision best left to the user of the code. Some users have
legacy issues which require such short passwords to be processed.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/81800044
2014-03-31 13:41:02 -04:00
David du Colombier a2c10b4975 go.crypto/ssh: build tests on Plan 9
LGTM=minux.ma
R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/64390044
2014-02-19 20:51:49 +01:00
Péter Szilágyi f82d56354e go.crypto/hkdf: implement hash-based, key derivation.
Detailed description in RFC 5869.

LGTM=agl
R=agl, minux.ma
CC=golang-codereviews
https://golang.org/cl/7474049
2014-02-12 14:08:25 -05:00
Brad Fitzpatrick 63a71ca82d undo CL 51690043 / abf8f8812575
Breaks FreeBSD build of subrepo for non-tip users.

««« original CL description
go.crypto/ssh/terminal: enable freebsd build

syscall.Termios, which was the only thing breaking the build, is
available in go tip now
(https://code.google.com/p/go/source/detail?r=873d664b00ec)

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/51690043

»»»

R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/51100044
2014-01-13 15:00:50 -08:00
Michael Gehring ef64186525 go.crypto/ssh/terminal: enable freebsd build
syscall.Termios, which was the only thing breaking the build, is
available in go tip now
(https://code.google.com/p/go/source/detail?r=873d664b00ec)

R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/51690043
2014-01-13 14:35:19 -08:00
Rob Pike 9717de930f .hgignore: add comment setting policy
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/44830043
2013-12-20 16:30:29 -08:00
Russ Cox 08da9c60bc codereview: switch defaultcc to golang-codereviews
See this thread for background:
https://groups.google.com/forum/#!topic/golang-dev/xG7vPi21r8g

R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/44120046
2013-12-20 10:57:29 -05:00
Jakob Borg 4758fe8ce4 go.crypto/ssh: Increase window size.
Increase window size for channels (session and tcpip) to 64 *
max packet size (32 KB), which is the same value that OpenSSH
uses. Also breaks out the relevant harcoded constants into named
constants in channel.go.

Fixes golang/go#6675.

R=golang-dev, dave, hanwen, agl
CC=golang-dev
https://golang.org/cl/18120043
2013-11-01 04:24:39 +11:00
Han-Wen Nienhuys 577ae2abf9 go.crypto/ssh: cosmetic: unnest signing code for public key auth.
R=dave
CC=golang-dev
https://golang.org/cl/15930044
2013-10-26 03:25:59 +11:00
Han-Wen Nienhuys 34df1ce598 go.crypto/ssh: in {Server,Client}Conn, read session ID from
transport layer.

R=agl, dave
CC=golang-dev
https://golang.org/cl/15870044
2013-10-25 11:15:34 -04:00
Dave Cheney c0d640c887 go.crypto/ssh: ensure {Server,Client}Conn do not expose io.ReadWriter
Transport should not be a ReadWriter. It can only write packets, i.e. no partial reads or writes. Furthermore, you can currently do ClientConn.Write() while the connection is live, which sends raw bytes over the connection. Doing so will confuse the transports because the data is not encrypted.

As a consequence, ClientConn and ServerConn stop being a net.Conn

Finally, ensure that {Server,Client}Conn implement LocalAddr and RemoteAddr methods that previously were exposed by an embedded net.Conn field.

R=hanwen
CC=golang-dev
https://golang.org/cl/16610043
2013-10-25 06:29:58 +11:00
Han-Wen Nienhuys 105632d35b go.crypto/ssh: only close connection if it was open in TestClientUnsupportedKex.
R=dave
CC=golang-dev
https://golang.org/cl/15450046
2013-10-24 04:12:59 +11:00
Jonathan Pittman 94779a0cf1 go.crypto/ssh: Implement CertTime to properly handle the "infinite" time
value ^0, which would become negative when expressed as int64.

R=agl, dave, jpsugar, hanwen
CC=golang-dev
https://golang.org/cl/15520047
2013-10-23 12:44:23 -04:00
Dave Cheney 0b167df1b4 go.crypto/ssh: additional coverage of message unmarshaling
R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/14767043
2013-10-23 08:45:49 +11:00
Jonathan Pittman 9112f50fcd go.crypto/ssh: Add certificate verification, step up support for authorized keys
R=agl, hanwen, jpsugar, dave
CC=golang-dev
https://golang.org/cl/14540051
2013-10-22 15:12:41 -04:00
Han-Wen Nienhuys f5f25bdad0 go.crypto/ssh: put version exchange in function
R=golang-dev, dave, jpsugar, agl
CC=golang-dev
https://golang.org/cl/14641044
2013-10-17 08:54:15 +11:00
Han-Wen Nienhuys ed40a6cc35 go.crypto/ssh: move channelForwardMsg declaration.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/14669046
2013-10-16 14:24:28 +11:00