aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/crypto/ssh/client.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-01-06 14:50:12 +0100
committerPaul Holzinger <pholzing@redhat.com>2022-01-12 17:40:12 +0100
commit0151e10b627fbfb82b7d633f3fc9703678ed4eaf (patch)
treedea285c6d5069c90e7e32694b24f60d7c10a94eb /vendor/golang.org/x/crypto/ssh/client.go
parent495884b3195de482dc610a2a002db7e053188a32 (diff)
downloadpodman-0151e10b627fbfb82b7d633f3fc9703678ed4eaf.tar.gz
podman-0151e10b627fbfb82b7d633f3fc9703678ed4eaf.tar.bz2
podman-0151e10b627fbfb82b7d633f3fc9703678ed4eaf.zip
update buildah to latest and use new network stack
Make sure buildah uses the new network stack. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/client.go')
-rw-r--r--vendor/golang.org/x/crypto/ssh/client.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go
index 99f68bd32..ba8621a89 100644
--- a/vendor/golang.org/x/crypto/ssh/client.go
+++ b/vendor/golang.org/x/crypto/ssh/client.go
@@ -115,12 +115,25 @@ func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) e
// verifyHostKeySignature verifies the host key obtained in the key
// exchange.
-func verifyHostKeySignature(hostKey PublicKey, result *kexResult) error {
+func verifyHostKeySignature(hostKey PublicKey, algo string, result *kexResult) error {
sig, rest, ok := parseSignatureBody(result.Signature)
if len(rest) > 0 || !ok {
return errors.New("ssh: signature parse error")
}
+ // For keys, underlyingAlgo is exactly algo. For certificates,
+ // we have to look up the underlying key algorithm that SSH
+ // uses to evaluate signatures.
+ underlyingAlgo := algo
+ for sigAlgo, certAlgo := range certAlgoNames {
+ if certAlgo == algo {
+ underlyingAlgo = sigAlgo
+ }
+ }
+ if sig.Format != underlyingAlgo {
+ return fmt.Errorf("ssh: invalid signature algorithm %q, expected %q", sig.Format, underlyingAlgo)
+ }
+
return hostKey.Verify(result.H, sig)
}