aboutsummaryrefslogtreecommitdiff
path: root/ssh/agent/server_test.go
AgeCommit message (Collapse)Author
2023-10-11ssh: add support for SSH_AGENT_CONSTRAIN_EXTENSION with id 255Nicola Murino
it was changed in the following draft https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent-03 The id 3 is now used for SSH_AGENT_CONSTRAIN_MAXSIGN key constraint, an OpenSSH extension to the protocol that we do not currently support. Instead, we added a compatibility layer for SSH_AGENT_CONSTRAIN_EXTENSION with ID 3. Fixes golang/go#62311 Change-Id: I421aee92aee9e693e43f66e6a5515c055333cb9b Reviewed-on: https://go-review.googlesource.com/c/crypto/+/525355 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Nicola Murino <nicola.murino@gmail.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2023-07-31ssh: fix call to Fatalf from a non-test goroutineNicola Murino
Also fix some redundant type declarations. Change-Id: Iad2950b67b1ec2e2590c59393b8ad15421ed3add GitHub-Last-Rev: 41cf552f11387208491dee7b867050475043b25e GitHub-Pull-Request: golang/crypto#263 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/505798 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org>
2017-08-08ssh/agent: use right message to unlock agent, with related integration testsGh0u1L5
Change-Id: Ie2e7618be63179fb65b8eea60684254712149a77 Reviewed-on: https://go-review.googlesource.com/50810 Reviewed-by: Han-Wen Nienhuys <hanwen@google.com> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-26ssh/agent: parse constraints when adding keysGh0u1L5
Change-Id: I264fc3e3e441d6e5ff7c5aa624eee1018cf9e4de Reviewed-on: https://go-review.googlesource.com/50811 Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
2017-03-30ssh: require host key checking in the ClientConfigHan-Wen Nienhuys
This change breaks existing behavior. Before, a missing ClientConfig.HostKeyCallback would cause host key checking to be disabled. In this configuration, establishing a connection to any host just works, so today, most SSH client code in the wild does not perform any host key checks. This makes it easy to perform a MITM attack: * SSH installations that use keyboard-interactive or password authentication can be attacked with MITM, thereby stealing passwords. * Clients that use public-key authentication with agent forwarding are also vulnerable: the MITM server could allow the login to succeed, and then immediately ask the agent to authenticate the login to the real server. * Clients that use public-key authentication without agent forwarding are harder to attack unnoticedly: an attacker cannot authenticate the login to the real server, so it cannot in general present a convincing server to the victim. Now, a missing HostKeyCallback will cause the handshake to fail. This change also provides InsecureIgnoreHostKey() and FixedHostKey(key) as ready made host checkers. A simplistic parser for OpenSSH's known_hosts file is given as an example. This change does not provide a full-fledged parser, as it has complexity (wildcards, revocation, hashed addresses) that will need further consideration. When introduced, the host checking feature maintained backward compatibility at the expense of security. We have decided this is not the right tradeoff for the SSH library. Fixes golang/go#19767 Change-Id: I45fc7ba9bd1ea29c31ec23f115cdbab99913e814 Reviewed-on: https://go-review.googlesource.com/38701 Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-11x/crypto/ssh/agent: ecdsa key/cert typoPeter Moody
Introduced by me in 21536 Change-Id: I4a5f3507270a3d6eea9779508642ea5789d1efca Reviewed-on: https://go-review.googlesource.com/24811 Reviewed-by: Han-Wen Nienhuys <hanwen@google.com> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-06-24agent: add agent server support for ed25519 keys.Peter Moody
the client library already supports them. Fixes golang/go#16096 Change-Id: Iaa117ee31f706301e8b24c2775f5a604ef005440 Reviewed-on: https://go-review.googlesource.com/24285 Reviewed-by: Adam Langley <agl@golang.org>
2016-04-25x/crypto/ssh: support more keytypes in the agent.Peter Moody
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-20x/crypto/ssh/agent: Support v1 remove all messageMark Severson
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>
2015-07-16crypto/ssh: allow identities to be constrained.Peter Moody
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>
2014-11-10go.crypto: use golang.org/x/... import pathsAndrew Gerrand
LGTM=bradfitz R=rsc, bradfitz CC=golang-codereviews https://golang.org/cl/167190043
2014-04-09go.crypto/ssh: import gosshnew.Adam Langley
See https://groups.google.com/d/msg/Golang-nuts/AoVxQ4bB5XQ/i8kpMxdbVlEJ R=hanwen CC=golang-codereviews https://golang.org/cl/86190043