From 7dd220bcdb773f80bb5fdf268a9b675eafccebde Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Sat, 19 Oct 2019 14:03:22 +0200 Subject: [PATCH] Fix CVE-2019-17596 Cherry-picked from upstream: https://github.com/golang/go/commit/2017d88dbc096381d4f348d2fb08bfb3c2b7ed73 Gbp-Pq: Name 0008-Fix-CVE-2019-17596.patch --- src/crypto/dsa/dsa.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crypto/dsa/dsa.go b/src/crypto/dsa/dsa.go index 575314b..2fc4f1f 100644 --- a/src/crypto/dsa/dsa.go +++ b/src/crypto/dsa/dsa.go @@ -279,6 +279,9 @@ func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool { } w := new(big.Int).ModInverse(s, pub.Q) + if w == nil { + return false + } n := pub.Q.BitLen() if n&7 != 0 { -- 2.30.2