Commit Graph
161 Commits
Author SHA1 Message Date
Adam Langley cb60f353cb go.crypto/ssh/terminal: support Unicode entry.
Previously, terminal only supported ASCII characters. This change
alters some []byte to []rune so that the full range of Unicode is
supported. The only thing that doesn't appear to work correctly are
grapheme clusters as the code still assumes one rune per glyph. Still,
this change allows many more languages to work than did previously.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13704043
2013-09-13 14:33:00 -04:00
Han-Wen Nienhuys e62b2aead4 go.crypto/ssh: introduce PublicKey interface type.
Public functions affected:
-AgentKey.Key
-AgentClient.SignRequest
-ClientKeyring.Key
-MarshalPublicKey
-ParsePublicKey

R=agl, jpsugar, jmpittman
CC=golang-dev
https://golang.org/cl/13642043
2013-09-13 14:25:14 -04:00
Jonathan Pittman 6a743c56c7 go.crypto/ssh: Begin adding server side support for more than RSA for client key auth
R=agl, dave, hanwen
CC=ekg, golang-dev
https://golang.org/cl/13528044
2013-09-09 13:06:04 -04:00
Han-Wen Nienhuys f17d130281 go.crypto/ssh: remove misleading marshalPrivRSA.
Properly capitalize publicKey throughout.

R=golang-dev
CC=agl, dave, golang-dev, jpsugar
https://golang.org/cl/13415046
2013-09-05 11:36:51 -04:00
Casey Marshall 58b09dec0e openpgp/packet: Compact UserAttribute subpacket lengths, fixes signatures.
Necessary to reproduce the same hash for verifying a UserAttribute signature.
Reuse and fix defect in serializeSubpacketLength, RFC 4880, Section 4.2.2.2.

R=agl
CC=golang-dev
https://golang.org/cl/13464044
2013-09-04 10:21:45 -04:00
Han-Wen Nienhuys ffadfa6648 go.crypto/ssh/test: Only show SSHD debug output if test fails.
R=agl, dave, jpsugar
CC=golang-dev
https://golang.org/cl/13438043
2013-09-03 10:54:19 -04:00
Casey Marshall 964142eb52 openpgp/packet: Add support for V3 public keys and signatures.
My goal here is to allow read-only access to legacy key material without allowing new V3 keys or signatures.

R=agl
CC=golang-dev
https://golang.org/cl/12746046
2013-09-03 10:36:04 -04:00
Adam Langley 5a4ea2fde3 go.crypto/curve25519: rewrite generic code to be constant time.
Previously curve25519 contained a constant-time, optimised amd64 implementation and
a generic implemenation that used math/big and that was not constant-time.

This change contains a Go port of the public domain, "ref10" implementation from
SUPERCOP. This has the advantage of being faster and constant-time.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13343045
2013-09-03 09:31:32 -04:00
Adam Langley 488d045bc0 go.crypto/openpgp/packet: use minimal interface for SerializeSignaturePrefix.
Only an io.Writer is needed in this case.

Fixes golang/go#6035.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13277044
2013-08-30 10:38:22 -04:00
Casey Marshall da934910d6 openpgp/packet: Parse and serialize ECC key material (RFC 6637).
Support ECDSA signature verification.

R=agl
CC=golang-dev
https://golang.org/cl/13141044
2013-08-29 17:10:08 -04:00
Alex Brainman 665213f561 go.crypto/ssh: use 127.0.0.1 during TestKexAlgorithms (fixes windows build)
R=golang-dev, mikioh.mikioh, remyoudompheng
CC=golang-dev
https://golang.org/cl/13370043
2013-08-29 12:57:42 +10:00
JP Sugarbroad a1beccb9f0 go.crypto/ssh: Update Dial to perform remote resolution of DNS names.
R=agl
CC=golang-dev
https://golang.org/cl/13010047
2013-08-28 17:51:56 -04:00
Han-Wen Nienhuys a93ee0c91a go.crypto/ssh: Use net.UnixConn for connecting client and sshd.
This obviates custom code to emulate a thread-safe connection.

Use this for testing that listeners close if the connection breaks.

R=dave, agl, fullung
CC=golang-dev
https://golang.org/cl/11781043
2013-08-28 12:41:55 -04:00
Casey Marshall 3780a70b7b go.crypto/openpgp/packet: Add user attribute packet support.
Supports JPEG images as well as free-form arbitrary subpacket data in
user attributes (RFC 4880, Section 5.12)

R=agl
CC=golang-dev
https://golang.org/cl/12966045
2013-08-28 11:02:21 -04:00
Han-Wen Nienhuys d7d50b0a7c go.crypto/ssh: implement ECDH.
Implement elliptic-curve Diffie-Hellman, including host key signature
verification.

Moves host key cryptographic verification to ClientConn.handshake(), so
RSA host keys are also verified.

Fixes golang/go#6158.

R=dave, agl
CC=golang-dev
https://golang.org/cl/13021045
2013-08-28 10:50:25 -04:00
Adam Langley b725ff72eb go.crypto/ssh/terminal: handle ^W, ^K and ^H
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13207043
2013-08-28 07:36:04 -04:00
JP Sugarbroad c2c80b64c0 crypto/ssh: Allow customization of the client version.
R=agl, golang-dev, dave
CC=golang-dev
https://golang.org/cl/13176044
2013-08-27 13:40:08 -04:00
JP Sugarbroad 504f1d5525 crypto/ssh: Handle msgUserAuthBanner during keyboard-interactive auth.
R=agl, golang-dev
CC=golang-dev
https://golang.org/cl/12983046
2013-08-27 11:23:31 -04:00
Brian Gitonga Marete 690e22b80a openpgp: Implement compressed data packets & add support for compressing data during symmetric encryption.
This patch implements the facilities needed to compress data before
encryption as allowed (and recommended) by RFC 4880. The new
functionality is then used to add support for compressing data during
symmetric encryption (openpgp.SymmetricallyEncrypt()).

For now, compression defaults to off. Also, only the ZIP and ZLIB
compression schemes are supported by this patch.

Resulting output tested/verified using GPG.

https://gist.github.com/marete/6189760 is a small program that can be
used to test that the output of various compression/encryption settings
can be read by GPG or other RFC 4880 programs.

Upon review, I will follow this patch with 2 others: a) Add support for 	compression during public key encryption (openpgp.Encrypt()) b) Enable
compression by default (subject to the restrictions of the "Compression 	Preferences" section in RFC 4880).

R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/12685044
2013-08-15 12:04:10 -04:00
Adam Langley f23aef828f go.crypto/openpgp: test that hashes are compiled in before using them.
Previously, if Encrypt decided to use a hash function that wasn't
compiled in then it would panic.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12055043
2013-08-05 14:22:57 -04:00
Adam Langley 16d76afb29 go.crypto/ocsp: pass in the issuing certificate.
Paul van Brouwershaven pointed out that it would be better to pass in
the issuing certificate and have the verification be done in the OCSP
package than to expect the caller to deal with the difference between
responses with and without a responder certificate.

R=golang-dev, dayveday, paul
CC=golang-dev
https://golang.org/cl/11220043
2013-07-29 15:32:19 -04:00
Han-Wen Nienhuys 4dc7c8e2f4 go.crypto/ssh: seed random generator, so auto port allocation is truly random.
R=agl, dave
CC=golang-dev
https://golang.org/cl/12027043
2013-07-29 13:09:39 -04:00
Han-Wen Nienhuys 2d394e3025 go.crypto/ssh: add workaround for broken port forwarding in
OpenSSH 5.

Tested with OpenSSH_5.9

R=agl, dave
CC=golang-dev
https://golang.org/cl/11921043
2013-07-26 14:37:37 -04:00
Adam Langley eb19e229bd go.crypto/openpgp: don't select expired keys.
When selecting keys for encryption, don't select keys that have
expired.

Fixes golang/go#5808.

R=bradfitz
CC=golang-dev
https://golang.org/cl/10847043
2013-07-22 18:23:28 -04:00
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
Adam Langley 396847505b go.crypto/salsa: fix typo in comment and move TODO out of package comment.
Thanks to Frithjof Schulze for noticing.

R=goland-dev, r
CC=golang-dev
https://golang.org/cl/11033044
2013-07-16 19:34:54 -04:00
Drew Hintz 0982ebf089 crypto: Correct s2k type constants. They are 0,1,3 according to both the RFC: http://tools.ietf.org/html/rfc4880#section-3.7
And according to the gpg implementation: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git&a=search&h=refs%2Fheads%2FSTABLE-BRANCH-2-0&st=grep&s=s2kmode

R=agl
CC=evn, golang-dev
https://golang.org/cl/11355046
2013-07-16 17:39:57 -04:00
Adam Langley c4978816b9 go.crypto/ssh/terminal: support Go 1.0.
For those still stuck on Go 1.0.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/11297043
2013-07-15 18:01:31 -04:00
Brian Gitonga Marete d43a35d821 openpgp: Add support for BZIP2-compressed data packets.
Tested using a variety of files encrypted with gpg and the
"--compress-algo BZIP2" gpg option.

R=golang-dev, bradfitz, agl
CC=golang-dev
https://golang.org/cl/10801043
2013-07-03 11:31:17 -04:00
Adam Langley c4711a569a 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://golang.org/cl/10853043
2013-07-02 19:46:13 -04:00
Adam Langley 3f4ad28b7c go.crypto/ocsp: make the zero value of RequestOptions valid and documented.
R=bradfitz
CC=golang-dev
https://golang.org/cl/10431044
2013-06-21 15:16:14 -04: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
Adam Langley b88b016522 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://golang.org/cl/10402043
2013-06-20 11:11:09 -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
Adam Langley c2ba5865a8 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://golang.org/cl/10099043
2013-06-10 18:03:26 -04:00
Adam Langley aa0f5b4081 go.crypto: revert 7f5a59ff6b43.
This change reverts https://golang.org/cl/10113043/ because
some folks are stuck on 1.0 till 1.1.1 comes out.

R=golang-dev
CC=golang-dev
https://golang.org/cl/10151043
2013-06-10 10:57:00 -04:00
Adam Langley eca6c1626e 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://golang.org/cl/10113043
2013-06-07 16:05:15 -04:00
Adam Langley 59566675d5 ssh/terminal: support home, end, up and down keys.
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/9777043
2013-06-07 10:21:53 -04:00
Han-Wen Nienhuys c7df565dd4 go.crypto/ssh: implement keyboard-interactive auth (RFC 4256), both
on client and server-side.

R=dave, agl
CC=gobot, golang-dev
https://golang.org/cl/9853050
2013-06-06 10:44:12 -04:00
Han-Wen Nienhuys 36bf31eb71 go.crypto/ssh: add a error return to decode(), and avoid casting decode() output.
R=dave, kardianos, agl
CC=gobot, golang-dev
https://golang.org/cl/9738053
2013-06-06 10:24:21 -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
Dave Cheney 1a6f1e67fb 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://golang.org/cl/9921044
2013-06-01 10:58:02 +10:00
Keith Rarick 0e971cde33 ssh: add Output and CombinedOutput helpers
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/9711043
2013-05-29 16:06:18 +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