summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch')
-rw-r--r--meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch b/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch
new file mode 100644
index 0000000000..134cfab737
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.12/0010-fix-CVE-2019-17596.patch
@@ -0,0 +1,42 @@
1From f1783e1ce44a86c000a7c380a57a805c89c3efbe Mon Sep 17 00:00:00 2001
2From: Katie Hockman <katie@golang.org>
3Date: Mon, 14 Oct 2019 16:42:21 -0400
4Subject: [PATCH] crypto/dsa: prevent bad public keys from causing panic
5
6dsa.Verify might currently use a nil s inverse in a
7multiplication if the public key contains a non-prime Q,
8causing a panic. Change this to check that the mod
9inverse exists before using it.
10
11Fixes CVE-2019-17596
12
13Change-Id: I94d5f3cc38f1b5d52d38dcb1d253c71b7fd1cae7
14Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/572809
15Reviewed-by: Filippo Valsorda <valsorda@google.com>
16(cherry picked from commit 9119dfb0511326d4485b248b83d4fde19c95d0f7)
17Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/575232
18
19CVE: CVE-2019-17596
20Upstream-Status: Backport [https://github.com/golang/go/commit/2017d88dbc096381d4f348d2fb08bfb3c2b7ed73]
21Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
22---
23 src/crypto/dsa/dsa.go | 3 +++
24 1 file changed, 3 insertions(+)
25
26diff --git a/src/crypto/dsa/dsa.go b/src/crypto/dsa/dsa.go
27index 575314b..2fc4f1f 100644
28--- a/src/crypto/dsa/dsa.go
29+++ b/src/crypto/dsa/dsa.go
30@@ -279,6 +279,9 @@ func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool {
31 }
32
33 w := new(big.Int).ModInverse(s, pub.Q)
34+ if w == nil {
35+ return false
36+ }
37
38 n := pub.Q.BitLen()
39 if n&7 != 0 {
40--
412.23.0
42