1 |
commit: 9cf9aa64d52743263e9619c3cd0794557e3b5445 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 29 13:02:33 2018 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 29 13:08:20 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cf9aa64 |
7 |
|
8 |
dev-libs/openssl: Revbumps to fix CVE-2018-0735 |
9 |
|
10 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
11 |
Package-Manager: Portage-2.3.51, Repoman-2.3.11 |
12 |
|
13 |
.../files/openssl-1.1.0i-CVE-2018-0735.patch | 44 ++++++++++++++++++++++ |
14 |
.../files/openssl-1.1.1-CVE-2018-0735.patch | 44 ++++++++++++++++++++++ |
15 |
...nssl-1.1.0i.ebuild => openssl-1.1.0i-r1.ebuild} | 5 ++- |
16 |
...penssl-1.1.1.ebuild => openssl-1.1.1-r1.ebuild} | 4 ++ |
17 |
4 files changed, 95 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/dev-libs/openssl/files/openssl-1.1.0i-CVE-2018-0735.patch b/dev-libs/openssl/files/openssl-1.1.0i-CVE-2018-0735.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..5762c04fa34 |
22 |
--- /dev/null |
23 |
+++ b/dev-libs/openssl/files/openssl-1.1.0i-CVE-2018-0735.patch |
24 |
@@ -0,0 +1,44 @@ |
25 |
+From 56fb454d281a023b3f950d969693553d3f3ceea1 Mon Sep 17 00:00:00 2001 |
26 |
+From: Pauli <paul.dale@××××××.com> |
27 |
+Date: Fri, 26 Oct 2018 10:54:58 +1000 |
28 |
+Subject: [PATCH] Timing vulnerability in ECDSA signature generation |
29 |
+ (CVE-2018-0735) |
30 |
+ |
31 |
+Preallocate an extra limb for some of the big numbers to avoid a reallocation |
32 |
+that can potentially provide a side channel. |
33 |
+ |
34 |
+Reviewed-by: Bernd Edlinger <bernd.edlinger@×××××××.de> |
35 |
+(Merged from https://github.com/openssl/openssl/pull/7486) |
36 |
+ |
37 |
+(cherry picked from commit 99540ec79491f59ed8b46b4edf130e17dc907f52) |
38 |
+--- |
39 |
+ crypto/ec/ec_mult.c | 6 +++--- |
40 |
+ 1 file changed, 3 insertions(+), 3 deletions(-) |
41 |
+ |
42 |
+diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c |
43 |
+index 22bb30ffa1..ff882cce20 100644 |
44 |
+--- a/crypto/ec/ec_mult.c |
45 |
++++ b/crypto/ec/ec_mult.c |
46 |
+@@ -177,8 +177,8 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, |
47 |
+ */ |
48 |
+ cardinality_bits = BN_num_bits(cardinality); |
49 |
+ group_top = bn_get_top(cardinality); |
50 |
+- if ((bn_wexpand(k, group_top + 1) == NULL) |
51 |
+- || (bn_wexpand(lambda, group_top + 1) == NULL)) |
52 |
++ if ((bn_wexpand(k, group_top + 2) == NULL) |
53 |
++ || (bn_wexpand(lambda, group_top + 2) == NULL)) |
54 |
+ goto err; |
55 |
+ |
56 |
+ if (!BN_copy(k, scalar)) |
57 |
+@@ -205,7 +205,7 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, |
58 |
+ * k := scalar + 2*cardinality |
59 |
+ */ |
60 |
+ kbit = BN_is_bit_set(lambda, cardinality_bits); |
61 |
+- BN_consttime_swap(kbit, k, lambda, group_top + 1); |
62 |
++ BN_consttime_swap(kbit, k, lambda, group_top + 2); |
63 |
+ |
64 |
+ group_top = bn_get_top(group->field); |
65 |
+ if ((bn_wexpand(s->X, group_top) == NULL) |
66 |
+-- |
67 |
+2.19.1 |
68 |
+ |
69 |
|
70 |
diff --git a/dev-libs/openssl/files/openssl-1.1.1-CVE-2018-0735.patch b/dev-libs/openssl/files/openssl-1.1.1-CVE-2018-0735.patch |
71 |
new file mode 100644 |
72 |
index 00000000000..295f5dbe8d8 |
73 |
--- /dev/null |
74 |
+++ b/dev-libs/openssl/files/openssl-1.1.1-CVE-2018-0735.patch |
75 |
@@ -0,0 +1,44 @@ |
76 |
+From b1d6d55ece1c26fa2829e2b819b038d7b6d692b4 Mon Sep 17 00:00:00 2001 |
77 |
+From: Pauli <paul.dale@××××××.com> |
78 |
+Date: Fri, 26 Oct 2018 10:54:58 +1000 |
79 |
+Subject: [PATCH] Timing vulnerability in ECDSA signature generation |
80 |
+ (CVE-2018-0735) |
81 |
+ |
82 |
+Preallocate an extra limb for some of the big numbers to avoid a reallocation |
83 |
+that can potentially provide a side channel. |
84 |
+ |
85 |
+Reviewed-by: Bernd Edlinger <bernd.edlinger@×××××××.de> |
86 |
+(Merged from https://github.com/openssl/openssl/pull/7486) |
87 |
+ |
88 |
+(cherry picked from commit 99540ec79491f59ed8b46b4edf130e17dc907f52) |
89 |
+--- |
90 |
+ crypto/ec/ec_mult.c | 6 +++--- |
91 |
+ 1 file changed, 3 insertions(+), 3 deletions(-) |
92 |
+ |
93 |
+diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c |
94 |
+index 7e1b3650e7..0e0a5e1394 100644 |
95 |
+--- a/crypto/ec/ec_mult.c |
96 |
++++ b/crypto/ec/ec_mult.c |
97 |
+@@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r, |
98 |
+ */ |
99 |
+ cardinality_bits = BN_num_bits(cardinality); |
100 |
+ group_top = bn_get_top(cardinality); |
101 |
+- if ((bn_wexpand(k, group_top + 1) == NULL) |
102 |
+- || (bn_wexpand(lambda, group_top + 1) == NULL)) { |
103 |
++ if ((bn_wexpand(k, group_top + 2) == NULL) |
104 |
++ || (bn_wexpand(lambda, group_top + 2) == NULL)) { |
105 |
+ ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); |
106 |
+ goto err; |
107 |
+ } |
108 |
+@@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r, |
109 |
+ * k := scalar + 2*cardinality |
110 |
+ */ |
111 |
+ kbit = BN_is_bit_set(lambda, cardinality_bits); |
112 |
+- BN_consttime_swap(kbit, k, lambda, group_top + 1); |
113 |
++ BN_consttime_swap(kbit, k, lambda, group_top + 2); |
114 |
+ |
115 |
+ group_top = bn_get_top(group->field); |
116 |
+ if ((bn_wexpand(s->X, group_top) == NULL) |
117 |
+-- |
118 |
+2.19.1 |
119 |
+ |
120 |
|
121 |
diff --git a/dev-libs/openssl/openssl-1.1.0i.ebuild b/dev-libs/openssl/openssl-1.1.0i-r1.ebuild |
122 |
similarity index 98% |
123 |
rename from dev-libs/openssl/openssl-1.1.0i.ebuild |
124 |
rename to dev-libs/openssl/openssl-1.1.0i-r1.ebuild |
125 |
index f97d4157d7e..4cc9eb656d0 100644 |
126 |
--- a/dev-libs/openssl/openssl-1.1.0i.ebuild |
127 |
+++ b/dev-libs/openssl/openssl-1.1.0i-r1.ebuild |
128 |
@@ -1,4 +1,4 @@ |
129 |
-# Copyright 1999-2018 Gentoo Foundation |
130 |
+# Copyright 1999-2018 Gentoo Authors |
131 |
# Distributed under the terms of the GNU General Public License v2 |
132 |
|
133 |
EAPI="6" |
134 |
@@ -56,6 +56,7 @@ MULTILIB_WRAPPED_HEADERS=( |
135 |
|
136 |
PATCHES=( |
137 |
"${FILESDIR}"/${PN}-1.0.2a-x32-asm.patch #542618 |
138 |
+ "${FILESDIR}"/${P}-CVE-2018-0735.patch |
139 |
) |
140 |
|
141 |
src_prepare() { |
142 |
@@ -98,7 +99,7 @@ src_prepare() { |
143 |
-e $(has noman FEATURES \ |
144 |
&& echo '/^install:/s:install_docs::' \ |
145 |
|| echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \ |
146 |
- -e "/^DOCDIR/s@\$(BASENAME)@&-${PF}@" \ |
147 |
+ -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \ |
148 |
Configurations/unix-Makefile.tmpl \ |
149 |
|| die |
150 |
|
151 |
|
152 |
diff --git a/dev-libs/openssl/openssl-1.1.1.ebuild b/dev-libs/openssl/openssl-1.1.1-r1.ebuild |
153 |
similarity index 99% |
154 |
rename from dev-libs/openssl/openssl-1.1.1.ebuild |
155 |
rename to dev-libs/openssl/openssl-1.1.1-r1.ebuild |
156 |
index 3b7cd3fc019..01dfbd3ec61 100644 |
157 |
--- a/dev-libs/openssl/openssl-1.1.1.ebuild |
158 |
+++ b/dev-libs/openssl/openssl-1.1.1-r1.ebuild |
159 |
@@ -34,6 +34,10 @@ MULTILIB_WRAPPED_HEADERS=( |
160 |
usr/include/openssl/opensslconf.h |
161 |
) |
162 |
|
163 |
+PATCHES=( |
164 |
+ "${FILESDIR}"/${P}-CVE-2018-0735.patch |
165 |
+) |
166 |
+ |
167 |
src_prepare() { |
168 |
# keep this in sync with app-misc/c_rehash |
169 |
SSL_CNF_DIR="/etc/ssl" |