summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Sarmadi <sona.sarmadi@enea.com>2015-12-14 08:36:45 (GMT)
committerMihaela Martinas <Mihaela.Martinas@enea.com>2015-12-14 12:57:13 (GMT)
commit265f875c5aeb50e2cb443315ea3674a93d7024b5 (patch)
tree6381aa1e0f80d87c6e95316ba4d34541553c41a9
parentcdf91befc739cbeae281e7bd4a4ff0028e6e10c6 (diff)
downloadpoky-265f875c5aeb50e2cb443315ea3674a93d7024b5.tar.gz
openssl: CVE-2015-3194, CVE-2015-3195
Fixes following vulnerabilities: Certificate verify crash with missing PSS parameter (CVE-2015-3194) X509_ATTRIBUTE memory leak (CVE-2015-3195) References: https://openssl.org/news/secadv/20151203.txt http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3194 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3195 Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-rw-r--r--meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch35
-rw-r--r--meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch59
-rw-r--r--meta/recipes-connectivity/openssl/openssl_1.0.1p.bb2
3 files changed, 96 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch
new file mode 100644
index 0000000..3c00bc1
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3194-Add-PSS-parameter-check.patch
@@ -0,0 +1,35 @@
1Date: Fri, 2 Oct 2015 13:10:29 +0100
2Subject: [PATCH] Add PSS parameter check.
3
4Avoid seg fault by checking mgf1 parameter is not NULL. This can be
5triggered during certificate verification so could be a DoS attack
6against a client or a server enabling client authentication.
7
8Thanks to Loïc Jonas Etienne (Qnective AG) for discovering this bug.
9
10CVE-2015-3194
11
12Upstream-Status: Backport
13
14Reviewed-by: Matt Caswell <matt@openssl.org>
15Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
16---
17 crypto/rsa/rsa_ameth.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c
21index 93e071d..c7f1148 100644
22--- a/crypto/rsa/rsa_ameth.c
23+++ b/crypto/rsa/rsa_ameth.c
24@@ -279,7 +279,7 @@ static RSA_PSS_PARAMS *rsa_pss_decode(const X509_ALGOR *alg,
25 if (pss->maskGenAlgorithm) {
26 ASN1_TYPE *param = pss->maskGenAlgorithm->parameter;
27 if (OBJ_obj2nid(pss->maskGenAlgorithm->algorithm) == NID_mgf1
28- && param->type == V_ASN1_SEQUENCE) {
29+ && param && param->type == V_ASN1_SEQUENCE) {
30 p = param->value.sequence->data;
31 plen = param->value.sequence->length;
32 *pmaskHash = d2i_X509_ALGOR(NULL, &p, plen);
33--
341.9.1
35
diff --git a/meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch
new file mode 100644
index 0000000..87c4c6c
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch
@@ -0,0 +1,59 @@
1Date: Tue, 10 Nov 2015 19:03:07 +0000
2Subject: [PATCH] Fix leak with ASN.1 combine.
3
4When parsing a combined structure pass a flag to the decode routine
5so on error a pointer to the parent structure is not zeroed as
6this will leak any additional components in the parent.
7
8This can leak memory in any application parsing PKCS#7 or CMS structures.
9
10CVE-2015-3195.
11
12Upstream-Status: Backport
13
14Thanks to Adam Langley (Google/BoringSSL) for discovering this bug using
15libFuzzer.
16
17PR#4131
18
19Reviewed-by: Richard Levitte <levitte@openssl.org>
20Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
21---
22 crypto/asn1/tasn_dec.c | 7 +++++--
23 1 file changed, 5 insertions(+), 2 deletions(-)
24
25diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
26index febf605..9256049 100644
27--- a/crypto/asn1/tasn_dec.c
28+++ b/crypto/asn1/tasn_dec.c
29@@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
30 int otag;
31 int ret = 0;
32 ASN1_VALUE **pchptr, *ptmpval;
33+ int combine = aclass & ASN1_TFLG_COMBINE;
34+ aclass &= ~ASN1_TFLG_COMBINE;
35 if (!pval)
36 return 0;
37 if (aux && aux->asn1_cb)
38@@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
39 auxerr:
40 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
41 err:
42- ASN1_item_ex_free(pval, it);
43+ if (combine == 0)
44+ ASN1_item_ex_free(pval, it);
45 if (errtt)
46 ERR_add_error_data(4, "Field=", errtt->field_name,
47 ", Type=", it->sname);
48@@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
49 } else {
50 /* Nothing special */
51 ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
52- -1, 0, opt, ctx);
53+ -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
54 if (!ret) {
55 ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR);
56 goto err;
57--
581.9.1
59
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb b/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb
index 3f61790..1d0242f 100644
--- a/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb
@@ -34,6 +34,8 @@ SRC_URI += "file://configure-targets.patch \
34 file://Makefiles-ptest.patch \ 34 file://Makefiles-ptest.patch \
35 file://ptest-deps.patch \ 35 file://ptest-deps.patch \
36 file://run-ptest \ 36 file://run-ptest \
37 file://CVE-2015-3194-Add-PSS-parameter-check.patch \
38 file://CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch \
37 " 39 "
38 40
39SRC_URI[md5sum] = "7563e92327199e0067ccd0f79f436976" 41SRC_URI[md5sum] = "7563e92327199e0067ccd0f79f436976"