diff options
author | Timo Teräs <timo.teras@iki.fi> | 2018-07-18 10:25:07 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2018-07-18 10:27:58 +0300 |
commit | 8593c3d6ba83fa5acf4bd55ff54c5481806a3596 (patch) | |
tree | 466c1e99e44ca8c87c9544be5e96ae4206c76528 | |
parent | bafb572dda2d0814641af68fa0cceff256bc3705 (diff) | |
download | alpine_aports-8593c3d6ba83fa5acf4bd55ff54c5481806a3596.tar.bz2 alpine_aports-8593c3d6ba83fa5acf4bd55ff54c5481806a3596.tar.xz alpine_aports-8593c3d6ba83fa5acf4bd55ff54c5481806a3596.zip |
main/openssl: fix CVE-2018-0732 and CVE-2018-0737
fixes #8815
fixes #9010
-rw-r--r-- | main/openssl/APKBUILD | 11 | ||||
-rw-r--r-- | main/openssl/CVE-2018-0732.patch | 39 | ||||
-rw-r--r-- | main/openssl/CVE-2018-0737.patch | 28 |
3 files changed, 76 insertions, 2 deletions
diff --git a/main/openssl/APKBUILD b/main/openssl/APKBUILD index ce6769aee5..e6d5dfa5f8 100644 --- a/main/openssl/APKBUILD +++ b/main/openssl/APKBUILD | |||
@@ -1,7 +1,7 @@ | |||
1 | # Maintainer: Timo Teras <timo.teras@iki.fi> | 1 | # Maintainer: Timo Teras <timo.teras@iki.fi> |
2 | pkgname=openssl | 2 | pkgname=openssl |
3 | pkgver=1.0.2o | 3 | pkgver=1.0.2o |
4 | pkgrel=0 | 4 | pkgrel=1 |
5 | pkgdesc="Toolkit for SSL v2/v3 and TLS v1" | 5 | pkgdesc="Toolkit for SSL v2/v3 and TLS v1" |
6 | url="http://openssl.org" | 6 | url="http://openssl.org" |
7 | depends= | 7 | depends= |
@@ -26,6 +26,8 @@ source="http://www.openssl.org/source/${pkgname}-${pkgver}.tar.gz | |||
26 | 1001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch | 26 | 1001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch |
27 | 1002-backport-changes-from-upstream-padlock-module.patch | 27 | 1002-backport-changes-from-upstream-padlock-module.patch |
28 | 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch | 28 | 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch |
29 | CVE-2018-0732.patch | ||
30 | CVE-2018-0737.patch | ||
29 | " | 31 | " |
30 | 32 | ||
31 | # secfixes: | 33 | # secfixes: |
@@ -61,6 +63,9 @@ source="http://www.openssl.org/source/${pkgname}-${pkgver}.tar.gz | |||
61 | # - CVE-2017-3738 | 63 | # - CVE-2017-3738 |
62 | # - CVE-2018-0733 | 64 | # - CVE-2018-0733 |
63 | # - CVE-2018-0739 | 65 | # - CVE-2018-0739 |
66 | # 1.0.2o-r1: | ||
67 | # - CVE-2018-0732 | ||
68 | # - CVE-2018-0737 | ||
64 | 69 | ||
65 | builddir="$srcdir"/$pkgname-$pkgver | 70 | builddir="$srcdir"/$pkgname-$pkgver |
66 | 71 | ||
@@ -138,4 +143,6 @@ c67472879a31b5dbdd313892df6d37e7c93e8c0237d406c30d50b1016c2618ead3c13277f5dc723e | |||
138 | 5febe20948e3f12d981e378e1f4ea538711657aacb6865a1aa91339d4a04277e250f490a1f2abc2c6f290bdc2b1bffdba1d00983b4c09f7ea983eef8163f9420 0010-ssl-env-zlib.patch | 143 | 5febe20948e3f12d981e378e1f4ea538711657aacb6865a1aa91339d4a04277e250f490a1f2abc2c6f290bdc2b1bffdba1d00983b4c09f7ea983eef8163f9420 0010-ssl-env-zlib.patch |
139 | 8c181760d7a149aa18d246d50f1c0438ffb63c98677b05306dfc00400ad0429b47d31e7c8d85126005c67f743d23e7a8a81174ffe98556f4caf9cf6b04d9ff17 1001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch | 144 | 8c181760d7a149aa18d246d50f1c0438ffb63c98677b05306dfc00400ad0429b47d31e7c8d85126005c67f743d23e7a8a81174ffe98556f4caf9cf6b04d9ff17 1001-crypto-hmac-support-EVP_MD_CTX_FLAG_ONESHOT-and-set-.patch |
140 | a3555440b5f544bfd6b9ad97557d8f4c1d673f6a35219f65056a72035d186be5f354717ddf9784899b602464d48657b090ade24379552d43af97609c0f48c389 1002-backport-changes-from-upstream-padlock-module.patch | 145 | a3555440b5f544bfd6b9ad97557d8f4c1d673f6a35219f65056a72035d186be5f354717ddf9784899b602464d48657b090ade24379552d43af97609c0f48c389 1002-backport-changes-from-upstream-padlock-module.patch |
141 | 6353c7a94016c20db5d683dde37775f6780952ecdb1a5f39f878d04ba37f6ad79ae10fb6d65d181d912505a5d1e22463004cd855d548b364c00b120da2b0fdbc 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch" | 146 | 6353c7a94016c20db5d683dde37775f6780952ecdb1a5f39f878d04ba37f6ad79ae10fb6d65d181d912505a5d1e22463004cd855d548b364c00b120da2b0fdbc 1003-engines-e_padlock-implement-sha1-sha224-sha256-accel.patch |
147 | ff91298629f157496a012da00ba7325923f5d087bfa54b60e205bf2dfb06374e958912e0df39dbdf39773555455c1a3afa3dcde1ddfec6e85cf89b0b62cc0eb4 CVE-2018-0732.patch | ||
148 | 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 @@ | |||
1 | From 3984ef0b72831da8b3ece4745cac4f8575b19098 Mon Sep 17 00:00:00 2001 | ||
2 | From: Guido Vranken <guidovranken@gmail.com> | ||
3 | Date: Mon, 11 Jun 2018 19:38:54 +0200 | ||
4 | Subject: [PATCH] Reject excessively large primes in DH key generation. | ||
5 | |||
6 | CVE-2018-0732 | ||
7 | |||
8 | Signed-off-by: Guido Vranken <guidovranken@gmail.com> | ||
9 | |||
10 | (cherry picked from commit 91f7361f47b082ae61ffe1a7b17bb2adf213c7fe) | ||
11 | |||
12 | Reviewed-by: Tim Hudson <tjh@openssl.org> | ||
13 | Reviewed-by: Matt Caswell <matt@openssl.org> | ||
14 | (Merged from https://github.com/openssl/openssl/pull/6457) | ||
15 | --- | ||
16 | crypto/dh/dh_key.c | 7 ++++++- | ||
17 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c | ||
20 | index 387558f1467..f235e0d682b 100644 | ||
21 | --- a/crypto/dh/dh_key.c | ||
22 | +++ b/crypto/dh/dh_key.c | ||
23 | @@ -130,10 +130,15 @@ static int generate_key(DH *dh) | ||
24 | int ok = 0; | ||
25 | int generate_new_key = 0; | ||
26 | unsigned l; | ||
27 | - BN_CTX *ctx; | ||
28 | + BN_CTX *ctx = NULL; | ||
29 | BN_MONT_CTX *mont = NULL; | ||
30 | BIGNUM *pub_key = NULL, *priv_key = NULL; | ||
31 | |||
32 | + if (BN_num_bits(dh->p) > OPENSSL_DH_MAX_MODULUS_BITS) { | ||
33 | + DHerr(DH_F_GENERATE_KEY, DH_R_MODULUS_TOO_LARGE); | ||
34 | + return 0; | ||
35 | + } | ||
36 | + | ||
37 | ctx = BN_CTX_new(); | ||
38 | if (ctx == NULL) | ||
39 | 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 @@ | |||
1 | From 349a41da1ad88ad87825414752a8ff5fdd6a6c3f Mon Sep 17 00:00:00 2001 | ||
2 | From: Billy Brumley <bbrumley@gmail.com> | ||
3 | Date: Wed, 11 Apr 2018 10:10:58 +0300 | ||
4 | Subject: [PATCH] RSA key generation: ensure BN_mod_inverse and BN_mod_exp_mont | ||
5 | both get called with BN_FLG_CONSTTIME flag set. | ||
6 | |||
7 | CVE-2018-0737 | ||
8 | |||
9 | Reviewed-by: Rich Salz <rsalz@openssl.org> | ||
10 | Reviewed-by: Matt Caswell <matt@openssl.org> | ||
11 | (cherry picked from commit 6939eab03a6e23d2bd2c3f5e34fe1d48e542e787) | ||
12 | --- | ||
13 | crypto/rsa/rsa_gen.c | 2 ++ | ||
14 | 1 file changed, 2 insertions(+) | ||
15 | |||
16 | diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c | ||
17 | index 9ca5dfefb70..42b89a8dfaa 100644 | ||
18 | --- a/crypto/rsa/rsa_gen.c | ||
19 | +++ b/crypto/rsa/rsa_gen.c | ||
20 | @@ -156,6 +156,8 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, | ||
21 | if (BN_copy(rsa->e, e_value) == NULL) | ||
22 | goto err; | ||
23 | |||
24 | + BN_set_flags(rsa->p, BN_FLG_CONSTTIME); | ||
25 | + BN_set_flags(rsa->q, BN_FLG_CONSTTIME); | ||
26 | BN_set_flags(r2, BN_FLG_CONSTTIME); | ||
27 | /* generate p and q */ | ||
28 | for (;;) { | ||