Commit Graph
212 Commits
Author SHA1 Message Date
Niall Sheridan 5bcd134fee ssh: allow adding ed25519 keys to the agent
Fixes golang/go#15701

Change-Id: I561701e38b9d434ef44448bdbcfab203f3c31d99
Reviewed-on: https://go-review.googlesource.com/23141
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-18 16:22:55 +00:00
Han-Wen Nienhuys 0a4e4d451b x/crypto/ssh: return msgNewKeys for a short-circuited first kex.
If one of both sides is slow, the first kex completes implicitly. The
first kex also produces msgNewKeys, and this must be read to ensure
that the authentication code is not confused by it.

Before this fix, the problem could be reproduced by inserting a sleep
just before the requestInitialKeyChange call.

Fixes #15198

Change-Id: I602db5dd37b2d8556c88ab4cdb693ccf90147a3d
Reviewed-on: https://go-review.googlesource.com/23137
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-18 15:15:28 +00:00
Sam Hug b6789ab629 x/crypto/ssh: add 3des-cbc as a non-default cipher
3des-cbc is an insecure cipher. As such, you must explictly add it to
Config in order to use it.

Change-Id: Ifd15cde46a9908eefef1c75bae7e97b05767361d
Reviewed-on: https://go-review.googlesource.com/22770
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
2016-05-15 12:48:58 +00:00
Martin Garton 1e61df8d9e x/crypto/ssh: add support for ed25519 keys
Added support for parsing the "new" openssh private key format.
(ed25519 keys only in this format for now)

Signing and verifying functions now work with ed25519 keys.

ed25519 can now be accepted by the server to authenticate a client.

ed25519 can now be accepted by a client as a server host key.

Related documentation used:
https://www.ietf.org/archive/id/draft-bjh21-ssh-ed25519-02.txt

Change-Id: I84385f24d666fea08de21f980f78623f7bff8007
Reviewed-on: https://go-review.googlesource.com/22512
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
2016-05-12 13:28:31 +00:00
Han-Wen Nienhuys b76c864ef1 x/crypto/ssh: hide msgNewKeys in the transport layer.
This ensures that extraneous key exchanges cannot confuse application
level code.

Change-Id: I1a333e2b7b46f1e484406a79db7a949294e79c6d
Reviewed-on: https://go-review.googlesource.com/22417
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-05-10 17:36:43 +00:00
Martin Garton 91ab96ae98 ssh: fix compatibility with recent OpenSSH
Make x/crypto/ssh tests compatible with recent OpenSSH versions.
This means not using rsa keys shorter than 1024 bits any more, and
explicitly enabling all key types in the OpenSSH config, since some
are now disabled by default.

Tested against OpenSSH_7.2p2 and now passes.

Change-Id: I607bf15f063d4833b0876393d6845a4f507f48af
Reviewed-on: https://go-review.googlesource.com/22840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-09 21:14:43 +00:00
Han-Wen Nienhuys 2cb52d9374 x/crypto/ssh: also log data packets when debugHandshake is set
Change-Id: Ibb26269608e506e8a676c276f847d77fe7014ceb
Reviewed-on: https://go-review.googlesource.com/22514
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-05-03 14:59:30 +00:00
Han-Wen Nienhuys 285fb2ed20 x/crypto/ssh: fix subsequent key exchanges.
In https://go-review.googlesource.com/#/c/21606/ , kexResult.SessionID
was erroneously not set for all but the first key exchange. The
unittests did not catch this, as server and client make the same
mistake, but OpenSSH notices corrupted data and kills the connection.

Fixes #15445.

Change-Id: If98249b37d81efaa2ebefc836df0b150feba1256
Reviewed-on: https://go-review.googlesource.com/22418
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-26 14:51:09 +00:00
Peter Moody e84a34b1ee x/crypto/ssh: support more keytypes in the agent.
This allows the golang ssh-agent to support the full suite of keys
the library accepts.

Currently constraints are ignored.

Change-Id: I7d48c78e9a355582eb54788571a483a736c3d3ef
Reviewed-on: https://go-review.googlesource.com/21536
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-04-25 17:01:51 +00:00
Han-Wen Nienhuys f98fd1f5ec x/crypto/ssh: if debugMux is set, also log global messages.
Change-Id: I685ba7f30f1d2e2bc3c078c7bddb6d383a179113
Reviewed-on: https://go-review.googlesource.com/22416
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
2016-04-25 15:26:28 +00:00
Scott Bell 7b428712ab x/crypto/ssh: remove misleading comment, add example
Add an example for using the PublicKeys AuthMethod.

Change-Id: I3fe02bb3c9b8ccf313d72858328c8576cbf3eb06
Reviewed-on: https://go-review.googlesource.com/22250
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
2016-04-21 09:08:50 +00:00
Mark Severson 3305186468 x/crypto/ssh/agent: Support v1 remove all message
Some ssh-agent clients expect the server to support remove all messages
for protocols 1 & 2 and error if protocol 1 support is missing.

This adds a null-op implementation of the remove all message in similar
fashion to the existing list all message support.

Fixes golang/go#15159

Change-Id: I9389885d89c9147f3e10850893bba6ed7d0a4e82
Reviewed-on: https://go-review.googlesource.com/21468
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
2016-04-20 10:42:34 +00:00
Scott Bell de15db8e4b x/crypto/ssh: omit empty fields in error message
Although the signal and msg fields are assigned together, their
values originate from the remote server and may be empty.

Fixes golang/go#14251

Change-Id: I9d9094cc69f3c14bf1648af59951f6b6c7a71e0a
Reviewed-on: https://go-review.googlesource.com/22196
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-20 10:39:07 +00:00
Han-Wen Nienhuys 2f6fccd33b x/crypto/ssh: debug support for msgUserAuthSuccess and msgChannelData
Change-Id: I14d59509f22edf01827610a4ef4c50b53cbc8059
Reviewed-on: https://go-review.googlesource.com/21605
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-19 12:57:35 +00:00
Han-Wen Nienhuys d68c3ecb62 x/crypto/ssh: make sure the initial key exchange happens once.
This is done by running the key exchange and setting the session ID
under mutex. If the first exchange encounters an already set session
ID, then do nothing.

This fixes a race condition:

On setting up the connection, both sides sent a kexInit to initiate
the first (mandatory) key exchange.  If one side was faster, the
faster side might have completed the key exchange, before the slow
side had a chance to send a kexInit.  The slow side would send a
kexInit which would trigger a second key exchange. The resulting
confirmation message (msgNewKeys) would confuse the authentication
loop.

This fix removes sessionID from the transport struct.

This fix also deletes the unused interface rekeyingTransport.

Fixes #15066

Change-Id: I7f303bce5d3214c9bdd58f52d21178a185871d90
Reviewed-on: https://go-review.googlesource.com/21606
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
2016-04-12 17:14:56 +00:00
John Schnake 3fbbcd23f1 x/crypto/ssh/terminal: ensure windows MakeRaw returns previous state
The MakeRaw method should be returning the original state so that
it can be restored.  However, the current implementation is returning
the new, "raw" state.

Fixes golang/go#15155

Change-Id: I8e0b87229b7577544e1118fa4b95664d3a9cf5da
Reviewed-on: https://go-review.googlesource.com/21612
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-08 16:30:10 +00:00
John Schnake 21e42927af x/crypto/ssh/terminal: create stubs for plan9 methods
To facilitate testing of methods in other GOOSs we need plan9 to
be able to build and run the test without a errors due to
undefined methods.

Fixes golang/go#15195

Change-Id: Ida334676f92db6fb4652af3e3a9f6bc13a96052c
Reviewed-on: https://go-review.googlesource.com/21711
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-08 15:58:03 +00:00
Han-Wen Nienhuys 9e7f5dc375 x/crypto/ssh: interpret disconnect message as error in the transport layer.
This ensures that higher level parts (e.g. the client authentication
loop) never have to deal with disconnect messages.

Fixes https://github.com/coreos/fleet/issues/565.

Change-Id: Ie164b6c4b0982c7ed9af6d3bf91697a78a911a20
Reviewed-on: https://go-review.googlesource.com/20801
Reviewed-by: Anton Khramov <anton@endocode.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-03-29 14:38:23 +00:00
Julian Kornberger c7e3b0ebdd x/crypto/ssh: Add timeout for dialing
Fixes golang/go#14941

Change-Id: I2b3a976d451d311519fab6cdabdc98a4a4752e31
Reviewed-on: https://go-review.googlesource.com/21136
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-27 21:20:01 +00:00
Han-Wen Nienhuys 5dc8cb4b8a x/crypto/ssh/agent: add a client example and tweak package doc.
Change-Id: I373fdbb6351d71b12fcfed31cf4b08975a443294
Reviewed-on: https://go-review.googlesource.com/19894
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-26 16:32:03 +00:00
Peter Moody 3760e01685 x/crypto/ssh: add function to parse known_hosts files.
Change-Id: I9258ecf2b38258e31bcb6e73ac042ad8125fd2d1
Reviewed-on: https://go-review.googlesource.com/18106
Reviewed-by: Peter Moody <peter.moody@gmail.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-01-13 19:11:26 +00:00
Adam Langley 803f01ea27 x/crypto/ssh: allow a custom Config to specify CBC mode.
Cryptographic flaws are so hard to kill it can only be a matter of time
before they start crying “brains!” and holding their arms out straight.

Fixes golang/go#13776.

Change-Id: Iee1c19dbe823eb8728e283dd11083638e41f7189
Reviewed-on: https://go-review.googlesource.com/18482
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-01-10 18:39:22 +00:00
Mark Severson f18420efc3 x/crypto/ssh/agent: Fix keyring removing the wrong key(s)
The Remove method for the keyring sliced the internal keys list
incorrectly when removing a key. This caused the wrong key to be removed
or sometimes multiple keys were removed. Additionally, if the key to be
removed was the last key, the method never returned.

Fixes golang/go#13628

Change-Id: I0facbcb8f8b65709222067ce37ea26e3fb5ba8e8
Reviewed-on: https://go-review.googlesource.com/17870
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-15 19:15:01 +00:00
Carl Jackson 7b85b097bf x/crypto/ssh: run go fmt
Change-Id: Ibb071aa550ca7392543c2d1eba8f8a69ba1d86fa
Reviewed-on: https://go-review.googlesource.com/17270
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-12-01 00:25:08 +00:00
Jonathan Boulle 346896d577 crypto/ssh: fix typo in error string.
cound -> could
Also change fmt.Errorf -> errors.New for consistency.

Change-Id: I0b6900a76b70cd37ab2e8d61327868b46366ec64
Reviewed-on: https://go-review.googlesource.com/11235
Reviewed-by: Adam Langley <agl@golang.org>
2015-11-15 23:11:30 +00:00
Lewin Bormann 59a4410d82 x/crypto/ssh: Add protocol version to ServerVersion
280be00 introduced custom server versions; however, at least OpenSSH
clients do not accept a server version that doesn't start with a
protocol version like "SSH-2.0-"; this is not documented in this
library, and automatically adding it in case that the user did not does
no harm.

Change-Id: Iafc23b23160a8277b10cbf29778dc64a96351bd7
Reviewed-on: https://go-review.googlesource.com/14018
Reviewed-by: Adam Langley <agl@golang.org>
2015-09-28 22:51:19 +00:00
Evan Broder e74b0352e5 crypto/ssh: Support turning a crypto.Signer into an ssh.Signer
This adds a NewSignerFromSigner to crypto/ssh which takes a
crypto.Signer and turns it into an ssh.Signer, helpful if, e.g., your
crypto.Signer is backed by some sort of hardware device.

The interfaces are very similar - the biggest differences are that a
crypto.Signer accepts hashed data, while an ssh.Signer does not, and
some differences in encoding for DSA and ECDSA signatures.

This also adjusts NewSignerFromKey to use NewSignerFromSigner where
possible, dropping the rsaPrivateKey and ecdsaPrivateKey types in
favor of wrappedSigner. (However, because *dsa.PrivateKey is not a
crypto.Signer, we still have to keep dsaPrivateKey)

Change-Id: Ia2e20ece9c9d3844b4e5a64c1a7d997178ec8781
Reviewed-on: https://go-review.googlesource.com/10953
Reviewed-by: Adam Langley <agl@golang.org>
2015-09-24 18:35:42 +00:00
Matt Bostock d5c5f1769f crypto/ssh: Parse ECDSA key using struct
Change parseECDSA() to unmarshal the key's contents into a struct
representing the wire format, consistent with the parseRSA() and
parseDSA(), to make the code more readable and its intent clearer.

Change-Id: Iea85630107ac0b3e681807d2278390c8c50ce141
Reviewed-on: https://go-review.googlesource.com/13663
Reviewed-by: Han-Wen Nienhuys <hanwenn@gmail.com>
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 22:25:31 +00:00
Thomas Desrosiers 6c2080b3cc crypto/ssh: clearer error messages when "no ciphers in common"
The error message reported by the ssh client when it can't find a
"cipher" in common between the client and server was overly vague.  This
adds more detailed error messages to findAgreedAlgorithms so that the
user can more easily identify which of the components can't reach
agreement.

Change-Id: I4d985e92fea964793213e5600b52b3141e712000
Reviewed-on: https://go-review.googlesource.com/13817
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 19:16:37 +00:00
Han-Wen Nienhuys c169681727 crypto/ssh: fix deadlock during error condition.
Unblock writers if a read error occurs while writers are blocked on a
pending key change.

Add test to check for deadlocks in error paths in handshake.go

Fixes golang/go#11992.

Change-Id: Id098bd9fec3d4fe83daeb2b7f935e5647c19afd3
Reviewed-on: https://go-review.googlesource.com/13594
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 22:20:11 +00:00
Han-Wen Nienhuys 4e213c0672 x/crypto/ssh: close memPipe after running kex test.
Change-Id: I6022d669946a7cb3403757a7c0dbf21a474e1c95
Reviewed-on: https://go-review.googlesource.com/13590
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 22:17:06 +00:00
hanwen aca188fab6 x/crypto/ssh: implement curve25519-sha256@libssh.org key agreement.
Fixes golang/go#11004.

Change-Id: Ic37cf9d620e3397b7ad769ae16abdaee63a7733b
Reviewed-on: https://go-review.googlesource.com/13592
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 22:16:34 +00:00
Han-Wen Nienhuys e3ebf1a8d3 x/crypto/ssh/test: test all key exchanges against sshd.
Change-Id: I9d775d6e9c39bee1f2bf914ba3659acb6b0029dd
Reviewed-on: https://go-review.googlesource.com/13591
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 21:45:12 +00:00
Eric Garrido 83f1503f77 crypto/ssh: Handle error in dial to avoid a goroutine leak
If the channel open request failed, a nil channel would be provided to
DiscardRequests, which would never return.

We return the error early to avoid this goroutine leak.

Change-Id: I4c0e0a7698f7623c042f2a04941b8c50e8031d33
Reviewed-on: https://go-review.googlesource.com/13390
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-08-08 08:51:02 +00:00
hanwen 2f3083f616 crypto/ssh: allow client to specify host key algorithms.
Fixes golang/go#11722.

Change-Id: I4fa2a1db14050151f9269427ca35cf7ebd21440a
Reviewed-on: https://go-review.googlesource.com/12907
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-04 13:06:53 +00:00
Dave Cheney 77de70a8d4 ssh: fix flake in TestHostKeyCert
Update golang/go#11811

The increased default concurrency in Go 1.5 showed up a test flake in
the TestHostKeyCert test. Under load, when the client provided incorrect
data, both sides would race to tear down the connection, which would often
lead to the server side, running in its own goroutine to see an unexpected
EOF or connection reset.

Fix this flake (and the incorrect use of t.Fatalf) by passing the error back
to the main goroutine for inspection. This also lets us ignore the expected
error in the unsuccessful path

Change-Id: I5a95c6d240479e9d537f34177e5ca8023b1b08e9
Reviewed-on: https://go-review.googlesource.com/12916
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-02 23:53:45 +00:00
Dave Cheney 7f27901cb9 ssh: fix deadlock during error path
Fixes golang/go#11882

If an error occurs during handshakeTransport.writePacket the lock may not be
released. Fix this by using defer rather than manually unlocking in all paths.

Change-Id: I0010284b4f7d99907c86b4c0e140ab6cf37b0441
Reviewed-on: https://go-review.googlesource.com/12888
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-30 21:10:58 +00:00
David du Colombier fcdb74e78f ssh: skip TestHandshakeBasic on Plan 9
Updates golang/go#7797.

Change-Id: I7aa57f3fb812ecf644c8f8c065848938868e473b
Reviewed-on: https://go-review.googlesource.com/12767
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-30 09:22:02 +00:00
Peter Moody 7d5b0be716 crypto/ssh: allow identities to be constrained.
The ssh-agent protocol allows the usage of keys and certs added to a
given agent to be constrained in certain ways. The only constraints
currently supported are lifetime (keys expire after some number of
seconds) and confirmation (the agent requires user confirmation before
performing any operations with the private key).

Change-Id: Idba5760db929805bf3da43fdcaca53ae6c479ca4
Reviewed-on: https://go-review.googlesource.com/12260
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Peter Moody <pmoody@uber.com>
2015-07-16 17:35:58 +00:00
Andrew Gerrand 4d8f0cfeca ssh: fix spelling of test so that it runs
Change-Id: I65ebae299f272d5f1367ca4c2e47e51f9c392b6a
Reviewed-on: https://go-review.googlesource.com/12229
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-07-15 23:39:58 +00:00
Dmitry Savintsev 02a186af8b crypto/ssh: fix a comment (trivial)
Comment in Agent made to conform the godoc style.

Change-Id: I4e1e8ce1a15ca346715fae257ae2178f5093d40d
Reviewed-on: https://go-review.googlesource.com/12183
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-14 19:39:11 +00:00
Michael Gehring 4831188890 x/crypto/ssh: fix comment
Fixes golang/go#11603

Change-Id: I019af73f5e036b47b8bd6c4a5541c06b97b44f11
Reviewed-on: https://go-review.googlesource.com/11866
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-06 16:48:17 +00:00
Michael Gehring cc04154d65 x/crypto/ssh: fix bounds check in parseString
Fixes #11348

Change-Id: If083744343256a2a53eb813411ba0c9a359d6dbd
Reviewed-on: https://go-review.googlesource.com/11332
Reviewed-by: Adam Langley <agl@golang.org>
2015-06-27 22:03:05 +00:00
Taru Karttunen 60052bd85f ssh: Add explicit type in comparison with constant to make go-fuzz happy
Currently using go-fuzz with code using golang.org/x/crypto/ssh fails
because it passes CertTimeInfinity to an interface{} and automatically
tries to use an int, which overflows and results in a compile error.

This change adds a no-op type conversion inside the function which
makes things compile with go-fuzz.

Change-Id: Iade0c0df7e20cbac4928480fad3e44c831e1e00a
Reviewed-on: https://go-review.googlesource.com/11285
Reviewed-by: Adam Langley <agl@golang.org>
2015-06-22 23:34:07 +00:00
Han-Wen Nienhuys 1e856cbfdf crypto/ssh: fix format string error in test.
Change-Id: I0c84f11fb74ee478617deb1b743a759c9f789101
Reviewed-on: https://go-review.googlesource.com/10822
Reviewed-by: Adam Langley <agl@golang.org>
2015-06-08 19:52:49 +00:00
Dmitry Savintsev 7ac880de98 crypto/ssh: trivial spacing change for gofmt compliance
Extra space added by 'gofmt -w' to align key/value columns
in the new test (TestParseCertWithOptions).

Follow-up on https://go-review.googlesource.com/#/c/9375/.

Change-Id: Id7dd0bc420888f12ce0af4178096bdc9f5c57161
Reviewed-on: https://go-review.googlesource.com/9627
Reviewed-by: Adam Langley <agl@golang.org>
2015-06-08 19:50:34 +00:00
Han-Wen Nienhuys 9fb97e878d x/crypto/ssh: add padding oracle countermeasures for AES-CBC.
This deprives an attacker of feedback for guesses against the packet
length given by the connection dropping.

Change-Id: I14939a82e5243a86d192bb18be93d45589227147
Reviewed-on: https://go-review.googlesource.com/9908
Reviewed-by: Adam Langley <agl@golang.org>
2015-05-30 19:27:53 +00:00
datianshi e3f150b437 ssh: add hmac-sha2-256.
Fixes golang/go#10274

Change-Id: Id8386828ee92ccc6cba5197831cdb8b2ce0cd648
Reviewed-on: https://go-review.googlesource.com/8353
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-05-14 18:39:32 +00:00
Han-Wen Nienhuys 74f810a015 x/crypto/ssh: bail early if a server has no auth methods configured.
Change-Id: I58fdfbe00fcc4ca09da9699edcc181cc512feef7
Reviewed-on: https://go-review.googlesource.com/9807
Reviewed-by: JP Sugarbroad <jpsugar@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
2015-05-11 18:34:55 +00:00
Dmitry Savintsev 59435533c8 crypto/ssh: fix encoding of ssh certs with critical options
Attention - BREAKING change for the certificates generated with
the previous versions of crypto/ssh!  Need to regenerate
certificates with a version of crypto/ssh library including
this fix.

[PROTOCOL.cerkeys] requires two length fields for non-empty
values of critical options (or extensions - but those are
currently always empty)  - see
https://bugzilla.mindrot.org/show_bug.cgi?id=2389.
Add SSH-conform handling of such composite values in marshalTuples
and parseTuples and related test (TestParseCertWithOptions) parsing
a certificate created with ssh-keygen which includes critical options.

Fixes #10569

Change-Id: Iecbfca67a66668880635141c72bc5fc370a9c112
Reviewed-on: https://go-review.googlesource.com/9375
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-05-04 20:45:50 +00:00