Browse code

Gnutls : Update to 3.5.15. Fixes CVE-2017-7507 and update libtasn1 to 4.12 and apply patch for CVE-2017-10790

Change-Id: If18a86a556e3e68ae9295c325f1736118df0d4f8
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4061
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

xiaolin-vmware authored on 2017/10/18 06:17:12
Showing 7 changed files
1 1
deleted file mode 100644
... ...
@@ -1,28 +0,0 @@
1
-From 964632f37dfdfb914ebc5e49db4fa29af35b1de9 Mon Sep 17 00:00:00 2001
2
-From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
3
-Date: Sat, 27 Aug 2016 17:00:22 +0200
4
-Subject: [PATCH] ocsp: corrected the comparison of the serial size in OCSP response
5
-
6
-Previously the OCSP certificate check wouldn't verify the serial length
7
-and could succeed in cases it shouldn't.
8
-
9
-Reported by Stefan Buehler.
10
- lib/x509/ocsp.c | 1 +
11
- 1 file changed, 1 insertion(+)
12
-
13
-diff --git a/lib/x509/ocsp.c b/lib/x509/ocsp.c
14
-index 92db9b6..8181f2e 100644
15
-+++ b/lib/x509/ocsp.c
16
-@@ -1318,6 +1318,7 @@ gnutls_ocsp_resp_check_crt(gnutls_ocsp_resp_t resp,
17
- 		gnutls_assert();
18
- 		goto cleanup;
19
- 	}
20
-+	cserial.size = t;
21
- 
22
- 	if (rserial.size != cserial.size
23
- 	    || memcmp(cserial.data, rserial.data, rserial.size) != 0) {
24
-libgit2 0.25.0
25
-
26 1
deleted file mode 100644
... ...
@@ -1,53 +0,0 @@
1
-From 51464af713d71802e3c6d5ac15f1a95132a354fe Mon Sep 17 00:00:00 2001
2
-From: Nikos Mavrogiannopoulos <nmav@redhat.com>
3
-Date: Mon, 20 Feb 2017 11:13:08 +0100
4
-Subject: [PATCH] cdk_pkt_read: enforce packet limits
5
-
6
-That ensures that there are no overflows in the subsequent
7
-calculations.
8
-
9
-Resolves the oss-fuzz found bug:
10
-https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=420
11
-
12
-Relates: #159
13
-
14
-Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
15
- lib/opencdk/read-packet.c |  9 +++++++++
16
- 1 file changed, 9 insertions(+)
17
-
18
-diff --git a/lib/opencdk/read-packet.c b/lib/opencdk/read-packet.c
19
-index 8055a63..ead6480 100644
20
-+++ b/lib/opencdk/read-packet.c
21
-@@ -888,7 +888,7 @@ static void skip_packet(cdk_stream_t inp, size_t pktlen)
22
- 	assert(pktlen == 0);
23
- }
24
- 
25
--
26
-+#define MAX_PACKET_LEN (1<<24)
27
- /**
28
-  * cdk_pkt_read:
29
-  * @inp: the input stream
30
-@@ -940,6 +940,13 @@ cdk_error_t cdk_pkt_read(cdk_stream_t inp, cdk_packet_t pkt)
31
- 	else
32
- 		read_old_length(inp, ctb, &pktlen, &pktsize);
33
- 
34
-+	/* enforce limits to ensure that the following calculations
35
-+	 * do not overflow */
36
-+	if (pktlen >= MAX_PACKET_LEN || pktsize >= MAX_PACKET_LEN) {
37
-+		_cdk_log_info("cdk_pkt_read: too long packet\n");
38
-+		return gnutls_assert_val(CDK_Inv_Packet);
39
-+	}
40
-+
41
- 	pkt->pkttype = pkttype;
42
- 	pkt->pktlen = pktlen;
43
- 	pkt->pktsize = pktsize + pktlen;
44
-@@ -964,6 +971,7 @@ cdk_error_t cdk_pkt_read(cdk_stream_t inp, cdk_packet_t pkt)
45
- 		break;
46
- 
47
- 	case CDK_PKT_USER_ID:
48
-+
49
- 		pkt->pkt.user_id = cdk_calloc(1, sizeof *pkt->pkt.user_id
50
- 					      + pkt->pktlen + 1);
51
- 		if (!pkt->pkt.user_id)
... ...
@@ -1,14 +1,11 @@
1 1
 Summary:        The GnuTLS Transport Layer Security Library
2 2
 Name:           gnutls
3
-Version:        3.4.11
4
-Release:        4%{?dist}
3
+Version:        3.5.15
4
+Release:        1%{?dist}
5 5
 License:        GPLv3+ and LGPLv2+
6 6
 URL:            http://www.gnutls.org
7
-Source0:        http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/gnutls/v3.4/%{name}-%{version}.tar.xz
8
-%define sha1    gnutls=55f73d1ea2b3335fea514fad6faa1e72006ae9f9
9
-Patch0:         gnutls_3.4.11_default_priority.patch
10
-Patch1:         gnutls-CVE-2016-7444.patch
11
-Patch2:         gnutls-CVE-2017-7869.patch
7
+Source0:        http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/gnutls/v3.5/%{name}-%{version}.tar.xz
8
+%define sha1    gnutls=9b7466434332b92dc3ca704b9211370370814fac
12 9
 Group:          System Environment/Libraries
13 10
 Vendor:         VMware, Inc.
14 11
 Distribution:   Photon
... ...
@@ -38,15 +35,17 @@ developing applications that use gnutls.
38 38
 
39 39
 %prep
40 40
 %setup -q
41
-%patch0 -p1
42
-%patch1 -p1
43
-%patch2 -p1
44 41
 %build
42
+# check for trust store file presence
43
+[ -f %{_sysconfdir}/pki/tls/certs/ca-bundle.crt ] || exit 1
44
+
45 45
 ./configure \
46 46
     --prefix=%{_prefix} \
47 47
     --without-p11-kit \
48 48
     --disable-openssl-compatibility \
49
-    --with-system-priority-file=%{_sysconfdir}/gnutls/default-priorities
49
+    --with-included-unistring \
50
+    --with-system-priority-file=%{_sysconfdir}/gnutls/default-priorities \
51
+    --with-default-trust-store-file=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt
50 52
 make %{?_smp_mflags}
51 53
 %install
52 54
 make DESTDIR=%{buildroot} install
... ...
@@ -69,12 +68,16 @@ make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
69 69
 %{_mandir}/man1/*
70 70
 %{_mandir}/man3/*
71 71
 %{_datadir}/locale/*
72
+%{_docdir}/gnutls/*.png
73
+
72 74
 %files devel
73 75
 %defattr(-,root,root)
74 76
 %{_includedir}/%{name}/*.h
75 77
 %{_libdir}/*.so
76 78
 %{_libdir}/pkgconfig/*.pc
77 79
 %changelog
80
+*   Tue Oct 17 2017 Xiaolin Li <xiaolinl@vmware.com> 3.5.15-1
81
+-   Update to 3.5.15. Fixes CVE-2017-7507
78 82
 *   Thu May 04 2017 Xiaolin Li <xiaolinl@vmware.com> 3.4.11-4
79 83
 -   Apply patch for CVE-2017-7869
80 84
 *   Tue Apr 25 2017 Xiaolin Li <xiaolinl@vmware.com> 3.4.11-3
81 85
deleted file mode 100644
... ...
@@ -1,32 +0,0 @@
1
-diff --git a/lib/gnutls_priority.c b/lib/gnutls_priority.c
2
-index 50d3d09..8c32d1c 100644
3
-+++ b/lib/gnutls_priority.c
4
-@@ -1066,6 +1066,8 @@ gnutls_priority_init(gnutls_priority_t * priority_cache,
5
- 	rmadd_func *fn;
6
- 	bulk_rmadd_func *bulk_fn;
7
- 	bulk_rmadd_func *bulk_given_fn;
8
-+	unsigned int default_set = 0;
9
-+
10
- 	const cipher_entry_st *centry;
11
- 
12
- 	if (err_pos)
13
-@@ -1084,10 +1086,16 @@ gnutls_priority_init(gnutls_priority_t * priority_cache,
14
- 	(*priority_cache)->sr = SR_PARTIAL;
15
- 	(*priority_cache)->min_record_version = 1;
16
- 
17
--	if (priorities == NULL)
18
--		priorities = "NORMAL";
19
-+	if (priorities == NULL) {
20
-+		priorities = "@SYSTEM";
21
-+		default_set = 1;
22
-+	}
23
- 
24
- 	darg = resolve_priorities(priorities);
25
-+	if (darg == NULL && default_set == 1) {
26
-+		priorities = "NORMAL";
27
-+		darg = resolve_priorities(priorities);
28
-+	}
29
- 	if (darg == NULL) {
30
- 		gnutls_assert();
31
- 		goto error;
32 1
deleted file mode 100644
... ...
@@ -1,22 +0,0 @@
1
-diff -rupr a/lib/decoding.c b/lib/decoding.c
2
-+++ b/lib/decoding.c	2016-11-30 14:23:11.096199084 -0800
3
-@@ -767,10 +767,17 @@ _asn1_extract_der_octet (asn1_node node,
4
-   DECR_LEN(der_len, len3);
5
- 
6
-   if (len2 == -1)
7
--    counter_end = der_len - 2;
8
-+    {
9
-+      if (der_len < 2)
10
-+        return ASN1_DER_ERROR;
11
-+      counter_end = der_len - 2;
12
-+    }
13
-   else
14
-     counter_end = der_len;
15
- 
16
-+  if (counter_end < counter)
17
-+    return ASN1_DER_ERROR;
18
-+
19
-   while (counter < counter_end)
20
-     {
21
-       DECR_LEN(der_len, 1);
22 1
new file mode 100644
... ...
@@ -0,0 +1,42 @@
0
+diff --git a/lib/parser_aux.c b/lib/parser_aux.c
1
+index 976ab38..786ea64 100644
2
+--- a/lib/parser_aux.c
3
+@@ -955,7 +955,7 @@ _asn1_check_identifier (asn1_node node)
4
+ 	  if (p2 == NULL)
5
+ 	    {
6
+ 	      if (p->value)
7
+-		_asn1_strcpy (_asn1_identifierMissing, p->value);
8
++		_asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p->value);
9
+ 	      else
10
+ 		_asn1_strcpy (_asn1_identifierMissing, "(null)");
11
+ 	      return ASN1_IDENTIFIER_NOT_FOUND;
12
+@@ -968,9 +968,15 @@ _asn1_check_identifier (asn1_node node)
13
+ 	  if (p2 && (type_field (p2->type) == ASN1_ETYPE_DEFAULT))
14
+ 	    {
15
+ 	      _asn1_str_cpy (name2, sizeof (name2), node->name);
16
+-	      _asn1_str_cat (name2, sizeof (name2), ".");
17
+-	      _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
18
+-	      _asn1_strcpy (_asn1_identifierMissing, p2->value);
19
++	      if (p2->value)
20
++	        {
21
++	          _asn1_str_cat (name2, sizeof (name2), ".");
22
++	          _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
23
++	          _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value);
24
++	        }
25
++	      else
26
++		_asn1_strcpy (_asn1_identifierMissing, "(null)");
27
++
28
+ 	      p2 = asn1_find_node (node, name2);
29
+ 	      if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID) ||
30
+ 		  !(p2->type & CONST_ASSIGN))
31
+@@ -990,7 +996,8 @@ _asn1_check_identifier (asn1_node node)
32
+ 		  _asn1_str_cpy (name2, sizeof (name2), node->name);
33
+ 		  _asn1_str_cat (name2, sizeof (name2), ".");
34
+ 		  _asn1_str_cat (name2, sizeof (name2), (char *) p2->value);
35
+-		  _asn1_strcpy (_asn1_identifierMissing, p2->value);
36
++		  _asn1_str_cpy (_asn1_identifierMissing, sizeof(_asn1_identifierMissing), (char*)p2->value);
37
++
38
+ 		  p2 = asn1_find_node (node, name2);
39
+ 		  if (!p2 || (type_field (p2->type) != ASN1_ETYPE_OBJECT_ID)
40
+ 		      || !(p2->type & CONST_ASSIGN))
... ...
@@ -1,25 +1,24 @@
1
-Summary:	ASN.1 library
2
-Name:		libtasn1
3
-Version:	4.7
4
-Release:	3%{?dist}
5
-License:	GPLv3+ and LGPLv2+
6
-URL:		http://www.gnu.org/software/libtasn1/
7
-Source0:	http://ftp.gnu.org/gnu/libtasn1/%{name}-%{version}.tar.gz
8
-%define sha1 libtasn1=1c2cf0b8c7954249cfd7842500fabe1c7fdcd5d5
9
-Group:		System Environment/Libraries
10
-Vendor:		VMware, Inc.
11
-Distribution:	Photon
12
-
13
-Patch0:         CVE-2016-4008.patch
1
+Summary:        ASN.1 library
2
+Name:           libtasn1
3
+Version:        4.12
4
+Release:        1%{?dist}
5
+License:        GPLv3+ and LGPLv2+
6
+URL:            http://www.gnu.org/software/libtasn1/
7
+Source0:        http://ftp.gnu.org/gnu/libtasn1/%{name}-%{version}.tar.gz
8
+%define sha1    libtasn1=f9a05b3b8acf319d89f07267407c03b184c4e3b0
9
+Group:          System Environment/Libraries
10
+Vendor:         VMware, Inc.
11
+Distribution:   Photon
12
+Patch0:         libtasn1-CVE-2017-10790.patch
14 13
 
15 14
 %description
16 15
 Libtasn1 library provides Abstract Syntax Notation One (ASN.1, as specified by the X.680 ITU-T recommendation) parsing and structures management, 
17 16
 and Distinguished Encoding Rules (DER, as per X.690) encoding and decoding functions.
18 17
 
19 18
 %package devel
20
-Summary:	Development libraries and header files for libtasn1
21
-Requires:	libtasn1
22
-Provides:	pkgconfig(libtasn1)
19
+Summary:    Development libraries and header files for libtasn1
20
+Requires:   libtasn1
21
+Provides:   pkgconfig(libtasn1)
23 22
 
24 23
 %description devel
25 24
 The package contains libraries and header files for
... ...
@@ -31,7 +30,7 @@ developing applications that use libtasn1.
31 31
 
32 32
 %build
33 33
 ./configure \
34
-	--prefix=%{_prefix}
34
+    --prefix=%{_prefix}
35 35
 make %{?_smp_mflags}
36 36
 %install
37 37
 make DESTDIR=%{buildroot} install
... ...
@@ -39,8 +38,8 @@ rm %{buildroot}%{_infodir}/*
39 39
 find %{buildroot}%{_libdir} -name '*.la' -delete
40 40
 %check
41 41
 make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
42
-%post	-p /sbin/ldconfig
43
-%postun	-p /sbin/ldconfig
42
+%post   -p /sbin/ldconfig
43
+%postun -p /sbin/ldconfig
44 44
 %files
45 45
 %defattr(-,root,root)
46 46
 %{_libdir}/*.so.*
... ...
@@ -54,16 +53,18 @@ make -k check |& tee %{_specdir}/%{name}-check-log || %{nocheck}
54 54
 %{_libdir}/pkgconfig/*.pc
55 55
 %{_libdir}/*.a
56 56
 %changelog
57
-*       Wed Nov 30 2016 Dheeraj Shetty <dheerajs@vmware.com> 4.7-3
58
--       Added patch for CVE-2016-4008
59
-*	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.7-2
60
--	GA - Bump release of all rpms
61
-* 	Fri Jan 15 2016 Xiaolin Li <xiaolinl@vmware.com> 4.7-1
62
-- 	Updated to version 4.7
57
+*   Tue Oct 17 2017 Xiaolin Li <xiaolinl@vmware.com> 4.12-1
58
+-   Update to 4.12 and apply patch for CVE-2017-10790
59
+*   Wed Nov 30 2016 Dheeraj Shetty <dheerajs@vmware.com> 4.7-3
60
+-   Added patch for CVE-2016-4008
61
+*   Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 4.7-2
62
+-   GA - Bump release of all rpms
63
+*   Fri Jan 15 2016 Xiaolin Li <xiaolinl@vmware.com> 4.7-1
64
+-   Updated to version 4.7
63 65
 *   Mon Oct 12 2015 Xiaolin Li <xiaolinl@vmware.com> 4.5-3
64 66
 -   Moving static lib files to devel package.
65 67
 *   Fri Oct 9 2015 Xiaolin Li <xiaolinl@vmware.com> 4.5-2
66 68
 -   Removing la files from packages.
67
-*	Fri Jun 19 2015 Divya Thaluru <dthaluru@vmware.com> 4.5-1
68
--	Initial build. First version
69
+*   Fri Jun 19 2015 Divya Thaluru <dthaluru@vmware.com> 4.5-1
70
+-   Initial build. First version
69 71