Fix CVE-2019-17596
authorDr. Tobias Quathamer <toddy@debian.org>
Sat, 19 Oct 2019 12:03:22 +0000 (14:03 +0200)
committerSylvain Beucler <beuc@debian.org>
Thu, 20 Apr 2023 14:32:58 +0000 (15:32 +0100)
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

index 575314b1b468908c3bb197ac656e368cb1f5e701..2fc4f1f05bfb09483e60882ff79bb5fd738f7c21 100644 (file)
@@ -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 {