Commit Graph
193 Commits
Author SHA1 Message Date
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
Han-Wen Nienhuys 49702c17cc go.crypto/ssh: (un)marshal data without type byte prefix.
This helps manipulating data in global and channel request
payloads.

R=agl, dave, jpsugar
CC=golang-dev
https://golang.org/cl/14438068
2013-10-15 16:18:32 +11:00
Han-Wen Nienhuys 4a7557f2bd go.crypto/ssh: add String method to RejectionReason.
R=agl, dave
CC=golang-dev
https://golang.org/cl/14494055
2013-10-14 16:13:09 -04:00
Han-Wen Nienhuys 7dc9a79b3e go.crypto/ssh: implement memTransport using sync.Cond.
This makes memTransport safe for use with multiple
writers/closers.

R=golang-dev, dave
CC=agl, golang-dev
https://golang.org/cl/14532048
2013-10-13 08:34:25 +11:00
Jonathan Pittman 44256fa2df go.crypto/ssh: cosmetic only spelling fixes
R=agl, hanwen
CC=dave, golang-dev, jpsugar
https://golang.org/cl/14430055
2013-10-10 11:35:15 -04:00
Adam Langley 7bb6c099c0 go.crypto/openpgp: support v3 detached signatures.
Although the package doesn't attempt to fully support ancient, version
3 messages, supporting v3 detached signatures is fairly easy and some
projects (in this case, Ubuntu) are using them for unknown reasons.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14590043
2013-10-09 17:24:09 -04:00
JP Sugarbroad 15d8abf5c4 go.crypto/ssh: fix certificate parsing/marshaling.
The change to add the PublicKey interface accidentally caused certificate handling to expect an extra copy of the private key algorithm name in the binary representation. This change adapts a suitable parsing API and adds a test to ensure that cert handling isn't easily broken in the future.

R=agl, hanwen, jmpittman
CC=golang-dev
https://golang.org/cl/13272055
2013-10-09 12:56:09 -04:00
Han-Wen Nienhuys 4147256c9c go.crypto/ssh: move interpretation of msgNewKeys into
transport.

Sending the msgNewKeys packet and setting up the key material
now happen under a lock, preventing races with concurrent
writers.

R=kardianos, agl, jpsugar, hanwenn
CC=golang-dev
https://golang.org/cl/14476043
2013-10-08 15:47:04 -04:00
Han-Wen Nienhuys 41400feb0b go.crypto/ssh: let client accept DSA and ECDSA host key algorithms.
R=agl, dave, jpsugar, m4dh4tt3r, agl
CC=golang-dev
https://golang.org/cl/14420045
2013-10-07 18:30:34 -04:00
Frithjof Schulze 153ce2a1d2 go.crypto/ssh/terminal: Allow ^A and ^E as synonyms for Home and End.
I understand that ssh/terminal can't implement everybodys
favorite keyboard shortcuts, but I think these are very
widespread. They exist not only in Emacs or Readline, but also
in Acme and Sam. Also they almost come for free.

R=golang-dev
CC=agl, golang-dev
https://golang.org/cl/13839047
2013-09-30 16:06:07 -04:00
Han-Wen Nienhuys 4e0581245c go.crypto/ssh: parse DSA private keys too.
R=golang-dev, agl
CC=golang-dev
https://golang.org/cl/13966043
2013-09-26 11:17:52 -04:00
Han-Wen Nienhuys 73e99326fb go.crypto/ssh: separate kex algorithms into kexAlgorithm class.
Adds readPacket() to conn, and renames conn to packetConn.
Key exchanges operate on packetConn, so they can be
unittested.

R=agl, jpsugar, dave
CC=golang-dev
https://golang.org/cl/13352055
2013-09-24 12:26:29 -04:00
Frithjof Schulze a3c6050446 go.crypto/otr: Reset Conversation.myKeyId for each AKE.
This shouldn't be necessary according to the OTRv2 spec,
but is expected by at least one other client.

CC=golang-dev
https://golang.org/cl/13823043
2013-09-22 15:38:36 -04:00
Han-Wen Nienhuys 934c14ffe9 go.crypto/ssh: introduce Signer method, an abstraction of
private keys.

R=agl, jpsugar, jonathan.mark.pittman
CC=golang-dev
https://golang.org/cl/13338044
2013-09-19 14:45:31 -04:00
Adam Langley 28dc961a18 go.crypto/ssh/terminal: fix non-ASCII history.
The length of history buffer entries (which are stored as strings) was
being used as the number of runes. This was correct until ff9ce887b46b,
which allowed unicode entry, but can now cause a panic when editing
history that contains non-ASCII codepoints.

R=golang-dev, sfrithjof, r
CC=golang-dev
https://golang.org/cl/13255050
2013-09-15 12:48:02 -04:00
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