aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssl
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-07-18 10:25:07 +0300
committerNatanael Copa <ncopa@alpinelinux.org>2018-11-22 16:32:44 +0100
commit8318a0b07a3aac56659289654c3403dfb8ee5ae1 (patch)
tree7679e00431fc367ecc7fe9543b3b908791a97f59 /main/openssl
parent83efaea263b7c03fff18c3cd4a08f46fe6d55ca0 (diff)
downloadaports-8318a0b07a3aac56659289654c3403dfb8ee5ae1.tar.bz2
aports-8318a0b07a3aac56659289654c3403dfb8ee5ae1.tar.xz
main/openssl: fix CVE-2018-0732 and CVE-2018-0737
fixes #8814 fixes #9009
Diffstat (limited to 'main/openssl')
-rw-r--r--main/openssl/APKBUILD9
-rw-r--r--main/openssl/CVE-2018-0732.patch39
-rw-r--r--main/openssl/CVE-2018-0737.patch28
3 files changed, 75 insertions, 1 deletions
diff --git a/main/openssl/APKBUILD b/main/openssl/APKBUILD
index 60a1080583..fe3391bacb 100644
--- a/main/openssl/APKBUILD
+++ b/main/openssl/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Timo Teras <timo.teras@iki.fi>
pkgname=openssl
pkgver=1.0.2o
-pkgrel=0
+pkgrel=1
pkgdesc="Toolkit for SSL v2/v3 and TLS v1"
url="http://openssl.org"
depends=
@@ -29,6 +29,8 @@ source="http://www.openssl.org/source/${pkgname}-${pkgver}.tar.gz
1002-backport-changes-from-upstream-padlock-module.patch
1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
1004-crypto-engine-autoload-padlock-dynamic-engine.patch
+ CVE-2018-0732.patch
+ CVE-2018-0737.patch
"
# secfixes:
@@ -70,6 +72,9 @@ source="http://www.openssl.org/source/${pkgname}-${pkgver}.tar.gz
# - CVE-2017-3738
# - CVE-2018-0733
# - CVE-2018-0739
+# 1.0.2o-r1:
+# - CVE-2018-0732
+# - CVE-2018-0737
_builddir="$srcdir"/$pkgname-$pkgver
@@ -172,3 +177,5 @@ fc4e383ec85c6543e4e82520904122a5a5601c68042ece1e95a0cae95e02d89174f06f78ba2f8aac
a3555440b5f544bfd6b9ad97557d8f4c1d673f6a35219f65056a72035d186be5f354717ddf9784899b602464d48657b090ade24379552d43af97609c0f48c389 1002-backport-changes-from-upstream-padlock-module.patch
6353c7a94016c20db5d683dde37775f6780952ecdb1a5f39f878d04ba37f6ad79ae10fb6d65d181d912505a5d1e22463004cd855d548b364c00b120da2b0fdbc 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch
b72436eb8d4dac42d8da76a51d46cfc03e92e162f692a7a1761201221b9c6d66b738c08270b2260f02ce47b42043538474df73a7185dd4a809dd3b14cc8af7c3 1004-crypto-engine-autoload-padlock-dynamic-engine.patch"
+ff91298629f157496a012da00ba7325923f5d087bfa54b60e205bf2dfb06374e958912e0df39dbdf39773555455c1a3afa3dcde1ddfec6e85cf89b0b62cc0eb4 CVE-2018-0732.patch
+70be7fb9abad901fd84e8028e328c5b2fb7feff18547cfb749c5f59faf06eceab9052f9979d721670f6f3e099ba59761e8394e986565d349dd25e9718eaa99f0 CVE-2018-0737.patch"
diff --git a/main/openssl/CVE-2018-0732.patch b/main/openssl/CVE-2018-0732.patch
new file mode 100644
index 0000000000..148e7c3bc1
--- /dev/null
+++ b/main/openssl/CVE-2018-0732.patch
@@ -0,0 +1,39 @@
+From 3984ef0b72831da8b3ece4745cac4f8575b19098 Mon Sep 17 00:00:00 2001
+From: Guido Vranken <guidovranken@gmail.com>
+Date: Mon, 11 Jun 2018 19:38:54 +0200
+Subject: [PATCH] Reject excessively large primes in DH key generation.
+
+CVE-2018-0732
+
+Signed-off-by: Guido Vranken <guidovranken@gmail.com>
+
+(cherry picked from commit 91f7361f47b082ae61ffe1a7b17bb2adf213c7fe)
+
+Reviewed-by: Tim Hudson <tjh@openssl.org>
+Reviewed-by: Matt Caswell <matt@openssl.org>
+(Merged from https://github.com/openssl/openssl/pull/6457)
+---
+ crypto/dh/dh_key.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
+index 387558f1467..f235e0d682b 100644
+--- a/crypto/dh/dh_key.c
++++ b/crypto/dh/dh_key.c
+@@ -130,10 +130,15 @@ static int generate_key(DH *dh)
+ int ok = 0;
+ int generate_new_key = 0;
+ unsigned l;
+- BN_CTX *ctx;
++ BN_CTX *ctx = NULL;
+ BN_MONT_CTX *mont = NULL;
+ BIGNUM *pub_key = NULL, *priv_key = NULL;
+
++ if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) {
++ DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE);
++ return 0;
++ }
++
+ ctx = BN_CTX_new();
+ if (ctx == NULL)
+ goto err;
diff --git a/main/openssl/CVE-2018-0737.patch b/main/openssl/CVE-2018-0737.patch
new file mode 100644
index 0000000000..162dc3d7fa
--- /dev/null
+++ b/main/openssl/CVE-2018-0737.patch
@@ -0,0 +1,28 @@
+From 349a41da1ad88ad87825414752a8ff5fdd6a6c3f Mon Sep 17 00:00:00 2001
+From: Billy Brumley <bbrumley@gmail.com>
+Date: Wed, 11 Apr 2018 10:10:58 +0300
+Subject: [PATCH] RSA key generation: ensure BN_mod_inverse and BN_mod_exp_mont
+ both get called with BN_FLG_CONSTTIME flag set.
+
+CVE-2018-0737
+
+Reviewed-by: Rich Salz <rsalz@openssl.org>
+Reviewed-by: Matt Caswell <matt@openssl.org>
+(cherry picked from commit 6939eab03a6e23d2bd2c3f5e34fe1d48e542e787)
+---
+ crypto/rsa/rsa_gen.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c
+index 9ca5dfefb70..42b89a8dfaa 100644
+--- a/crypto/rsa/rsa_gen.c
++++ b/crypto/rsa/rsa_gen.c
+@@ -156,6 +156,8 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value,
+ if (BN_copy(rsa->e, e_value) == NULL)
+ goto err;
+
++ BN_set_flags(rsa->p, BN_FLG_CONSTTIME);
++ BN_set_flags(rsa->q, BN_FLG_CONSTTIME);
+ BN_set_flags(r2, BN_FLG_CONSTTIME);
+ /* generate p and q */
+ for (;;) {