Commit 24d42f6e authored by Tobias Quathamer's avatar Tobias Quathamer
Browse files

Add patch to fix CVE-2019-6486.

Closes: #920548
parent e2f61e0d
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
From: "Dr. Tobias Quathamer" <toddy@debian.org>
Date: Sun, 27 Jan 2019 20:03:45 +0100
Subject: Fix CVE-2019-6486

---
 src/crypto/elliptic/elliptic.go | 3 ++-
 src/net/lookup_test.go          | 9 +++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go
index 4fc2b5e..c84657c 100644
--- a/src/crypto/elliptic/elliptic.go
+++ b/src/crypto/elliptic/elliptic.go
@@ -210,8 +210,9 @@ func (curve *CurveParams) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int,
 
 	x3 := new(big.Int).Mul(alpha, alpha)
 	beta8 := new(big.Int).Lsh(beta, 3)
+	beta8.Mod(beta8, curve.P)
 	x3.Sub(x3, beta8)
-	for x3.Sign() == -1 {
+	if x3.Sign() == -1 {
 		x3.Add(x3, curve.P)
 	}
 	x3.Mod(x3, curve.P)
diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go
index 1da0e49..6dc5f61 100644
--- a/src/net/lookup_test.go
+++ b/src/net/lookup_test.go
@@ -237,11 +237,16 @@ func TestLookupGmailTXT(t *testing.T) {
 		if len(txts) == 0 {
 			t.Error("got no record")
 		}
+		found := false
 		for _, txt := range txts {
-			if !strings.Contains(txt, tt.txt) || (!strings.HasSuffix(txt, tt.host) && !strings.HasSuffix(txt, tt.host+".")) {
-				t.Errorf("got %s; want a record containing %s, %s", txt, tt.txt, tt.host)
+			if strings.Contains(txt, tt.txt) && (strings.HasSuffix(txt, tt.host) || strings.HasSuffix(txt, tt.host+".")) {
+				found = true
+				break
 			}
 		}
+		if !found {
+			t.Errorf("got %v; want a record containing %s, %s", txts, tt.txt, tt.host)
+		}
 	}
 }
 
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@
0002-Fix-Lintian-warnings-about-wrong-interpreter-path.patch
0003-arm64-arm64asm-recognise-new-ssbb-pssbb-mnemonics-fr.patch
0004-Disable-test-for-UserHomeDir.patch
0005-Fix-CVE-2019-6486.patch