From b82246307bd525fde15c1df976318003716bca68 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 17 Jan 2017 17:10:46 -0800 Subject: [PATCH] crypto/ssh: fix parsing order for ssh.ParseDSAPrivateKey The inline struct has the wrong order for the public and private key parts. Change-Id: Ib3a5d6846296a2300241331a2ad398579e042ca9 Reviewed-on: https://go-review.googlesource.com/35351 Run-TryBot: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- ssh/keys.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssh/keys.go b/ssh/keys.go index 21f7d0d..f38de98 100644 --- a/ssh/keys.go +++ b/ssh/keys.go @@ -798,8 +798,8 @@ func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { P *big.Int Q *big.Int G *big.Int - Priv *big.Int Pub *big.Int + Priv *big.Int } rest, err := asn1.Unmarshal(der, &k) if err != nil { @@ -816,9 +816,9 @@ func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { Q: k.Q, G: k.G, }, - Y: k.Priv, + Y: k.Pub, }, - X: k.Pub, + X: k.Priv, }, nil }