From 36ea3a7583b6da96b47b305af861518055e97bac Mon Sep 17 00:00:00 2001 From: edef Date: Tue, 14 Jun 2022 17:35:57 +0000 Subject: [PATCH] ssh/agent: match OpenSSH extensionAgentMsg, not IETF draft The OpenSSH wire format just suffixes the raw extension body, without a nested string. Fixes golang/go#51689 Change-Id: Ic224cedb934ba0563abca9a45a6be1c67769ed6d Reviewed-on: https://go-review.googlesource.com/c/crypto/+/412154 Reviewed-by: Roland Shoemaker Run-TryBot: Filippo Valsorda Run-TryBot: hopehook Reviewed-by: Daniel Lublin Auto-Submit: Filippo Valsorda Reviewed-by: Filippo Valsorda TryBot-Result: Gopher Robot Reviewed-by: David Chase --- ssh/agent/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssh/agent/client.go b/ssh/agent/client.go index 3c4d18a15c..eb6bc71792 100644 --- a/ssh/agent/client.go +++ b/ssh/agent/client.go @@ -226,7 +226,9 @@ var ErrExtensionUnsupported = errors.New("agent: extension unsupported") type extensionAgentMsg struct { ExtensionType string `sshtype:"27"` - Contents []byte + // NOTE: this matches OpenSSH's PROTOCOL.agent, not the IETF draft [PROTOCOL.agent], + // so that it matches what OpenSSH actually implements in the wild. + Contents []byte `ssh:"rest"` } // Key represents a protocol 2 public key as defined in