aboutsummaryrefslogtreecommitdiff
path: root/ssh/agent/server_test.go
diff options
context:
space:
mode:
authorNicola Murino <nicola.murino@gmail.com>2023-09-03 18:26:04 +0200
committerFilippo Valsorda <filippo@golang.org>2023-10-11 10:27:03 +0000
commit2aeefc3f8a8174d7c23f7ec8e92ecebb47db0b49 (patch)
treef6f34fb710ca11a959d6e241e387d0cb78fd29ea /ssh/agent/server_test.go
parente3cc52e598e302f8c613a645bb7231264d8ec995 (diff)
downloadgo-x-crypto-2aeefc3f8a8174d7c23f7ec8e92ecebb47db0b49.tar.xz
ssh: add support for SSH_AGENT_CONSTRAIN_EXTENSION with id 255
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>
Diffstat (limited to 'ssh/agent/server_test.go')
-rw-r--r--ssh/agent/server_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/ssh/agent/server_test.go b/ssh/agent/server_test.go
index 0af8545..7700d18 100644
--- a/ssh/agent/server_test.go
+++ b/ssh/agent/server_test.go
@@ -243,7 +243,11 @@ func TestParseConstraints(t *testing.T) {
ExtensionDetails: []byte(fmt.Sprintf("details: %d", i)),
}
expect = append(expect, ext)
- data = append(data, agentConstrainExtension)
+ if i%2 == 0 {
+ data = append(data, agentConstrainExtension)
+ } else {
+ data = append(data, agentConstrainExtensionV00)
+ }
data = append(data, ssh.Marshal(ext)...)
}
_, _, extensions, err := parseConstraints(data)