From a1b38730cec8a39decb90b3b05d2746b72ebc0ee Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 15 Mar 2018 14:22:08 +0100
Subject: [PATCH 001/256] make the test-suite use Python 3
Unfortunately, smbserver.py does not work with Python 3 because
there is no 'impacket' module available for Python 3:
https://github.com/CoreSecurity/impacket/issues/61
---
0103-curl-7.59.0-python3.patch | 140 +++++++++++++++++++++++++++++++++
curl.spec | 14 +++-
2 files changed, 152 insertions(+), 2 deletions(-)
create mode 100644 0103-curl-7.59.0-python3.patch
diff --git a/0103-curl-7.59.0-python3.patch b/0103-curl-7.59.0-python3.patch
new file mode 100644
index 0000000..8a39f85
--- /dev/null
+++ b/0103-curl-7.59.0-python3.patch
@@ -0,0 +1,140 @@
+From bdba7b54224814055185513de1e7ff6619031553 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Thu, 15 Mar 2018 13:21:40 +0100
+Subject: [PATCH 1/2] tests/http_pipe.py: migrate to Python 3
+
+---
+ tests/http_pipe.py | 4 ++--
+ tests/runtests.pl | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/tests/http_pipe.py b/tests/http_pipe.py
+index bc32173..75ac165 100755
+--- a/tests/http_pipe.py
++++ b/tests/http_pipe.py
+@@ -383,13 +383,13 @@ class PipelineRequestHandler(socketserver.BaseRequestHandler):
+ self.request.setblocking(True)
+ if not new_data:
+ return
+- new_requests = self._request_parser.ParseAdditionalData(new_data)
++ new_requests = self._request_parser.ParseAdditionalData(new_data.decode('utf8'))
+ self._response_builder.QueueRequests(
+ new_requests, self._request_parser.were_all_requests_http_1_1)
+ self._num_queued += len(new_requests)
+ self._last_queued_time = time.time()
+ elif fileno in wlist:
+- num_bytes_sent = self.request.send(self._send_buffer[0:4096])
++ num_bytes_sent = self.request.send(self._send_buffer[0:4096].encode('utf8'))
+ self._send_buffer = self._send_buffer[num_bytes_sent:]
+ time.sleep(0.05)
+
+diff --git a/tests/runtests.pl b/tests/runtests.pl
+index d6aa5ca..4d395ef 100755
+--- a/tests/runtests.pl
++++ b/tests/runtests.pl
+@@ -1437,7 +1437,7 @@ sub runhttpserver {
+ elsif($alt eq "pipe") {
+ # basically the same, but another ID
+ $idnum = 3;
+- $exe = "python $srcdir/http_pipe.py";
++ $exe = "python3 $srcdir/http_pipe.py";
+ $verbose_flag .= "1 ";
+ }
+ elsif($alt eq "unix") {
+--
+2.14.3
+
+
+From 3c4c7340e455b7256c0786759422f34ec3e2d440 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Thu, 15 Mar 2018 14:49:56 +0100
+Subject: [PATCH 2/2] tests/{negtelnet,smb}server.py: migrate to Python 3
+
+Unfortunately, smbserver.py does not work with Python 3 because
+there is no 'impacket' module available for Python 3:
+
+https://github.com/CoreSecurity/impacket/issues/61
+---
+ tests/negtelnetserver.py | 12 ++++++------
+ tests/smbserver.py | 4 ++--
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/negtelnetserver.py b/tests/negtelnetserver.py
+index 8cfd409..72ee771 100755
+--- a/tests/negtelnetserver.py
++++ b/tests/negtelnetserver.py
+@@ -23,7 +23,7 @@ IDENT = "NTEL"
+
+ # The strings that indicate the test framework is checking our aliveness
+ VERIFIED_REQ = b"verifiedserver"
+-VERIFIED_RSP = b"WE ROOLZ: {pid}"
++VERIFIED_RSP = "WE ROOLZ: {pid}"
+
+
+ def telnetserver(options):
+@@ -34,7 +34,7 @@ def telnetserver(options):
+ if options.pidfile:
+ pid = os.getpid()
+ with open(options.pidfile, "w") as f:
+- f.write(b"{0}".format(pid))
++ f.write("{0}".format(pid))
+
+ local_bind = (HOST, options.port)
+ log.info("Listening on %s", local_bind)
+@@ -73,11 +73,11 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
+ response_data = VERIFIED_RSP.format(pid=os.getpid())
+ else:
+ log.debug("Received normal request - echoing back")
+- response_data = data.strip()
++ response_data = data.decode('utf8').strip()
+
+ if response_data:
+ log.debug("Sending %r", response_data)
+- self.request.sendall(response_data)
++ self.request.sendall(response_data.encode('utf8'))
+
+ except IOError:
+ log.exception("IOError hit during request")
+@@ -132,7 +132,7 @@ class Negotiator(object):
+ return buffer
+
+ def byte_to_int(self, byte):
+- return struct.unpack(b'B', byte)[0]
++ return int(byte)
+
+ def no_neg(self, byte, byte_int, buffer):
+ # Not negotiating anything thus far. Check to see if we
+@@ -197,7 +197,7 @@ class Negotiator(object):
+ self.tcp.sendall(packed_message)
+
+ def pack(self, arr):
+- return struct.pack(b'{0}B'.format(len(arr)), *arr)
++ return struct.pack('{0}B'.format(len(arr)), *arr)
+
+ def send_iac(self, arr):
+ message = [NegTokens.IAC]
+diff --git a/tests/smbserver.py b/tests/smbserver.py
+index 195ae39..b09cd44 100755
+--- a/tests/smbserver.py
++++ b/tests/smbserver.py
+@@ -24,7 +24,7 @@
+ from __future__ import (absolute_import, division, print_function)
+ # unicode_literals)
+ import argparse
+-import ConfigParser
++import configparser
+ import os
+ import sys
+ import logging
+@@ -58,7 +58,7 @@ def smbserver(options):
+ f.write("{0}".format(pid))
+
+ # Here we write a mini config for the server
+- smb_config = ConfigParser.ConfigParser()
++ smb_config = configparser.ConfigParser()
+ smb_config.add_section("global")
+ smb_config.set("global", "server_name", "SERVICE")
+ smb_config.set("global", "server_os", "UNIX")
+--
+2.14.3
+
diff --git a/curl.spec b/curl.spec
index d722f07..eb0ad83 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -14,6 +14,9 @@ Patch101: 0101-curl-7.32.0-multilib.patch
# prevent configure script from discarding -g in CFLAGS (#496778)
Patch102: 0102-curl-7.36.0-debug.patch
+# migrate tests/http_pipe.py to Python 3
+Patch103: 0103-curl-7.59.0-python3.patch
+
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
@@ -36,7 +39,7 @@ BuildRequires: openssh-clients
BuildRequires: openssh-server
BuildRequires: openssl-devel
BuildRequires: pkgconfig
-BuildRequires: python
+BuildRequires: python3
BuildRequires: sed
BuildRequires: stunnel
BuildRequires: zlib-devel
@@ -159,8 +162,12 @@ be installed.
# Fedora patches
%patch101 -p1
%patch102 -p1
+%patch103 -p1
%patch104 -p1
+# make tests/*.py use Python 3
+sed -e '1 s|^#!/.*python|&3|' -i tests/*.py
+
# regenerate Makefile.in files
#aclocal -I m4
#automake
@@ -300,6 +307,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Mar 15 2018 Kamil Dudka - 7.59.0-3
+- make the test-suite use Python 3
+
* Wed Mar 14 2018 Kamil Dudka - 7.59.0-2
- ftp: fix typo in recursive callback detection for seeking
From 5a0fa9250ba51f804d18b99133055a4874bf06b7 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 16 May 2018 13:16:56 +0200
Subject: [PATCH 002/256] new upstream release, which fixes the following
vulnerabilities
Resolves: CVE-2018-1000300 - FTP shutdown response buffer overflow
Resolves: CVE-2018-1000301 - RTSP bad headers buffer over-read
---
...typo-in-recursive-callback-detection.patch | 29 -------------------
0102-curl-7.36.0-debug.patch | 2 +-
0103-curl-7.59.0-python3.patch | 2 +-
curl-7.59.0.tar.xz.asc | 11 -------
curl-7.60.0.tar.xz.asc | 11 +++++++
curl.spec | 13 +++++----
sources | 2 +-
7 files changed, 21 insertions(+), 49 deletions(-)
delete mode 100644 0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch
delete mode 100644 curl-7.59.0.tar.xz.asc
create mode 100644 curl-7.60.0.tar.xz.asc
diff --git a/0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch b/0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch
deleted file mode 100644
index 224630c..0000000
--- a/0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 1b02cb2b51148915b2ba025bb262ef34f369fa4b Mon Sep 17 00:00:00 2001
-From: dasimx
-Date: Wed, 14 Mar 2018 11:02:05 +0100
-Subject: [PATCH] FTP: fix typo in recursive callback detection for seeking
-
-Fixes #2380
-
-Upstream-commit: 920f73a6906dce87c6ee87c32b109a287189965d
-Signed-off-by: Kamil Dudka
----
- lib/ftp.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/ftp.c b/lib/ftp.c
-index e2cc38b..0cc583b 100644
---- a/lib/ftp.c
-+++ b/lib/ftp.c
-@@ -1621,7 +1621,7 @@ static CURLcode ftp_state_ul_setup(struct connectdata *conn,
- Curl_set_in_callback(data, true);
- seekerr = conn->seek_func(conn->seek_client, data->state.resume_from,
- SEEK_SET);
-- Curl_set_in_callback(data, true);
-+ Curl_set_in_callback(data, false);
- }
-
- if(seekerr != CURL_SEEKFUNC_OK) {
---
-2.14.3
-
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 13f07df..95670f0 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16524,18 +16524,11 @@ $as_echo "yes" >&6; }
+@@ -16537,18 +16537,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/0103-curl-7.59.0-python3.patch b/0103-curl-7.59.0-python3.patch
index 8a39f85..dd10986 100644
--- a/0103-curl-7.59.0-python3.patch
+++ b/0103-curl-7.59.0-python3.patch
@@ -32,7 +32,7 @@ diff --git a/tests/runtests.pl b/tests/runtests.pl
index d6aa5ca..4d395ef 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
-@@ -1437,7 +1437,7 @@ sub runhttpserver {
+@@ -1438,7 +1438,7 @@ sub runhttpserver {
elsif($alt eq "pipe") {
# basically the same, but another ID
$idnum = 3;
diff --git a/curl-7.59.0.tar.xz.asc b/curl-7.59.0.tar.xz.asc
deleted file mode 100644
index e74f7b2..0000000
--- a/curl-7.59.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlqoxTwACgkQXMkI/bce
-EsJrHQf7B0ik8F5dfGYumYWkXHc9poJU+dJ0o6pwzg4QsP+4mwVTw/gnrXDm1hVk
-iFPIAdgTkxiIDZi+6mDfZA9dZ8Aq38XbYjRIwXTW4KrjTtEFQXtwlEClrHrJyXfl
-+2YC52BcY0D2JVDqUAB9cVSSgaHHf1jd4h32a8YMrwco4jP5rSxbmZe4psU2m8TC
-skaZEoSIRJzg5oV+AgDSQMrq+fLsc5lIDKTl+7v6sjnGlcYeRC1SiBePyrh5g/o5
-w4JJH839MyjrYvi6MyCBHeyCFYDrxKvQw8zRwivfZ1oipM2SaSVq8c60PdR85Zw5
-/SNOU/7Qpvhua0GhAfaI/CTwwewy6w==
-=OcVv
------END PGP SIGNATURE-----
diff --git a/curl-7.60.0.tar.xz.asc b/curl-7.60.0.tar.xz.asc
new file mode 100644
index 0000000..53ca282
--- /dev/null
+++ b/curl-7.60.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlr7zUoACgkQXMkI/bce
+EsK3jgf7Bvnswxxgq4wQWmqRKQvkN/zkuA2GjSm98M7mizVHl/7/imeqDl7S1vp0
+A6KCI99Epf+2EYgxrEbvZqlSQ6H30eBxOvV2yNwPhrS3UnXwNSJsbFr5bDRE4o8S
+upyP/tSgEIGJcpq0bstrD7T/DRZ1yFCLB5rOOJx4lQnPuB3C7GAmuOj1ZtIxWIn+
+D/G+X1+/oZlils2TMI7ryjRuFvOSPHdUNldwtvfaRg0i3tNYnPbWq54lhouSn31H
+ft8wNd3nnUpueWCWaKKXo+GBVDemDAMEcDbna+woW5SFLI6ZG/c822ljtld05Dk1
+KmwikC7MREQxkODmC10yrgy9I9akNg==
+=f++X
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index eb0ad83..348f6db 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.59.0
-Release: 3%{?dist}
+Version: 7.60.0
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# ftp: fix typo in recursive callback detection for seeking
-Patch1: 0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -157,7 +154,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -307,6 +303,11 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed May 16 2018 Kamil Dudka - 7.60.0-1
+- new upstream release, which fixes the following vulnerabilities
+ CVE-2018-1000300 - FTP shutdown response buffer overflow
+ CVE-2018-1000301 - RTSP bad headers buffer over-read
+
* Thu Mar 15 2018 Kamil Dudka - 7.59.0-3
- make the test-suite use Python 3
diff --git a/sources b/sources
index f353b13..4a1cecd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.59.0.tar.xz) = 6982a5950b564d6b2a4f4b96296b6db3db24a096acc68aa96966821b57f66362f5a69d9f2da762b5d2b1011a4a47478ebacaf05e26604f78bb013098749dd8a6
+SHA512 (curl-7.60.0.tar.xz) = 96a0c32ca846a76bba75e9e560ad4c15df79540992ed1a83713095be94ddba039f289bda9678762fd79fb9691fe810735178fb9dc970c37012dff96b8ce08abf
From 09c874db5300a1846a61cd675164d84974a4a8e0 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 16 May 2018 15:23:55 +0200
Subject: [PATCH 003/256] require glibc-debuginfo for valgrind-enabled build
... as suggested by valgrind itself:
valgrind: Fatal error at startup: a function redirection
valgrind: which is mandatory for this platform-tool combination
valgrind: cannot be set up. Details of the redirection are:
valgrind:
valgrind: A must-be-redirected function
valgrind: whose name matches the pattern: strlen
valgrind: in an object with soname matching: ld-linux-x86-64.so.2
valgrind: was not found whilst processing
valgrind: symbols from the object with soname: ld-linux-x86-64.so.2
valgrind:
valgrind: Possible fixes: (1, short term): install glibc's debuginfo
valgrind: package on this machine. (2, longer term): ask the packagers
valgrind: for your Linux distribution to please in future ship a non-
valgrind: stripped ld.so (or whatever the dynamic linker .so is called)
valgrind: that exports the above-named function using the standard
valgrind: calling conventions for this platform. The package you need
valgrind: to install for fix (1) is called
valgrind:
valgrind: On Debian, Ubuntu: libc6-dbg
valgrind: On SuSE, openSuSE, Fedora, RHEL: glibc-debuginfo
valgrind:
valgrind: Note that if you are debugging a 32 bit process on a
valgrind: 64 bit system, you will need a corresponding 32 bit debuginfo
valgrind: package (e.g. libc6-dbg:i386).
valgrind:
valgrind: Cannot continue -- exiting now. Sorry.
---
curl.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/curl.spec b/curl.spec
index 348f6db..9c12786 100644
--- a/curl.spec
+++ b/curl.spec
@@ -69,6 +69,7 @@ BuildRequires: perl(vars)
# #810992, #816175, and #886891). Nevertheless developers are free to install
# valgrind manually to improve test coverage on any architecture.
%ifarch x86_64 %{ix86}
+BuildRequires: glibc-debuginfo
BuildRequires: valgrind
%endif
From e51a34d6cc39a103b43b20a7eee32ed783f98035 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 16 May 2018 15:54:58 +0200
Subject: [PATCH 004/256] Related: #1570246 - temporarily disable valgrind
completely
... and revert the previous workaround, which does not work on Koji
---
curl.spec | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/curl.spec b/curl.spec
index 9c12786..5f11302 100644
--- a/curl.spec
+++ b/curl.spec
@@ -69,8 +69,8 @@ BuildRequires: perl(vars)
# #810992, #816175, and #886891). Nevertheless developers are free to install
# valgrind manually to improve test coverage on any architecture.
%ifarch x86_64 %{ix86}
-BuildRequires: glibc-debuginfo
-BuildRequires: valgrind
+# temporarily disabled completely because of https://bugzilla.redhat.com/1570246
+# BuildRequires: valgrind
%endif
# using an older version of libcurl could result in CURLE_UNKNOWN_OPTION
From 5dee6fb8b33f1ef9ea84f54394da4aaee390ed25 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Fri, 18 May 2018 16:17:51 +0200
Subject: [PATCH 005/256] Resolves: CVE-2018-1000301 - http: restore buffer ptr
when bad response-line is parsed
---
0002-curl-7.59.0-CVE-2018-1000301.patch | 48 +++++++++++++++++++++++++
curl.spec | 9 ++++-
2 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 0002-curl-7.59.0-CVE-2018-1000301.patch
diff --git a/0002-curl-7.59.0-CVE-2018-1000301.patch b/0002-curl-7.59.0-CVE-2018-1000301.patch
new file mode 100644
index 0000000..b733979
--- /dev/null
+++ b/0002-curl-7.59.0-CVE-2018-1000301.patch
@@ -0,0 +1,48 @@
+From 5815730864a2010872840bae24797983e892eb90 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Sat, 24 Mar 2018 23:47:41 +0100
+Subject: [PATCH 1/2] http: restore buffer pointer when bad response-line is
+ parsed
+
+... leaving the k->str could lead to buffer over-reads later on.
+
+CVE: CVE-2018-1000301
+Assisted-by: Max Dymond
+
+Detected by OSS-Fuzz.
+Bug: https://curl.haxx.se/docs/adv_2018-b138.html
+Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7105
+
+Upstream-commit: 8c7b3737d29ed5c0575bf592063de8a51450812d
+Signed-off-by: Kamil Dudka
+---
+ lib/http.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/http.c b/lib/http.c
+index 841f6cc..dc10f5f 100644
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -2966,6 +2966,8 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
+ {
+ CURLcode result;
+ struct SingleRequest *k = &data->req;
++ ssize_t onread = *nread;
++ char *ostr = k->str;
+
+ /* header line within buffer loop */
+ do {
+@@ -3030,7 +3032,9 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
+ else {
+ /* this was all we read so it's all a bad header */
+ k->badheader = HEADER_ALLBAD;
+- *nread = (ssize_t)rest_length;
++ *nread = onread;
++ k->str = ostr;
++ return CURLE_OK;
+ }
+ break;
+ }
+--
+2.14.3
+
diff --git a/curl.spec b/curl.spec
index d722f07..4bdc523 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# ftp: fix typo in recursive callback detection for seeking
Patch1: 0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch
+# fix RTSP bad headers buffer over-read (CVE-2018-1000301)
+Patch2: 0002-curl-7.59.0-CVE-2018-1000301.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -155,6 +158,7 @@ be installed.
# upstream patches
%patch1 -p1
+%patch2 -p1
# Fedora patches
%patch101 -p1
@@ -300,6 +304,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Fri May 18 2018 Kamil Dudka - 7.59.0-3
+- fix RTSP bad headers buffer over-read (CVE-2018-1000301)
+
* Wed Mar 14 2018 Kamil Dudka - 7.59.0-2
- ftp: fix typo in recursive callback detection for seeking
From 73d6b73380f22edd6565e870ac6aa169c74b6e3f Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Fri, 18 May 2018 16:20:36 +0200
Subject: [PATCH 006/256] Resolves: CVE-2018-1000300 - fix FTP shutdown
response buffer overflow
---
0003-curl-7.59.0-CVE-2018-1000300.patch | 39 +++++++++++++++++++++++++
curl.spec | 5 ++++
2 files changed, 44 insertions(+)
create mode 100644 0003-curl-7.59.0-CVE-2018-1000300.patch
diff --git a/0003-curl-7.59.0-CVE-2018-1000300.patch b/0003-curl-7.59.0-CVE-2018-1000300.patch
new file mode 100644
index 0000000..fb4d15b
--- /dev/null
+++ b/0003-curl-7.59.0-CVE-2018-1000300.patch
@@ -0,0 +1,39 @@
+From 9b757a9a431f6859807d9f6e697cc2d2a120098d Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Fri, 23 Mar 2018 23:30:04 +0100
+Subject: [PATCH 2/2] pingpong: fix response cache memcpy overflow
+
+Response data for a handle with a large buffer might be cached and then
+used with the "closure" handle when it has a smaller buffer and then the
+larger cache will be copied and overflow the new smaller heap based
+buffer.
+
+Reported-by: Dario Weisser
+CVE: CVE-2018-1000300
+Bug: https://curl.haxx.se/docs/adv_2018-82c2.html
+
+Upstream-commit: 583b42cb3b809b1bf597af160468ccba728c2248
+Signed-off-by: Kamil Dudka
+---
+ lib/pingpong.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/pingpong.c b/lib/pingpong.c
+index 438856a..ad370ee 100644
+--- a/lib/pingpong.c
++++ b/lib/pingpong.c
+@@ -304,7 +304,10 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd,
+ * it would have been populated with something of size int to begin
+ * with, even though its datatype may be larger than an int.
+ */
+- DEBUGASSERT((ptr + pp->cache_size) <= (buf + data->set.buffer_size + 1));
++ if((ptr + pp->cache_size) > (buf + data->set.buffer_size + 1)) {
++ failf(data, "cached response data too big to handle");
++ return CURLE_RECV_ERROR;
++ }
+ memcpy(ptr, pp->cache, pp->cache_size);
+ gotbytes = (ssize_t)pp->cache_size;
+ free(pp->cache); /* free the cache */
+--
+2.14.3
+
diff --git a/curl.spec b/curl.spec
index 4bdc523..904ba10 100644
--- a/curl.spec
+++ b/curl.spec
@@ -11,6 +11,9 @@ Patch1: 0001-curl-7.58.0-ftp-typo-in-recursive-callback-detection.patch
# fix RTSP bad headers buffer over-read (CVE-2018-1000301)
Patch2: 0002-curl-7.59.0-CVE-2018-1000301.patch
+# fix FTP shutdown response buffer overflow (CVE-2018-1000300)
+Patch3: 0003-curl-7.59.0-CVE-2018-1000300.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -159,6 +162,7 @@ be installed.
# upstream patches
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# Fedora patches
%patch101 -p1
@@ -305,6 +309,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Fri May 18 2018 Kamil Dudka - 7.59.0-3
+- fix FTP shutdown response buffer overflow (CVE-2018-1000300)
- fix RTSP bad headers buffer over-read (CVE-2018-1000301)
* Wed Mar 14 2018 Kamil Dudka - 7.59.0-2
From 67e93f67b8904524e2013cef126d5f6d7e5b18e4 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 5 Jun 2018 15:10:20 +0200
Subject: [PATCH 007/256] Resolves: #1585797 - http2: handle GOAWAY properly
---
0004-curl-7.59.0-http2-GOAWAY.patch | 137 ++++++++++++++++++++++++++++
curl.spec | 9 +-
2 files changed, 145 insertions(+), 1 deletion(-)
create mode 100644 0004-curl-7.59.0-http2-GOAWAY.patch
diff --git a/0004-curl-7.59.0-http2-GOAWAY.patch b/0004-curl-7.59.0-http2-GOAWAY.patch
new file mode 100644
index 0000000..0e76a6e
--- /dev/null
+++ b/0004-curl-7.59.0-http2-GOAWAY.patch
@@ -0,0 +1,137 @@
+From 84ddda3994c1f12d79946780dee9111b3cf1c308 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Thu, 19 Apr 2018 20:03:30 +0200
+Subject: [PATCH] http2: handle GOAWAY properly
+
+When receiving REFUSED_STREAM, mark the connection for close and retry
+streams accordingly on another/fresh connection.
+
+Reported-by: Terry Wu
+Fixes #2416
+Fixes #1618
+Closes #2510
+
+Upstream-commit: d122df5972fc01e39ae28e6bca705237d7e3318a
+Signed-off-by: Kamil Dudka
+---
+ lib/http2.c | 17 ++++++++++++-----
+ lib/multi.c | 4 +++-
+ lib/transfer.c | 17 +++++++++++++++--
+ lib/urldata.h | 2 +-
+ 4 files changed, 31 insertions(+), 9 deletions(-)
+
+diff --git a/lib/http2.c b/lib/http2.c
+index b2c34e9..fba4d70 100644
+--- a/lib/http2.c
++++ b/lib/http2.c
+@@ -1078,7 +1078,6 @@ void Curl_http2_done(struct connectdata *conn, bool premature)
+ struct http_conn *httpc = &conn->proto.httpc;
+
+ if(http->header_recvbuf) {
+- H2BUGF(infof(data, "free header_recvbuf!!\n"));
+ Curl_add_buffer_free(http->header_recvbuf);
+ http->header_recvbuf = NULL; /* clear the pointer */
+ Curl_add_buffer_free(http->trailer_recvbuf);
+@@ -1351,7 +1350,15 @@ static ssize_t http2_handle_stream_close(struct connectdata *conn,
+
+ /* Reset to FALSE to prevent infinite loop in readwrite_data function. */
+ stream->closed = FALSE;
+- if(httpc->error_code != NGHTTP2_NO_ERROR) {
++ if(httpc->error_code == NGHTTP2_REFUSED_STREAM) {
++ H2BUGF(infof(data, "REFUSED_STREAM (%d), try again on a new connection!\n",
++ stream->stream_id));
++ connclose(conn, "REFUSED_STREAM"); /* don't use this anymore */
++ data->state.refused_stream = TRUE;
++ *err = CURLE_RECV_ERROR; /* trigger Curl_retry_request() later */
++ return -1;
++ }
++ else if(httpc->error_code != NGHTTP2_NO_ERROR) {
+ failf(data, "HTTP/2 stream %u was not closed cleanly: %s (err %d)",
+ stream->stream_id, Curl_http2_strerror(httpc->error_code),
+ httpc->error_code);
+@@ -1579,9 +1586,9 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
+ }
+
+ if(nread == 0) {
+- failf(data, "Unexpected EOF");
+- *err = CURLE_RECV_ERROR;
+- return -1;
++ H2BUGF(infof(data, "end of stream\n"));
++ *err = CURLE_OK;
++ return 0;
+ }
+
+ H2BUGF(infof(data, "nread=%zd\n", nread));
+diff --git a/lib/multi.c b/lib/multi.c
+index 98e5fca..d69e5f9 100644
+--- a/lib/multi.c
++++ b/lib/multi.c
+@@ -541,7 +541,9 @@ static CURLcode multi_done(struct connectdata **connp,
+ if(conn->send_pipe.size || conn->recv_pipe.size) {
+ /* Stop if pipeline is not empty . */
+ data->easy_conn = NULL;
+- DEBUGF(infof(data, "Connection still in use, no more multi_done now!\n"));
++ DEBUGF(infof(data, "Connection still in use %d/%d, "
++ "no more multi_done now!\n",
++ conn->send_pipe.size, conn->recv_pipe.size));
+ return CURLE_OK;
+ }
+
+diff --git a/lib/transfer.c b/lib/transfer.c
+index fd9af31..5c29cc9 100644
+--- a/lib/transfer.c
++++ b/lib/transfer.c
+@@ -1926,7 +1926,7 @@ CURLcode Curl_retry_request(struct connectdata *conn,
+ char **url)
+ {
+ struct Curl_easy *data = conn->data;
+-
++ bool retry = FALSE;
+ *url = NULL;
+
+ /* if we're talking upload, we can't do the checks below, unless the protocol
+@@ -1939,7 +1939,7 @@ CURLcode Curl_retry_request(struct connectdata *conn,
+ conn->bits.reuse &&
+ (!data->set.opt_no_body
+ || (conn->handler->protocol & PROTO_FAMILY_HTTP)) &&
+- (data->set.rtspreq != RTSPREQ_RECEIVE)) {
++ (data->set.rtspreq != RTSPREQ_RECEIVE))
+ /* We got no data, we attempted to re-use a connection. For HTTP this
+ can be a retry so we try again regardless if we expected a body.
+ For other protocols we only try again only if we expected a body.
+@@ -1947,6 +1947,19 @@ CURLcode Curl_retry_request(struct connectdata *conn,
+ This might happen if the connection was left alive when we were
+ done using it before, but that was closed when we wanted to read from
+ it again. Bad luck. Retry the same request on a fresh connect! */
++ retry = TRUE;
++ else if(data->state.refused_stream &&
++ (data->req.bytecount + data->req.headerbytecount == 0) ) {
++ /* This was sent on a refused stream, safe to rerun. A refused stream
++ error can typically only happen on HTTP/2 level if the stream is safe
++ to issue again, but the nghttp2 API can deliver the message to other
++ streams as well, which is why this adds the check the data counters
++ too. */
++ infof(conn->data, "REFUSED_STREAM, retrying a fresh connect\n");
++ data->state.refused_stream = FALSE; /* clear again */
++ retry = TRUE;
++ }
++ if(retry) {
+ infof(conn->data, "Connection died, retrying a fresh connect\n");
+ *url = strdup(conn->data->change.url);
+ if(!*url)
+diff --git a/lib/urldata.h b/lib/urldata.h
+index 3d7b9e5..6a36ee9 100644
+--- a/lib/urldata.h
++++ b/lib/urldata.h
+@@ -1225,7 +1225,7 @@ struct UrlState {
+ curl_off_t current_speed; /* the ProgressShow() function sets this,
+ bytes / second */
+ bool this_is_a_follow; /* this is a followed Location: request */
+-
++ bool refused_stream; /* this was refused, try again */
+ char *first_host; /* host name of the first (not followed) request.
+ if set, this should be the host name that we will
+ sent authorization to, no else. Used to make Location:
+--
+2.14.4
+
diff --git a/curl.spec b/curl.spec
index 904ba10..abf84a4 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -14,6 +14,9 @@ Patch2: 0002-curl-7.59.0-CVE-2018-1000301.patch
# fix FTP shutdown response buffer overflow (CVE-2018-1000300)
Patch3: 0003-curl-7.59.0-CVE-2018-1000300.patch
+# http2: handle GOAWAY properly (#1585797)
+Patch4: 0004-curl-7.59.0-http2-GOAWAY.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -163,6 +166,7 @@ be installed.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
# Fedora patches
%patch101 -p1
@@ -308,6 +312,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Tue Jun 05 2018 Kamil Dudka - 7.59.0-4
+- http2: handle GOAWAY properly (#1585797)
+
* Fri May 18 2018 Kamil Dudka - 7.59.0-3
- fix FTP shutdown response buffer overflow (CVE-2018-1000300)
- fix RTSP bad headers buffer over-read (CVE-2018-1000301)
From 4f55f71cfecf26e83feac730cb1c7eda58cc65a4 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 4 Jul 2018 15:12:27 +0200
Subject: [PATCH 008/256] Related: #1570246 - enable vlagrind again
This reverts commit e51a34d6cc39a103b43b20a7eee32ed783f98035.
---
curl.spec | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/curl.spec b/curl.spec
index 5f11302..348f6db 100644
--- a/curl.spec
+++ b/curl.spec
@@ -69,8 +69,7 @@ BuildRequires: perl(vars)
# #810992, #816175, and #886891). Nevertheless developers are free to install
# valgrind manually to improve test coverage on any architecture.
%ifarch x86_64 %{ix86}
-# temporarily disabled completely because of https://bugzilla.redhat.com/1570246
-# BuildRequires: valgrind
+BuildRequires: valgrind
%endif
# using an older version of libcurl could result in CURLE_UNKNOWN_OPTION
From befa5428f0a60d2f134dd8976cdf338cf6abbc5f Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 4 Jul 2018 15:07:32 +0200
Subject: [PATCH 009/256] do not hard-wire path of the Python 3 interpreter
---
curl.spec | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/curl.spec b/curl.spec
index 348f6db..814abf2 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.60.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -36,7 +36,7 @@ BuildRequires: openssh-clients
BuildRequires: openssh-server
BuildRequires: openssl-devel
BuildRequires: pkgconfig
-BuildRequires: python3
+BuildRequires: python3-devel
BuildRequires: sed
BuildRequires: stunnel
BuildRequires: zlib-devel
@@ -162,7 +162,7 @@ be installed.
%patch104 -p1
# make tests/*.py use Python 3
-sed -e '1 s|^#!/.*python|&3|' -i tests/*.py
+sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
# regenerate Makefile.in files
#aclocal -I m4
@@ -303,6 +303,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Jul 04 2018 Kamil Dudka - 7.60.0-2
+- do not hard-wire path of the Python 3 interpreter
+
* Wed May 16 2018 Kamil Dudka - 7.60.0-1
- new upstream release, which fixes the following vulnerabilities
CVE-2018-1000300 - FTP shutdown response buffer overflow
From 9f5f0d1189a299bbe690ebb6233ad3f746b5b801 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 10 Jul 2018 13:51:08 +0200
Subject: [PATCH 010/256] enable support for brotli compression in libcurl-full
---
curl.spec | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index 814abf2..94a77a8 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.60.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -21,6 +21,7 @@ Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
#BuildRequires: automake
+BuildRequires: brotli-devel
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: groff
@@ -198,6 +199,7 @@ export common_configure_opts=" \
--disable-ldap \
--disable-ldaps \
--disable-manual \
+ --without-brotli \
--without-libidn2 \
--without-libmetalink \
--without-libpsl \
@@ -211,6 +213,7 @@ export common_configure_opts=" \
--enable-ldap \
--enable-ldaps \
--enable-manual \
+ --with-brotli \
--with-libidn2 \
--with-libmetalink \
--with-libpsl \
@@ -303,6 +306,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Tue Jul 10 2018 Kamil Dudka - 7.60.0-3
+- enable support for brotli compression in libcurl-full
+
* Wed Jul 04 2018 Kamil Dudka - 7.60.0-2
- do not hard-wire path of the Python 3 interpreter
From d41d215108ce0cb639ba45ae3f20fa05a47454c5 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 10 Jul 2018 15:14:27 +0200
Subject: [PATCH 011/256] disable test 1455, which occasionally fails in Koji
... with 'bind failed with errno 98: Address already in use'
---
curl.spec | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/curl.spec b/curl.spec
index 94a77a8..4072953 100644
--- a/curl.spec
+++ b/curl.spec
@@ -169,9 +169,10 @@ sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
#aclocal -I m4
#automake
-# disable test 1112 (#565305) and test 1801
+# disable test 1112 (#565305), test 1455 (occasionally fails with 'bind failed
+# with errno 98: Address already in use' in Koji environment), and test 1801
#
-printf "1112\n1801\n" >> tests/data/DISABLED
+printf "1112\n1455\n1801\n" >> tests/data/DISABLED
# disable test 1319 on ppc64 (server times out)
%ifarch ppc64
From a89a46eca8e5466c18dc70a0e5f7b54eb60071af Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 11 Jul 2018 14:16:32 +0200
Subject: [PATCH 012/256] new upstream release - 7.61.0
Resolves: CVE-2018-0500 - SMTP send heap buffer overflow
---
0102-curl-7.36.0-debug.patch | 2 +-
curl-7.60.0.tar.xz.asc | 11 -----------
curl-7.61.0.tar.xz.asc | 11 +++++++++++
curl.spec | 8 ++++++--
sources | 2 +-
5 files changed, 19 insertions(+), 15 deletions(-)
delete mode 100644 curl-7.60.0.tar.xz.asc
create mode 100644 curl-7.61.0.tar.xz.asc
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 95670f0..5fb54b6 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16537,18 +16537,11 @@ $as_echo "yes" >&6; }
+@@ -16409,18 +16409,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/curl-7.60.0.tar.xz.asc b/curl-7.60.0.tar.xz.asc
deleted file mode 100644
index 53ca282..0000000
--- a/curl-7.60.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlr7zUoACgkQXMkI/bce
-EsK3jgf7Bvnswxxgq4wQWmqRKQvkN/zkuA2GjSm98M7mizVHl/7/imeqDl7S1vp0
-A6KCI99Epf+2EYgxrEbvZqlSQ6H30eBxOvV2yNwPhrS3UnXwNSJsbFr5bDRE4o8S
-upyP/tSgEIGJcpq0bstrD7T/DRZ1yFCLB5rOOJx4lQnPuB3C7GAmuOj1ZtIxWIn+
-D/G+X1+/oZlils2TMI7ryjRuFvOSPHdUNldwtvfaRg0i3tNYnPbWq54lhouSn31H
-ft8wNd3nnUpueWCWaKKXo+GBVDemDAMEcDbna+woW5SFLI6ZG/c822ljtld05Dk1
-KmwikC7MREQxkODmC10yrgy9I9akNg==
-=f++X
------END PGP SIGNATURE-----
diff --git a/curl-7.61.0.tar.xz.asc b/curl-7.61.0.tar.xz.asc
new file mode 100644
index 0000000..024ef39
--- /dev/null
+++ b/curl-7.61.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAltFnUIACgkQXMkI/bce
+EsJSSggAo2pO9DacErY/wVqYm2KA76s8HDMyGkvb7HXPWe3w1Nj6nwCY8Knbp2C6
+s6LZ73gqKfe3K+kFsFE6bFy9l2MKNs64cBG19dNUGcoYek6zt1BBXC6LT8/eOWc4
+l6HKift+CBh6ErtInB2CzmoG7dvNoZA00sERJbj9w+QZK4CTBZPWjz9BRHo7V31q
+VnciTRgJ39HjL0kupdDIZgpCL741aWlkbOZu5wsRfe7nxWeiCdyOVluXluDi9t2i
+s1mTPMpkMWDIEh723QL5jOlct9/hTLXAS2yZeR6qJafcicyIboXh0ZwGQGonHADi
+aBs922AWx3v8x18thsCMQZwJSHiYEw==
+=7p0n
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 4072953..813d18b 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.60.0
-Release: 3%{?dist}
+Version: 7.61.0
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -307,6 +307,10 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Jul 11 2018 Kamil Dudka - 7.61.0-1
+- new upstream release, which fixes the following vulnerability
+ CVE-2018-0500 - SMTP send heap buffer overflow
+
* Tue Jul 10 2018 Kamil Dudka - 7.60.0-3
- enable support for brotli compression in libcurl-full
diff --git a/sources b/sources
index 4a1cecd..4248e66 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.60.0.tar.xz) = 96a0c32ca846a76bba75e9e560ad4c15df79540992ed1a83713095be94ddba039f289bda9678762fd79fb9691fe810735178fb9dc970c37012dff96b8ce08abf
+SHA512 (curl-7.61.0.tar.xz) = 1b450bbd794460fea12374a49739a49a43c3651038dc092c277769bab09a62627f8eedfa94b5c1610503bf20eeaf60643a1e32fdcf1bcf8d4085090c4a598b13
From c79dff9b8baa2cb7ca51060f7303d91092fb7d0a Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 11 Jul 2018 17:51:58 +0200
Subject: [PATCH 013/256] Resolves: CVE-2018-0500 - fix heap buffer overflow in
SMTP send
---
0005-curl-7.59.0-CVE-2018-0500.patch | 40 ++++++++++++++++++++++++++++
curl.spec | 9 ++++++-
2 files changed, 48 insertions(+), 1 deletion(-)
create mode 100644 0005-curl-7.59.0-CVE-2018-0500.patch
diff --git a/0005-curl-7.59.0-CVE-2018-0500.patch b/0005-curl-7.59.0-CVE-2018-0500.patch
new file mode 100644
index 0000000..221c05f
--- /dev/null
+++ b/0005-curl-7.59.0-CVE-2018-0500.patch
@@ -0,0 +1,40 @@
+From 7a5d2b67b8bee753735d4b03f66c4054d9b812f9 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Wed, 13 Jun 2018 12:24:40 +0200
+Subject: [PATCH] smtp: use the upload buffer size for scratch buffer malloc
+
+... not the read buffer size, as that can be set smaller and thus cause
+a buffer overflow! CVE-2018-0500
+
+Reported-by: Peter Wu
+Bug: https://curl.haxx.se/docs/adv_2018-70a2.html
+
+Upstream-commit: ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628
+Signed-off-by: Kamil Dudka
+---
+ lib/smtp.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/smtp.c b/lib/smtp.c
+index 3f3b45a..400ad54 100644
+--- a/lib/smtp.c
++++ b/lib/smtp.c
+@@ -1563,13 +1563,14 @@ CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread)
+ if(!scratch || data->set.crlf) {
+ oldscratch = scratch;
+
+- scratch = newscratch = malloc(2 * data->set.buffer_size);
++ scratch = newscratch = malloc(2 * UPLOAD_BUFSIZE);
+ if(!newscratch) {
+ failf(data, "Failed to alloc scratch buffer!");
+
+ return CURLE_OUT_OF_MEMORY;
+ }
+ }
++ DEBUGASSERT(UPLOAD_BUFSIZE >= nread);
+
+ /* Have we already sent part of the EOB? */
+ eob_sent = smtp->eob;
+--
+2.14.4
+
diff --git a/curl.spec b/curl.spec
index abf84a4..008dd3f 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 4%{?dist}
+Release: 5%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -17,6 +17,9 @@ Patch3: 0003-curl-7.59.0-CVE-2018-1000300.patch
# http2: handle GOAWAY properly (#1585797)
Patch4: 0004-curl-7.59.0-http2-GOAWAY.patch
+# fix heap buffer overflow in SMTP send (CVE-2018-0500)
+Patch5: 0005-curl-7.59.0-CVE-2018-0500.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -167,6 +170,7 @@ be installed.
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
# Fedora patches
%patch101 -p1
@@ -312,6 +316,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Jul 11 2018 Kamil Dudka - 7.59.0-5
+- fix heap buffer overflow in SMTP send (CVE-2018-0500)
+
* Tue Jun 05 2018 Kamil Dudka - 7.59.0-4
- http2: handle GOAWAY properly (#1585797)
From 072eac2fb6b2bf8875ccb915628d2ca30cd9a8af Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering
Date: Thu, 12 Jul 2018 22:28:24 +0000
Subject: [PATCH 014/256] - Rebuilt for
https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering
---
curl.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index 813d18b..2bac3e1 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -307,6 +307,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Jul 12 2018 Fedora Release Engineering - 7.61.0-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
+
* Wed Jul 11 2018 Kamil Dudka - 7.61.0-1
- new upstream release, which fixes the following vulnerability
CVE-2018-0500 - SMTP send heap buffer overflow
From bcdea587035cd7e9fbbf3fe1bb41e4658beb64da Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 4 Jul 2018 17:17:26 +0200
Subject: [PATCH 015/256] temporarily disable test 582 on s390x (client times
out)
---
curl.spec | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/curl.spec b/curl.spec
index 2bac3e1..c897629 100644
--- a/curl.spec
+++ b/curl.spec
@@ -179,6 +179,11 @@ printf "1112\n1455\n1801\n" >> tests/data/DISABLED
echo "1319" >> tests/data/DISABLED
%endif
+# temporarily disable test 582 on s390x (client times out)
+%ifarch s390x
+echo "582" >> tests/data/DISABLED
+%endif
+
%build
mkdir build-{full,minimal}
export common_configure_opts=" \
From 85286dc2b33ebd0343f5bdf8c79fa49e8e9183a9 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 31 Jul 2018 10:33:53 +0200
Subject: [PATCH 016/256] adapt test 323 for updated OpenSSL
---
curl.spec | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index c897629..e1149bc 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -184,6 +184,9 @@ echo "1319" >> tests/data/DISABLED
echo "582" >> tests/data/DISABLED
%endif
+# adapt test 323 for updated OpenSSL
+sed -e 's/^35$/35,52/' -i tests/data/test323
+
%build
mkdir build-{full,minimal}
export common_configure_opts=" \
@@ -312,6 +315,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Tue Jul 31 2018 Kamil Dudka - 7.61.0-3
+- adapt test 323 for updated OpenSSL
+
* Thu Jul 12 2018 Fedora Release Engineering - 7.61.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
From 3fb6e235575109530b10e9bc17c4f2ba21d17bcb Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 31 Jul 2018 10:34:24 +0200
Subject: [PATCH 017/256] disable flaky test 1900, which covers deprecated HTTP
pipelining
See https://github.com/curl/curl/pull/2705 for details.
---
curl.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index e1149bc..a56de38 100644
--- a/curl.spec
+++ b/curl.spec
@@ -172,7 +172,9 @@ sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
# disable test 1112 (#565305), test 1455 (occasionally fails with 'bind failed
# with errno 98: Address already in use' in Koji environment), and test 1801
#
-printf "1112\n1455\n1801\n" >> tests/data/DISABLED
+# and test 1900, which is flaky and covers a deprecated feature of libcurl
+#
+printf "1112\n1455\n1801\n1900\n" >> tests/data/DISABLED
# disable test 1319 on ppc64 (server times out)
%ifarch ppc64
@@ -316,6 +318,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Tue Jul 31 2018 Kamil Dudka - 7.61.0-3
+- disable flaky test 1900, which covers deprecated HTTP pipelining
- adapt test 323 for updated OpenSSL
* Thu Jul 12 2018 Fedora Release Engineering - 7.61.0-2
From 35134a4aeeb38d3e2ce158e023acc4f3ffd0c175 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 7 Aug 2018 16:56:26 +0200
Subject: [PATCH 018/256] Related: #1610888 - relax crypto policy for the
test-suite to make it pass again
---
curl.spec | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index a56de38..2b7a4f5 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -248,6 +248,10 @@ export LD_LIBRARY_PATH
cd build-full/tests
make %{?_smp_mflags} V=1
+# relax crypto policy for the test-suite to make it pass again (#1610888)
+export OPENSSL_SYSTEM_CIPHERS_OVERRIDE=XXX
+export OPENSSL_CONF=
+
# run the upstream test-suite
srcdir=../../tests perl -I../../tests ../../tests/runtests.pl -a -p -v '!flaky'
@@ -317,6 +321,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Tue Aug 07 2018 Kamil Dudka - 7.61.0-4
+- relax crypto policy for the test-suite to make it pass again (#1610888)
+
* Tue Jul 31 2018 Kamil Dudka - 7.61.0-3
- disable flaky test 1900, which covers deprecated HTTP pipelining
- adapt test 323 for updated OpenSSL
From 178b0fc823a0cf52899b809e90b02860be596a1f Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 9 Aug 2018 13:37:25 +0200
Subject: [PATCH 019/256] Resolves: #1219544 - ssl: set engine implicitly when
a PKCS#11 URI is provided
---
0001-curl-7.61.0-pkcs11.patch | 272 ++++++++++++++++++++++++++++++++++
curl.spec | 9 +-
2 files changed, 280 insertions(+), 1 deletion(-)
create mode 100644 0001-curl-7.61.0-pkcs11.patch
diff --git a/0001-curl-7.61.0-pkcs11.patch b/0001-curl-7.61.0-pkcs11.patch
new file mode 100644
index 0000000..d92b3e9
--- /dev/null
+++ b/0001-curl-7.61.0-pkcs11.patch
@@ -0,0 +1,272 @@
+From a9a65ae9f6516faf042b36eca2450db7d34bff47 Mon Sep 17 00:00:00 2001
+From: Anderson Toshiyuki Sasaki
+Date: Mon, 19 Feb 2018 14:31:06 +0100
+Subject: [PATCH 1/2] ssl: set engine implicitly when a PKCS#11 URI is provided
+
+This allows the use of PKCS#11 URI for certificates and keys without
+setting the corresponding type as "ENG" and the engine as "pkcs11"
+explicitly. If a PKCS#11 URI is provided for certificate, key,
+proxy_certificate or proxy_key, the corresponding type is set as "ENG"
+if not provided and the engine is set to "pkcs11" if not provided.
+
+Acked-by: Nikos Mavrogiannopoulos
+Closes #2333
+
+Upstream-commit: 298d2565e2a2f06a859b7f5a1cc24ba7c87a8ce2
+Signed-off-by: Kamil Dudka
+---
+ docs/cmdline-opts/cert.d | 7 ++++++
+ docs/cmdline-opts/key.d | 7 ++++++
+ lib/vtls/openssl.c | 38 ++++++++++++++++++++++++++++
+ src/tool_getparam.c | 2 +-
+ src/tool_operate.c | 53 ++++++++++++++++++++++++++++++++++++++++
+ tests/unit/unit1394.c | 3 +++
+ 6 files changed, 109 insertions(+), 1 deletion(-)
+
+diff --git a/docs/cmdline-opts/cert.d b/docs/cmdline-opts/cert.d
+index adf62fc..510b833 100644
+--- a/docs/cmdline-opts/cert.d
++++ b/docs/cmdline-opts/cert.d
+@@ -23,6 +23,13 @@ nickname contains ":", it needs to be preceded by "\\" so that it is not
+ recognized as password delimiter. If the nickname contains "\\", it needs to
+ be escaped as "\\\\" so that it is not recognized as an escape character.
+
++If curl is built against OpenSSL library, and the engine pkcs11 is available,
++then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in
++a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
++PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set
++as "pkcs11" if none was provided and the --cert-type option will be set as
++"ENG" if none was provided.
++
+ (iOS and macOS only) If curl is built against Secure Transport, then the
+ certificate string can either be the name of a certificate/private key in the
+ system or user keychain, or the path to a PKCS#12-encoded certificate and
+diff --git a/docs/cmdline-opts/key.d b/docs/cmdline-opts/key.d
+index fbf583a..4877b42 100644
+--- a/docs/cmdline-opts/key.d
++++ b/docs/cmdline-opts/key.d
+@@ -7,4 +7,11 @@ Private key file name. Allows you to provide your private key in this separate
+ file. For SSH, if not specified, curl tries the following candidates in order:
+ '~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
+
++If curl is built against OpenSSL library, and the engine pkcs11 is available,
++then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a
++PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
++PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set
++as "pkcs11" if none was provided and the --key-type option will be set as
++"ENG" if none was provided.
++
+ If this option is used several times, the last one will be used.
+diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
+index 0b1929b..bc46eca 100644
+--- a/lib/vtls/openssl.c
++++ b/lib/vtls/openssl.c
+@@ -558,8 +558,25 @@ static int ssl_ui_writer(UI *ui, UI_STRING *uis)
+ }
+ return (UI_method_get_writer(UI_OpenSSL()))(ui, uis);
+ }
++
++/*
++ * Check if a given string is a PKCS#11 URI
++ */
++static bool is_pkcs11_uri(const char *string)
++{
++ if(strncasecompare(string, "pkcs11:", 7)) {
++ return TRUE;
++ }
++ else {
++ return FALSE;
++ }
++}
++
+ #endif
+
++static CURLcode Curl_ossl_set_engine(struct Curl_easy *data,
++ const char *engine);
++
+ static
+ int cert_stuff(struct connectdata *conn,
+ SSL_CTX* ctx,
+@@ -622,6 +639,16 @@ int cert_stuff(struct connectdata *conn,
+ case SSL_FILETYPE_ENGINE:
+ #if defined(USE_OPENSSL_ENGINE) && defined(ENGINE_CTRL_GET_CMD_FROM_NAME)
+ {
++ /* Implicitly use pkcs11 engine if none was provided and the
++ * cert_file is a PKCS#11 URI */
++ if(!data->state.engine) {
++ if(is_pkcs11_uri(cert_file)) {
++ if(Curl_ossl_set_engine(data, "pkcs11") != CURLE_OK) {
++ return 0;
++ }
++ }
++ }
++
+ if(data->state.engine) {
+ const char *cmd_name = "LOAD_CERT_CTRL";
+ struct {
+@@ -798,6 +825,17 @@ int cert_stuff(struct connectdata *conn,
+ #ifdef USE_OPENSSL_ENGINE
+ { /* XXXX still needs some work */
+ EVP_PKEY *priv_key = NULL;
++
++ /* Implicitly use pkcs11 engine if none was provided and the
++ * key_file is a PKCS#11 URI */
++ if(!data->state.engine) {
++ if(is_pkcs11_uri(key_file)) {
++ if(Curl_ossl_set_engine(data, "pkcs11") != CURLE_OK) {
++ return 0;
++ }
++ }
++ }
++
+ if(data->state.engine) {
+ UI_METHOD *ui_method =
+ UI_create_method((char *)"curl user interface");
+diff --git a/src/tool_getparam.c b/src/tool_getparam.c
+index cc3fcf3..a7bb7f9 100644
+--- a/src/tool_getparam.c
++++ b/src/tool_getparam.c
+@@ -342,7 +342,7 @@ void parse_cert_parameter(const char *cert_parameter,
+ * looks like a RFC7512 PKCS#11 URI which can be used as-is.
+ * Also if cert_parameter contains no colon nor backslash, this
+ * means no passphrase was given and no characters escaped */
+- if(!strncmp(cert_parameter, "pkcs11:", 7) ||
++ if(curl_strnequal(cert_parameter, "pkcs11:", 7) ||
+ !strpbrk(cert_parameter, ":\\")) {
+ *certname = strdup(cert_parameter);
+ return;
+diff --git a/src/tool_operate.c b/src/tool_operate.c
+index 26fc251..25d450c 100644
+--- a/src/tool_operate.c
++++ b/src/tool_operate.c
+@@ -113,6 +113,19 @@ static bool is_fatal_error(CURLcode code)
+ return FALSE;
+ }
+
++/*
++ * Check if a given string is a PKCS#11 URI
++ */
++static bool is_pkcs11_uri(const char *string)
++{
++ if(curl_strnequal(string, "pkcs11:", 7)) {
++ return TRUE;
++ }
++ else {
++ return FALSE;
++ }
++}
++
+ #ifdef __VMS
+ /*
+ * get_vms_file_size does what it takes to get the real size of the file
+@@ -1073,6 +1086,46 @@ static CURLcode operate_do(struct GlobalConfig *global,
+ my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey);
+
+ if(curlinfo->features & CURL_VERSION_SSL) {
++ /* Check if config->cert is a PKCS#11 URI and set the
++ * config->cert_type if necessary */
++ if(config->cert) {
++ if(!config->cert_type) {
++ if(is_pkcs11_uri(config->cert)) {
++ config->cert_type = strdup("ENG");
++ }
++ }
++ }
++
++ /* Check if config->key is a PKCS#11 URI and set the
++ * config->key_type if necessary */
++ if(config->key) {
++ if(!config->key_type) {
++ if(is_pkcs11_uri(config->key)) {
++ config->key_type = strdup("ENG");
++ }
++ }
++ }
++
++ /* Check if config->proxy_cert is a PKCS#11 URI and set the
++ * config->proxy_type if necessary */
++ if(config->proxy_cert) {
++ if(!config->proxy_cert_type) {
++ if(is_pkcs11_uri(config->proxy_cert)) {
++ config->proxy_cert_type = strdup("ENG");
++ }
++ }
++ }
++
++ /* Check if config->proxy_key is a PKCS#11 URI and set the
++ * config->proxy_key_type if necessary */
++ if(config->proxy_key) {
++ if(!config->proxy_key_type) {
++ if(is_pkcs11_uri(config->proxy_key)) {
++ config->proxy_key_type = strdup("ENG");
++ }
++ }
++ }
++
+ my_setopt_str(curl, CURLOPT_SSLCERT, config->cert);
+ my_setopt_str(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert);
+ my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type);
+diff --git a/tests/unit/unit1394.c b/tests/unit/unit1394.c
+index 667991d..010f052 100644
+--- a/tests/unit/unit1394.c
++++ b/tests/unit/unit1394.c
+@@ -56,6 +56,9 @@ UNITTEST_START
+ "foo:bar\\\\", "foo", "bar\\\\",
+ "foo:bar:", "foo", "bar:",
+ "foo\\::bar\\:", "foo:", "bar\\:",
++ "pkcs11:foobar", "pkcs11:foobar", NULL,
++ "PKCS11:foobar", "PKCS11:foobar", NULL,
++ "PkCs11:foobar", "PkCs11:foobar", NULL,
+ #ifdef WIN32
+ "c:\\foo:bar:baz", "c:\\foo", "bar:baz",
+ "c:\\foo\\:bar:baz", "c:\\foo:bar", "baz",
+--
+2.17.1
+
+
+From 2be42ac65f4c345ed3ddc97917c8ef54e13fcbfd Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Thu, 9 Aug 2018 15:34:22 +0200
+Subject: [PATCH 2/2] docs: add files needed to regenerate curl.1 man page
+
+Bug: https://github.com/curl/curl/pull/2856
+---
+ docs/cmdline-opts/disallow-username-in-url.d | 7 +++++++
+ docs/cmdline-opts/haproxy-protocol.d | 11 +++++++++++
+ 2 files changed, 18 insertions(+)
+ create mode 100644 docs/cmdline-opts/disallow-username-in-url.d
+ create mode 100644 docs/cmdline-opts/haproxy-protocol.d
+
+diff --git a/docs/cmdline-opts/disallow-username-in-url.d b/docs/cmdline-opts/disallow-username-in-url.d
+new file mode 100644
+index 0000000..a7f46ea
+--- /dev/null
++++ b/docs/cmdline-opts/disallow-username-in-url.d
+@@ -0,0 +1,7 @@
++Long: disallow-username-in-url
++Help: Disallow username in url
++Protocols: HTTP
++Added: 7.61.0
++See-also: proto
++---
++This tells curl to exit if passed a url containing a username.
+diff --git a/docs/cmdline-opts/haproxy-protocol.d b/docs/cmdline-opts/haproxy-protocol.d
+new file mode 100644
+index 0000000..cc41c9c
+--- /dev/null
++++ b/docs/cmdline-opts/haproxy-protocol.d
+@@ -0,0 +1,11 @@
++Long: haproxy-protocol
++Help: Send HAProxy PROXY protocol v1 header
++Protocols: HTTP
++Added: 7.60.0
++---
++Send a HAProxy PROXY protocol v1 header at the beginning of the connection. This
++is used by some load balancers and reverse proxies to indicate the client's
++true IP address and port.
++
++This option is primarily useful when sending test requests to a service that
++expects this header.
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 2b7a4f5..db7d3a4 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,10 +1,13 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 4%{?dist}
+Release: 5%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
+Patch1: 0001-curl-7.61.0-pkcs11.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -155,6 +158,7 @@ be installed.
%setup -q
# upstream patches
+%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -321,6 +325,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Aug 09 2018 Kamil Dudka - 7.61.0-5
+- ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
+
* Tue Aug 07 2018 Kamil Dudka - 7.61.0-4
- relax crypto policy for the test-suite to make it pass again (#1610888)
From ab86f69980d8f5936b4fcfa98669c1bb8bfc1265 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 9 Aug 2018 13:37:25 +0200
Subject: [PATCH 020/256] Resolves: #1219544 - ssl: set engine implicitly when
a PKCS#11 URI is provided
---
0006-curl-7.59.0-pkcs11.patch | 225 ++++++++++++++++++++++++++++++++++
curl.spec | 9 +-
2 files changed, 233 insertions(+), 1 deletion(-)
create mode 100644 0006-curl-7.59.0-pkcs11.patch
diff --git a/0006-curl-7.59.0-pkcs11.patch b/0006-curl-7.59.0-pkcs11.patch
new file mode 100644
index 0000000..d0f8ff1
--- /dev/null
+++ b/0006-curl-7.59.0-pkcs11.patch
@@ -0,0 +1,225 @@
+From cf48e08b1a7c480e43d6e66154e94c5029c0d335 Mon Sep 17 00:00:00 2001
+From: Anderson Toshiyuki Sasaki
+Date: Mon, 19 Feb 2018 14:31:06 +0100
+Subject: [PATCH] ssl: set engine implicitly when a PKCS#11 URI is provided
+
+This allows the use of PKCS#11 URI for certificates and keys without
+setting the corresponding type as "ENG" and the engine as "pkcs11"
+explicitly. If a PKCS#11 URI is provided for certificate, key,
+proxy_certificate or proxy_key, the corresponding type is set as "ENG"
+if not provided and the engine is set to "pkcs11" if not provided.
+
+Acked-by: Nikos Mavrogiannopoulos
+Closes #2333
+
+Upstream-commit: 298d2565e2a2f06a859b7f5a1cc24ba7c87a8ce2
+Signed-off-by: Kamil Dudka
+---
+ docs/cmdline-opts/cert.d | 7 ++++++
+ docs/cmdline-opts/key.d | 7 ++++++
+ lib/vtls/openssl.c | 38 ++++++++++++++++++++++++++++
+ src/tool_getparam.c | 2 +-
+ src/tool_operate.c | 53 ++++++++++++++++++++++++++++++++++++++++
+ tests/unit/unit1394.c | 3 +++
+ 6 files changed, 109 insertions(+), 1 deletion(-)
+
+diff --git a/docs/cmdline-opts/cert.d b/docs/cmdline-opts/cert.d
+index 0cd5d53..ae6fe2f 100644
+--- a/docs/cmdline-opts/cert.d
++++ b/docs/cmdline-opts/cert.d
+@@ -23,6 +23,13 @@ nickname contains ":", it needs to be preceded by "\\" so that it is not
+ recognized as password delimiter. If the nickname contains "\\", it needs to
+ be escaped as "\\\\" so that it is not recognized as an escape character.
+
++If curl is built against OpenSSL library, and the engine pkcs11 is available,
++then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in
++a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
++PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set
++as "pkcs11" if none was provided and the --cert-type option will be set as
++"ENG" if none was provided.
++
+ (iOS and macOS only) If curl is built against Secure Transport, then the
+ certificate string can either be the name of a certificate/private key in the
+ system or user keychain, or the path to a PKCS#12-encoded certificate and
+diff --git a/docs/cmdline-opts/key.d b/docs/cmdline-opts/key.d
+index fbf583a..4877b42 100644
+--- a/docs/cmdline-opts/key.d
++++ b/docs/cmdline-opts/key.d
+@@ -7,4 +7,11 @@ Private key file name. Allows you to provide your private key in this separate
+ file. For SSH, if not specified, curl tries the following candidates in order:
+ '~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
+
++If curl is built against OpenSSL library, and the engine pkcs11 is available,
++then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a
++PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
++PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set
++as "pkcs11" if none was provided and the --key-type option will be set as
++"ENG" if none was provided.
++
+ If this option is used several times, the last one will be used.
+diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
+index 2a6b3cf..5f16dbd 100644
+--- a/lib/vtls/openssl.c
++++ b/lib/vtls/openssl.c
+@@ -532,8 +532,25 @@ static int ssl_ui_writer(UI *ui, UI_STRING *uis)
+ }
+ return (UI_method_get_writer(UI_OpenSSL()))(ui, uis);
+ }
++
++/*
++ * Check if a given string is a PKCS#11 URI
++ */
++static bool is_pkcs11_uri(const char *string)
++{
++ if(strncasecompare(string, "pkcs11:", 7)) {
++ return TRUE;
++ }
++ else {
++ return FALSE;
++ }
++}
++
+ #endif
+
++static CURLcode Curl_ossl_set_engine(struct Curl_easy *data,
++ const char *engine);
++
+ static
+ int cert_stuff(struct connectdata *conn,
+ SSL_CTX* ctx,
+@@ -596,6 +613,16 @@ int cert_stuff(struct connectdata *conn,
+ case SSL_FILETYPE_ENGINE:
+ #if defined(HAVE_OPENSSL_ENGINE_H) && defined(ENGINE_CTRL_GET_CMD_FROM_NAME)
+ {
++ /* Implicitly use pkcs11 engine if none was provided and the
++ * cert_file is a PKCS#11 URI */
++ if(!data->state.engine) {
++ if(is_pkcs11_uri(cert_file)) {
++ if(Curl_ossl_set_engine(data, "pkcs11") != CURLE_OK) {
++ return 0;
++ }
++ }
++ }
++
+ if(data->state.engine) {
+ const char *cmd_name = "LOAD_CERT_CTRL";
+ struct {
+@@ -762,6 +789,17 @@ int cert_stuff(struct connectdata *conn,
+ #ifdef HAVE_OPENSSL_ENGINE_H
+ { /* XXXX still needs some work */
+ EVP_PKEY *priv_key = NULL;
++
++ /* Implicitly use pkcs11 engine if none was provided and the
++ * key_file is a PKCS#11 URI */
++ if(!data->state.engine) {
++ if(is_pkcs11_uri(key_file)) {
++ if(Curl_ossl_set_engine(data, "pkcs11") != CURLE_OK) {
++ return 0;
++ }
++ }
++ }
++
+ if(data->state.engine) {
+ UI_METHOD *ui_method =
+ UI_create_method((char *)"curl user interface");
+diff --git a/src/tool_getparam.c b/src/tool_getparam.c
+index 7ce9c28..6628247 100644
+--- a/src/tool_getparam.c
++++ b/src/tool_getparam.c
+@@ -337,7 +337,7 @@ void parse_cert_parameter(const char *cert_parameter,
+ * looks like a RFC7512 PKCS#11 URI which can be used as-is.
+ * Also if cert_parameter contains no colon nor backslash, this
+ * means no passphrase was given and no characters escaped */
+- if(!strncmp(cert_parameter, "pkcs11:", 7) ||
++ if(curl_strnequal(cert_parameter, "pkcs11:", 7) ||
+ !strpbrk(cert_parameter, ":\\")) {
+ *certname = strdup(cert_parameter);
+ return;
+diff --git a/src/tool_operate.c b/src/tool_operate.c
+index e8b434a..fa44c70 100644
+--- a/src/tool_operate.c
++++ b/src/tool_operate.c
+@@ -113,6 +113,19 @@ static bool is_fatal_error(CURLcode code)
+ return FALSE;
+ }
+
++/*
++ * Check if a given string is a PKCS#11 URI
++ */
++static bool is_pkcs11_uri(const char *string)
++{
++ if(curl_strnequal(string, "pkcs11:", 7)) {
++ return TRUE;
++ }
++ else {
++ return FALSE;
++ }
++}
++
+ #ifdef __VMS
+ /*
+ * get_vms_file_size does what it takes to get the real size of the file
+@@ -1057,6 +1070,46 @@ static CURLcode operate_do(struct GlobalConfig *global,
+ my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey);
+
+ if(curlinfo->features & CURL_VERSION_SSL) {
++ /* Check if config->cert is a PKCS#11 URI and set the
++ * config->cert_type if necessary */
++ if(config->cert) {
++ if(!config->cert_type) {
++ if(is_pkcs11_uri(config->cert)) {
++ config->cert_type = strdup("ENG");
++ }
++ }
++ }
++
++ /* Check if config->key is a PKCS#11 URI and set the
++ * config->key_type if necessary */
++ if(config->key) {
++ if(!config->key_type) {
++ if(is_pkcs11_uri(config->key)) {
++ config->key_type = strdup("ENG");
++ }
++ }
++ }
++
++ /* Check if config->proxy_cert is a PKCS#11 URI and set the
++ * config->proxy_type if necessary */
++ if(config->proxy_cert) {
++ if(!config->proxy_cert_type) {
++ if(is_pkcs11_uri(config->proxy_cert)) {
++ config->proxy_cert_type = strdup("ENG");
++ }
++ }
++ }
++
++ /* Check if config->proxy_key is a PKCS#11 URI and set the
++ * config->proxy_key_type if necessary */
++ if(config->proxy_key) {
++ if(!config->proxy_key_type) {
++ if(is_pkcs11_uri(config->proxy_key)) {
++ config->proxy_key_type = strdup("ENG");
++ }
++ }
++ }
++
+ my_setopt_str(curl, CURLOPT_SSLCERT, config->cert);
+ my_setopt_str(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert);
+ my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type);
+diff --git a/tests/unit/unit1394.c b/tests/unit/unit1394.c
+index 667991d..010f052 100644
+--- a/tests/unit/unit1394.c
++++ b/tests/unit/unit1394.c
+@@ -56,6 +56,9 @@ UNITTEST_START
+ "foo:bar\\\\", "foo", "bar\\\\",
+ "foo:bar:", "foo", "bar:",
+ "foo\\::bar\\:", "foo:", "bar\\:",
++ "pkcs11:foobar", "pkcs11:foobar", NULL,
++ "PKCS11:foobar", "PKCS11:foobar", NULL,
++ "PkCs11:foobar", "PkCs11:foobar", NULL,
+ #ifdef WIN32
+ "c:\\foo:bar:baz", "c:\\foo", "bar:baz",
+ "c:\\foo\\:bar:baz", "c:\\foo:bar", "baz",
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 008dd3f..a49e005 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 5%{?dist}
+Release: 6%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -20,6 +20,9 @@ Patch4: 0004-curl-7.59.0-http2-GOAWAY.patch
# fix heap buffer overflow in SMTP send (CVE-2018-0500)
Patch5: 0005-curl-7.59.0-CVE-2018-0500.patch
+# ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
+Patch6: 0006-curl-7.59.0-pkcs11.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -171,6 +174,7 @@ be installed.
%patch3 -p1
%patch4 -p1
%patch5 -p1
+%patch6 -p1
# Fedora patches
%patch101 -p1
@@ -316,6 +320,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Aug 09 2018 Kamil Dudka - 7.59.0-6
+- ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
+
* Wed Jul 11 2018 Kamil Dudka - 7.59.0-5
- fix heap buffer overflow in SMTP send (CVE-2018-0500)
From 023b327acc85474414b8935401fd90238f89b5bb Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 15 Aug 2018 13:56:12 +0200
Subject: [PATCH 021/256] Resolves: #1595135 - scp/sftp: fix infinite connect
loop on invalid private key
---
0002-curl-7.61.0-libssh.patch | 130 ++++++++++++++++++++++++++++++++++
curl.spec | 15 ++--
2 files changed, 141 insertions(+), 4 deletions(-)
create mode 100644 0002-curl-7.61.0-libssh.patch
diff --git a/0002-curl-7.61.0-libssh.patch b/0002-curl-7.61.0-libssh.patch
new file mode 100644
index 0000000..75966b4
--- /dev/null
+++ b/0002-curl-7.61.0-libssh.patch
@@ -0,0 +1,130 @@
+From 155d4ffb7d40daf2afa0102f91f810675220ab6e Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Tue, 14 Aug 2018 13:14:49 +0200
+Subject: [PATCH] ssh-libssh: reduce excessive verbose output about pubkey auth
+
+The verbose message "Authentication using SSH public key file" was
+printed each time the ssh_userauth_publickey_auto() was called, which
+meant each time a packet was transferred over network because the API
+operates in non-blocking mode.
+
+This patch makes sure that the verbose message is printed just once
+(when the authentication state is entered by the SSH state machine).
+
+Upstream-commit: 1e843a31a49484aeddf8f358e71392205f5fd6b1
+Signed-off-by: Kamil Dudka
+---
+ lib/ssh-libssh.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
+index cecf477ac..f40f074b9 100644
+--- a/lib/ssh-libssh.c
++++ b/lib/ssh-libssh.c
+@@ -618,6 +618,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
+ sshc->auth_methods = ssh_userauth_list(sshc->ssh_session, NULL);
+ if(sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
+ state(conn, SSH_AUTH_PKEY_INIT);
++ infof(data, "Authentication using SSH public key file\n");
+ }
+ else if(sshc->auth_methods & SSH_AUTH_METHOD_GSSAPI_MIC) {
+ state(conn, SSH_AUTH_GSSAPI);
+@@ -670,8 +671,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
+
+ }
+ else {
+- infof(data, "Authentication using SSH public key file\n");
+-
+ rc = ssh_userauth_publickey_auto(sshc->ssh_session, NULL,
+ data->set.ssl.key_passwd);
+ if(rc == SSH_AUTH_AGAIN) {
+--
+2.17.1
+
+From 4b445519694ab620bd6376066844a7076e8ce4ab Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Tue, 14 Aug 2018 12:47:18 +0200
+Subject: [PATCH] ssh-libssh: fix infinite connect loop on invalid private key
+
+Added test 656 (based on test 604) to verify the fix.
+
+Bug: https://bugzilla.redhat.com/1595135
+
+Closes #2879
+
+Upstream-commit: a4c7911a48dadb4f68ba6b38bb1bf3f061b747f6
+Signed-off-by: Kamil Dudka
+---
+ lib/ssh-libssh.c | 1 +
+ tests/data/Makefile.inc | 2 +-
+ tests/data/test656 | 33 +++++++++++++++++++++++++++++++++
+ 3 files changed, 35 insertions(+), 1 deletion(-)
+ create mode 100644 tests/data/test656
+
+diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
+index f40f074b9..12d618cfe 100644
+--- a/lib/ssh-libssh.c
++++ b/lib/ssh-libssh.c
+@@ -663,6 +663,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
+ if(rc != SSH_OK) {
+ failf(data, "Could not load private key file %s",
+ data->set.str[STRING_SSH_PRIVATE_KEY]);
++ MOVE_TO_ERROR_STATE(CURLE_LOGIN_DENIED);
+ break;
+ }
+
+diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
+index 20274b37c..518a5a543 100644
+--- a/tests/data/Makefile.inc
++++ b/tests/data/Makefile.inc
+@@ -83,7 +83,7 @@ test617 test618 test619 test620 test621 test622 test623 test624 test625 \
+ test626 test627 test628 test629 test630 test631 test632 test633 test634 \
+ test635 test636 test637 test638 test639 test640 test641 test642 \
+ test643 test644 test645 test646 test647 test648 test649 test650 test651 \
+-test652 test653 test654 test655 \
++test652 test653 test654 test655 test656 \
+ \
+ test700 test701 test702 test703 test704 test705 test706 test707 test708 \
+ test709 test710 test711 test712 test713 test714 test715 \
+diff --git a/tests/data/test656 b/tests/data/test656
+new file mode 100644
+index 000000000..4107d3d17
+--- /dev/null
++++ b/tests/data/test656
+@@ -0,0 +1,33 @@
++
++
++
++SFTP
++FAILURE
++
++
++
++#
++# Client-side
++
++
++sftp
++
++
++SFTP retrieval with nonexistent private key file
++
++
++--key DOES_NOT_EXIST --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure --connect-timeout 8
++
++
++
++#
++# Verify data after the test has been "shot"
++
++
++disable
++
++
++67
++
++
++
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index db7d3a4..8c2b8bb 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 5%{?dist}
+Release: 6%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
Patch1: 0001-curl-7.61.0-pkcs11.patch
+# scp/sftp: fix infinite connect loop on invalid private key (#1595135)
+Patch2: 0002-curl-7.61.0-libssh.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -23,7 +26,7 @@ Patch104: 0104-curl-7.19.7-localhost6.patch
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
-#BuildRequires: automake
+BuildRequires: automake
BuildRequires: brotli-devel
BuildRequires: coreutils
BuildRequires: gcc
@@ -159,6 +162,7 @@ be installed.
# upstream patches
%patch1 -p1
+%patch2 -p1
# Fedora patches
%patch101 -p1
@@ -170,8 +174,8 @@ be installed.
sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
# regenerate Makefile.in files
-#aclocal -I m4
-#automake
+aclocal -I m4
+automake
# disable test 1112 (#565305), test 1455 (occasionally fails with 'bind failed
# with errno 98: Address already in use' in Koji environment), and test 1801
@@ -325,6 +329,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Aug 15 2018 Kamil Dudka - 7.61.0-6
+- scp/sftp: fix infinite connect loop on invalid private key (#1595135)
+
* Thu Aug 09 2018 Kamil Dudka - 7.61.0-5
- ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
From 8bff7e0d6b511d2b351c51f86933ac2eaa7c6180 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 27 Aug 2018 15:58:33 +0200
Subject: [PATCH 022/256] Related: #1622594 - tests: make ssh-keygen always
produce PEM format
The default format produced by openssh-7.8p1 cannot be consumed
by currently available versions of libssh and libssh2.
---
0105-curl-7.61.0-tests-ssh-keygen.patch | 33 +++++++++++++++++++++++++
curl.spec | 9 ++++++-
2 files changed, 41 insertions(+), 1 deletion(-)
create mode 100644 0105-curl-7.61.0-tests-ssh-keygen.patch
diff --git a/0105-curl-7.61.0-tests-ssh-keygen.patch b/0105-curl-7.61.0-tests-ssh-keygen.patch
new file mode 100644
index 0000000..b8b9ffb
--- /dev/null
+++ b/0105-curl-7.61.0-tests-ssh-keygen.patch
@@ -0,0 +1,33 @@
+From daded1aff280104d16e405fcd1be1a857c74b191 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Mon, 27 Aug 2018 15:53:35 +0200
+Subject: [PATCH] tests: make ssh-keygen always produce PEM format
+
+The default format produced by openssh-7.8p1 cannot be consumed
+by currently available versions of libssh and libssh2.
+---
+ tests/sshserver.pl | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/sshserver.pl b/tests/sshserver.pl
+index 9b3d122..d477a02 100755
+--- a/tests/sshserver.pl
++++ b/tests/sshserver.pl
+@@ -372,12 +372,12 @@ if((! -e $hstprvkeyf) || (! -s $hstprvkeyf) ||
+ # Make sure all files are gone so ssh-keygen doesn't complain
+ unlink($hstprvkeyf, $hstpubkeyf, $cliprvkeyf, $clipubkeyf);
+ logmsg 'generating host keys...' if($verbose);
+- if(system "\"$sshkeygen\" -q -t rsa -f $hstprvkeyf -C 'curl test server' -N ''") {
++ if(system "\"$sshkeygen\" -q -t rsa -f $hstprvkeyf -C 'curl test server' -N '' -m PEM") {
+ logmsg 'Could not generate host key';
+ exit 1;
+ }
+ logmsg 'generating client keys...' if($verbose);
+- if(system "\"$sshkeygen\" -q -t rsa -f $cliprvkeyf -C 'curl test client' -N ''") {
++ if(system "\"$sshkeygen\" -q -t rsa -f $cliprvkeyf -C 'curl test client' -N '' -m PEM") {
+ logmsg 'Could not generate client key';
+ exit 1;
+ }
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 8c2b8bb..41e828b 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 6%{?dist}
+Release: 7%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -23,6 +23,9 @@ Patch103: 0103-curl-7.59.0-python3.patch
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
+# tests: make ssh-keygen always produce PEM format (#1622594)
+Patch105: 0105-curl-7.61.0-tests-ssh-keygen.patch
+
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
@@ -169,6 +172,7 @@ be installed.
%patch102 -p1
%patch103 -p1
%patch104 -p1
+%patch105 -p1
# make tests/*.py use Python 3
sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
@@ -329,6 +333,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Aug 27 2018 Kamil Dudka - 7.61.0-7
+- tests: make ssh-keygen always produce PEM format (#1622594)
+
* Wed Aug 15 2018 Kamil Dudka - 7.61.0-6
- scp/sftp: fix infinite connect loop on invalid private key (#1595135)
From e7b6b91818749a26ce0f5a152d6c7387dc883efb Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 4 Sep 2018 15:20:55 +0200
Subject: [PATCH 023/256] make the --tls13-ciphers option work
---
0003-curl-7.61.0-tls13-ciphers.patch | 101 +++++++++++++++++++++++++++
curl.spec | 9 ++-
2 files changed, 109 insertions(+), 1 deletion(-)
create mode 100644 0003-curl-7.61.0-tls13-ciphers.patch
diff --git a/0003-curl-7.61.0-tls13-ciphers.patch b/0003-curl-7.61.0-tls13-ciphers.patch
new file mode 100644
index 0000000..a55ca64
--- /dev/null
+++ b/0003-curl-7.61.0-tls13-ciphers.patch
@@ -0,0 +1,101 @@
+From 426b00d0587797d79806f9682b058d5c90a0ab79 Mon Sep 17 00:00:00 2001
+From: Jay Satiro
+Date: Fri, 31 Aug 2018 19:46:29 -0400
+Subject: [PATCH 1/2] openssl: Fix setting TLS 1.3 cipher suites
+
+The flag indicating TLS 1.3 cipher support in the OpenSSL backend was
+missing.
+
+Bug: https://github.com/curl/curl/pull/2607#issuecomment-417283187
+Reported-by: Kamil Dudka
+
+Closes #2926
+
+Upstream-commit: 978574b502294ae06eb97d4f590b54ed5d24cd7f
+Signed-off-by: Kamil Dudka
+---
+ lib/vtls/openssl.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
+index bc46eca..fad4287 100644
+--- a/lib/vtls/openssl.c
++++ b/lib/vtls/openssl.c
+@@ -3804,6 +3804,9 @@ const struct Curl_ssl Curl_ssl_openssl = {
+ SSLSUPP_CERTINFO |
+ SSLSUPP_PINNEDPUBKEY |
+ SSLSUPP_SSL_CTX |
++#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
++ SSLSUPP_TLS13_CIPHERSUITES |
++#endif
+ SSLSUPP_HTTPS_PROXY,
+
+ sizeof(struct ssl_backend_data),
+--
+2.17.1
+
+
+From 081afa4e2eb5e853833bd87ca43f48ab550fe657 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Mon, 3 Sep 2018 13:04:00 +0200
+Subject: [PATCH 2/2] url, vtls: make CURLOPT{,_PROXY}_TLS13_CIPHERS work
+
+This is a follow-up to PR #2607 and PR #2926.
+
+Closes #2936
+
+Upstream-commit: 52c13d6328ff56b2d2e8313e88cfdfc78acda365
+Signed-off-by: Kamil Dudka
+---
+ lib/url.c | 4 ++++
+ lib/vtls/vtls.c | 5 ++++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/lib/url.c b/lib/url.c
+index 27b2c1e..46898c4 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -4356,6 +4356,10 @@ static CURLcode create_conn(struct Curl_easy *data,
+ data->set.str[STRING_SSL_CIPHER_LIST_ORIG];
+ data->set.proxy_ssl.primary.cipher_list =
+ data->set.str[STRING_SSL_CIPHER_LIST_PROXY];
++ data->set.ssl.primary.cipher_list13 =
++ data->set.str[STRING_SSL_CIPHER13_LIST_ORIG];
++ data->set.proxy_ssl.primary.cipher_list13 =
++ data->set.str[STRING_SSL_CIPHER13_LIST_PROXY];
+
+ data->set.ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE_ORIG];
+ data->set.proxy_ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE_PROXY];
+diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
+index bf96518..b61c640 100644
+--- a/lib/vtls/vtls.c
++++ b/lib/vtls/vtls.c
+@@ -96,7 +96,8 @@ Curl_ssl_config_matches(struct ssl_primary_config* data,
+ Curl_safe_strcasecompare(data->clientcert, needle->clientcert) &&
+ Curl_safe_strcasecompare(data->random_file, needle->random_file) &&
+ Curl_safe_strcasecompare(data->egdsocket, needle->egdsocket) &&
+- Curl_safe_strcasecompare(data->cipher_list, needle->cipher_list))
++ Curl_safe_strcasecompare(data->cipher_list, needle->cipher_list) &&
++ Curl_safe_strcasecompare(data->cipher_list13, needle->cipher_list13))
+ return TRUE;
+
+ return FALSE;
+@@ -119,6 +120,7 @@ Curl_clone_primary_ssl_config(struct ssl_primary_config *source,
+ CLONE_STRING(random_file);
+ CLONE_STRING(egdsocket);
+ CLONE_STRING(cipher_list);
++ CLONE_STRING(cipher_list13);
+
+ return TRUE;
+ }
+@@ -131,6 +133,7 @@ void Curl_free_primary_ssl_config(struct ssl_primary_config* sslc)
+ Curl_safefree(sslc->random_file);
+ Curl_safefree(sslc->egdsocket);
+ Curl_safefree(sslc->cipher_list);
++ Curl_safefree(sslc->cipher_list13);
+ }
+
+ #ifdef USE_SSL
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 41e828b..dbd4d40 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.0
-Release: 7%{?dist}
+Release: 8%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -11,6 +11,9 @@ Patch1: 0001-curl-7.61.0-pkcs11.patch
# scp/sftp: fix infinite connect loop on invalid private key (#1595135)
Patch2: 0002-curl-7.61.0-libssh.patch
+# make the --tls13-ciphers option work
+Patch3: 0003-curl-7.61.0-tls13-ciphers.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -166,6 +169,7 @@ be installed.
# upstream patches
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# Fedora patches
%patch101 -p1
@@ -333,6 +337,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Tue Sep 04 2018 Kamil Dudka - 7.61.0-8
+- make the --tls13-ciphers option work
+
* Mon Aug 27 2018 Kamil Dudka - 7.61.0-7
- tests: make ssh-keygen always produce PEM format (#1622594)
From 20b63790e4e0f1c1ef978d2f337c858d90f6e262 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 5 Sep 2018 09:57:41 +0200
Subject: [PATCH 024/256] new upstream release - 7.61.1
Resolves: CVE-2018-14618 - NTLM password overflow via integer overflow
---
0001-curl-7.61.0-pkcs11.patch | 272 ---------------------------
0002-curl-7.61.0-libssh.patch | 130 -------------
0003-curl-7.61.0-tls13-ciphers.patch | 101 ----------
0102-curl-7.36.0-debug.patch | 2 +-
0103-curl-7.59.0-python3.patch | 2 +-
curl-7.61.0.tar.xz.asc | 11 --
curl-7.61.1.tar.xz.asc | 11 ++
curl.spec | 20 +-
sources | 2 +-
9 files changed, 20 insertions(+), 531 deletions(-)
delete mode 100644 0001-curl-7.61.0-pkcs11.patch
delete mode 100644 0002-curl-7.61.0-libssh.patch
delete mode 100644 0003-curl-7.61.0-tls13-ciphers.patch
delete mode 100644 curl-7.61.0.tar.xz.asc
create mode 100644 curl-7.61.1.tar.xz.asc
diff --git a/0001-curl-7.61.0-pkcs11.patch b/0001-curl-7.61.0-pkcs11.patch
deleted file mode 100644
index d92b3e9..0000000
--- a/0001-curl-7.61.0-pkcs11.patch
+++ /dev/null
@@ -1,272 +0,0 @@
-From a9a65ae9f6516faf042b36eca2450db7d34bff47 Mon Sep 17 00:00:00 2001
-From: Anderson Toshiyuki Sasaki
-Date: Mon, 19 Feb 2018 14:31:06 +0100
-Subject: [PATCH 1/2] ssl: set engine implicitly when a PKCS#11 URI is provided
-
-This allows the use of PKCS#11 URI for certificates and keys without
-setting the corresponding type as "ENG" and the engine as "pkcs11"
-explicitly. If a PKCS#11 URI is provided for certificate, key,
-proxy_certificate or proxy_key, the corresponding type is set as "ENG"
-if not provided and the engine is set to "pkcs11" if not provided.
-
-Acked-by: Nikos Mavrogiannopoulos
-Closes #2333
-
-Upstream-commit: 298d2565e2a2f06a859b7f5a1cc24ba7c87a8ce2
-Signed-off-by: Kamil Dudka
----
- docs/cmdline-opts/cert.d | 7 ++++++
- docs/cmdline-opts/key.d | 7 ++++++
- lib/vtls/openssl.c | 38 ++++++++++++++++++++++++++++
- src/tool_getparam.c | 2 +-
- src/tool_operate.c | 53 ++++++++++++++++++++++++++++++++++++++++
- tests/unit/unit1394.c | 3 +++
- 6 files changed, 109 insertions(+), 1 deletion(-)
-
-diff --git a/docs/cmdline-opts/cert.d b/docs/cmdline-opts/cert.d
-index adf62fc..510b833 100644
---- a/docs/cmdline-opts/cert.d
-+++ b/docs/cmdline-opts/cert.d
-@@ -23,6 +23,13 @@ nickname contains ":", it needs to be preceded by "\\" so that it is not
- recognized as password delimiter. If the nickname contains "\\", it needs to
- be escaped as "\\\\" so that it is not recognized as an escape character.
-
-+If curl is built against OpenSSL library, and the engine pkcs11 is available,
-+then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in
-+a PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
-+PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set
-+as "pkcs11" if none was provided and the --cert-type option will be set as
-+"ENG" if none was provided.
-+
- (iOS and macOS only) If curl is built against Secure Transport, then the
- certificate string can either be the name of a certificate/private key in the
- system or user keychain, or the path to a PKCS#12-encoded certificate and
-diff --git a/docs/cmdline-opts/key.d b/docs/cmdline-opts/key.d
-index fbf583a..4877b42 100644
---- a/docs/cmdline-opts/key.d
-+++ b/docs/cmdline-opts/key.d
-@@ -7,4 +7,11 @@ Private key file name. Allows you to provide your private key in this separate
- file. For SSH, if not specified, curl tries the following candidates in order:
- '~/.ssh/id_rsa', '~/.ssh/id_dsa', './id_rsa', './id_dsa'.
-
-+If curl is built against OpenSSL library, and the engine pkcs11 is available,
-+then a PKCS#11 URI (RFC 7512) can be used to specify a private key located in a
-+PKCS#11 device. A string beginning with "pkcs11:" will be interpreted as a
-+PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option will be set
-+as "pkcs11" if none was provided and the --key-type option will be set as
-+"ENG" if none was provided.
-+
- If this option is used several times, the last one will be used.
-diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
-index 0b1929b..bc46eca 100644
---- a/lib/vtls/openssl.c
-+++ b/lib/vtls/openssl.c
-@@ -558,8 +558,25 @@ static int ssl_ui_writer(UI *ui, UI_STRING *uis)
- }
- return (UI_method_get_writer(UI_OpenSSL()))(ui, uis);
- }
-+
-+/*
-+ * Check if a given string is a PKCS#11 URI
-+ */
-+static bool is_pkcs11_uri(const char *string)
-+{
-+ if(strncasecompare(string, "pkcs11:", 7)) {
-+ return TRUE;
-+ }
-+ else {
-+ return FALSE;
-+ }
-+}
-+
- #endif
-
-+static CURLcode Curl_ossl_set_engine(struct Curl_easy *data,
-+ const char *engine);
-+
- static
- int cert_stuff(struct connectdata *conn,
- SSL_CTX* ctx,
-@@ -622,6 +639,16 @@ int cert_stuff(struct connectdata *conn,
- case SSL_FILETYPE_ENGINE:
- #if defined(USE_OPENSSL_ENGINE) && defined(ENGINE_CTRL_GET_CMD_FROM_NAME)
- {
-+ /* Implicitly use pkcs11 engine if none was provided and the
-+ * cert_file is a PKCS#11 URI */
-+ if(!data->state.engine) {
-+ if(is_pkcs11_uri(cert_file)) {
-+ if(Curl_ossl_set_engine(data, "pkcs11") != CURLE_OK) {
-+ return 0;
-+ }
-+ }
-+ }
-+
- if(data->state.engine) {
- const char *cmd_name = "LOAD_CERT_CTRL";
- struct {
-@@ -798,6 +825,17 @@ int cert_stuff(struct connectdata *conn,
- #ifdef USE_OPENSSL_ENGINE
- { /* XXXX still needs some work */
- EVP_PKEY *priv_key = NULL;
-+
-+ /* Implicitly use pkcs11 engine if none was provided and the
-+ * key_file is a PKCS#11 URI */
-+ if(!data->state.engine) {
-+ if(is_pkcs11_uri(key_file)) {
-+ if(Curl_ossl_set_engine(data, "pkcs11") != CURLE_OK) {
-+ return 0;
-+ }
-+ }
-+ }
-+
- if(data->state.engine) {
- UI_METHOD *ui_method =
- UI_create_method((char *)"curl user interface");
-diff --git a/src/tool_getparam.c b/src/tool_getparam.c
-index cc3fcf3..a7bb7f9 100644
---- a/src/tool_getparam.c
-+++ b/src/tool_getparam.c
-@@ -342,7 +342,7 @@ void parse_cert_parameter(const char *cert_parameter,
- * looks like a RFC7512 PKCS#11 URI which can be used as-is.
- * Also if cert_parameter contains no colon nor backslash, this
- * means no passphrase was given and no characters escaped */
-- if(!strncmp(cert_parameter, "pkcs11:", 7) ||
-+ if(curl_strnequal(cert_parameter, "pkcs11:", 7) ||
- !strpbrk(cert_parameter, ":\\")) {
- *certname = strdup(cert_parameter);
- return;
-diff --git a/src/tool_operate.c b/src/tool_operate.c
-index 26fc251..25d450c 100644
---- a/src/tool_operate.c
-+++ b/src/tool_operate.c
-@@ -113,6 +113,19 @@ static bool is_fatal_error(CURLcode code)
- return FALSE;
- }
-
-+/*
-+ * Check if a given string is a PKCS#11 URI
-+ */
-+static bool is_pkcs11_uri(const char *string)
-+{
-+ if(curl_strnequal(string, "pkcs11:", 7)) {
-+ return TRUE;
-+ }
-+ else {
-+ return FALSE;
-+ }
-+}
-+
- #ifdef __VMS
- /*
- * get_vms_file_size does what it takes to get the real size of the file
-@@ -1073,6 +1086,46 @@ static CURLcode operate_do(struct GlobalConfig *global,
- my_setopt_str(curl, CURLOPT_PINNEDPUBLICKEY, config->pinnedpubkey);
-
- if(curlinfo->features & CURL_VERSION_SSL) {
-+ /* Check if config->cert is a PKCS#11 URI and set the
-+ * config->cert_type if necessary */
-+ if(config->cert) {
-+ if(!config->cert_type) {
-+ if(is_pkcs11_uri(config->cert)) {
-+ config->cert_type = strdup("ENG");
-+ }
-+ }
-+ }
-+
-+ /* Check if config->key is a PKCS#11 URI and set the
-+ * config->key_type if necessary */
-+ if(config->key) {
-+ if(!config->key_type) {
-+ if(is_pkcs11_uri(config->key)) {
-+ config->key_type = strdup("ENG");
-+ }
-+ }
-+ }
-+
-+ /* Check if config->proxy_cert is a PKCS#11 URI and set the
-+ * config->proxy_type if necessary */
-+ if(config->proxy_cert) {
-+ if(!config->proxy_cert_type) {
-+ if(is_pkcs11_uri(config->proxy_cert)) {
-+ config->proxy_cert_type = strdup("ENG");
-+ }
-+ }
-+ }
-+
-+ /* Check if config->proxy_key is a PKCS#11 URI and set the
-+ * config->proxy_key_type if necessary */
-+ if(config->proxy_key) {
-+ if(!config->proxy_key_type) {
-+ if(is_pkcs11_uri(config->proxy_key)) {
-+ config->proxy_key_type = strdup("ENG");
-+ }
-+ }
-+ }
-+
- my_setopt_str(curl, CURLOPT_SSLCERT, config->cert);
- my_setopt_str(curl, CURLOPT_PROXY_SSLCERT, config->proxy_cert);
- my_setopt_str(curl, CURLOPT_SSLCERTTYPE, config->cert_type);
-diff --git a/tests/unit/unit1394.c b/tests/unit/unit1394.c
-index 667991d..010f052 100644
---- a/tests/unit/unit1394.c
-+++ b/tests/unit/unit1394.c
-@@ -56,6 +56,9 @@ UNITTEST_START
- "foo:bar\\\\", "foo", "bar\\\\",
- "foo:bar:", "foo", "bar:",
- "foo\\::bar\\:", "foo:", "bar\\:",
-+ "pkcs11:foobar", "pkcs11:foobar", NULL,
-+ "PKCS11:foobar", "PKCS11:foobar", NULL,
-+ "PkCs11:foobar", "PkCs11:foobar", NULL,
- #ifdef WIN32
- "c:\\foo:bar:baz", "c:\\foo", "bar:baz",
- "c:\\foo\\:bar:baz", "c:\\foo:bar", "baz",
---
-2.17.1
-
-
-From 2be42ac65f4c345ed3ddc97917c8ef54e13fcbfd Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Thu, 9 Aug 2018 15:34:22 +0200
-Subject: [PATCH 2/2] docs: add files needed to regenerate curl.1 man page
-
-Bug: https://github.com/curl/curl/pull/2856
----
- docs/cmdline-opts/disallow-username-in-url.d | 7 +++++++
- docs/cmdline-opts/haproxy-protocol.d | 11 +++++++++++
- 2 files changed, 18 insertions(+)
- create mode 100644 docs/cmdline-opts/disallow-username-in-url.d
- create mode 100644 docs/cmdline-opts/haproxy-protocol.d
-
-diff --git a/docs/cmdline-opts/disallow-username-in-url.d b/docs/cmdline-opts/disallow-username-in-url.d
-new file mode 100644
-index 0000000..a7f46ea
---- /dev/null
-+++ b/docs/cmdline-opts/disallow-username-in-url.d
-@@ -0,0 +1,7 @@
-+Long: disallow-username-in-url
-+Help: Disallow username in url
-+Protocols: HTTP
-+Added: 7.61.0
-+See-also: proto
-+---
-+This tells curl to exit if passed a url containing a username.
-diff --git a/docs/cmdline-opts/haproxy-protocol.d b/docs/cmdline-opts/haproxy-protocol.d
-new file mode 100644
-index 0000000..cc41c9c
---- /dev/null
-+++ b/docs/cmdline-opts/haproxy-protocol.d
-@@ -0,0 +1,11 @@
-+Long: haproxy-protocol
-+Help: Send HAProxy PROXY protocol v1 header
-+Protocols: HTTP
-+Added: 7.60.0
-+---
-+Send a HAProxy PROXY protocol v1 header at the beginning of the connection. This
-+is used by some load balancers and reverse proxies to indicate the client's
-+true IP address and port.
-+
-+This option is primarily useful when sending test requests to a service that
-+expects this header.
---
-2.17.1
-
diff --git a/0002-curl-7.61.0-libssh.patch b/0002-curl-7.61.0-libssh.patch
deleted file mode 100644
index 75966b4..0000000
--- a/0002-curl-7.61.0-libssh.patch
+++ /dev/null
@@ -1,130 +0,0 @@
-From 155d4ffb7d40daf2afa0102f91f810675220ab6e Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Tue, 14 Aug 2018 13:14:49 +0200
-Subject: [PATCH] ssh-libssh: reduce excessive verbose output about pubkey auth
-
-The verbose message "Authentication using SSH public key file" was
-printed each time the ssh_userauth_publickey_auto() was called, which
-meant each time a packet was transferred over network because the API
-operates in non-blocking mode.
-
-This patch makes sure that the verbose message is printed just once
-(when the authentication state is entered by the SSH state machine).
-
-Upstream-commit: 1e843a31a49484aeddf8f358e71392205f5fd6b1
-Signed-off-by: Kamil Dudka
----
- lib/ssh-libssh.c | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
-index cecf477ac..f40f074b9 100644
---- a/lib/ssh-libssh.c
-+++ b/lib/ssh-libssh.c
-@@ -618,6 +618,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
- sshc->auth_methods = ssh_userauth_list(sshc->ssh_session, NULL);
- if(sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
- state(conn, SSH_AUTH_PKEY_INIT);
-+ infof(data, "Authentication using SSH public key file\n");
- }
- else if(sshc->auth_methods & SSH_AUTH_METHOD_GSSAPI_MIC) {
- state(conn, SSH_AUTH_GSSAPI);
-@@ -670,8 +671,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
-
- }
- else {
-- infof(data, "Authentication using SSH public key file\n");
--
- rc = ssh_userauth_publickey_auto(sshc->ssh_session, NULL,
- data->set.ssl.key_passwd);
- if(rc == SSH_AUTH_AGAIN) {
---
-2.17.1
-
-From 4b445519694ab620bd6376066844a7076e8ce4ab Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Tue, 14 Aug 2018 12:47:18 +0200
-Subject: [PATCH] ssh-libssh: fix infinite connect loop on invalid private key
-
-Added test 656 (based on test 604) to verify the fix.
-
-Bug: https://bugzilla.redhat.com/1595135
-
-Closes #2879
-
-Upstream-commit: a4c7911a48dadb4f68ba6b38bb1bf3f061b747f6
-Signed-off-by: Kamil Dudka
----
- lib/ssh-libssh.c | 1 +
- tests/data/Makefile.inc | 2 +-
- tests/data/test656 | 33 +++++++++++++++++++++++++++++++++
- 3 files changed, 35 insertions(+), 1 deletion(-)
- create mode 100644 tests/data/test656
-
-diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
-index f40f074b9..12d618cfe 100644
---- a/lib/ssh-libssh.c
-+++ b/lib/ssh-libssh.c
-@@ -663,6 +663,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
- if(rc != SSH_OK) {
- failf(data, "Could not load private key file %s",
- data->set.str[STRING_SSH_PRIVATE_KEY]);
-+ MOVE_TO_ERROR_STATE(CURLE_LOGIN_DENIED);
- break;
- }
-
-diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
-index 20274b37c..518a5a543 100644
---- a/tests/data/Makefile.inc
-+++ b/tests/data/Makefile.inc
-@@ -83,7 +83,7 @@ test617 test618 test619 test620 test621 test622 test623 test624 test625 \
- test626 test627 test628 test629 test630 test631 test632 test633 test634 \
- test635 test636 test637 test638 test639 test640 test641 test642 \
- test643 test644 test645 test646 test647 test648 test649 test650 test651 \
--test652 test653 test654 test655 \
-+test652 test653 test654 test655 test656 \
- \
- test700 test701 test702 test703 test704 test705 test706 test707 test708 \
- test709 test710 test711 test712 test713 test714 test715 \
-diff --git a/tests/data/test656 b/tests/data/test656
-new file mode 100644
-index 000000000..4107d3d17
---- /dev/null
-+++ b/tests/data/test656
-@@ -0,0 +1,33 @@
-+
-+
-+
-+SFTP
-+FAILURE
-+
-+
-+
-+#
-+# Client-side
-+
-+
-+sftp
-+
-+
-+SFTP retrieval with nonexistent private key file
-+
-+
-+--key DOES_NOT_EXIST --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure --connect-timeout 8
-+
-+
-+
-+#
-+# Verify data after the test has been "shot"
-+
-+
-+disable
-+
-+
-+67
-+
-+
-+
---
-2.17.1
-
diff --git a/0003-curl-7.61.0-tls13-ciphers.patch b/0003-curl-7.61.0-tls13-ciphers.patch
deleted file mode 100644
index a55ca64..0000000
--- a/0003-curl-7.61.0-tls13-ciphers.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 426b00d0587797d79806f9682b058d5c90a0ab79 Mon Sep 17 00:00:00 2001
-From: Jay Satiro
-Date: Fri, 31 Aug 2018 19:46:29 -0400
-Subject: [PATCH 1/2] openssl: Fix setting TLS 1.3 cipher suites
-
-The flag indicating TLS 1.3 cipher support in the OpenSSL backend was
-missing.
-
-Bug: https://github.com/curl/curl/pull/2607#issuecomment-417283187
-Reported-by: Kamil Dudka
-
-Closes #2926
-
-Upstream-commit: 978574b502294ae06eb97d4f590b54ed5d24cd7f
-Signed-off-by: Kamil Dudka
----
- lib/vtls/openssl.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
-index bc46eca..fad4287 100644
---- a/lib/vtls/openssl.c
-+++ b/lib/vtls/openssl.c
-@@ -3804,6 +3804,9 @@ const struct Curl_ssl Curl_ssl_openssl = {
- SSLSUPP_CERTINFO |
- SSLSUPP_PINNEDPUBKEY |
- SSLSUPP_SSL_CTX |
-+#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
-+ SSLSUPP_TLS13_CIPHERSUITES |
-+#endif
- SSLSUPP_HTTPS_PROXY,
-
- sizeof(struct ssl_backend_data),
---
-2.17.1
-
-
-From 081afa4e2eb5e853833bd87ca43f48ab550fe657 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Mon, 3 Sep 2018 13:04:00 +0200
-Subject: [PATCH 2/2] url, vtls: make CURLOPT{,_PROXY}_TLS13_CIPHERS work
-
-This is a follow-up to PR #2607 and PR #2926.
-
-Closes #2936
-
-Upstream-commit: 52c13d6328ff56b2d2e8313e88cfdfc78acda365
-Signed-off-by: Kamil Dudka
----
- lib/url.c | 4 ++++
- lib/vtls/vtls.c | 5 ++++-
- 2 files changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/lib/url.c b/lib/url.c
-index 27b2c1e..46898c4 100644
---- a/lib/url.c
-+++ b/lib/url.c
-@@ -4356,6 +4356,10 @@ static CURLcode create_conn(struct Curl_easy *data,
- data->set.str[STRING_SSL_CIPHER_LIST_ORIG];
- data->set.proxy_ssl.primary.cipher_list =
- data->set.str[STRING_SSL_CIPHER_LIST_PROXY];
-+ data->set.ssl.primary.cipher_list13 =
-+ data->set.str[STRING_SSL_CIPHER13_LIST_ORIG];
-+ data->set.proxy_ssl.primary.cipher_list13 =
-+ data->set.str[STRING_SSL_CIPHER13_LIST_PROXY];
-
- data->set.ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE_ORIG];
- data->set.proxy_ssl.CRLfile = data->set.str[STRING_SSL_CRLFILE_PROXY];
-diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
-index bf96518..b61c640 100644
---- a/lib/vtls/vtls.c
-+++ b/lib/vtls/vtls.c
-@@ -96,7 +96,8 @@ Curl_ssl_config_matches(struct ssl_primary_config* data,
- Curl_safe_strcasecompare(data->clientcert, needle->clientcert) &&
- Curl_safe_strcasecompare(data->random_file, needle->random_file) &&
- Curl_safe_strcasecompare(data->egdsocket, needle->egdsocket) &&
-- Curl_safe_strcasecompare(data->cipher_list, needle->cipher_list))
-+ Curl_safe_strcasecompare(data->cipher_list, needle->cipher_list) &&
-+ Curl_safe_strcasecompare(data->cipher_list13, needle->cipher_list13))
- return TRUE;
-
- return FALSE;
-@@ -119,6 +120,7 @@ Curl_clone_primary_ssl_config(struct ssl_primary_config *source,
- CLONE_STRING(random_file);
- CLONE_STRING(egdsocket);
- CLONE_STRING(cipher_list);
-+ CLONE_STRING(cipher_list13);
-
- return TRUE;
- }
-@@ -131,6 +133,7 @@ void Curl_free_primary_ssl_config(struct ssl_primary_config* sslc)
- Curl_safefree(sslc->random_file);
- Curl_safefree(sslc->egdsocket);
- Curl_safefree(sslc->cipher_list);
-+ Curl_safefree(sslc->cipher_list13);
- }
-
- #ifdef USE_SSL
---
-2.17.1
-
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 5fb54b6..bbb253f 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16409,18 +16409,11 @@ $as_echo "yes" >&6; }
+@@ -16414,18 +16414,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/0103-curl-7.59.0-python3.patch b/0103-curl-7.59.0-python3.patch
index dd10986..f66b6c0 100644
--- a/0103-curl-7.59.0-python3.patch
+++ b/0103-curl-7.59.0-python3.patch
@@ -32,7 +32,7 @@ diff --git a/tests/runtests.pl b/tests/runtests.pl
index d6aa5ca..4d395ef 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
-@@ -1438,7 +1438,7 @@ sub runhttpserver {
+@@ -1439,7 +1439,7 @@ sub runhttpserver {
elsif($alt eq "pipe") {
# basically the same, but another ID
$idnum = 3;
diff --git a/curl-7.61.0.tar.xz.asc b/curl-7.61.0.tar.xz.asc
deleted file mode 100644
index 024ef39..0000000
--- a/curl-7.61.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAltFnUIACgkQXMkI/bce
-EsJSSggAo2pO9DacErY/wVqYm2KA76s8HDMyGkvb7HXPWe3w1Nj6nwCY8Knbp2C6
-s6LZ73gqKfe3K+kFsFE6bFy9l2MKNs64cBG19dNUGcoYek6zt1BBXC6LT8/eOWc4
-l6HKift+CBh6ErtInB2CzmoG7dvNoZA00sERJbj9w+QZK4CTBZPWjz9BRHo7V31q
-VnciTRgJ39HjL0kupdDIZgpCL741aWlkbOZu5wsRfe7nxWeiCdyOVluXluDi9t2i
-s1mTPMpkMWDIEh723QL5jOlct9/hTLXAS2yZeR6qJafcicyIboXh0ZwGQGonHADi
-aBs922AWx3v8x18thsCMQZwJSHiYEw==
-=7p0n
------END PGP SIGNATURE-----
diff --git a/curl-7.61.1.tar.xz.asc b/curl-7.61.1.tar.xz.asc
new file mode 100644
index 0000000..6a1e664
--- /dev/null
+++ b/curl-7.61.1.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAluPblgACgkQXMkI/bce
+EsJynAgArST/gB9eVYIQTTAdXxCOSnArBK/Ne/UNW83QIgOawj0HvEpj9+1SNfTi
+EwC5YSwymyMuKGTDLNswTnJ0MripRKylekfu1QGGzmIOkqovTiHz60xiFuWYI3vy
+fYuAAse5MJz64GCVFwOM4me8SgEjtb/hIbhiCLqilOyXnqtocDm4FPCMAYQ1mTFy
+RJBbwgDLwtktfBDCQyMXTeETGuk3bTrtvSwRv8+Rq8qehOt5s58Fqeztv8EVNi+B
+Qzsi5NXMulgl3C0P3dN/cC81+OL75ehuE91AFXUmbNOnlYNTOxHR2dioaXaEyhKb
+51KLH2D0G75wlfMbgMhX/rguuXT2rg==
+=vM6i
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index dbd4d40..d4edfd9 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,19 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.61.0
-Release: 8%{?dist}
+Version: 7.61.1
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
-Patch1: 0001-curl-7.61.0-pkcs11.patch
-
-# scp/sftp: fix infinite connect loop on invalid private key (#1595135)
-Patch2: 0002-curl-7.61.0-libssh.patch
-
-# make the --tls13-ciphers option work
-Patch3: 0003-curl-7.61.0-tls13-ciphers.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -167,9 +158,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
# Fedora patches
%patch101 -p1
@@ -337,6 +325,10 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Sep 05 2018 Kamil Dudka - 7.61.1-1
+- new upstream release, which fixes the following vulnerability
+ CVE-2018-14618 - NTLM password overflow via integer overflow
+
* Tue Sep 04 2018 Kamil Dudka - 7.61.0-8
- make the --tls13-ciphers option work
diff --git a/sources b/sources
index 4248e66..717a22e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.61.0.tar.xz) = 1b450bbd794460fea12374a49739a49a43c3651038dc092c277769bab09a62627f8eedfa94b5c1610503bf20eeaf60643a1e32fdcf1bcf8d4085090c4a598b13
+SHA512 (curl-7.61.1.tar.xz) = e6f82a7292c70841162480c8880d25046bcfa64058f4ff76f7d398c85da569af1c244442c9c58a3478d59264365ff8e39eed2fb564cb137118588f7862e64e9a
From 964e6fe0a35b78324a7c2b9618192029dabf2726 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 15 Aug 2018 13:56:12 +0200
Subject: [PATCH 025/256] Resolves: #1595135 - scp/sftp: fix infinite connect
loop on invalid private key
---
0007-curl-7.61.0-libssh.patch | 133 ++++++++++++++++++++++++++++++++++
curl.spec | 16 +++-
2 files changed, 145 insertions(+), 4 deletions(-)
create mode 100644 0007-curl-7.61.0-libssh.patch
diff --git a/0007-curl-7.61.0-libssh.patch b/0007-curl-7.61.0-libssh.patch
new file mode 100644
index 0000000..496e9b1
--- /dev/null
+++ b/0007-curl-7.61.0-libssh.patch
@@ -0,0 +1,133 @@
+From 155d4ffb7d40daf2afa0102f91f810675220ab6e Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Tue, 14 Aug 2018 13:14:49 +0200
+Subject: [PATCH 1/2] ssh-libssh: reduce excessive verbose output about pubkey
+ auth
+
+The verbose message "Authentication using SSH public key file" was
+printed each time the ssh_userauth_publickey_auto() was called, which
+meant each time a packet was transferred over network because the API
+operates in non-blocking mode.
+
+This patch makes sure that the verbose message is printed just once
+(when the authentication state is entered by the SSH state machine).
+
+Upstream-commit: 1e843a31a49484aeddf8f358e71392205f5fd6b1
+Signed-off-by: Kamil Dudka
+---
+ lib/ssh-libssh.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
+index cecf477ac..f40f074b9 100644
+--- a/lib/ssh-libssh.c
++++ b/lib/ssh-libssh.c
+@@ -607,6 +607,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
+ sshc->auth_methods = ssh_userauth_list(sshc->ssh_session, NULL);
+ if(sshc->auth_methods & SSH_AUTH_METHOD_PUBLICKEY) {
+ state(conn, SSH_AUTH_PKEY_INIT);
++ infof(data, "Authentication using SSH public key file\n");
+ }
+ else if(sshc->auth_methods & SSH_AUTH_METHOD_GSSAPI_MIC) {
+ state(conn, SSH_AUTH_GSSAPI);
+@@ -659,8 +660,6 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
+
+ }
+ else {
+- infof(data, "Authentication using SSH public key file\n");
+-
+ rc = ssh_userauth_publickey_auto(sshc->ssh_session, NULL,
+ data->set.ssl.key_passwd);
+ if(rc == SSH_AUTH_AGAIN) {
+--
+2.17.1
+
+
+From 4b445519694ab620bd6376066844a7076e8ce4ab Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Tue, 14 Aug 2018 12:47:18 +0200
+Subject: [PATCH 2/2] ssh-libssh: fix infinite connect loop on invalid private
+ key
+
+Added test 656 (based on test 604) to verify the fix.
+
+Bug: https://bugzilla.redhat.com/1595135
+
+Closes #2879
+
+Upstream-commit: a4c7911a48dadb4f68ba6b38bb1bf3f061b747f6
+Signed-off-by: Kamil Dudka
+---
+ lib/ssh-libssh.c | 1 +
+ tests/data/Makefile.inc | 2 +-
+ tests/data/test656 | 33 +++++++++++++++++++++++++++++++++
+ 3 files changed, 35 insertions(+), 1 deletion(-)
+ create mode 100644 tests/data/test656
+
+diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c
+index f40f074b9..12d618cfe 100644
+--- a/lib/ssh-libssh.c
++++ b/lib/ssh-libssh.c
+@@ -652,6 +652,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block)
+ if(rc != SSH_OK) {
+ failf(data, "Could not load private key file %s",
+ data->set.str[STRING_SSH_PRIVATE_KEY]);
++ MOVE_TO_ERROR_STATE(CURLE_LOGIN_DENIED);
+ break;
+ }
+
+diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
+index 20274b37c..518a5a543 100644
+--- a/tests/data/Makefile.inc
++++ b/tests/data/Makefile.inc
+@@ -83,7 +83,7 @@ test617 test618 test619 test620 test621 test622 test623 test624 test625 \
+ test626 test627 test628 test629 test630 test631 test632 test633 test634 \
+ test635 test636 test637 test638 test639 test640 test641 test642 \
+ test643 test644 test645 test646 test647 test648 test649 test650 test651 \
+-test652 test653 test654 test655 \
++test652 test653 test654 test655 test656 \
+ \
+ test700 test701 test702 test703 test704 test705 test706 test707 test708 \
+ test709 test710 test711 test712 test713 test714 test715 \
+diff --git a/tests/data/test656 b/tests/data/test656
+new file mode 100644
+index 000000000..4107d3d17
+--- /dev/null
++++ b/tests/data/test656
+@@ -0,0 +1,33 @@
++
++
++
++SFTP
++FAILURE
++
++
++
++#
++# Client-side
++
++
++sftp
++
++
++SFTP retrieval with nonexistent private key file
++
++
++--key DOES_NOT_EXIST --pubkey curl_client_key.pub -u %USER: sftp://%HOSTIP:%SSHPORT%PWD/not-a-valid-file-moooo --insecure --connect-timeout 8
++
++
++
++#
++# Verify data after the test has been "shot"
++
++
++disable
++
++
++67
++
++
++
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index a49e005..1e7aff0 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 6%{?dist}
+Release: 7%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -23,6 +23,9 @@ Patch5: 0005-curl-7.59.0-CVE-2018-0500.patch
# ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
Patch6: 0006-curl-7.59.0-pkcs11.patch
+# scp/sftp: fix infinite connect loop on invalid private key (#1595135)
+Patch7: 0007-curl-7.61.0-libssh.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -35,7 +38,8 @@ Patch104: 0104-curl-7.19.7-localhost6.patch
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
-#BuildRequires: automake
+
+BuildRequires: automake
BuildRequires: coreutils
BuildRequires: gcc
BuildRequires: groff
@@ -175,6 +179,7 @@ be installed.
%patch4 -p1
%patch5 -p1
%patch6 -p1
+%patch7 -p1
# Fedora patches
%patch101 -p1
@@ -182,8 +187,8 @@ be installed.
%patch104 -p1
# regenerate Makefile.in files
-#aclocal -I m4
-#automake
+aclocal -I m4
+automake
# disable test 1112 (#565305) and test 1801
#
@@ -320,6 +325,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Sep 05 2018 Kamil Dudka - 7.59.0-7
+- scp/sftp: fix infinite connect loop on invalid private key (#1595135)
+
* Thu Aug 09 2018 Kamil Dudka - 7.59.0-6
- ssl: set engine implicitly when a PKCS#11 URI is provided (#1219544)
From 503408095bf15813c472c371f8b4c2fd23b59d60 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 27 Aug 2018 15:58:33 +0200
Subject: [PATCH 026/256] Related: #1622594 - tests: make ssh-keygen always
produce PEM format
The default format produced by openssh-7.8p1 cannot be consumed
by currently available versions of libssh and libssh2.
---
0105-curl-7.61.0-tests-ssh-keygen.patch | 33 +++++++++++++++++++++++++
curl.spec | 5 ++++
2 files changed, 38 insertions(+)
create mode 100644 0105-curl-7.61.0-tests-ssh-keygen.patch
diff --git a/0105-curl-7.61.0-tests-ssh-keygen.patch b/0105-curl-7.61.0-tests-ssh-keygen.patch
new file mode 100644
index 0000000..b8b9ffb
--- /dev/null
+++ b/0105-curl-7.61.0-tests-ssh-keygen.patch
@@ -0,0 +1,33 @@
+From daded1aff280104d16e405fcd1be1a857c74b191 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Mon, 27 Aug 2018 15:53:35 +0200
+Subject: [PATCH] tests: make ssh-keygen always produce PEM format
+
+The default format produced by openssh-7.8p1 cannot be consumed
+by currently available versions of libssh and libssh2.
+---
+ tests/sshserver.pl | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/sshserver.pl b/tests/sshserver.pl
+index 9b3d122..d477a02 100755
+--- a/tests/sshserver.pl
++++ b/tests/sshserver.pl
+@@ -372,12 +372,12 @@ if((! -e $hstprvkeyf) || (! -s $hstprvkeyf) ||
+ # Make sure all files are gone so ssh-keygen doesn't complain
+ unlink($hstprvkeyf, $hstpubkeyf, $cliprvkeyf, $clipubkeyf);
+ logmsg 'generating host keys...' if($verbose);
+- if(system "\"$sshkeygen\" -q -t rsa -f $hstprvkeyf -C 'curl test server' -N ''") {
++ if(system "\"$sshkeygen\" -q -t rsa -f $hstprvkeyf -C 'curl test server' -N '' -m PEM") {
+ logmsg 'Could not generate host key';
+ exit 1;
+ }
+ logmsg 'generating client keys...' if($verbose);
+- if(system "\"$sshkeygen\" -q -t rsa -f $cliprvkeyf -C 'curl test client' -N ''") {
++ if(system "\"$sshkeygen\" -q -t rsa -f $cliprvkeyf -C 'curl test client' -N '' -m PEM") {
+ logmsg 'Could not generate client key';
+ exit 1;
+ }
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 1e7aff0..c0d7575 100644
--- a/curl.spec
+++ b/curl.spec
@@ -35,6 +35,9 @@ Patch102: 0102-curl-7.36.0-debug.patch
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
+# tests: make ssh-keygen always produce PEM format (#1622594)
+Patch105: 0105-curl-7.61.0-tests-ssh-keygen.patch
+
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
@@ -185,6 +188,7 @@ be installed.
%patch101 -p1
%patch102 -p1
%patch104 -p1
+%patch105 -p1
# regenerate Makefile.in files
aclocal -I m4
@@ -326,6 +330,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Wed Sep 05 2018 Kamil Dudka - 7.59.0-7
+- tests: make ssh-keygen always produce PEM format (#1622594)
- scp/sftp: fix infinite connect loop on invalid private key (#1595135)
* Thu Aug 09 2018 Kamil Dudka - 7.59.0-6
From 5f4e92def348a7733bdce0d2aeb7d57b2a42000e Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 5 Sep 2018 13:03:52 +0200
Subject: [PATCH 027/256] Resolves: CVE-2018-14618 - fix NTLM password overflow
via integer overflow
---
0008-curl-7.59.0-CVE-2018-14618.patch | 72 +++++++++++++++++++++++++++
curl.spec | 5 ++
2 files changed, 77 insertions(+)
create mode 100644 0008-curl-7.59.0-CVE-2018-14618.patch
diff --git a/0008-curl-7.59.0-CVE-2018-14618.patch b/0008-curl-7.59.0-CVE-2018-14618.patch
new file mode 100644
index 0000000..e9ed142
--- /dev/null
+++ b/0008-curl-7.59.0-CVE-2018-14618.patch
@@ -0,0 +1,72 @@
+From 114b31ab5b7e6965b629697020a7ce4b6cea340e Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Mon, 13 Aug 2018 10:35:52 +0200
+Subject: [PATCH] Curl_ntlm_core_mk_nt_hash: return error on too long password
+
+... since it would cause an integer overflow if longer than (max size_t
+/ 2).
+
+This is CVE-2018-14618
+
+Bug: https://curl.haxx.se/docs/CVE-2018-14618.html
+Closes #2756
+Reported-by: Zhaoyang Wu
+
+Upstream-commit: 57d299a499155d4b327e341c6024e293b0418243
+Signed-off-by: Kamil Dudka
+---
+ lib/curl_ntlm_core.c | 23 +++++++++++++----------
+ 1 file changed, 13 insertions(+), 10 deletions(-)
+
+diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
+index e896276..e5c785d 100644
+--- a/lib/curl_ntlm_core.c
++++ b/lib/curl_ntlm_core.c
+@@ -143,6 +143,15 @@
+ #define NTLMv2_BLOB_SIGNATURE "\x01\x01\x00\x00"
+ #define NTLMv2_BLOB_LEN (44 -16 + ntlm->target_info_len + 4)
+
++#ifndef SIZE_T_MAX
++/* some limits.h headers have this defined, some don't */
++#if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4)
++#define SIZE_T_MAX 18446744073709551615U
++#else
++#define SIZE_T_MAX 4294967295U
++#endif
++#endif
++
+ /*
+ * Turns a 56-bit key into being 64-bit wide.
+ */
+@@ -557,8 +566,11 @@ CURLcode Curl_ntlm_core_mk_nt_hash(struct Curl_easy *data,
+ unsigned char *ntbuffer /* 21 bytes */)
+ {
+ size_t len = strlen(password);
+- unsigned char *pw = len ? malloc(len * 2) : strdup("");
++ unsigned char *pw;
+ CURLcode result;
++ if(len > SIZE_T_MAX/2) /* avoid integer overflow */
++ return CURLE_OUT_OF_MEMORY;
++ pw = len ? malloc(len * 2) : strdup("");
+ if(!pw)
+ return CURLE_OUT_OF_MEMORY;
+
+@@ -646,15 +658,6 @@ CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen,
+ return CURLE_OK;
+ }
+
+-#ifndef SIZE_T_MAX
+-/* some limits.h headers have this defined, some don't */
+-#if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4)
+-#define SIZE_T_MAX 18446744073709551615U
+-#else
+-#define SIZE_T_MAX 4294967295U
+-#endif
+-#endif
+-
+ /* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode
+ * (uppercase UserName + Domain) as the data
+ */
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index c0d7575..b7041ad 100644
--- a/curl.spec
+++ b/curl.spec
@@ -26,6 +26,9 @@ Patch6: 0006-curl-7.59.0-pkcs11.patch
# scp/sftp: fix infinite connect loop on invalid private key (#1595135)
Patch7: 0007-curl-7.61.0-libssh.patch
+# fix NTLM password overflow via integer overflow (CVE-2018-14618)
+Patch8: 0008-curl-7.59.0-CVE-2018-14618.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -183,6 +186,7 @@ be installed.
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
# Fedora patches
%patch101 -p1
@@ -330,6 +334,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Wed Sep 05 2018 Kamil Dudka - 7.59.0-7
+- fix NTLM password overflow via integer overflow (CVE-2018-14618)
- tests: make ssh-keygen always produce PEM format (#1622594)
- scp/sftp: fix infinite connect loop on invalid private key (#1595135)
From ece57c4aa470860579c18e7181321cbe894a55a1 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 4 Oct 2018 15:37:53 +0200
Subject: [PATCH 028/256] Related: #1622594 - drop
0105-curl-7.61.0-tests-ssh-keygen.patch no longer needed
---
0105-curl-7.61.0-tests-ssh-keygen.patch | 33 -------------------------
curl.spec | 9 +++----
2 files changed, 4 insertions(+), 38 deletions(-)
delete mode 100644 0105-curl-7.61.0-tests-ssh-keygen.patch
diff --git a/0105-curl-7.61.0-tests-ssh-keygen.patch b/0105-curl-7.61.0-tests-ssh-keygen.patch
deleted file mode 100644
index b8b9ffb..0000000
--- a/0105-curl-7.61.0-tests-ssh-keygen.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From daded1aff280104d16e405fcd1be1a857c74b191 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Mon, 27 Aug 2018 15:53:35 +0200
-Subject: [PATCH] tests: make ssh-keygen always produce PEM format
-
-The default format produced by openssh-7.8p1 cannot be consumed
-by currently available versions of libssh and libssh2.
----
- tests/sshserver.pl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/tests/sshserver.pl b/tests/sshserver.pl
-index 9b3d122..d477a02 100755
---- a/tests/sshserver.pl
-+++ b/tests/sshserver.pl
-@@ -372,12 +372,12 @@ if((! -e $hstprvkeyf) || (! -s $hstprvkeyf) ||
- # Make sure all files are gone so ssh-keygen doesn't complain
- unlink($hstprvkeyf, $hstpubkeyf, $cliprvkeyf, $clipubkeyf);
- logmsg 'generating host keys...' if($verbose);
-- if(system "\"$sshkeygen\" -q -t rsa -f $hstprvkeyf -C 'curl test server' -N ''") {
-+ if(system "\"$sshkeygen\" -q -t rsa -f $hstprvkeyf -C 'curl test server' -N '' -m PEM") {
- logmsg 'Could not generate host key';
- exit 1;
- }
- logmsg 'generating client keys...' if($verbose);
-- if(system "\"$sshkeygen\" -q -t rsa -f $cliprvkeyf -C 'curl test client' -N ''") {
-+ if(system "\"$sshkeygen\" -q -t rsa -f $cliprvkeyf -C 'curl test client' -N '' -m PEM") {
- logmsg 'Could not generate client key';
- exit 1;
- }
---
-2.17.1
-
diff --git a/curl.spec b/curl.spec
index d4edfd9..93e2d57 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -17,9 +17,6 @@ Patch103: 0103-curl-7.59.0-python3.patch
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
-# tests: make ssh-keygen always produce PEM format (#1622594)
-Patch105: 0105-curl-7.61.0-tests-ssh-keygen.patch
-
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
@@ -164,7 +161,6 @@ be installed.
%patch102 -p1
%patch103 -p1
%patch104 -p1
-%patch105 -p1
# make tests/*.py use Python 3
sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
@@ -325,6 +321,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Oct 04 2018 Kamil Dudka - 7.61.1-2
+- drop 0105-curl-7.61.0-tests-ssh-keygen.patch no longer needed (#1622594)
+
* Wed Sep 05 2018 Kamil Dudka - 7.61.1-1
- new upstream release, which fixes the following vulnerability
CVE-2018-14618 - NTLM password overflow via integer overflow
From 84125cbefe7feae53efed8b177e41106c7ed7262 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 4 Oct 2018 15:40:31 +0200
Subject: [PATCH 029/256] test320: update expected output for gnutls-3.6.4
---
0001-curl-7.61.1-test320-gnutls.patch | 63 +++++++++++++++++++++++++++
curl.spec | 5 +++
2 files changed, 68 insertions(+)
create mode 100644 0001-curl-7.61.1-test320-gnutls.patch
diff --git a/0001-curl-7.61.1-test320-gnutls.patch b/0001-curl-7.61.1-test320-gnutls.patch
new file mode 100644
index 0000000..a9cbaac
--- /dev/null
+++ b/0001-curl-7.61.1-test320-gnutls.patch
@@ -0,0 +1,63 @@
+From 3cd5b375e31fb98e4782dc3a77e7316ad9eb26cf Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Thu, 4 Oct 2018 15:34:13 +0200
+Subject: [PATCH] test320: strip out more HTML when comparing
+
+To make the test case work with different gnutls-serv versions better.
+
+Reported-by: Kamil Dudka
+Fixes #3093
+Closes #3094
+
+Upstream-commit: 94ad57b0246b5658c2a9139dbe6a80efa4c4e2f3
+Signed-off-by: Kamil Dudka
+---
+ tests/data/test320 | 24 ++++--------------------
+ 1 file changed, 4 insertions(+), 20 deletions(-)
+
+diff --git a/tests/data/test320 b/tests/data/test320
+index 457a11eb2..87311d4f2 100644
+--- a/tests/data/test320
++++ b/tests/data/test320
+@@ -62,34 +62,18 @@ simple TLS-SRP HTTPS GET, check user in response
+ HTTP/1.0 200 OK
+ Content-type: text/html
+
+-
+-
+-
+-
+-
+-
+-If your browser supports session resuming, then you should see the same session ID, when you press the reload button.
+-Connected as user 'jsmith'.
+-
+-
|
+-| Key Exchange: | SRP |
+-| Compression | NULL |
+-| Cipher | AES-NNN-CBC |
+-| MAC | SHA1 |
+-| Ciphersuite | SRP_SHA_AES_NNN_CBC_SHA1 |
+-
Your HTTP header was:
Host: %HOSTIP:%HTTPTLSPORT
++FINE
+ User-Agent: curl-test-suite
+ Accept: */*
+
+-
+-
+-
+
+
+-s/^Session ID:.*//
++s/^
Connected as user 'jsmith'.*/FINE/
+ s/Protocol version:.*[0-9]//
+ s/GNUTLS/GnuTLS/
+ s/(AES[-_])\d\d\d([-_]CBC)/$1NNN$2/
++s/^<.*\n//
++s/^\n//
+
+
+
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 93e2d57..61b9341 100644
--- a/curl.spec
+++ b/curl.spec
@@ -5,6 +5,9 @@ Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# test320: update expected output for gnutls-3.6.4
+Patch1: 0001-curl-7.61.1-test320-gnutls.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -155,6 +158,7 @@ be installed.
%setup -q
# upstream patches
+%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -322,6 +326,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Thu Oct 04 2018 Kamil Dudka - 7.61.1-2
+- test320: update expected output for gnutls-3.6.4
- drop 0105-curl-7.61.0-tests-ssh-keygen.patch no longer needed (#1622594)
* Wed Sep 05 2018 Kamil Dudka - 7.61.1-1
From 800bb58ef3610df46777baebf996060460cbbb0c Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Fri, 5 Oct 2018 13:59:35 +0200
Subject: [PATCH 030/256] Resolves: #1631804 - enforce versioned libpsl
dependency for libcurl
---
curl.spec | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/curl.spec b/curl.spec
index 61b9341..f057d54 100644
--- a/curl.spec
+++ b/curl.spec
@@ -79,6 +79,10 @@ BuildRequires: valgrind
# using an older version of libcurl could result in CURLE_UNKNOWN_OPTION
Requires: libcurl%{?_isa} >= %{version}-%{release}
+# require at least the version of libpsl that we were built against,
+# to ensure that we have the necessary symbols available (#1631804)
+%global libpsl_version %(pkg-config --modversion libpsl 2>/dev/null || echo 0)
+
# require at least the version of libssh that we were built against,
# to ensure that we have the necessary symbols available (#525002, #642796)
%global libssh_version %(pkg-config --modversion libssh 2>/dev/null || echo 0)
@@ -97,6 +101,7 @@ resume, proxy tunneling and a busload of other useful tricks.
%package -n libcurl
Summary: A library for getting files from web servers
+Requires: libpsl%{?_isa} >= %{libpsl_version}
Requires: libssh%{?_isa} >= %{libssh_version}
Requires: openssl-libs%{?_isa} >= 1:%{openssl_version}
Provides: libcurl-full = %{version}-%{release}
@@ -326,6 +331,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Thu Oct 04 2018 Kamil Dudka - 7.61.1-2
+- enforce versioned libpsl dependency for libcurl (#1631804)
- test320: update expected output for gnutls-3.6.4
- drop 0105-curl-7.61.0-tests-ssh-keygen.patch no longer needed (#1622594)
From 2346b66a23a6369c284f5b649aa5af42ad7960a7 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 8 Oct 2018 13:45:20 +0200
Subject: [PATCH 031/256] update the documentation of --tlsv1.0 in curl(1) man
page
---
0002-curl-7.61.1-tlsv1.0-man.patch | 28 ++++++++++++++++++++++++++++
curl.spec | 12 +++++++++++-
2 files changed, 39 insertions(+), 1 deletion(-)
create mode 100644 0002-curl-7.61.1-tlsv1.0-man.patch
diff --git a/0002-curl-7.61.1-tlsv1.0-man.patch b/0002-curl-7.61.1-tlsv1.0-man.patch
new file mode 100644
index 0000000..f384366
--- /dev/null
+++ b/0002-curl-7.61.1-tlsv1.0-man.patch
@@ -0,0 +1,28 @@
+From c574e05b0035f0d78e6bf6040d3f80430112ab4f Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Fri, 7 Sep 2018 16:50:45 +0200
+Subject: [PATCH] docs/cmdline-opts: update the documentation of --tlsv1.0
+
+... to reflect the changes in 6015cefb1b2cfde4b4850121c42405275e5e77d9
+
+Closes #2955
+
+Upstream-commit: 9ba22ce6b52751ed1e2abdd177b0a1d241819b4e
+Signed-off-by: Kamil Dudka
+---
+ docs/cmdline-opts/tlsv1.0.d | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/docs/cmdline-opts/tlsv1.0.d b/docs/cmdline-opts/tlsv1.0.d
+index 8789025e0..54e259682 100644
+--- a/docs/cmdline-opts/tlsv1.0.d
++++ b/docs/cmdline-opts/tlsv1.0.d
+@@ -3,4 +3,4 @@ Help: Use TLSv1.0
+ Protocols: TLS
+ Added: 7.34.0
+ ---
+-Forces curl to use TLS version 1.0 when connecting to a remote TLS server.
++Forces curl to use TLS version 1.0 or later when connecting to a remote TLS server.
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index f057d54..946836a 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.61.1
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# test320: update expected output for gnutls-3.6.4
Patch1: 0001-curl-7.61.1-test320-gnutls.patch
+# update the documentation of --tlsv1.0 in curl(1) man page
+Patch2: 0002-curl-7.61.1-tlsv1.0-man.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -45,6 +48,9 @@ BuildRequires: sed
BuildRequires: stunnel
BuildRequires: zlib-devel
+# needed to compress content of tool_hugehelp.c after changing curl.1 man page
+BuildRequires: perl(IO::Compress::Gzip)
+
# gnutls-serv is used by the upstream test-suite
BuildRequires: gnutls-utils
@@ -164,6 +170,7 @@ be installed.
# upstream patches
%patch1 -p1
+%patch2 -p1
# Fedora patches
%patch101 -p1
@@ -330,6 +337,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Oct 11 2018 Kamil Dudka - 7.61.1-3
+- update the documentation of --tlsv1.0 in curl(1) man page
+
* Thu Oct 04 2018 Kamil Dudka - 7.61.1-2
- enforce versioned libpsl dependency for libcurl (#1631804)
- test320: update expected output for gnutls-3.6.4
From 9be316eea198f1bf9647692c3386f90325104192 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 11 Oct 2018 16:06:50 +0200
Subject: [PATCH 032/256] enable TLS 1.3 post-handshake auth in OpenSSL
Bug: https://github.com/curl/curl/pull/3027
---
0003-curl-7.61.1-TLS-1.3-PHA.patch | 46 ++++++++++++++++++++++++++++++
curl.spec | 5 ++++
2 files changed, 51 insertions(+)
create mode 100644 0003-curl-7.61.1-TLS-1.3-PHA.patch
diff --git a/0003-curl-7.61.1-TLS-1.3-PHA.patch b/0003-curl-7.61.1-TLS-1.3-PHA.patch
new file mode 100644
index 0000000..99273ac
--- /dev/null
+++ b/0003-curl-7.61.1-TLS-1.3-PHA.patch
@@ -0,0 +1,46 @@
+From bb8ad3da3fb4ab3f6556daa1f67b259c12a3c7de Mon Sep 17 00:00:00 2001
+From: Christian Heimes
+Date: Fri, 21 Sep 2018 10:37:43 +0200
+Subject: [PATCH] OpenSSL: enable TLS 1.3 post-handshake auth
+
+OpenSSL 1.1.1 requires clients to opt-in for post-handshake
+authentication.
+
+Fixes: https://github.com/curl/curl/issues/3026
+Signed-off-by: Christian Heimes
+
+Closes https://github.com/curl/curl/pull/3027
+
+Upstream-commit: b939bc47b27cd57c6ebb852ad653933e4124b452
+Signed-off-by: Kamil Dudka
+---
+ lib/vtls/openssl.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
+index a487f55..78970d1 100644
+--- a/lib/vtls/openssl.c
++++ b/lib/vtls/openssl.c
+@@ -178,6 +178,7 @@ static unsigned long OpenSSL_version_num(void)
+ !defined(LIBRESSL_VERSION_NUMBER) && \
+ !defined(OPENSSL_IS_BORINGSSL))
+ #define HAVE_SSL_CTX_SET_CIPHERSUITES
++#define HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
+ #endif
+
+ #if defined(LIBRESSL_VERSION_NUMBER)
+@@ -2467,6 +2468,11 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
+ }
+ #endif
+
++#ifdef HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
++ /* OpenSSL 1.1.1 requires clients to opt-in for PHA */
++ SSL_CTX_set_post_handshake_auth(BACKEND->ctx, 1);
++#endif
++
+ #ifdef USE_TLS_SRP
+ if(ssl_authtype == CURL_TLSAUTH_SRP) {
+ char * const ssl_username = SSL_SET_OPTION(username);
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index 946836a..d3366ac 100644
--- a/curl.spec
+++ b/curl.spec
@@ -11,6 +11,9 @@ Patch1: 0001-curl-7.61.1-test320-gnutls.patch
# update the documentation of --tlsv1.0 in curl(1) man page
Patch2: 0002-curl-7.61.1-tlsv1.0-man.patch
+# enable TLS 1.3 post-handshake auth in OpenSSL
+Patch3: 0003-curl-7.61.1-TLS-1.3-PHA.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -171,6 +174,7 @@ be installed.
# upstream patches
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# Fedora patches
%patch101 -p1
@@ -338,6 +342,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Thu Oct 11 2018 Kamil Dudka - 7.61.1-3
+- enable TLS 1.3 post-handshake auth in OpenSSL
- update the documentation of --tlsv1.0 in curl(1) man page
* Thu Oct 04 2018 Kamil Dudka - 7.61.1-2
From 34a4d8f84827412e621e7a424df1a2341ec0c292 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 31 Oct 2018 10:49:24 +0100
Subject: [PATCH 033/256] new upstream release - 7.62.0
Resolves: CVE-2018-16839 - SASL password overflow via integer overflow
Resolves: CVE-2018-16840 - use-after-free in handle close
Resolves: CVE-2018-16842 - warning message out-of-buffer read
---
0001-curl-7.61.1-test320-gnutls.patch | 63 ------------------
0002-curl-7.61.1-tlsv1.0-man.patch | 28 --------
0003-curl-7.61.1-TLS-1.3-PHA.patch | 46 -------------
0101-curl-7.32.0-multilib.patch | 2 +-
0102-curl-7.36.0-debug.patch | 2 +-
0103-curl-7.59.0-python3.patch | 93 ++-------------------------
curl-7.61.1.tar.xz.asc | 11 ----
curl-7.62.0.tar.xz.asc | 11 ++++
curl.spec | 22 +++----
sources | 2 +-
10 files changed, 27 insertions(+), 253 deletions(-)
delete mode 100644 0001-curl-7.61.1-test320-gnutls.patch
delete mode 100644 0002-curl-7.61.1-tlsv1.0-man.patch
delete mode 100644 0003-curl-7.61.1-TLS-1.3-PHA.patch
delete mode 100644 curl-7.61.1.tar.xz.asc
create mode 100644 curl-7.62.0.tar.xz.asc
diff --git a/0001-curl-7.61.1-test320-gnutls.patch b/0001-curl-7.61.1-test320-gnutls.patch
deleted file mode 100644
index a9cbaac..0000000
--- a/0001-curl-7.61.1-test320-gnutls.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 3cd5b375e31fb98e4782dc3a77e7316ad9eb26cf Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Thu, 4 Oct 2018 15:34:13 +0200
-Subject: [PATCH] test320: strip out more HTML when comparing
-
-To make the test case work with different gnutls-serv versions better.
-
-Reported-by: Kamil Dudka
-Fixes #3093
-Closes #3094
-
-Upstream-commit: 94ad57b0246b5658c2a9139dbe6a80efa4c4e2f3
-Signed-off-by: Kamil Dudka
----
- tests/data/test320 | 24 ++++--------------------
- 1 file changed, 4 insertions(+), 20 deletions(-)
-
-diff --git a/tests/data/test320 b/tests/data/test320
-index 457a11eb2..87311d4f2 100644
---- a/tests/data/test320
-+++ b/tests/data/test320
-@@ -62,34 +62,18 @@ simple TLS-SRP HTTPS GET, check user in response
- HTTP/1.0 200 OK
- Content-type: text/html
-
--
--
--
--
--
--
--If your browser supports session resuming, then you should see the same session ID, when you press the reload button.
--Connected as user 'jsmith'.
--
--
|
--| Key Exchange: | SRP |
--| Compression | NULL |
--| Cipher | AES-NNN-CBC |
--| MAC | SHA1 |
--| Ciphersuite | SRP_SHA_AES_NNN_CBC_SHA1 |
--
Your HTTP header was:
Host: %HOSTIP:%HTTPTLSPORT
-+FINE
- User-Agent: curl-test-suite
- Accept: */*
-
--
--
--
-
-
--s/^Session ID:.*//
-+s/^
Connected as user 'jsmith'.*/FINE/
- s/Protocol version:.*[0-9]//
- s/GNUTLS/GnuTLS/
- s/(AES[-_])\d\d\d([-_]CBC)/$1NNN$2/
-+s/^<.*\n//
-+s/^\n//
-
-
-
---
-2.17.1
-
diff --git a/0002-curl-7.61.1-tlsv1.0-man.patch b/0002-curl-7.61.1-tlsv1.0-man.patch
deleted file mode 100644
index f384366..0000000
--- a/0002-curl-7.61.1-tlsv1.0-man.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From c574e05b0035f0d78e6bf6040d3f80430112ab4f Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Fri, 7 Sep 2018 16:50:45 +0200
-Subject: [PATCH] docs/cmdline-opts: update the documentation of --tlsv1.0
-
-... to reflect the changes in 6015cefb1b2cfde4b4850121c42405275e5e77d9
-
-Closes #2955
-
-Upstream-commit: 9ba22ce6b52751ed1e2abdd177b0a1d241819b4e
-Signed-off-by: Kamil Dudka
----
- docs/cmdline-opts/tlsv1.0.d | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/docs/cmdline-opts/tlsv1.0.d b/docs/cmdline-opts/tlsv1.0.d
-index 8789025e0..54e259682 100644
---- a/docs/cmdline-opts/tlsv1.0.d
-+++ b/docs/cmdline-opts/tlsv1.0.d
-@@ -3,4 +3,4 @@ Help: Use TLSv1.0
- Protocols: TLS
- Added: 7.34.0
- ---
--Forces curl to use TLS version 1.0 when connecting to a remote TLS server.
-+Forces curl to use TLS version 1.0 or later when connecting to a remote TLS server.
---
-2.17.1
-
diff --git a/0003-curl-7.61.1-TLS-1.3-PHA.patch b/0003-curl-7.61.1-TLS-1.3-PHA.patch
deleted file mode 100644
index 99273ac..0000000
--- a/0003-curl-7.61.1-TLS-1.3-PHA.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From bb8ad3da3fb4ab3f6556daa1f67b259c12a3c7de Mon Sep 17 00:00:00 2001
-From: Christian Heimes
-Date: Fri, 21 Sep 2018 10:37:43 +0200
-Subject: [PATCH] OpenSSL: enable TLS 1.3 post-handshake auth
-
-OpenSSL 1.1.1 requires clients to opt-in for post-handshake
-authentication.
-
-Fixes: https://github.com/curl/curl/issues/3026
-Signed-off-by: Christian Heimes
-
-Closes https://github.com/curl/curl/pull/3027
-
-Upstream-commit: b939bc47b27cd57c6ebb852ad653933e4124b452
-Signed-off-by: Kamil Dudka
----
- lib/vtls/openssl.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
-index a487f55..78970d1 100644
---- a/lib/vtls/openssl.c
-+++ b/lib/vtls/openssl.c
-@@ -178,6 +178,7 @@ static unsigned long OpenSSL_version_num(void)
- !defined(LIBRESSL_VERSION_NUMBER) && \
- !defined(OPENSSL_IS_BORINGSSL))
- #define HAVE_SSL_CTX_SET_CIPHERSUITES
-+#define HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
- #endif
-
- #if defined(LIBRESSL_VERSION_NUMBER)
-@@ -2467,6 +2468,11 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
- }
- #endif
-
-+#ifdef HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
-+ /* OpenSSL 1.1.1 requires clients to opt-in for PHA */
-+ SSL_CTX_set_post_handshake_auth(BACKEND->ctx, 1);
-+#endif
-+
- #ifdef USE_TLS_SRP
- if(ssl_authtype == CURL_TLSAUTH_SRP) {
- char * const ssl_username = SSL_SET_OPTION(username);
---
-2.17.1
-
diff --git a/0101-curl-7.32.0-multilib.patch b/0101-curl-7.32.0-multilib.patch
index 532980e..613106d 100644
--- a/0101-curl-7.32.0-multilib.patch
+++ b/0101-curl-7.32.0-multilib.patch
@@ -22,7 +22,7 @@ index 150004d..95d0759 100644
;;
--prefix)
-@@ -143,32 +143,17 @@ while test $# -gt 0; do
+@@ -155,32 +155,17 @@ while test $# -gt 0; do
;;
--libs)
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index bbb253f..495fe63 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16414,18 +16414,11 @@ $as_echo "yes" >&6; }
+@@ -16421,18 +16421,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/0103-curl-7.59.0-python3.patch b/0103-curl-7.59.0-python3.patch
index f66b6c0..56485fe 100644
--- a/0103-curl-7.59.0-python3.patch
+++ b/0103-curl-7.59.0-python3.patch
@@ -1,88 +1,23 @@
-From bdba7b54224814055185513de1e7ff6619031553 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Thu, 15 Mar 2018 13:21:40 +0100
-Subject: [PATCH 1/2] tests/http_pipe.py: migrate to Python 3
-
----
- tests/http_pipe.py | 4 ++--
- tests/runtests.pl | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/tests/http_pipe.py b/tests/http_pipe.py
-index bc32173..75ac165 100755
---- a/tests/http_pipe.py
-+++ b/tests/http_pipe.py
-@@ -383,13 +383,13 @@ class PipelineRequestHandler(socketserver.BaseRequestHandler):
- self.request.setblocking(True)
- if not new_data:
- return
-- new_requests = self._request_parser.ParseAdditionalData(new_data)
-+ new_requests = self._request_parser.ParseAdditionalData(new_data.decode('utf8'))
- self._response_builder.QueueRequests(
- new_requests, self._request_parser.were_all_requests_http_1_1)
- self._num_queued += len(new_requests)
- self._last_queued_time = time.time()
- elif fileno in wlist:
-- num_bytes_sent = self.request.send(self._send_buffer[0:4096])
-+ num_bytes_sent = self.request.send(self._send_buffer[0:4096].encode('utf8'))
- self._send_buffer = self._send_buffer[num_bytes_sent:]
- time.sleep(0.05)
-
-diff --git a/tests/runtests.pl b/tests/runtests.pl
-index d6aa5ca..4d395ef 100755
---- a/tests/runtests.pl
-+++ b/tests/runtests.pl
-@@ -1439,7 +1439,7 @@ sub runhttpserver {
- elsif($alt eq "pipe") {
- # basically the same, but another ID
- $idnum = 3;
-- $exe = "python $srcdir/http_pipe.py";
-+ $exe = "python3 $srcdir/http_pipe.py";
- $verbose_flag .= "1 ";
- }
- elsif($alt eq "unix") {
---
-2.14.3
-
-
From 3c4c7340e455b7256c0786759422f34ec3e2d440 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 15 Mar 2018 14:49:56 +0100
-Subject: [PATCH 2/2] tests/{negtelnet,smb}server.py: migrate to Python 3
+Subject: [PATCH] tests/{negtelnet,smb}server.py: migrate to Python 3
Unfortunately, smbserver.py does not work with Python 3 because
there is no 'impacket' module available for Python 3:
https://github.com/CoreSecurity/impacket/issues/61
---
- tests/negtelnetserver.py | 12 ++++++------
- tests/smbserver.py | 4 ++--
- 2 files changed, 8 insertions(+), 8 deletions(-)
+ tests/negtelnetserver.py | 4 ++--
+ tests/smbserver.py | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/negtelnetserver.py b/tests/negtelnetserver.py
index 8cfd409..72ee771 100755
--- a/tests/negtelnetserver.py
+++ b/tests/negtelnetserver.py
-@@ -23,7 +23,7 @@ IDENT = "NTEL"
-
- # The strings that indicate the test framework is checking our aliveness
- VERIFIED_REQ = b"verifiedserver"
--VERIFIED_RSP = b"WE ROOLZ: {pid}"
-+VERIFIED_RSP = "WE ROOLZ: {pid}"
-
-
- def telnetserver(options):
-@@ -34,7 +34,7 @@ def telnetserver(options):
- if options.pidfile:
- pid = os.getpid()
- with open(options.pidfile, "w") as f:
-- f.write(b"{0}".format(pid))
-+ f.write("{0}".format(pid))
-
- local_bind = (HOST, options.port)
- log.info("Listening on %s", local_bind)
@@ -73,11 +73,11 @@ class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
- response_data = VERIFIED_RSP.format(pid=os.getpid())
+ response_data = response.encode('ascii')
else:
log.debug("Received normal request - echoing back")
- response_data = data.strip()
@@ -95,24 +30,6 @@ index 8cfd409..72ee771 100755
except IOError:
log.exception("IOError hit during request")
-@@ -132,7 +132,7 @@ class Negotiator(object):
- return buffer
-
- def byte_to_int(self, byte):
-- return struct.unpack(b'B', byte)[0]
-+ return int(byte)
-
- def no_neg(self, byte, byte_int, buffer):
- # Not negotiating anything thus far. Check to see if we
-@@ -197,7 +197,7 @@ class Negotiator(object):
- self.tcp.sendall(packed_message)
-
- def pack(self, arr):
-- return struct.pack(b'{0}B'.format(len(arr)), *arr)
-+ return struct.pack('{0}B'.format(len(arr)), *arr)
-
- def send_iac(self, arr):
- message = [NegTokens.IAC]
diff --git a/tests/smbserver.py b/tests/smbserver.py
index 195ae39..b09cd44 100755
--- a/tests/smbserver.py
diff --git a/curl-7.61.1.tar.xz.asc b/curl-7.61.1.tar.xz.asc
deleted file mode 100644
index 6a1e664..0000000
--- a/curl-7.61.1.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAluPblgACgkQXMkI/bce
-EsJynAgArST/gB9eVYIQTTAdXxCOSnArBK/Ne/UNW83QIgOawj0HvEpj9+1SNfTi
-EwC5YSwymyMuKGTDLNswTnJ0MripRKylekfu1QGGzmIOkqovTiHz60xiFuWYI3vy
-fYuAAse5MJz64GCVFwOM4me8SgEjtb/hIbhiCLqilOyXnqtocDm4FPCMAYQ1mTFy
-RJBbwgDLwtktfBDCQyMXTeETGuk3bTrtvSwRv8+Rq8qehOt5s58Fqeztv8EVNi+B
-Qzsi5NXMulgl3C0P3dN/cC81+OL75ehuE91AFXUmbNOnlYNTOxHR2dioaXaEyhKb
-51KLH2D0G75wlfMbgMhX/rguuXT2rg==
-=vM6i
------END PGP SIGNATURE-----
diff --git a/curl-7.62.0.tar.xz.asc b/curl-7.62.0.tar.xz.asc
new file mode 100644
index 0000000..230438a
--- /dev/null
+++ b/curl-7.62.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlvZT5wACgkQXMkI/bce
+EsJG4gf+IY2RkT9d7SIBAanHOD2NeT4UtPAOVRVtpW8dD9TIJq4IKOqv8CpcCCRq
+OZPJovdxM0qmXcrX2Dlf3zpPuY+bSzBW/xUYsKBBTTXhdUh5dv1Tz3HR6JzMHyT4
+hQm1mj6eFHFvayUKxoeQwiw3SkvW6WIlAySwEBzIzaE7icwvJ2dPO7xUOJWLXk/F
+pDRCAuHqIIgNzNph0EKXkvLWz5poBzGaK9kpJxmeaS3aWpe0EZ4+N6ju2GfHK5jO
+VQSuLWDHCZulv1eve+LOxgRjp/5kqQ/PPc3/99mEOxGRUxwCWVMEWGklAungn4bX
+nBPWNGArGJq2+kMP7v5pr0onBz6wxg==
+=CWQL
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index d3366ac..70e148e 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,19 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.61.1
-Release: 3%{?dist}
+Version: 7.62.0
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# test320: update expected output for gnutls-3.6.4
-Patch1: 0001-curl-7.61.1-test320-gnutls.patch
-
-# update the documentation of --tlsv1.0 in curl(1) man page
-Patch2: 0002-curl-7.61.1-tlsv1.0-man.patch
-
-# enable TLS 1.3 post-handshake auth in OpenSSL
-Patch3: 0003-curl-7.61.1-TLS-1.3-PHA.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -172,9 +163,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
# Fedora patches
%patch101 -p1
@@ -341,6 +329,12 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Oct 31 2018 Kamil Dudka - 7.62.0-1
+- new upstream release, which fixes the following vulnerabilities
+ CVE-2018-16839 - SASL password overflow via integer overflow
+ CVE-2018-16840 - use-after-free in handle close
+ CVE-2018-16842 - warning message out-of-buffer read
+
* Thu Oct 11 2018 Kamil Dudka - 7.61.1-3
- enable TLS 1.3 post-handshake auth in OpenSSL
- update the documentation of --tlsv1.0 in curl(1) man page
diff --git a/sources b/sources
index 717a22e..f127541 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.61.1.tar.xz) = e6f82a7292c70841162480c8880d25046bcfa64058f4ff76f7d398c85da569af1c244442c9c58a3478d59264365ff8e39eed2fb564cb137118588f7862e64e9a
+SHA512 (curl-7.62.0.tar.xz) = 3aace2fc85e1d5ac06a3208980f887b5f1de5e2a1460e130b15cff3f7e5700b958cbb8f296483290961ef41f550245590067f86558dbba25e3d3ac10cec1adcd
From 6c95600feddc0b86189ebf037d2099ad84a94835 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 4 Oct 2018 15:40:31 +0200
Subject: [PATCH 034/256] test320: update expected output for gnutls-3.6.4
---
0009-curl-7.59.0-test320-gnutls.patch | 63 +++++++++++++++++++++++++++
curl.spec | 9 +++-
2 files changed, 71 insertions(+), 1 deletion(-)
create mode 100644 0009-curl-7.59.0-test320-gnutls.patch
diff --git a/0009-curl-7.59.0-test320-gnutls.patch b/0009-curl-7.59.0-test320-gnutls.patch
new file mode 100644
index 0000000..a9cbaac
--- /dev/null
+++ b/0009-curl-7.59.0-test320-gnutls.patch
@@ -0,0 +1,63 @@
+From 3cd5b375e31fb98e4782dc3a77e7316ad9eb26cf Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Thu, 4 Oct 2018 15:34:13 +0200
+Subject: [PATCH] test320: strip out more HTML when comparing
+
+To make the test case work with different gnutls-serv versions better.
+
+Reported-by: Kamil Dudka
+Fixes #3093
+Closes #3094
+
+Upstream-commit: 94ad57b0246b5658c2a9139dbe6a80efa4c4e2f3
+Signed-off-by: Kamil Dudka
+---
+ tests/data/test320 | 24 ++++--------------------
+ 1 file changed, 4 insertions(+), 20 deletions(-)
+
+diff --git a/tests/data/test320 b/tests/data/test320
+index 457a11eb2..87311d4f2 100644
+--- a/tests/data/test320
++++ b/tests/data/test320
+@@ -62,34 +62,18 @@ simple TLS-SRP HTTPS GET, check user in response
+ HTTP/1.0 200 OK
+ Content-type: text/html
+
+-
+-
+-
+-
+-
+-
+-If your browser supports session resuming, then you should see the same session ID, when you press the reload button.
+-Connected as user 'jsmith'.
+-
+-
|
+-| Key Exchange: | SRP |
+-| Compression | NULL |
+-| Cipher | AES-NNN-CBC |
+-| MAC | SHA1 |
+-| Ciphersuite | SRP_SHA_AES_NNN_CBC_SHA1 |
+-
Your HTTP header was:
Host: %HOSTIP:%HTTPTLSPORT
++FINE
+ User-Agent: curl-test-suite
+ Accept: */*
+
+-
+-
+-
+
+
+-s/^Session ID:.*//
++s/^
Connected as user 'jsmith'.*/FINE/
+ s/Protocol version:.*[0-9]//
+ s/GNUTLS/GnuTLS/
+ s/(AES[-_])\d\d\d([-_]CBC)/$1NNN$2/
++s/^<.*\n//
++s/^\n//
+
+
+
+--
+2.17.1
+
diff --git a/curl.spec b/curl.spec
index b7041ad..f031f2e 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 7%{?dist}
+Release: 8%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -29,6 +29,9 @@ Patch7: 0007-curl-7.61.0-libssh.patch
# fix NTLM password overflow via integer overflow (CVE-2018-14618)
Patch8: 0008-curl-7.59.0-CVE-2018-14618.patch
+# test320: update expected output for gnutls-3.6.4
+Patch9: 0009-curl-7.59.0-test320-gnutls.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -187,6 +190,7 @@ be installed.
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
# Fedora patches
%patch101 -p1
@@ -333,6 +337,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Nov 01 2018 Kamil Dudka - 7.59.0-8
+- test320: update expected output for gnutls-3.6.4
+
* Wed Sep 05 2018 Kamil Dudka - 7.59.0-7
- fix NTLM password overflow via integer overflow (CVE-2018-14618)
- tests: make ssh-keygen always produce PEM format (#1622594)
From 796d905297bafdca5ff3bbfb51bf57620b48227d Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 1 Nov 2018 09:45:48 +0100
Subject: [PATCH 035/256] Resolves: CVE-2018-16842 - fix bad arethmetic when
outputting warnings to stderr
Use `git apply` to apply the patch because `patch` would fail with:
File tests/data/test2080: git binary diffs are not supported.
---
0010-curl-7.59.0-CVE-2018-16842.patch | 78 +++++++++++++++++++++++++++
curl.spec | 7 +++
2 files changed, 85 insertions(+)
create mode 100644 0010-curl-7.59.0-CVE-2018-16842.patch
diff --git a/0010-curl-7.59.0-CVE-2018-16842.patch b/0010-curl-7.59.0-CVE-2018-16842.patch
new file mode 100644
index 0000000..6903ad6
--- /dev/null
+++ b/0010-curl-7.59.0-CVE-2018-16842.patch
@@ -0,0 +1,78 @@
+From 27d6c92acdac671ddf8f77f72956b2181561f774 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Sun, 28 Oct 2018 01:33:23 +0200
+Subject: [PATCH 1/2] voutf: fix bad arethmetic when outputting warnings to
+ stderr
+
+CVE-2018-16842
+Reported-by: Brian Carpenter
+Bug: https://curl.haxx.se/docs/CVE-2018-16842.html
+
+Upstream-commit: d530e92f59ae9bb2d47066c3c460b25d2ffeb211
+Signed-off-by: Kamil Dudka
+---
+ src/tool_msgs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tool_msgs.c b/src/tool_msgs.c
+index 9cce806..05bec39 100644
+--- a/src/tool_msgs.c
++++ b/src/tool_msgs.c
+@@ -67,7 +67,7 @@ static void voutf(struct GlobalConfig *config,
+ (void)fwrite(ptr, cut + 1, 1, config->errors);
+ fputs("\n", config->errors);
+ ptr += cut + 1; /* skip the space too */
+- len -= cut;
++ len -= cut + 1;
+ }
+ else {
+ fputs(ptr, config->errors);
+--
+2.17.2
+
+
+From 23f8c641b02e6c302d0e8cc5a5ee225a33b01f28 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Sun, 28 Oct 2018 10:43:57 +0100
+Subject: [PATCH 2/2] test2080: verify the fix for CVE-2018-16842
+
+Upstream-commit: 350306e4726b71b5b386fc30e3fecc039a807157
+Signed-off-by: Kamil Dudka
+---
+ tests/data/Makefile.inc | 3 ++-
+ tests/data/test2080 | Bin 0 -> 20659 bytes
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+ create mode 100644 tests/data/test2080
+
+diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
+index e045748..aa5fff0 100644
+--- a/tests/data/Makefile.inc
++++ b/tests/data/Makefile.inc
+@@ -194,4 +194,5 @@ test2048 test2049 test2050 test2051 test2052 test2053 test2054 test2055 \
+ test2056 test2057 test2058 test2059 test2060 test2061 test2062 test2063 \
+ test2064 test2065 test2066 test2067 test2068 test2069 \
+ \
+-test2070 test2071 test2072 test2073
++test2070 test2071 test2072 test2073 \
++test2080
+diff --git a/tests/data/test2080 b/tests/data/test2080
+new file mode 100644
+index 0000000000000000000000000000000000000000..47e376ecb5d7879c0a98e392bff48ccc52e9db0a
+GIT binary patch
+literal 20659
+zcmeI)Pj3@35QkyT{uI*`iBshYE(n>u@JB+F3kdG+t~asjwJY0gl}``eO+)FONU8ef
+zl6Ca+%A4K8~qdz
+zd{+G6l*#ToY+DU||F9%J1n*+KPxQ;7MapuoQ!&MMQSXmpqMh0_yS6g=;N;HNjilBk
+zY$c?)mULZxib{;$g~jw~nrs|8b@sJI)_QmS_4(WLrNld}2Y0LEO$e>m->_NA&o$n!
+z9^YDZ>cvMs2q1s}0tg_000PG)@a?$9VHyMwKmY**5I_I{1Q0m1z~!MEP#*yV5I_I{
+z1Q0*~0R#|0009ILKmY**4ldvh-hl=PAb-+Xw`j-8D
+zzg+g?Rt8(G*s;1Sb>n1S94H%G - 7.59.0-8
+- fix bad arethmetic when outputting warnings to stderr (CVE-2018-16842)
- test320: update expected output for gnutls-3.6.4
* Wed Sep 05 2018 Kamil Dudka - 7.59.0-7
From 00c5d944d93e5ca4efc1776ec1419f79c1cb05f7 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 1 Nov 2018 09:59:22 +0100
Subject: [PATCH 036/256] Resolves: CVE-2018-16840 - fix use-after-free in
handle close
---
0011-curl-7.59.0-CVE-2018-16840.patch | 39 +++++++++++++++++++++++++++
curl.spec | 5 ++++
2 files changed, 44 insertions(+)
create mode 100644 0011-curl-7.59.0-CVE-2018-16840.patch
diff --git a/0011-curl-7.59.0-CVE-2018-16840.patch b/0011-curl-7.59.0-CVE-2018-16840.patch
new file mode 100644
index 0000000..43f5eb2
--- /dev/null
+++ b/0011-curl-7.59.0-CVE-2018-16840.patch
@@ -0,0 +1,39 @@
+From 235f209a0e62edee654be441a50bb0c154edeaa5 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Thu, 18 Oct 2018 15:07:15 +0200
+Subject: [PATCH] Curl_close: clear data->multi_easy on free to avoid
+ use-after-free
+
+Regression from b46cfbc068 (7.59.0)
+CVE-2018-16840
+Reported-by: Brian Carpenter (Geeknik Labs)
+
+Bug: https://curl.haxx.se/docs/CVE-2018-16840.html
+
+Upstream-commit: 81d135d67155c5295b1033679c606165d4e28f3f
+Signed-off-by: Kamil Dudka
+---
+ lib/url.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/url.c b/lib/url.c
+index f159008..dcc1ecc 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -320,10 +320,12 @@ CURLcode Curl_close(struct Curl_easy *data)
+ and detach this handle from there. */
+ curl_multi_remove_handle(data->multi, data);
+
+- if(data->multi_easy)
++ if(data->multi_easy) {
+ /* when curl_easy_perform() is used, it creates its own multi handle to
+ use and this is the one */
+ curl_multi_cleanup(data->multi_easy);
++ data->multi_easy = NULL;
++ }
+
+ /* Destroy the timeout list that is held in the easy handle. It is
+ /normally/ done by curl_multi_remove_handle() but this is "just in
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 43e035e..6cd55a8 100644
--- a/curl.spec
+++ b/curl.spec
@@ -37,6 +37,9 @@ Patch10: 0010-curl-7.59.0-CVE-2018-16842.patch
# we need `git apply` to apply this patch
BuildRequires: git
+# fix use-after-free in handle close (CVE-2018-16840)
+Patch11: 0011-curl-7.59.0-CVE-2018-16840.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -197,6 +200,7 @@ be installed.
%patch8 -p1
%patch9 -p1
git apply %{PATCH10}
+%patch11 -p1
# Fedora patches
%patch101 -p1
@@ -344,6 +348,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Thu Nov 01 2018 Kamil Dudka - 7.59.0-8
+- fix use-after-free in handle close (CVE-2018-16840)
- fix bad arethmetic when outputting warnings to stderr (CVE-2018-16842)
- test320: update expected output for gnutls-3.6.4
From a1bd4f84de03b8d4f0f1c65acba7914cd9c601ce Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 1 Nov 2018 10:07:35 +0100
Subject: [PATCH 037/256] Resolves: CVE-2018-16839 - SASL password overflow via
integer overflow
---
0012-curl-7.59.0-CVE-2018-16839.patch | 136 ++++++++++++++++++++++++++
curl.spec | 5 +
2 files changed, 141 insertions(+)
create mode 100644 0012-curl-7.59.0-CVE-2018-16839.patch
diff --git a/0012-curl-7.59.0-CVE-2018-16839.patch b/0012-curl-7.59.0-CVE-2018-16839.patch
new file mode 100644
index 0000000..5570f44
--- /dev/null
+++ b/0012-curl-7.59.0-CVE-2018-16839.patch
@@ -0,0 +1,136 @@
+From 4df8ff21144236497fc92521d79fbca2dc079686 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Tue, 20 Mar 2018 15:15:14 +0100
+Subject: [PATCH 1/2] vauth/cleartext: fix integer overflow check
+
+Make the integer overflow check not rely on the undefined behavior that
+a size_t wraps around on overflow.
+
+Detected by lgtm.com
+Closes #2408
+
+Upstream-commit: c1366571b609407cf0d4d9f4a2769d29e1313151
+Signed-off-by: Kamil Dudka
+---
+ lib/curl_ntlm_core.c | 11 +----------
+ lib/curl_setup.h | 9 +++++++++
+ lib/vauth/cleartext.c | 14 ++++----------
+ 3 files changed, 14 insertions(+), 20 deletions(-)
+
+diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
+index e5c785d..b69c293 100644
+--- a/lib/curl_ntlm_core.c
++++ b/lib/curl_ntlm_core.c
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al.
++ * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -143,15 +143,6 @@
+ #define NTLMv2_BLOB_SIGNATURE "\x01\x01\x00\x00"
+ #define NTLMv2_BLOB_LEN (44 -16 + ntlm->target_info_len + 4)
+
+-#ifndef SIZE_T_MAX
+-/* some limits.h headers have this defined, some don't */
+-#if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4)
+-#define SIZE_T_MAX 18446744073709551615U
+-#else
+-#define SIZE_T_MAX 4294967295U
+-#endif
+-#endif
+-
+ /*
+ * Turns a 56-bit key into being 64-bit wide.
+ */
+diff --git a/lib/curl_setup.h b/lib/curl_setup.h
+index f128696..e4503c6 100644
+--- a/lib/curl_setup.h
++++ b/lib/curl_setup.h
+@@ -447,6 +447,15 @@
+ # endif
+ #endif
+
++#ifndef SIZE_T_MAX
++/* some limits.h headers have this defined, some don't */
++#if defined(SIZEOF_SIZE_T) && (SIZEOF_SIZE_T > 4)
++#define SIZE_T_MAX 18446744073709551615U
++#else
++#define SIZE_T_MAX 4294967295U
++#endif
++#endif
++
+ /*
+ * Arg 2 type for gethostname in case it hasn't been defined in config file.
+ */
+diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c
+index a761ae7..5d61ce6 100644
+--- a/lib/vauth/cleartext.c
++++ b/lib/vauth/cleartext.c
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
++ * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -73,16 +73,10 @@ CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
+ ulen = strlen(userp);
+ plen = strlen(passwdp);
+
+- /* Compute binary message length, checking for overflows. */
+- plainlen = 2 * ulen;
+- if(plainlen < ulen)
+- return CURLE_OUT_OF_MEMORY;
+- plainlen += plen;
+- if(plainlen < plen)
+- return CURLE_OUT_OF_MEMORY;
+- plainlen += 2;
+- if(plainlen < 2)
++ /* Compute binary message length. Check for overflows. */
++ if((ulen > SIZE_T_MAX/2) || (plen > (SIZE_T_MAX/2 - 2)))
+ return CURLE_OUT_OF_MEMORY;
++ plainlen = 2 * ulen + plen + 2;
+
+ plainauth = malloc(plainlen);
+ if(!plainauth)
+--
+2.17.2
+
+
+From ad9943254ded9a983af7d581e8a1f3317e8a8781 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Fri, 28 Sep 2018 16:08:16 +0200
+Subject: [PATCH 2/2] Curl_auth_create_plain_message: fix too-large-input-check
+
+CVE-2018-16839
+Reported-by: Harry Sintonen
+Bug: https://curl.haxx.se/docs/CVE-2018-16839.html
+
+Upstream-commit: f3a24d7916b9173c69a3e0ee790102993833d6c5
+Signed-off-by: Kamil Dudka
+---
+ lib/vauth/cleartext.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c
+index 5d61ce6..1367143 100644
+--- a/lib/vauth/cleartext.c
++++ b/lib/vauth/cleartext.c
+@@ -74,7 +74,7 @@ CURLcode Curl_auth_create_plain_message(struct Curl_easy *data,
+ plen = strlen(passwdp);
+
+ /* Compute binary message length. Check for overflows. */
+- if((ulen > SIZE_T_MAX/2) || (plen > (SIZE_T_MAX/2 - 2)))
++ if((ulen > SIZE_T_MAX/4) || (plen > (SIZE_T_MAX/2 - 2)))
+ return CURLE_OUT_OF_MEMORY;
+ plainlen = 2 * ulen + plen + 2;
+
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 6cd55a8..d26bec3 100644
--- a/curl.spec
+++ b/curl.spec
@@ -40,6 +40,9 @@ BuildRequires: git
# fix use-after-free in handle close (CVE-2018-16840)
Patch11: 0011-curl-7.59.0-CVE-2018-16840.patch
+# SASL password overflow via integer overflow (CVE-2018-16839)
+Patch12: 0012-curl-7.59.0-CVE-2018-16839.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -201,6 +204,7 @@ be installed.
%patch9 -p1
git apply %{PATCH10}
%patch11 -p1
+%patch12 -p1
# Fedora patches
%patch101 -p1
@@ -348,6 +352,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Thu Nov 01 2018 Kamil Dudka - 7.59.0-8
+- SASL password overflow via integer overflow (CVE-2018-16839)
- fix use-after-free in handle close (CVE-2018-16840)
- fix bad arethmetic when outputting warnings to stderr (CVE-2018-16842)
- test320: update expected output for gnutls-3.6.4
From 58646f29ccd62a0703ed6cd56ca854328ca0b817 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 15 Nov 2018 15:32:09 +0100
Subject: [PATCH 038/256] Resolves: CVE-2018-16842 - make the patch for
CVE-2018-16842 apply properly
`git apply` fails silently unless `git init` is invoked first.
---
curl.spec | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index d26bec3..337ec68 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 8%{?dist}
+Release: 9%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -202,6 +202,7 @@ be installed.
%patch7 -p1
%patch8 -p1
%patch9 -p1
+git init
git apply %{PATCH10}
%patch11 -p1
%patch12 -p1
@@ -351,6 +352,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Nov 15 2018 Kamil Dudka - 7.59.0-9
+- make the patch for CVE-2018-16842 apply properly (CVE-2018-16842)
+
* Thu Nov 01 2018 Kamil Dudka - 7.59.0-8
- SASL password overflow via integer overflow (CVE-2018-16839)
- fix use-after-free in handle close (CVE-2018-16840)
From a94ce82de00deaf7134abcceb2ff0c94de4e7be3 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 12 Dec 2018 09:45:07 +0100
Subject: [PATCH 039/256] new upstream release - 7.63.0
---
0102-curl-7.36.0-debug.patch | 2 +-
curl-7.62.0.tar.xz.asc | 11 -----------
curl-7.63.0.tar.xz.asc | 11 +++++++++++
curl.spec | 5 ++++-
sources | 2 +-
5 files changed, 17 insertions(+), 14 deletions(-)
delete mode 100644 curl-7.62.0.tar.xz.asc
create mode 100644 curl-7.63.0.tar.xz.asc
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 495fe63..60de5b3 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16421,18 +16421,11 @@ $as_echo "yes" >&6; }
+@@ -16415,18 +16415,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/curl-7.62.0.tar.xz.asc b/curl-7.62.0.tar.xz.asc
deleted file mode 100644
index 230438a..0000000
--- a/curl-7.62.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlvZT5wACgkQXMkI/bce
-EsJG4gf+IY2RkT9d7SIBAanHOD2NeT4UtPAOVRVtpW8dD9TIJq4IKOqv8CpcCCRq
-OZPJovdxM0qmXcrX2Dlf3zpPuY+bSzBW/xUYsKBBTTXhdUh5dv1Tz3HR6JzMHyT4
-hQm1mj6eFHFvayUKxoeQwiw3SkvW6WIlAySwEBzIzaE7icwvJ2dPO7xUOJWLXk/F
-pDRCAuHqIIgNzNph0EKXkvLWz5poBzGaK9kpJxmeaS3aWpe0EZ4+N6ju2GfHK5jO
-VQSuLWDHCZulv1eve+LOxgRjp/5kqQ/PPc3/99mEOxGRUxwCWVMEWGklAungn4bX
-nBPWNGArGJq2+kMP7v5pr0onBz6wxg==
-=CWQL
------END PGP SIGNATURE-----
diff --git a/curl-7.63.0.tar.xz.asc b/curl-7.63.0.tar.xz.asc
new file mode 100644
index 0000000..1dd44ac
--- /dev/null
+++ b/curl-7.63.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlwQtYIACgkQXMkI/bce
+EsKPHgf/RhfKPvl1Q8ftuEOXakF/ZIvINukj49vOMFmfQRHfmGWh5ajaGj0qVF6x
+U5HtrDoFOP5m74tj6jrzr2Ala/HGeyZmiTWwRLMgu+Tvq4djIv2pzZUJpgawJS52
+LCb2DUS2F+E1AsZQYvyliYA+r2FO2RRX1kbwdu+0RyuFy5WmWwkI02VahAIYV48o
+44IqtXshxfSAlfEqQ8MgXtU1KW0SWtfKVP2HpsurugjGyknoXxHP7yoDMgDAkMk0
+fNYyPDZbUXXN+6Oyo4Xh8rz4dpVLBkIoCZb4WG2pFZSrfP2+FTL5/vRo/tUyjFfv
+2LHmDUOOFH3VMwMYlnMCgaaXG7/jtg==
+=TkSP
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 70e148e..b39182e 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,6 +1,6 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.62.0
+Version: 7.63.0
Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -329,6 +329,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Dec 12 2018 Kamil Dudka - 7.63.0-1
+- new upstream release
+
* Wed Oct 31 2018 Kamil Dudka - 7.62.0-1
- new upstream release, which fixes the following vulnerabilities
CVE-2018-16839 - SASL password overflow via integer overflow
diff --git a/sources b/sources
index f127541..c40ff26 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.62.0.tar.xz) = 3aace2fc85e1d5ac06a3208980f887b5f1de5e2a1460e130b15cff3f7e5700b958cbb8f296483290961ef41f550245590067f86558dbba25e3d3ac10cec1adcd
+SHA512 (curl-7.63.0.tar.xz) = c905eb157c6b0093f1b1a506e4782b83af423fd6de1ce0ab5372164a686ef292ffb10d7999d3dec2de602f63ee41b65e1a1008409dd8c959a597644c0ecb395b
From c91c27bce90e913a6fdfd4cb42172496d0e264a8 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 12 Dec 2018 14:39:00 +0100
Subject: [PATCH 040/256] libtest: avoid symbol lookup error in libstubgss.so
---
0105-curl-7.63.0-libstubgss-ldadd.patch | 25 +++++++++++++++++++++++++
curl.spec | 4 ++++
2 files changed, 29 insertions(+)
create mode 100644 0105-curl-7.63.0-libstubgss-ldadd.patch
diff --git a/0105-curl-7.63.0-libstubgss-ldadd.patch b/0105-curl-7.63.0-libstubgss-ldadd.patch
new file mode 100644
index 0000000..e87b05b
--- /dev/null
+++ b/0105-curl-7.63.0-libstubgss-ldadd.patch
@@ -0,0 +1,25 @@
+From d8a3bdce7a43cb777866c34d3dabf908254e516d Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Wed, 12 Dec 2018 14:25:32 +0100
+Subject: [PATCH] libtest: avoid symbol lookup error in libstubgss.so
+
+---
+ tests/libtest/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
+index 56c84a7..117b79f 100644
+--- a/tests/libtest/Makefile.am
++++ b/tests/libtest/Makefile.am
+@@ -123,7 +123,7 @@ libstubgss_la_CFLAGS = $(AM_CFLAGS) -g
+
+ libstubgss_la_SOURCES = stub_gssapi.c stub_gssapi.h
+
+-libstubgss_la_LIBADD =
++libstubgss_la_LIBADD = $(top_builddir)/lib/libcurl.la
+ libstubgss_la_DEPENDENCIES =
+ endif
+
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index b39182e..e77d447 100644
--- a/curl.spec
+++ b/curl.spec
@@ -17,6 +17,9 @@ Patch103: 0103-curl-7.59.0-python3.patch
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
+# libtest: avoid symbol lookup error in libstubgss.so
+Patch105: 0105-curl-7.63.0-libstubgss-ldadd.patch
+
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
@@ -169,6 +172,7 @@ be installed.
%patch102 -p1
%patch103 -p1
%patch104 -p1
+%patch105 -p1
# make tests/*.py use Python 3
sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
From c30a9c7fdb343528c29e503b626dc566fa4deb9e Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Fri, 14 Dec 2018 11:21:54 +0100
Subject: [PATCH 041/256] Resolves: #1659329 - revert an upstream commit that
broke `fedpkg new-sources`
---
0001-curl-7.62.0-http-post-negotiate.patch | 72 ++++++++++++++++++++++
curl.spec | 9 ++-
2 files changed, 80 insertions(+), 1 deletion(-)
create mode 100644 0001-curl-7.62.0-http-post-negotiate.patch
diff --git a/0001-curl-7.62.0-http-post-negotiate.patch b/0001-curl-7.62.0-http-post-negotiate.patch
new file mode 100644
index 0000000..a391183
--- /dev/null
+++ b/0001-curl-7.62.0-http-post-negotiate.patch
@@ -0,0 +1,72 @@
+From be7395e31ae884cfaf87056f400130e3321767b3 Mon Sep 17 00:00:00 2001
+From: Elia Tufarolo
+Date: Tue, 13 Nov 2018 18:30:56 +0100
+Subject: [PATCH] http_negotiate: do not close connection until negotiation is
+ completed
+
+Fix HTTP POST using CURLAUTH_NEGOTIATE.
+
+Closes #3275
+
+Upstream-commit: 07ebaf837843124ee670e5b8c218b80b92e06e47
+Signed-off-by: Kamil Dudka
+---
+ lib/http.c | 1 -
+ lib/http_negotiate.c | 8 ++++++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/lib/http.c b/lib/http.c
+index 46ac15a6e..afc919b09 100644
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -610,7 +610,6 @@ output_auth_headers(struct connectdata *conn,
+ result = Curl_output_negotiate(conn, proxy);
+ if(result)
+ return result;
+- authstatus->done = TRUE;
+ negdata->state = GSS_AUTHSENT;
+ }
+ else
+diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
+index ddcd65b3b..444265d11 100644
+--- a/lib/http_negotiate.c
++++ b/lib/http_negotiate.c
+@@ -49,6 +49,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+
+ /* Point to the correct struct with this */
+ struct negotiatedata *neg_ctx;
++ struct auth *authp;
+
+ if(proxy) {
+ userp = conn->http_proxy.user;
+@@ -57,6 +58,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+ data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
+ host = conn->http_proxy.host.name;
+ neg_ctx = &data->state.proxyneg;
++ authp = &conn->data->state.authproxy;
+ }
+ else {
+ userp = conn->user;
+@@ -65,6 +67,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+ data->set.str[STRING_SERVICE_NAME] : "HTTP";
+ host = conn->host.name;
+ neg_ctx = &data->state.negotiate;
++ authp = &conn->data->state.authhost;
+ }
+
+ /* Not set means empty */
+@@ -95,6 +98,11 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+
+ if(result)
+ Curl_auth_spnego_cleanup(neg_ctx);
++ else
++ /* If the status is different than 0 and we encountered no errors
++ it means we have to continue. 0 is the OK value for both GSSAPI
++ (GSS_S_COMPLETE) and SSPI (SEC_E_OK) */
++ authp->done = !neg_ctx->status;
+
+ return result;
+ }
+--
+2.20.0
+
diff --git a/curl.spec b/curl.spec
index e77d447..3237389 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,10 +1,13 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.63.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# revert an upstream commit that broke `fedpkg new-sources` (#1659329)
+Patch1: 0001-curl-7.62.0-http-post-negotiate.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -164,6 +167,7 @@ be installed.
%prep
%setup -q
+%patch1 -p1 -R
# upstream patches
@@ -333,6 +337,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Fri Dec 14 2018 Kamil Dudka - 7.63.0-2
+- revert an upstream commit that broke `fedpkg new-sources` (#1659329)
+
* Wed Dec 12 2018 Kamil Dudka - 7.63.0-1
- new upstream release
From 49f5a42f9621baf874c9387c2b6e8d13e8f7868e Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 19 Dec 2018 13:42:58 +0100
Subject: [PATCH 042/256] Resolves: #1658574 - curl -J: do not append to the
destination file
---
0007-curl-7.63.0-JO-preserve-local-file.patch | 115 ++++++++++++++++++
curl.spec | 11 +-
2 files changed, 125 insertions(+), 1 deletion(-)
create mode 100644 0007-curl-7.63.0-JO-preserve-local-file.patch
diff --git a/0007-curl-7.63.0-JO-preserve-local-file.patch b/0007-curl-7.63.0-JO-preserve-local-file.patch
new file mode 100644
index 0000000..12ac53e
--- /dev/null
+++ b/0007-curl-7.63.0-JO-preserve-local-file.patch
@@ -0,0 +1,115 @@
+From ff74657fb645e7175971128a171ef7d5ece40d77 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Mon, 17 Dec 2018 12:51:51 +0100
+Subject: [PATCH] curl -J: do not append to the destination file
+
+Reported-by: Kamil Dudka
+Fixes #3380
+Closes #3381
+
+Upstream-commit: 4849267197682e69cfa056c2bd7a44acd123a917
+Signed-off-by: Kamil Dudka
+---
+ src/tool_cb_hdr.c | 6 +++---
+ src/tool_cb_wrt.c | 9 ++++-----
+ src/tool_cb_wrt.h | 2 +-
+ src/tool_operate.c | 2 +-
+ 4 files changed, 9 insertions(+), 10 deletions(-)
+
+diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
+index 84b0d9c..3844904 100644
+--- a/src/tool_cb_hdr.c
++++ b/src/tool_cb_hdr.c
+@@ -157,12 +157,12 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
+ outs->filename = filename;
+ outs->alloc_filename = TRUE;
+ hdrcbdata->honor_cd_filename = FALSE; /* done now! */
+- if(!tool_create_output_file(outs, TRUE))
++ if(!tool_create_output_file(outs))
+ return failure;
+ }
+ break;
+ }
+- if(!outs->stream && !tool_create_output_file(outs, FALSE))
++ if(!outs->stream && !tool_create_output_file(outs))
+ return failure;
+ }
+
+@@ -172,7 +172,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
+ /* bold headers only for selected protocols */
+ char *value = NULL;
+
+- if(!outs->stream && !tool_create_output_file(outs, FALSE))
++ if(!outs->stream && !tool_create_output_file(outs))
+ return failure;
+
+ if(hdrcbdata->global->isatty && hdrcbdata->global->styled_output)
+diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c
+index 2cb5e1b..195d6e7 100644
+--- a/src/tool_cb_wrt.c
++++ b/src/tool_cb_wrt.c
+@@ -32,8 +32,7 @@
+ #include "memdebug.h" /* keep this as LAST include */
+
+ /* create a local file for writing, return TRUE on success */
+-bool tool_create_output_file(struct OutStruct *outs,
+- bool append)
++bool tool_create_output_file(struct OutStruct *outs)
+ {
+ struct GlobalConfig *global = outs->config->global;
+ FILE *file;
+@@ -43,7 +42,7 @@ bool tool_create_output_file(struct OutStruct *outs,
+ return FALSE;
+ }
+
+- if(outs->is_cd_filename && !append) {
++ if(outs->is_cd_filename) {
+ /* don't overwrite existing files */
+ file = fopen(outs->filename, "rb");
+ if(file) {
+@@ -55,7 +54,7 @@ bool tool_create_output_file(struct OutStruct *outs,
+ }
+
+ /* open file for writing */
+- file = fopen(outs->filename, append?"ab":"wb");
++ file = fopen(outs->filename, "wb");
+ if(!file) {
+ warnf(global, "Failed to create the file %s: %s\n", outs->filename,
+ strerror(errno));
+@@ -142,7 +141,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
+ }
+ #endif
+
+- if(!outs->stream && !tool_create_output_file(outs, FALSE))
++ if(!outs->stream && !tool_create_output_file(outs))
+ return failure;
+
+ if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) {
+diff --git a/src/tool_cb_wrt.h b/src/tool_cb_wrt.h
+index 51e002b..188d3ea 100644
+--- a/src/tool_cb_wrt.h
++++ b/src/tool_cb_wrt.h
+@@ -30,6 +30,6 @@
+ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata);
+
+ /* create a local file for writing, return TRUE on success */
+-bool tool_create_output_file(struct OutStruct *outs, bool append);
++bool tool_create_output_file(struct OutStruct *outs);
+
+ #endif /* HEADER_CURL_TOOL_CB_WRT_H */
+diff --git a/src/tool_operate.c b/src/tool_operate.c
+index e53a9d8..429e9cf 100644
+--- a/src/tool_operate.c
++++ b/src/tool_operate.c
+@@ -1583,7 +1583,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
+ /* do not create (or even overwrite) the file in case we get no
+ data because of unmet condition */
+ curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet);
+- if(!cond_unmet && !tool_create_output_file(&outs, FALSE))
++ if(!cond_unmet && !tool_create_output_file(&outs))
+ result = CURLE_WRITE_ERROR;
+ }
+
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 3237389..aaa75a4 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.63.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# revert an upstream commit that broke `fedpkg new-sources` (#1659329)
Patch1: 0001-curl-7.62.0-http-post-negotiate.patch
+# curl -J: do not append to the destination file (#1658574)
+Patch7: 0007-curl-7.63.0-JO-preserve-local-file.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -167,9 +170,12 @@ be installed.
%prep
%setup -q
+
+# upstream patches to revert
%patch1 -p1 -R
# upstream patches
+%patch7 -p1
# Fedora patches
%patch101 -p1
@@ -337,6 +343,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Dec 19 2018 Kamil Dudka - 7.63.0-3
+- curl -J: do not append to the destination file (#1658574)
+
* Fri Dec 14 2018 Kamil Dudka - 7.63.0-2
- revert an upstream commit that broke `fedpkg new-sources` (#1659329)
From 32b0144f200134a2eee3b466e79f9f6488463541 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Fri, 4 Jan 2019 14:18:26 +0100
Subject: [PATCH 043/256] replace 0105-curl-7.63.0-libstubgss-ldadd.patch by
upstream patch
---
...-7.62.0-libtest-stub_gssapi-snprintf.patch | 63 +++++++++++++++++++
0105-curl-7.63.0-libstubgss-ldadd.patch | 25 --------
curl.spec | 13 ++--
3 files changed, 71 insertions(+), 30 deletions(-)
create mode 100644 0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
delete mode 100644 0105-curl-7.63.0-libstubgss-ldadd.patch
diff --git a/0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch b/0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
new file mode 100644
index 0000000..22868c4
--- /dev/null
+++ b/0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
@@ -0,0 +1,63 @@
+From 510ab52ed43589d96f0fab338eb6286940a29a78 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Thu, 3 Jan 2019 12:00:58 +0100
+Subject: [PATCH] libtest/stub_gssapi: use "real" snprintf
+
+... since it doesn't link with libcurl.
+
+Reverts the commit dcd6f81025 changes from this file.
+
+Bug: https://curl.haxx.se/mail/lib-2019-01/0000.html
+Reported-by: Shlomi Fish
+Reviewed-by: Daniel Gustafsson
+Reviewed-by: Kamil Dudka
+
+Closes #3434
+
+Upstream-commit: c7c362a24c0247644f9fde05e8ea353af4a94b04
+Signed-off-by: Kamil Dudka
+---
+ tests/libtest/stub_gssapi.c | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/tests/libtest/stub_gssapi.c b/tests/libtest/stub_gssapi.c
+index 254a01b31..377b75452 100644
+--- a/tests/libtest/stub_gssapi.c
++++ b/tests/libtest/stub_gssapi.c
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 2017-2018, Daniel Stenberg, , et al.
++ * Copyright (C) 2017-2019, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -28,10 +28,7 @@
+
+ #include "stub_gssapi.h"
+
+-#define ENABLE_CURLX_PRINTF
+-/* make the curlx header define all printf() functions to use the curlx_*
+- versions instead */
+-#include "curlx.h" /* from the private lib dir */
++/* !checksrc! disable SNPRINTF all */
+
+ #define MAX_CREDS_LENGTH 250
+ #define APPROX_TOKEN_LEN 250
+@@ -207,8 +204,10 @@ OM_uint32 gss_init_sec_context(OM_uint32 *min,
+ }
+
+ /* Token format: creds:target:type:padding */
+- used = msnprintf(token, length, "%s:%s:%d:", creds,
+- (char *) target_name, ctx->sent);
++ /* Note: this is using the *real* snprintf() and not the curl provided
++ one */
++ used = snprintf(token, length, "%s:%s:%d:", creds,
++ (char *) target_name, ctx->sent);
+
+ if(used >= length) {
+ free(token);
+--
+2.17.2
+
diff --git a/0105-curl-7.63.0-libstubgss-ldadd.patch b/0105-curl-7.63.0-libstubgss-ldadd.patch
deleted file mode 100644
index e87b05b..0000000
--- a/0105-curl-7.63.0-libstubgss-ldadd.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From d8a3bdce7a43cb777866c34d3dabf908254e516d Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Wed, 12 Dec 2018 14:25:32 +0100
-Subject: [PATCH] libtest: avoid symbol lookup error in libstubgss.so
-
----
- tests/libtest/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am
-index 56c84a7..117b79f 100644
---- a/tests/libtest/Makefile.am
-+++ b/tests/libtest/Makefile.am
-@@ -123,7 +123,7 @@ libstubgss_la_CFLAGS = $(AM_CFLAGS) -g
-
- libstubgss_la_SOURCES = stub_gssapi.c stub_gssapi.h
-
--libstubgss_la_LIBADD =
-+libstubgss_la_LIBADD = $(top_builddir)/lib/libcurl.la
- libstubgss_la_DEPENDENCIES =
- endif
-
---
-2.17.2
-
diff --git a/curl.spec b/curl.spec
index aaa75a4..fc60ce6 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.63.0
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# revert an upstream commit that broke `fedpkg new-sources` (#1659329)
Patch1: 0001-curl-7.62.0-http-post-negotiate.patch
+# libtest: avoid symbol lookup error in libstubgss.so
+Patch2: 0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
+
# curl -J: do not append to the destination file (#1658574)
Patch7: 0007-curl-7.63.0-JO-preserve-local-file.patch
@@ -23,9 +26,6 @@ Patch103: 0103-curl-7.59.0-python3.patch
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
-# libtest: avoid symbol lookup error in libstubgss.so
-Patch105: 0105-curl-7.63.0-libstubgss-ldadd.patch
-
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
@@ -175,6 +175,7 @@ be installed.
%patch1 -p1 -R
# upstream patches
+%patch2 -p1
%patch7 -p1
# Fedora patches
@@ -182,7 +183,6 @@ be installed.
%patch102 -p1
%patch103 -p1
%patch104 -p1
-%patch105 -p1
# make tests/*.py use Python 3
sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
@@ -343,6 +343,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Fri Jan 04 2019 Kamil Dudka - 7.63.0-4
+- replace 0105-curl-7.63.0-libstubgss-ldadd.patch by upstream patch
+
* Wed Dec 19 2018 Kamil Dudka - 7.63.0-3
- curl -J: do not append to the destination file (#1658574)
From da8449decdcb41b4b6d51b44e3eae06f831e4327 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 7 Jan 2019 12:39:58 +0100
Subject: [PATCH 044/256] replace 0001-curl-7.62.0-http-post-negotiate.patch by
upstream patch
---
0001-curl-7.62.0-http-post-negotiate.patch | 75 ++++++++++++++--------
curl.spec | 4 +-
2 files changed, 49 insertions(+), 30 deletions(-)
diff --git a/0001-curl-7.62.0-http-post-negotiate.patch b/0001-curl-7.62.0-http-post-negotiate.patch
index a391183..4bb3f0d 100644
--- a/0001-curl-7.62.0-http-post-negotiate.patch
+++ b/0001-curl-7.62.0-http-post-negotiate.patch
@@ -1,69 +1,90 @@
-From be7395e31ae884cfaf87056f400130e3321767b3 Mon Sep 17 00:00:00 2001
-From: Elia Tufarolo
-Date: Tue, 13 Nov 2018 18:30:56 +0100
-Subject: [PATCH] http_negotiate: do not close connection until negotiation is
- completed
+From 46fe12fc1d35b8d2484811b9359f0de72114dee4 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Fri, 4 Jan 2019 23:34:50 +0100
+Subject: [PATCH] Revert "http_negotiate: do not close connection until
+ negotiation is completed"
-Fix HTTP POST using CURLAUTH_NEGOTIATE.
+This reverts commit 07ebaf837843124ee670e5b8c218b80b92e06e47.
-Closes #3275
+This also reopens PR #3275 which brought the change now reverted.
-Upstream-commit: 07ebaf837843124ee670e5b8c218b80b92e06e47
+Fixes #3384
+Closes #3439
+
+Upstream-commit: ebe658c1e5a6577178981a7f406794699305be5c
Signed-off-by: Kamil Dudka
---
- lib/http.c | 1 -
- lib/http_negotiate.c | 8 ++++++++
- 2 files changed, 8 insertions(+), 1 deletion(-)
+ lib/http.c | 3 ++-
+ lib/http_negotiate.c | 10 +---------
+ 2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/lib/http.c b/lib/http.c
-index 46ac15a6e..afc919b09 100644
+index 8866fdf0a..303535af6 100644
--- a/lib/http.c
+++ b/lib/http.c
-@@ -610,7 +610,6 @@ output_auth_headers(struct connectdata *conn,
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
++ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -616,6 +616,7 @@ output_auth_headers(struct connectdata *conn,
result = Curl_output_negotiate(conn, proxy);
if(result)
return result;
-- authstatus->done = TRUE;
++ authstatus->done = TRUE;
negdata->state = GSS_AUTHSENT;
}
else
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
-index ddcd65b3b..444265d11 100644
+index 444265d11..4713d1bd5 100644
--- a/lib/http_negotiate.c
+++ b/lib/http_negotiate.c
-@@ -49,6 +49,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
++ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -49,7 +49,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
/* Point to the correct struct with this */
struct negotiatedata *neg_ctx;
-+ struct auth *authp;
+- struct auth *authp;
if(proxy) {
userp = conn->http_proxy.user;
-@@ -57,6 +58,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+@@ -58,7 +57,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
host = conn->http_proxy.host.name;
neg_ctx = &data->state.proxyneg;
-+ authp = &conn->data->state.authproxy;
+- authp = &conn->data->state.authproxy;
}
else {
userp = conn->user;
-@@ -65,6 +67,7 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+@@ -67,7 +65,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
data->set.str[STRING_SERVICE_NAME] : "HTTP";
host = conn->host.name;
neg_ctx = &data->state.negotiate;
-+ authp = &conn->data->state.authhost;
+- authp = &conn->data->state.authhost;
}
/* Not set means empty */
-@@ -95,6 +98,11 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
+@@ -98,11 +95,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
if(result)
Curl_auth_spnego_cleanup(neg_ctx);
-+ else
-+ /* If the status is different than 0 and we encountered no errors
-+ it means we have to continue. 0 is the OK value for both GSSAPI
-+ (GSS_S_COMPLETE) and SSPI (SEC_E_OK) */
-+ authp->done = !neg_ctx->status;
+- else
+- /* If the status is different than 0 and we encountered no errors
+- it means we have to continue. 0 is the OK value for both GSSAPI
+- (GSS_S_COMPLETE) and SSPI (SEC_E_OK) */
+- authp->done = !neg_ctx->status;
return result;
}
diff --git a/curl.spec b/curl.spec
index fc60ce6..f04fb8b 100644
--- a/curl.spec
+++ b/curl.spec
@@ -171,10 +171,8 @@ be installed.
%prep
%setup -q
-# upstream patches to revert
-%patch1 -p1 -R
-
# upstream patches
+%patch1 -p1
%patch2 -p1
%patch7 -p1
From 1a6a3b20a66509e5fad971d6dfb8b33daab8ca60 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 21 Jan 2019 10:13:55 +0100
Subject: [PATCH 045/256] Resolves: CVE-2018-20483 - xattr: strip credentials
from any URL that is stored
---
...xattr-strip-credentials-from-any-URL.patch | 284 ++++++++++++++++++
curl.spec | 9 +-
2 files changed, 292 insertions(+), 1 deletion(-)
create mode 100644 0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
diff --git a/0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch b/0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
new file mode 100644
index 0000000..d9fa798
--- /dev/null
+++ b/0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
@@ -0,0 +1,284 @@
+From 9fa7298750c1d66331dc55a202277b131868c048 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Wed, 2 Jan 2019 20:18:27 +0100
+Subject: [PATCH] xattr: strip credentials from any URL that is stored
+
+Both user and password are cleared uncondtitionally.
+
+Added unit test 1621 to verify.
+
+Fixes #3423
+Closes #3433
+
+Upstream-commit: 98e6629154044e4ab1ee7cff8351c7ebcb131e88
+Signed-off-by: Kamil Dudka
+---
+ src/tool_xattr.c | 63 +++++++++++++++++++++++++----
+ tests/data/Makefile.inc | 2 +-
+ tests/data/test1621 | 27 +++++++++++++
+ tests/unit/Makefile.inc | 6 ++-
+ tests/unit/unit1621.c | 89 +++++++++++++++++++++++++++++++++++++++++
+ 5 files changed, 177 insertions(+), 10 deletions(-)
+ create mode 100644 tests/data/test1621
+ create mode 100644 tests/unit/unit1621.c
+
+diff --git a/src/tool_xattr.c b/src/tool_xattr.c
+index 92b99db..730381b 100644
+--- a/src/tool_xattr.c
++++ b/src/tool_xattr.c
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al.
++ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -49,6 +49,46 @@ static const struct xattr_mapping {
+ { NULL, CURLINFO_NONE } /* last element, abort loop here */
+ };
+
++/* returns TRUE if a new URL is returned, that then needs to be freed */
++/* @unittest: 1621 */
++#ifdef UNITTESTS
++bool stripcredentials(char **url);
++#else
++static
++#endif
++bool stripcredentials(char **url)
++{
++ CURLU *u;
++ CURLUcode uc;
++ char *nurl;
++ u = curl_url();
++ if(u) {
++ uc = curl_url_set(u, CURLUPART_URL, *url, 0);
++ if(uc)
++ goto error;
++
++ uc = curl_url_set(u, CURLUPART_USER, NULL, 0);
++ if(uc)
++ goto error;
++
++ uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0);
++ if(uc)
++ goto error;
++
++ uc = curl_url_get(u, CURLUPART_URL, &nurl, 0);
++ if(uc)
++ goto error;
++
++ curl_url_cleanup(u);
++
++ *url = nurl;
++ return TRUE;
++ }
++ error:
++ curl_url_cleanup(u);
++ return FALSE;
++}
++
+ /* store metadata from the curl request alongside the downloaded
+ * file using extended attributes
+ */
+@@ -62,17 +102,24 @@ int fwrite_xattr(CURL *curl, int fd)
+ char *value = NULL;
+ CURLcode result = curl_easy_getinfo(curl, mappings[i].info, &value);
+ if(!result && value) {
++ bool freeptr = FALSE;
++ if(CURLINFO_EFFECTIVE_URL == mappings[i].info)
++ freeptr = stripcredentials(&value);
++ if(value) {
+ #ifdef HAVE_FSETXATTR_6
+- err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0);
++ err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0);
+ #elif defined(HAVE_FSETXATTR_5)
+- err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0);
++ err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0);
+ #elif defined(__FreeBSD_version)
+- err = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, mappings[i].attr, value,
+- strlen(value));
+- /* FreeBSD's extattr_set_fd returns the length of the extended attribute
+- */
+- err = err < 0 ? err : 0;
++ err = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, mappings[i].attr,
++ value, strlen(value));
++ /* FreeBSD's extattr_set_fd returns the length of the extended
++ attribute */
++ err = err < 0 ? err : 0;
+ #endif
++ if(freeptr)
++ curl_free(value);
++ }
+ }
+ i++;
+ }
+diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
+index dd38f89..6172b77 100644
+--- a/tests/data/Makefile.inc
++++ b/tests/data/Makefile.inc
+@@ -180,7 +180,7 @@ test1560 \
+ \
+ test1590 \
+ test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \
+-test1608 test1609 test1620 \
++test1608 test1609 test1620 test1621 \
+ \
+ test1650 test1651 test1652 test1653 \
+ \
+diff --git a/tests/data/test1621 b/tests/data/test1621
+new file mode 100644
+index 0000000..1117d1b
+--- /dev/null
++++ b/tests/data/test1621
+@@ -0,0 +1,27 @@
++
++
++
++unittest
++stripcredentials
++
++
++
++#
++# Client-side
++
++
++none
++
++
++unittest
++https
++
++
++unit tests for stripcredentials from URL
++
++
++unit1621
++
++
++
++
+diff --git a/tests/unit/Makefile.inc b/tests/unit/Makefile.inc
+index 8b1a607..82eaec7 100644
+--- a/tests/unit/Makefile.inc
++++ b/tests/unit/Makefile.inc
+@@ -10,7 +10,7 @@ UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \
+ unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 \
+ unit1399 \
+ unit1600 unit1601 unit1602 unit1603 unit1604 unit1605 unit1606 unit1607 \
+- unit1608 unit1609 unit1620 \
++ unit1608 unit1609 unit1620 unit1621 \
+ unit1650 unit1651 unit1652 unit1653
+
+ unit1300_SOURCES = unit1300.c $(UNITFILES)
+@@ -100,6 +100,10 @@ unit1609_CPPFLAGS = $(AM_CPPFLAGS)
+ unit1620_SOURCES = unit1620.c $(UNITFILES)
+ unit1620_CPPFLAGS = $(AM_CPPFLAGS)
+
++unit1621_SOURCES = unit1621.c $(UNITFILES)
++unit1621_CPPFLAGS = $(AM_CPPFLAGS)
++unit1621_LDADD = $(top_builddir)/src/libcurltool.la $(top_builddir)/lib/libcurl.la
++
+ unit1650_SOURCES = unit1650.c $(UNITFILES)
+ unit1650_CPPFLAGS = $(AM_CPPFLAGS)
+
+diff --git a/tests/unit/unit1621.c b/tests/unit/unit1621.c
+new file mode 100644
+index 0000000..6e07b6e
+--- /dev/null
++++ b/tests/unit/unit1621.c
+@@ -0,0 +1,89 @@
++/***************************************************************************
++ * _ _ ____ _
++ * Project ___| | | | _ \| |
++ * / __| | | | |_) | |
++ * | (__| |_| | _ <| |___
++ * \___|\___/|_| \_\_____|
++ *
++ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
++ *
++ * This software is licensed as described in the file COPYING, which
++ * you should have received as part of this distribution. The terms
++ * are also available at https://curl.haxx.se/docs/copyright.html.
++ *
++ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
++ * copies of the Software, and permit persons to whom the Software is
++ * furnished to do so, under the terms of the COPYING file.
++ *
++ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
++ * KIND, either express or implied.
++ *
++ ***************************************************************************/
++#include "curlcheck.h"
++
++#include "urldata.h"
++#include "url.h"
++
++#include "memdebug.h" /* LAST include file */
++
++static CURLcode unit_setup(void)
++{
++ return CURLE_OK;
++}
++
++static void unit_stop(void)
++{
++}
++
++#ifdef __MINGW32__
++UNITTEST_START
++{
++ return 0;
++}
++UNITTEST_STOP
++#else
++
++bool stripcredentials(char **url);
++
++struct checkthis {
++ const char *input;
++ const char *output;
++};
++
++static struct checkthis tests[] = {
++ { "ninja://foo@example.com", "ninja://foo@example.com" },
++ { "https://foo@example.com", "https://example.com/" },
++ { "https://localhost:45", "https://localhost:45/" },
++ { "https://foo@localhost:45", "https://localhost:45/" },
++ { "http://daniel:password@localhost", "http://localhost/" },
++ { "http://daniel@localhost", "http://localhost/" },
++ { "http://localhost/", "http://localhost/" },
++ { NULL, NULL } /* end marker */
++};
++
++UNITTEST_START
++{
++ bool cleanup;
++ char *url;
++ int i;
++ int rc = 0;
++
++ for(i = 0; tests[i].input; i++) {
++ url = (char *)tests[i].input;
++ cleanup = stripcredentials(&url);
++ printf("Test %u got input \"%s\", output: \"%s\"\n",
++ i, tests[i].input, url);
++
++ if(strcmp(tests[i].output, url)) {
++ fprintf(stderr, "Test %u got input \"%s\", expected output \"%s\"\n"
++ " Actual output: \"%s\"\n", i, tests[i].input, tests[i].output,
++ url);
++ rc++;
++ }
++ if(cleanup)
++ curl_free(url);
++ }
++ return rc;
++}
++UNITTEST_STOP
++#endif
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index f04fb8b..8582a58 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.63.0
-Release: 4%{?dist}
+Release: 5%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -14,6 +14,9 @@ Patch2: 0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
# curl -J: do not append to the destination file (#1658574)
Patch7: 0007-curl-7.63.0-JO-preserve-local-file.patch
+# xattr: strip credentials from any URL that is stored (CVE-2018-20483)
+Patch8: 0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -175,6 +178,7 @@ be installed.
%patch1 -p1
%patch2 -p1
%patch7 -p1
+%patch8 -p1
# Fedora patches
%patch101 -p1
@@ -341,6 +345,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Jan 21 2019 Kamil Dudka - 7.63.0-5
+- xattr: strip credentials from any URL that is stored (CVE-2018-20483)
+
* Fri Jan 04 2019 Kamil Dudka - 7.63.0-4
- replace 0105-curl-7.63.0-libstubgss-ldadd.patch by upstream patch
From 9221f774a1e524d8330fb2b72cda15ad83ca1c51 Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering
Date: Thu, 31 Jan 2019 16:37:02 +0000
Subject: [PATCH 046/256] - Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering
---
curl.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index 8582a58..4600a84 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.63.0
-Release: 5%{?dist}
+Release: 6%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -345,6 +345,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Jan 31 2019 Fedora Release Engineering - 7.63.0-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
+
* Mon Jan 21 2019 Kamil Dudka - 7.63.0-5
- xattr: strip credentials from any URL that is stored (CVE-2018-20483)
From 3c5dec6602592a730cbe3518e9b222bc3d3e4a0b Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 4 Feb 2019 17:45:12 +0100
Subject: [PATCH 047/256] prevent valgrind from reporting false positives on
x86_64
---
0105-curl-7.63.0-lib1560-valgrind.patch | 39 +++++++++++++++++++++++++
curl.spec | 9 +++++-
2 files changed, 47 insertions(+), 1 deletion(-)
create mode 100644 0105-curl-7.63.0-lib1560-valgrind.patch
diff --git a/0105-curl-7.63.0-lib1560-valgrind.patch b/0105-curl-7.63.0-lib1560-valgrind.patch
new file mode 100644
index 0000000..40d0a9b
--- /dev/null
+++ b/0105-curl-7.63.0-lib1560-valgrind.patch
@@ -0,0 +1,39 @@
+From f55cca0e86f59ec11ffafd5c0503c39ca3723e2e Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Mon, 4 Feb 2019 17:32:56 +0100
+Subject: [PATCH] libtest: compile lib1560.c with -fno-builtin-strcmp
+
+... to prevent valgrind from reporting false positives on x86_64:
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x10BCAA: part2id (lib1560.c:489)
+ by 0x10BCAA: updateurl (lib1560.c:521)
+ by 0x10BCAA: set_parts (lib1560.c:630)
+ by 0x10BCAA: test (lib1560.c:802)
+ by 0x4923412: (below main) (in /usr/lib64/libc-2.28.9000.so)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x10BCC3: part2id (lib1560.c:491)
+ by 0x10BCC3: updateurl (lib1560.c:521)
+ by 0x10BCC3: set_parts (lib1560.c:630)
+ by 0x10BCC3: test (lib1560.c:802)
+ by 0x4923412: (below main) (in /usr/lib64/libc-2.28.9000.so)
+---
+ tests/libtest/Makefile.inc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
+index 080421b..ea3b806 100644
+--- a/tests/libtest/Makefile.inc
++++ b/tests/libtest/Makefile.inc
+@@ -516,6 +516,7 @@ lib1557_LDADD = $(TESTUTIL_LIBS)
+ lib1557_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1557
+
+ lib1560_SOURCES = lib1560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
++lib1560_CFLAGS = $(AM_CFLAGS) -fno-builtin-strcmp
+ lib1560_LDADD = $(TESTUTIL_LIBS)
+
+ lib1900_SOURCES = lib1900.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 4600a84..ce957f6 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.63.0
-Release: 6%{?dist}
+Release: 7%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -29,6 +29,9 @@ Patch103: 0103-curl-7.59.0-python3.patch
# use localhost6 instead of ip6-localhost in the curl test-suite
Patch104: 0104-curl-7.19.7-localhost6.patch
+# prevent valgrind from reporting false positives on x86_64
+Patch105: 0105-curl-7.63.0-lib1560-valgrind.patch
+
Provides: curl-full = %{version}-%{release}
Provides: webclient
URL: https://curl.haxx.se/
@@ -185,6 +188,7 @@ be installed.
%patch102 -p1
%patch103 -p1
%patch104 -p1
+%patch105 -p1
# make tests/*.py use Python 3
sed -e '1 s|^#!/.*python|#!%{__python3}|' -i tests/*.py
@@ -345,6 +349,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Feb 04 2019 Kamil Dudka - 7.63.0-7
+- prevent valgrind from reporting false positives on x86_64
+
* Thu Jan 31 2019 Fedora Release Engineering - 7.63.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
From 2bdb62413990d788a0e9acad53ca15e9e2aed17f Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 6 Feb 2019 09:51:19 +0100
Subject: [PATCH 048/256] new upstream release - 7.64.0
Resolves: CVE-2019-3823 - SMTP end-of-response out-of-bounds read
Resolves: CVE-2019-3822 - NTLMv2 type-3 header stack buffer overflow
Resolves: CVE-2018-16890 - NTLM type-2 out-of-bounds buffer read
---
0001-curl-7.62.0-http-post-negotiate.patch | 93 ------
...-7.62.0-libtest-stub_gssapi-snprintf.patch | 63 ----
0007-curl-7.63.0-JO-preserve-local-file.patch | 115 -------
...xattr-strip-credentials-from-any-URL.patch | 284 ------------------
0102-curl-7.36.0-debug.patch | 4 +-
0105-curl-7.63.0-lib1560-valgrind.patch | 6 +-
curl-7.63.0.tar.xz.asc | 11 -
curl-7.64.0.tar.xz.asc | 11 +
curl.spec | 26 +-
sources | 2 +-
10 files changed, 25 insertions(+), 590 deletions(-)
delete mode 100644 0001-curl-7.62.0-http-post-negotiate.patch
delete mode 100644 0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
delete mode 100644 0007-curl-7.63.0-JO-preserve-local-file.patch
delete mode 100644 0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
delete mode 100644 curl-7.63.0.tar.xz.asc
create mode 100644 curl-7.64.0.tar.xz.asc
diff --git a/0001-curl-7.62.0-http-post-negotiate.patch b/0001-curl-7.62.0-http-post-negotiate.patch
deleted file mode 100644
index 4bb3f0d..0000000
--- a/0001-curl-7.62.0-http-post-negotiate.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 46fe12fc1d35b8d2484811b9359f0de72114dee4 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Fri, 4 Jan 2019 23:34:50 +0100
-Subject: [PATCH] Revert "http_negotiate: do not close connection until
- negotiation is completed"
-
-This reverts commit 07ebaf837843124ee670e5b8c218b80b92e06e47.
-
-This also reopens PR #3275 which brought the change now reverted.
-
-Fixes #3384
-Closes #3439
-
-Upstream-commit: ebe658c1e5a6577178981a7f406794699305be5c
-Signed-off-by: Kamil Dudka
----
- lib/http.c | 3 ++-
- lib/http_negotiate.c | 10 +---------
- 2 files changed, 3 insertions(+), 10 deletions(-)
-
-diff --git a/lib/http.c b/lib/http.c
-index 8866fdf0a..303535af6 100644
---- a/lib/http.c
-+++ b/lib/http.c
-@@ -5,7 +5,7 @@
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
-- * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
-+ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
-@@ -616,6 +616,7 @@ output_auth_headers(struct connectdata *conn,
- result = Curl_output_negotiate(conn, proxy);
- if(result)
- return result;
-+ authstatus->done = TRUE;
- negdata->state = GSS_AUTHSENT;
- }
- else
-diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
-index 444265d11..4713d1bd5 100644
---- a/lib/http_negotiate.c
-+++ b/lib/http_negotiate.c
-@@ -5,7 +5,7 @@
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
-- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al.
-+ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
-@@ -49,7 +49,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
-
- /* Point to the correct struct with this */
- struct negotiatedata *neg_ctx;
-- struct auth *authp;
-
- if(proxy) {
- userp = conn->http_proxy.user;
-@@ -58,7 +57,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
- data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
- host = conn->http_proxy.host.name;
- neg_ctx = &data->state.proxyneg;
-- authp = &conn->data->state.authproxy;
- }
- else {
- userp = conn->user;
-@@ -67,7 +65,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
- data->set.str[STRING_SERVICE_NAME] : "HTTP";
- host = conn->host.name;
- neg_ctx = &data->state.negotiate;
-- authp = &conn->data->state.authhost;
- }
-
- /* Not set means empty */
-@@ -98,11 +95,6 @@ CURLcode Curl_input_negotiate(struct connectdata *conn, bool proxy,
-
- if(result)
- Curl_auth_spnego_cleanup(neg_ctx);
-- else
-- /* If the status is different than 0 and we encountered no errors
-- it means we have to continue. 0 is the OK value for both GSSAPI
-- (GSS_S_COMPLETE) and SSPI (SEC_E_OK) */
-- authp->done = !neg_ctx->status;
-
- return result;
- }
---
-2.20.0
-
diff --git a/0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch b/0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
deleted file mode 100644
index 22868c4..0000000
--- a/0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 510ab52ed43589d96f0fab338eb6286940a29a78 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Thu, 3 Jan 2019 12:00:58 +0100
-Subject: [PATCH] libtest/stub_gssapi: use "real" snprintf
-
-... since it doesn't link with libcurl.
-
-Reverts the commit dcd6f81025 changes from this file.
-
-Bug: https://curl.haxx.se/mail/lib-2019-01/0000.html
-Reported-by: Shlomi Fish
-Reviewed-by: Daniel Gustafsson
-Reviewed-by: Kamil Dudka
-
-Closes #3434
-
-Upstream-commit: c7c362a24c0247644f9fde05e8ea353af4a94b04
-Signed-off-by: Kamil Dudka
----
- tests/libtest/stub_gssapi.c | 13 ++++++-------
- 1 file changed, 6 insertions(+), 7 deletions(-)
-
-diff --git a/tests/libtest/stub_gssapi.c b/tests/libtest/stub_gssapi.c
-index 254a01b31..377b75452 100644
---- a/tests/libtest/stub_gssapi.c
-+++ b/tests/libtest/stub_gssapi.c
-@@ -5,7 +5,7 @@
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
-- * Copyright (C) 2017-2018, Daniel Stenberg, , et al.
-+ * Copyright (C) 2017-2019, Daniel Stenberg, , et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
-@@ -28,10 +28,7 @@
-
- #include "stub_gssapi.h"
-
--#define ENABLE_CURLX_PRINTF
--/* make the curlx header define all printf() functions to use the curlx_*
-- versions instead */
--#include "curlx.h" /* from the private lib dir */
-+/* !checksrc! disable SNPRINTF all */
-
- #define MAX_CREDS_LENGTH 250
- #define APPROX_TOKEN_LEN 250
-@@ -207,8 +204,10 @@ OM_uint32 gss_init_sec_context(OM_uint32 *min,
- }
-
- /* Token format: creds:target:type:padding */
-- used = msnprintf(token, length, "%s:%s:%d:", creds,
-- (char *) target_name, ctx->sent);
-+ /* Note: this is using the *real* snprintf() and not the curl provided
-+ one */
-+ used = snprintf(token, length, "%s:%s:%d:", creds,
-+ (char *) target_name, ctx->sent);
-
- if(used >= length) {
- free(token);
---
-2.17.2
-
diff --git a/0007-curl-7.63.0-JO-preserve-local-file.patch b/0007-curl-7.63.0-JO-preserve-local-file.patch
deleted file mode 100644
index 12ac53e..0000000
--- a/0007-curl-7.63.0-JO-preserve-local-file.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From ff74657fb645e7175971128a171ef7d5ece40d77 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Mon, 17 Dec 2018 12:51:51 +0100
-Subject: [PATCH] curl -J: do not append to the destination file
-
-Reported-by: Kamil Dudka
-Fixes #3380
-Closes #3381
-
-Upstream-commit: 4849267197682e69cfa056c2bd7a44acd123a917
-Signed-off-by: Kamil Dudka
----
- src/tool_cb_hdr.c | 6 +++---
- src/tool_cb_wrt.c | 9 ++++-----
- src/tool_cb_wrt.h | 2 +-
- src/tool_operate.c | 2 +-
- 4 files changed, 9 insertions(+), 10 deletions(-)
-
-diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
-index 84b0d9c..3844904 100644
---- a/src/tool_cb_hdr.c
-+++ b/src/tool_cb_hdr.c
-@@ -157,12 +157,12 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
- outs->filename = filename;
- outs->alloc_filename = TRUE;
- hdrcbdata->honor_cd_filename = FALSE; /* done now! */
-- if(!tool_create_output_file(outs, TRUE))
-+ if(!tool_create_output_file(outs))
- return failure;
- }
- break;
- }
-- if(!outs->stream && !tool_create_output_file(outs, FALSE))
-+ if(!outs->stream && !tool_create_output_file(outs))
- return failure;
- }
-
-@@ -172,7 +172,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
- /* bold headers only for selected protocols */
- char *value = NULL;
-
-- if(!outs->stream && !tool_create_output_file(outs, FALSE))
-+ if(!outs->stream && !tool_create_output_file(outs))
- return failure;
-
- if(hdrcbdata->global->isatty && hdrcbdata->global->styled_output)
-diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c
-index 2cb5e1b..195d6e7 100644
---- a/src/tool_cb_wrt.c
-+++ b/src/tool_cb_wrt.c
-@@ -32,8 +32,7 @@
- #include "memdebug.h" /* keep this as LAST include */
-
- /* create a local file for writing, return TRUE on success */
--bool tool_create_output_file(struct OutStruct *outs,
-- bool append)
-+bool tool_create_output_file(struct OutStruct *outs)
- {
- struct GlobalConfig *global = outs->config->global;
- FILE *file;
-@@ -43,7 +42,7 @@ bool tool_create_output_file(struct OutStruct *outs,
- return FALSE;
- }
-
-- if(outs->is_cd_filename && !append) {
-+ if(outs->is_cd_filename) {
- /* don't overwrite existing files */
- file = fopen(outs->filename, "rb");
- if(file) {
-@@ -55,7 +54,7 @@ bool tool_create_output_file(struct OutStruct *outs,
- }
-
- /* open file for writing */
-- file = fopen(outs->filename, append?"ab":"wb");
-+ file = fopen(outs->filename, "wb");
- if(!file) {
- warnf(global, "Failed to create the file %s: %s\n", outs->filename,
- strerror(errno));
-@@ -142,7 +141,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
- }
- #endif
-
-- if(!outs->stream && !tool_create_output_file(outs, FALSE))
-+ if(!outs->stream && !tool_create_output_file(outs))
- return failure;
-
- if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) {
-diff --git a/src/tool_cb_wrt.h b/src/tool_cb_wrt.h
-index 51e002b..188d3ea 100644
---- a/src/tool_cb_wrt.h
-+++ b/src/tool_cb_wrt.h
-@@ -30,6 +30,6 @@
- size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata);
-
- /* create a local file for writing, return TRUE on success */
--bool tool_create_output_file(struct OutStruct *outs, bool append);
-+bool tool_create_output_file(struct OutStruct *outs);
-
- #endif /* HEADER_CURL_TOOL_CB_WRT_H */
-diff --git a/src/tool_operate.c b/src/tool_operate.c
-index e53a9d8..429e9cf 100644
---- a/src/tool_operate.c
-+++ b/src/tool_operate.c
-@@ -1583,7 +1583,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
- /* do not create (or even overwrite) the file in case we get no
- data because of unmet condition */
- curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet);
-- if(!cond_unmet && !tool_create_output_file(&outs, FALSE))
-+ if(!cond_unmet && !tool_create_output_file(&outs))
- result = CURLE_WRITE_ERROR;
- }
-
---
-2.17.2
-
diff --git a/0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch b/0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
deleted file mode 100644
index d9fa798..0000000
--- a/0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
+++ /dev/null
@@ -1,284 +0,0 @@
-From 9fa7298750c1d66331dc55a202277b131868c048 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Wed, 2 Jan 2019 20:18:27 +0100
-Subject: [PATCH] xattr: strip credentials from any URL that is stored
-
-Both user and password are cleared uncondtitionally.
-
-Added unit test 1621 to verify.
-
-Fixes #3423
-Closes #3433
-
-Upstream-commit: 98e6629154044e4ab1ee7cff8351c7ebcb131e88
-Signed-off-by: Kamil Dudka
----
- src/tool_xattr.c | 63 +++++++++++++++++++++++++----
- tests/data/Makefile.inc | 2 +-
- tests/data/test1621 | 27 +++++++++++++
- tests/unit/Makefile.inc | 6 ++-
- tests/unit/unit1621.c | 89 +++++++++++++++++++++++++++++++++++++++++
- 5 files changed, 177 insertions(+), 10 deletions(-)
- create mode 100644 tests/data/test1621
- create mode 100644 tests/unit/unit1621.c
-
-diff --git a/src/tool_xattr.c b/src/tool_xattr.c
-index 92b99db..730381b 100644
---- a/src/tool_xattr.c
-+++ b/src/tool_xattr.c
-@@ -5,7 +5,7 @@
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
-- * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al.
-+ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
-@@ -49,6 +49,46 @@ static const struct xattr_mapping {
- { NULL, CURLINFO_NONE } /* last element, abort loop here */
- };
-
-+/* returns TRUE if a new URL is returned, that then needs to be freed */
-+/* @unittest: 1621 */
-+#ifdef UNITTESTS
-+bool stripcredentials(char **url);
-+#else
-+static
-+#endif
-+bool stripcredentials(char **url)
-+{
-+ CURLU *u;
-+ CURLUcode uc;
-+ char *nurl;
-+ u = curl_url();
-+ if(u) {
-+ uc = curl_url_set(u, CURLUPART_URL, *url, 0);
-+ if(uc)
-+ goto error;
-+
-+ uc = curl_url_set(u, CURLUPART_USER, NULL, 0);
-+ if(uc)
-+ goto error;
-+
-+ uc = curl_url_set(u, CURLUPART_PASSWORD, NULL, 0);
-+ if(uc)
-+ goto error;
-+
-+ uc = curl_url_get(u, CURLUPART_URL, &nurl, 0);
-+ if(uc)
-+ goto error;
-+
-+ curl_url_cleanup(u);
-+
-+ *url = nurl;
-+ return TRUE;
-+ }
-+ error:
-+ curl_url_cleanup(u);
-+ return FALSE;
-+}
-+
- /* store metadata from the curl request alongside the downloaded
- * file using extended attributes
- */
-@@ -62,17 +102,24 @@ int fwrite_xattr(CURL *curl, int fd)
- char *value = NULL;
- CURLcode result = curl_easy_getinfo(curl, mappings[i].info, &value);
- if(!result && value) {
-+ bool freeptr = FALSE;
-+ if(CURLINFO_EFFECTIVE_URL == mappings[i].info)
-+ freeptr = stripcredentials(&value);
-+ if(value) {
- #ifdef HAVE_FSETXATTR_6
-- err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0);
-+ err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0, 0);
- #elif defined(HAVE_FSETXATTR_5)
-- err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0);
-+ err = fsetxattr(fd, mappings[i].attr, value, strlen(value), 0);
- #elif defined(__FreeBSD_version)
-- err = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, mappings[i].attr, value,
-- strlen(value));
-- /* FreeBSD's extattr_set_fd returns the length of the extended attribute
-- */
-- err = err < 0 ? err : 0;
-+ err = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, mappings[i].attr,
-+ value, strlen(value));
-+ /* FreeBSD's extattr_set_fd returns the length of the extended
-+ attribute */
-+ err = err < 0 ? err : 0;
- #endif
-+ if(freeptr)
-+ curl_free(value);
-+ }
- }
- i++;
- }
-diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
-index dd38f89..6172b77 100644
---- a/tests/data/Makefile.inc
-+++ b/tests/data/Makefile.inc
-@@ -180,7 +180,7 @@ test1560 \
- \
- test1590 \
- test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \
--test1608 test1609 test1620 \
-+test1608 test1609 test1620 test1621 \
- \
- test1650 test1651 test1652 test1653 \
- \
-diff --git a/tests/data/test1621 b/tests/data/test1621
-new file mode 100644
-index 0000000..1117d1b
---- /dev/null
-+++ b/tests/data/test1621
-@@ -0,0 +1,27 @@
-+
-+
-+
-+unittest
-+stripcredentials
-+
-+
-+
-+#
-+# Client-side
-+
-+
-+none
-+
-+
-+unittest
-+https
-+
-+
-+unit tests for stripcredentials from URL
-+
-+
-+unit1621
-+
-+
-+
-+
-diff --git a/tests/unit/Makefile.inc b/tests/unit/Makefile.inc
-index 8b1a607..82eaec7 100644
---- a/tests/unit/Makefile.inc
-+++ b/tests/unit/Makefile.inc
-@@ -10,7 +10,7 @@ UNITPROGS = unit1300 unit1301 unit1302 unit1303 unit1304 unit1305 unit1307 \
- unit1330 unit1394 unit1395 unit1396 unit1397 unit1398 \
- unit1399 \
- unit1600 unit1601 unit1602 unit1603 unit1604 unit1605 unit1606 unit1607 \
-- unit1608 unit1609 unit1620 \
-+ unit1608 unit1609 unit1620 unit1621 \
- unit1650 unit1651 unit1652 unit1653
-
- unit1300_SOURCES = unit1300.c $(UNITFILES)
-@@ -100,6 +100,10 @@ unit1609_CPPFLAGS = $(AM_CPPFLAGS)
- unit1620_SOURCES = unit1620.c $(UNITFILES)
- unit1620_CPPFLAGS = $(AM_CPPFLAGS)
-
-+unit1621_SOURCES = unit1621.c $(UNITFILES)
-+unit1621_CPPFLAGS = $(AM_CPPFLAGS)
-+unit1621_LDADD = $(top_builddir)/src/libcurltool.la $(top_builddir)/lib/libcurl.la
-+
- unit1650_SOURCES = unit1650.c $(UNITFILES)
- unit1650_CPPFLAGS = $(AM_CPPFLAGS)
-
-diff --git a/tests/unit/unit1621.c b/tests/unit/unit1621.c
-new file mode 100644
-index 0000000..6e07b6e
---- /dev/null
-+++ b/tests/unit/unit1621.c
-@@ -0,0 +1,89 @@
-+/***************************************************************************
-+ * _ _ ____ _
-+ * Project ___| | | | _ \| |
-+ * / __| | | | |_) | |
-+ * | (__| |_| | _ <| |___
-+ * \___|\___/|_| \_\_____|
-+ *
-+ * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
-+ *
-+ * This software is licensed as described in the file COPYING, which
-+ * you should have received as part of this distribution. The terms
-+ * are also available at https://curl.haxx.se/docs/copyright.html.
-+ *
-+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
-+ * copies of the Software, and permit persons to whom the Software is
-+ * furnished to do so, under the terms of the COPYING file.
-+ *
-+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
-+ * KIND, either express or implied.
-+ *
-+ ***************************************************************************/
-+#include "curlcheck.h"
-+
-+#include "urldata.h"
-+#include "url.h"
-+
-+#include "memdebug.h" /* LAST include file */
-+
-+static CURLcode unit_setup(void)
-+{
-+ return CURLE_OK;
-+}
-+
-+static void unit_stop(void)
-+{
-+}
-+
-+#ifdef __MINGW32__
-+UNITTEST_START
-+{
-+ return 0;
-+}
-+UNITTEST_STOP
-+#else
-+
-+bool stripcredentials(char **url);
-+
-+struct checkthis {
-+ const char *input;
-+ const char *output;
-+};
-+
-+static struct checkthis tests[] = {
-+ { "ninja://foo@example.com", "ninja://foo@example.com" },
-+ { "https://foo@example.com", "https://example.com/" },
-+ { "https://localhost:45", "https://localhost:45/" },
-+ { "https://foo@localhost:45", "https://localhost:45/" },
-+ { "http://daniel:password@localhost", "http://localhost/" },
-+ { "http://daniel@localhost", "http://localhost/" },
-+ { "http://localhost/", "http://localhost/" },
-+ { NULL, NULL } /* end marker */
-+};
-+
-+UNITTEST_START
-+{
-+ bool cleanup;
-+ char *url;
-+ int i;
-+ int rc = 0;
-+
-+ for(i = 0; tests[i].input; i++) {
-+ url = (char *)tests[i].input;
-+ cleanup = stripcredentials(&url);
-+ printf("Test %u got input \"%s\", output: \"%s\"\n",
-+ i, tests[i].input, url);
-+
-+ if(strcmp(tests[i].output, url)) {
-+ fprintf(stderr, "Test %u got input \"%s\", expected output \"%s\"\n"
-+ " Actual output: \"%s\"\n", i, tests[i].input, tests[i].output,
-+ url);
-+ rc++;
-+ }
-+ if(cleanup)
-+ curl_free(url);
-+ }
-+ return rc;
-+}
-+UNITTEST_STOP
-+#endif
---
-2.17.2
-
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 60de5b3..57c05c6 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16415,18 +16415,11 @@ $as_echo "yes" >&6; }
+@@ -16250,18 +16250,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
@@ -38,7 +38,7 @@ diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
index 0cbba7a..9175b5b 100644
--- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
-@@ -157,18 +157,11 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [
+@@ -166,18 +166,11 @@ AC_DEFUN([CURL_CHECK_COMPILER_GNU_C], [
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/0105-curl-7.63.0-lib1560-valgrind.patch b/0105-curl-7.63.0-lib1560-valgrind.patch
index 40d0a9b..003655c 100644
--- a/0105-curl-7.63.0-lib1560-valgrind.patch
+++ b/0105-curl-7.63.0-lib1560-valgrind.patch
@@ -26,14 +26,14 @@ diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
index 080421b..ea3b806 100644
--- a/tests/libtest/Makefile.inc
+++ b/tests/libtest/Makefile.inc
-@@ -516,6 +516,7 @@ lib1557_LDADD = $(TESTUTIL_LIBS)
- lib1557_CPPFLAGS = $(AM_CPPFLAGS) -DLIB1557
+@@ -521,6 +521,7 @@ lib1558_SOURCES = lib1558.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+ lib1558_LDADD = $(TESTUTIL_LIBS)
lib1560_SOURCES = lib1560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+lib1560_CFLAGS = $(AM_CFLAGS) -fno-builtin-strcmp
lib1560_LDADD = $(TESTUTIL_LIBS)
- lib1900_SOURCES = lib1900.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+ lib1591_SOURCES = lib1591.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
--
2.17.2
diff --git a/curl-7.63.0.tar.xz.asc b/curl-7.63.0.tar.xz.asc
deleted file mode 100644
index 1dd44ac..0000000
--- a/curl-7.63.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlwQtYIACgkQXMkI/bce
-EsKPHgf/RhfKPvl1Q8ftuEOXakF/ZIvINukj49vOMFmfQRHfmGWh5ajaGj0qVF6x
-U5HtrDoFOP5m74tj6jrzr2Ala/HGeyZmiTWwRLMgu+Tvq4djIv2pzZUJpgawJS52
-LCb2DUS2F+E1AsZQYvyliYA+r2FO2RRX1kbwdu+0RyuFy5WmWwkI02VahAIYV48o
-44IqtXshxfSAlfEqQ8MgXtU1KW0SWtfKVP2HpsurugjGyknoXxHP7yoDMgDAkMk0
-fNYyPDZbUXXN+6Oyo4Xh8rz4dpVLBkIoCZb4WG2pFZSrfP2+FTL5/vRo/tUyjFfv
-2LHmDUOOFH3VMwMYlnMCgaaXG7/jtg==
-=TkSP
------END PGP SIGNATURE-----
diff --git a/curl-7.64.0.tar.xz.asc b/curl-7.64.0.tar.xz.asc
new file mode 100644
index 0000000..21f7542
--- /dev/null
+++ b/curl-7.64.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlxahccACgkQXMkI/bce
+EsKdrAf+OoNH+Yz1HfJG5MtmEi2sgRC56iAvZBQujPG8SJYGnT3D2nLiuC2+bzA8
+eMCqisodW5f6lV/9JRvLmLS0dhxAfdf/NHlMOdtgSv+NzVGsggpHeYEZ7HucRHsQ
+AKZ6/wx7rby8yZqrn2s7yWWB0qgiajWx30r+CJEYXpuw+YwZ2qZo5ecM7fa/J9ko
+ESwb7BLF6KMkdSz1wSApwCdznB/BXOaPrUBMiOcwO7ftq/t1ZmqnUWLtdlSp8OoH
+Tw832H1kCP2OFHcOFTQmZJLagRQtLBhC522wNsagXaMwak6uhoFApcAPqoPdm4Pm
+PvTO6aAopZk+sX9VemdSQzx/4ysT3w==
+=HOlc
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index ce957f6..1a410f0 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,22 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.63.0
-Release: 7%{?dist}
+Version: 7.64.0
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# revert an upstream commit that broke `fedpkg new-sources` (#1659329)
-Patch1: 0001-curl-7.62.0-http-post-negotiate.patch
-
-# libtest: avoid symbol lookup error in libstubgss.so
-Patch2: 0002-curl-7.62.0-libtest-stub_gssapi-snprintf.patch
-
-# curl -J: do not append to the destination file (#1658574)
-Patch7: 0007-curl-7.63.0-JO-preserve-local-file.patch
-
-# xattr: strip credentials from any URL that is stored (CVE-2018-20483)
-Patch8: 0008-curl-7.63.0-xattr-strip-credentials-from-any-URL.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -178,10 +166,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
-%patch2 -p1
-%patch7 -p1
-%patch8 -p1
# Fedora patches
%patch101 -p1
@@ -349,6 +333,12 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Feb 06 2019 Kamil Dudka - 7.64.0-1
+- new upstream release, which fixes the following vulnerabilities
+ CVE-2019-3823 - SMTP end-of-response out-of-bounds read
+ CVE-2019-3822 - NTLMv2 type-3 header stack buffer overflow
+ CVE-2018-16890 - NTLM type-2 out-of-bounds buffer read
+
* Mon Feb 04 2019 Kamil Dudka - 7.63.0-7
- prevent valgrind from reporting false positives on x86_64
diff --git a/sources b/sources
index c40ff26..d5662be 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.63.0.tar.xz) = c905eb157c6b0093f1b1a506e4782b83af423fd6de1ce0ab5372164a686ef292ffb10d7999d3dec2de602f63ee41b65e1a1008409dd8c959a597644c0ecb395b
+SHA512 (curl-7.64.0.tar.xz) = 953f1f5336ce5dfd1b9f933624432d401552d91ee02d39ecde6f023c956f99ec6aae8d7746d7c34b6eb2d6452f114e67da4e64d9c8dd90b7644b7844e7b9b423
From 9ace613273f52bce8206116b7ab8fb040f7199a1 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 11 Feb 2019 13:22:07 +0100
Subject: [PATCH 049/256] make zsh completion work again
---
0001-curl-7.64.0-zsh-completion.patch | 76 +++++++++++++++++++++++++++
curl.spec | 9 +++-
2 files changed, 84 insertions(+), 1 deletion(-)
create mode 100644 0001-curl-7.64.0-zsh-completion.patch
diff --git a/0001-curl-7.64.0-zsh-completion.patch b/0001-curl-7.64.0-zsh-completion.patch
new file mode 100644
index 0000000..770a15b
--- /dev/null
+++ b/0001-curl-7.64.0-zsh-completion.patch
@@ -0,0 +1,76 @@
+From 082034e2334b2d0795b2b324ff3e0635bb7d2b86 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini
+Date: Tue, 5 Feb 2019 20:44:14 +0000
+Subject: [PATCH 1/2] zsh.pl: update regex to better match curl -h output
+
+The current regex fails to match '<...>' arguments properly (e.g. those
+with spaces in them), which causes an completion script with wrong
+descriptions for some options.
+
+The problem can be reproduced as follows:
+
+% curl --reso
+
+Upstream-commit: dbd32f3241b297b96ee11a51da1a661f528ca026
+Signed-off-by: Kamil Dudka
+---
+ scripts/zsh.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/zsh.pl b/scripts/zsh.pl
+index 1257190..941b322 100755
+--- a/scripts/zsh.pl
++++ b/scripts/zsh.pl
+@@ -7,7 +7,7 @@ use warnings;
+
+ my $curl = $ARGV[0] || 'curl';
+
+-my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s([^\s.]+)?\s+(.*)';
++my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s*(\<.+?\>)?\s+(.*)';
+ my @opts = parse_main_opts('--help', $regex);
+
+ my $opts_str;
+--
+2.17.2
+
+
+From 45abc785e101346f19599aa5f9fa1617e525ec4d Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini
+Date: Tue, 5 Feb 2019 21:06:26 +0000
+Subject: [PATCH 2/2] zsh.pl: escape ':' character
+
+':' is interpreted as separator by zsh, so if used as part of the argument
+or option's description it needs to be escaped.
+
+The problem can be reproduced as follows:
+
+% curl -E
+
+Bug: https://bugs.debian.org/921452
+
+Upstream-commit: b3cc8017b7364f588365be2b2629c49c142efdb7
+Signed-off-by: Kamil Dudka
+---
+ scripts/zsh.pl | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/scripts/zsh.pl b/scripts/zsh.pl
+index 941b322..0f9cbec 100755
+--- a/scripts/zsh.pl
++++ b/scripts/zsh.pl
+@@ -45,9 +45,12 @@ sub parse_main_opts {
+
+ my $option = '';
+
++ $arg =~ s/\:/\\\:/g if defined $arg;
++
+ $desc =~ s/'/'\\''/g if defined $desc;
+ $desc =~ s/\[/\\\[/g if defined $desc;
+ $desc =~ s/\]/\\\]/g if defined $desc;
++ $desc =~ s/\:/\\\:/g if defined $desc;
+
+ $option .= '{' . trim($short) . ',' if defined $short;
+ $option .= trim($long) if defined $long;
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 1a410f0..3c8279d 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,10 +1,13 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.64.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# make zsh completion work again
+Patch1: 0001-curl-7.64.0-zsh-completion.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -166,6 +169,7 @@ be installed.
%setup -q
# upstream patches
+%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -333,6 +337,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Feb 11 2019 Kamil Dudka - 7.64.0-2
+- make zsh completion work again
+
* Wed Feb 06 2019 Kamil Dudka - 7.64.0-1
- new upstream release, which fixes the following vulnerabilities
CVE-2019-3823 - SMTP end-of-response out-of-bounds read
From 77901fea1dce2a28df17ec8a623709f82d4f307d Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 11 Feb 2019 13:22:07 +0100
Subject: [PATCH 050/256] make zsh completion work again
---
0013-curl-7.61.1-zsh-completion.patch | 76 +++++++++++++++++++++++++++
curl.spec | 9 +++-
2 files changed, 84 insertions(+), 1 deletion(-)
create mode 100644 0013-curl-7.61.1-zsh-completion.patch
diff --git a/0013-curl-7.61.1-zsh-completion.patch b/0013-curl-7.61.1-zsh-completion.patch
new file mode 100644
index 0000000..770a15b
--- /dev/null
+++ b/0013-curl-7.61.1-zsh-completion.patch
@@ -0,0 +1,76 @@
+From 082034e2334b2d0795b2b324ff3e0635bb7d2b86 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini
+Date: Tue, 5 Feb 2019 20:44:14 +0000
+Subject: [PATCH 1/2] zsh.pl: update regex to better match curl -h output
+
+The current regex fails to match '<...>' arguments properly (e.g. those
+with spaces in them), which causes an completion script with wrong
+descriptions for some options.
+
+The problem can be reproduced as follows:
+
+% curl --reso
+
+Upstream-commit: dbd32f3241b297b96ee11a51da1a661f528ca026
+Signed-off-by: Kamil Dudka
+---
+ scripts/zsh.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/zsh.pl b/scripts/zsh.pl
+index 1257190..941b322 100755
+--- a/scripts/zsh.pl
++++ b/scripts/zsh.pl
+@@ -7,7 +7,7 @@ use warnings;
+
+ my $curl = $ARGV[0] || 'curl';
+
+-my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s([^\s.]+)?\s+(.*)';
++my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s*(\<.+?\>)?\s+(.*)';
+ my @opts = parse_main_opts('--help', $regex);
+
+ my $opts_str;
+--
+2.17.2
+
+
+From 45abc785e101346f19599aa5f9fa1617e525ec4d Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini
+Date: Tue, 5 Feb 2019 21:06:26 +0000
+Subject: [PATCH 2/2] zsh.pl: escape ':' character
+
+':' is interpreted as separator by zsh, so if used as part of the argument
+or option's description it needs to be escaped.
+
+The problem can be reproduced as follows:
+
+% curl -E
+
+Bug: https://bugs.debian.org/921452
+
+Upstream-commit: b3cc8017b7364f588365be2b2629c49c142efdb7
+Signed-off-by: Kamil Dudka
+---
+ scripts/zsh.pl | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/scripts/zsh.pl b/scripts/zsh.pl
+index 941b322..0f9cbec 100755
+--- a/scripts/zsh.pl
++++ b/scripts/zsh.pl
+@@ -45,9 +45,12 @@ sub parse_main_opts {
+
+ my $option = '';
+
++ $arg =~ s/\:/\\\:/g if defined $arg;
++
+ $desc =~ s/'/'\\''/g if defined $desc;
+ $desc =~ s/\[/\\\[/g if defined $desc;
+ $desc =~ s/\]/\\\]/g if defined $desc;
++ $desc =~ s/\:/\\\:/g if defined $desc;
+
+ $option .= '{' . trim($short) . ',' if defined $short;
+ $option .= trim($long) if defined $long;
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 337ec68..ad34021 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.59.0
-Release: 9%{?dist}
+Release: 10%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -43,6 +43,9 @@ Patch11: 0011-curl-7.59.0-CVE-2018-16840.patch
# SASL password overflow via integer overflow (CVE-2018-16839)
Patch12: 0012-curl-7.59.0-CVE-2018-16839.patch
+# make zsh completion work again
+Patch13: 0013-curl-7.61.1-zsh-completion.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -206,6 +209,7 @@ git init
git apply %{PATCH10}
%patch11 -p1
%patch12 -p1
+%patch13 -p1
# Fedora patches
%patch101 -p1
@@ -352,6 +356,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Feb 11 2019 Kamil Dudka - 7.61.1-10
+- make zsh completion work again
+
* Thu Nov 15 2018 Kamil Dudka - 7.59.0-9
- make the patch for CVE-2018-16842 apply properly (CVE-2018-16842)
From e97fdf9b7f8dfd53c0604b87a8be9678ca548434 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 25 Feb 2019 14:24:32 +0100
Subject: [PATCH 051/256] Resolves: #1680198 - prevent NetworkManager from
leaking file descriptors
---
0002-curl-7.64.0-nm-fd-leak.patch | 162 ++++++++++++++++++++++++++++++
curl.spec | 9 +-
2 files changed, 170 insertions(+), 1 deletion(-)
create mode 100644 0002-curl-7.64.0-nm-fd-leak.patch
diff --git a/0002-curl-7.64.0-nm-fd-leak.patch b/0002-curl-7.64.0-nm-fd-leak.patch
new file mode 100644
index 0000000..681e58f
--- /dev/null
+++ b/0002-curl-7.64.0-nm-fd-leak.patch
@@ -0,0 +1,162 @@
+From 377101f138873bfa481785cb7d04c326006f0b5d Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Mon, 11 Feb 2019 07:56:00 +0100
+Subject: [PATCH 1/3] connection_check: set ->data to the transfer doing the
+ check
+
+The http2 code for connection checking needs a transfer to use. Make
+sure a working one is set before handler->connection_check() is called.
+
+Reported-by: jnbr on github
+Fixes #3541
+Closes #3547
+
+Upstream-commit: 38d8e1bd4ed1ae52930ae466ecbac78e888b142f
+Signed-off-by: Kamil Dudka
+---
+ lib/url.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/url.c b/lib/url.c
+index d5a9820..229c655 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -965,6 +965,7 @@ static bool extract_if_dead(struct connectdata *conn,
+ /* The protocol has a special method for checking the state of the
+ connection. Use it to check if the connection is dead. */
+ unsigned int state;
++ conn->data = data; /* use this transfer for now */
+ state = conn->handler->connection_check(conn, CONNCHECK_ISDEAD);
+ dead = (state & CONNRESULT_DEAD);
+ }
+--
+2.17.2
+
+
+From 287f5d70395b3833f8901a57b29a48b87d84a9fe Mon Sep 17 00:00:00 2001
+From: Jay Satiro
+Date: Mon, 11 Feb 2019 23:00:00 -0500
+Subject: [PATCH 2/3] connection_check: restore original conn->data after the
+ check
+
+- Save the original conn->data before it's changed to the specified
+ data transfer for the connection check and then restore it afterwards.
+
+This is a follow-up to 38d8e1b 2019-02-11.
+
+History:
+
+It was discovered a month ago that before checking whether to extract a
+dead connection that that connection should be associated with a "live"
+transfer for the check (ie original conn->data ignored and set to the
+passed in data). A fix was landed in 54b201b which did that and also
+cleared conn->data after the check. The original conn->data was not
+restored, so presumably it was thought that a valid conn->data was no
+longer needed.
+
+Several days later it was discovered that a valid conn->data was needed
+after the check and follow-up fix was landed in bbae24c which partially
+reverted the original fix and attempted to limit the scope of when
+conn->data was changed to only when pruning dead connections. In that
+case conn->data was not cleared and the original conn->data not
+restored.
+
+A month later it was discovered that the original fix was somewhat
+correct; a "live" transfer is needed for the check in all cases
+because original conn->data could be null which could cause a bad deref
+at arbitrary points in the check. A fix was landed in 38d8e1b which
+expanded the scope to all cases. conn->data was not cleared and the
+original conn->data not restored.
+
+A day later it was discovered that not restoring the original conn->data
+may lead to busy loops in applications that use the event interface, and
+given this observation it's a pretty safe assumption that there is some
+code path that still needs the original conn->data. This commit is the
+follow-up fix for that, it restores the original conn->data after the
+connection check.
+
+Assisted-by: tholin@users.noreply.github.com
+Reported-by: tholin@users.noreply.github.com
+
+Fixes https://github.com/curl/curl/issues/3542
+Closes #3559
+
+Upstream-commit: 4015fae044ce52a639c9358e22a9e948f287c89f
+Signed-off-by: Kamil Dudka
+---
+ lib/url.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/lib/url.c b/lib/url.c
+index 229c655..a77e92d 100644
+--- a/lib/url.c
++++ b/lib/url.c
+@@ -965,8 +965,10 @@ static bool extract_if_dead(struct connectdata *conn,
+ /* The protocol has a special method for checking the state of the
+ connection. Use it to check if the connection is dead. */
+ unsigned int state;
++ struct Curl_easy *olddata = conn->data;
+ conn->data = data; /* use this transfer for now */
+ state = conn->handler->connection_check(conn, CONNCHECK_ISDEAD);
++ conn->data = olddata;
+ dead = (state & CONNRESULT_DEAD);
+ }
+ else {
+@@ -995,7 +997,6 @@ struct prunedead {
+ static int call_extract_if_dead(struct connectdata *conn, void *param)
+ {
+ struct prunedead *p = (struct prunedead *)param;
+- conn->data = p->data; /* transfer to use for this check */
+ if(extract_if_dead(conn, p->data)) {
+ /* stop the iteration here, pass back the connection that was extracted */
+ p->extracted = conn;
+--
+2.17.2
+
+
+From 15e3f2eef87bff1210f43921cb15f03c68be59f7 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Tue, 19 Feb 2019 15:56:54 +0100
+Subject: [PATCH 3/3] singlesocket: fix the 'sincebefore' placement
+
+The variable wasn't properly reset within the loop and thus could remain
+set for sockets that hadn't been set before and miss notifying the app.
+
+This is a follow-up to 4c35574 (shipped in curl 7.64.0)
+
+Reported-by: buzo-ffm on github
+Detected-by: Jan Alexander Steffens
+Fixes #3585
+Closes #3589
+
+Upstream-commit: afc00e047c773faeaa60a5f86a246cbbeeba5819
+Signed-off-by: Kamil Dudka
+---
+ lib/multi.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/multi.c b/lib/multi.c
+index 130226f..28f4c47 100644
+--- a/lib/multi.c
++++ b/lib/multi.c
+@@ -2360,8 +2360,6 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
+ int num;
+ unsigned int curraction;
+ int actions[MAX_SOCKSPEREASYHANDLE];
+- unsigned int comboaction;
+- bool sincebefore = FALSE;
+
+ for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++)
+ socks[i] = CURL_SOCKET_BAD;
+@@ -2380,6 +2378,8 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
+ i++) {
+ unsigned int action = CURL_POLL_NONE;
+ unsigned int prevaction = 0;
++ unsigned int comboaction;
++ bool sincebefore = FALSE;
+
+ s = socks[i];
+
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 3c8279d..834c964 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.64.0
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# make zsh completion work again
Patch1: 0001-curl-7.64.0-zsh-completion.patch
+# prevent NetworkManager from leaking file descriptors (#1680198)
+Patch2: 0002-curl-7.64.0-nm-fd-leak.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -170,6 +173,7 @@ be installed.
# upstream patches
%patch1 -p1
+%patch2 -p1
# Fedora patches
%patch101 -p1
@@ -337,6 +341,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Feb 25 2019 Kamil Dudka - 7.64.0-3
+- prevent NetworkManager from leaking file descriptors (#1680198)
+
* Mon Feb 11 2019 Kamil Dudka - 7.64.0-2
- make zsh completion work again
From 95008127cf8cce13fd350840dfd31372ab85b48f Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 27 Feb 2019 18:02:05 +0100
Subject: [PATCH 052/256] Resolves: #1683676 - fix NULL dereference if flushing
cookies with no CookieInfo set
---
0003-curl-7.64.0-cookie-segfault.patch | 42 ++++++++++++++++++++++++++
curl.spec | 9 +++++-
2 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 0003-curl-7.64.0-cookie-segfault.patch
diff --git a/0003-curl-7.64.0-cookie-segfault.patch b/0003-curl-7.64.0-cookie-segfault.patch
new file mode 100644
index 0000000..9539efa
--- /dev/null
+++ b/0003-curl-7.64.0-cookie-segfault.patch
@@ -0,0 +1,42 @@
+From d73dc8d3e70bde0ef999ecf7bcd5585b9892371c Mon Sep 17 00:00:00 2001
+From: Michael Wallner
+Date: Mon, 25 Feb 2019 19:05:02 +0100
+Subject: [PATCH] cookies: fix NULL dereference if flushing cookies with no
+ CookieInfo set
+
+Regression brought by a52e46f3900fb0 (shipped in 7.63.0)
+
+Closes #3613
+
+Upstream-commit: 8eddb8f4259193633cfc95a42603958a89b31de5
+Signed-off-by: Kamil Dudka
+---
+ lib/cookie.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/lib/cookie.c b/lib/cookie.c
+index 4fb992a..d535170 100644
+--- a/lib/cookie.c
++++ b/lib/cookie.c
+@@ -1504,7 +1504,8 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
+ struct Cookie **array;
+
+ /* at first, remove expired cookies */
+- remove_expired(c);
++ if(c)
++ remove_expired(c);
+
+ if(!strcmp("-", dumphere)) {
+ /* use stdout */
+@@ -1523,7 +1524,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
+ "# This file was generated by libcurl! Edit at your own risk.\n\n",
+ out);
+
+- if(c->numcookies) {
++ if(c && c->numcookies) {
+ array = malloc(sizeof(struct Cookie *) * c->numcookies);
+ if(!array) {
+ if(!use_stdout)
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index 834c964..a8292a6 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.64.0
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -11,6 +11,9 @@ Patch1: 0001-curl-7.64.0-zsh-completion.patch
# prevent NetworkManager from leaking file descriptors (#1680198)
Patch2: 0002-curl-7.64.0-nm-fd-leak.patch
+# fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
+Patch3: 0003-curl-7.64.0-cookie-segfault.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -174,6 +177,7 @@ be installed.
# upstream patches
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# Fedora patches
%patch101 -p1
@@ -341,6 +345,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Feb 27 2019 Kamil Dudka - 7.64.0-4
+- fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
+
* Mon Feb 25 2019 Kamil Dudka - 7.64.0-3
- prevent NetworkManager from leaking file descriptors (#1680198)
From 902ddefeb533ae02d3588bb99d78fb178999da22 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 21 Mar 2019 09:38:52 +0100
Subject: [PATCH 053/256] avoid spurious "Could not resolve host: [host name]"
error messages
---
...-curl-7.64.0-spurious-resolver-error.patch | 118 ++++++++++++++++++
curl.spec | 9 +-
2 files changed, 126 insertions(+), 1 deletion(-)
create mode 100644 0004-curl-7.64.0-spurious-resolver-error.patch
diff --git a/0004-curl-7.64.0-spurious-resolver-error.patch b/0004-curl-7.64.0-spurious-resolver-error.patch
new file mode 100644
index 0000000..3e05ad5
--- /dev/null
+++ b/0004-curl-7.64.0-spurious-resolver-error.patch
@@ -0,0 +1,118 @@
+From 5ddabe85b2e3e4fd08d06980719d71a2aed77a5b Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Thu, 28 Feb 2019 20:34:36 +0100
+Subject: [PATCH] threaded-resolver: shutdown the resolver thread without error
+ message
+
+When a transfer is done, the resolver thread will be brought down. That
+could accidentally generate an error message in the error buffer even
+though this is not an error situationand the transfer would still return
+OK. An application that still reads the error buffer could find a
+"Could not resolve host: [host name]" message there and get confused.
+
+Reported-by: Michael Schmid
+Fixes #3629
+Closes #3630
+
+Upstream-commit: 754ae103989a6ad0869d23a6a427d652b5b4a2fe
+Signed-off-by: Kamil Dudka
+---
+ lib/asyn-thread.c | 68 ++++++++++++++++++++++++++---------------------
+ 1 file changed, 38 insertions(+), 30 deletions(-)
+
+diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
+index a9679d0..55e0811 100644
+--- a/lib/asyn-thread.c
++++ b/lib/asyn-thread.c
+@@ -461,6 +461,42 @@ static CURLcode resolver_error(struct connectdata *conn)
+ return result;
+ }
+
++static CURLcode thread_wait_resolv(struct connectdata *conn,
++ struct Curl_dns_entry **entry,
++ bool report)
++{
++ struct thread_data *td = (struct thread_data*) conn->async.os_specific;
++ CURLcode result = CURLE_OK;
++
++ DEBUGASSERT(conn && td);
++ DEBUGASSERT(td->thread_hnd != curl_thread_t_null);
++
++ /* wait for the thread to resolve the name */
++ if(Curl_thread_join(&td->thread_hnd)) {
++ if(entry)
++ result = getaddrinfo_complete(conn);
++ }
++ else
++ DEBUGASSERT(0);
++
++ conn->async.done = TRUE;
++
++ if(entry)
++ *entry = conn->async.dns;
++
++ if(!conn->async.dns && report)
++ /* a name was not resolved, report error */
++ result = resolver_error(conn);
++
++ destroy_async_data(&conn->async);
++
++ if(!conn->async.dns && report)
++ connclose(conn, "asynch resolve failed");
++
++ return result;
++}
++
++
+ /*
+ * Until we gain a way to signal the resolver threads to stop early, we must
+ * simply wait for them and ignore their results.
+@@ -473,7 +509,7 @@ void Curl_resolver_kill(struct connectdata *conn)
+ unfortunately. Otherwise, we can simply cancel to clean up any resolver
+ data. */
+ if(td && td->thread_hnd != curl_thread_t_null)
+- (void)Curl_resolver_wait_resolv(conn, NULL);
++ (void)thread_wait_resolv(conn, NULL, FALSE);
+ else
+ Curl_resolver_cancel(conn);
+ }
+@@ -494,35 +530,7 @@ void Curl_resolver_kill(struct connectdata *conn)
+ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
+ struct Curl_dns_entry **entry)
+ {
+- struct thread_data *td = (struct thread_data*) conn->async.os_specific;
+- CURLcode result = CURLE_OK;
+-
+- DEBUGASSERT(conn && td);
+- DEBUGASSERT(td->thread_hnd != curl_thread_t_null);
+-
+- /* wait for the thread to resolve the name */
+- if(Curl_thread_join(&td->thread_hnd)) {
+- if(entry)
+- result = getaddrinfo_complete(conn);
+- }
+- else
+- DEBUGASSERT(0);
+-
+- conn->async.done = TRUE;
+-
+- if(entry)
+- *entry = conn->async.dns;
+-
+- if(!conn->async.dns)
+- /* a name was not resolved, report error */
+- result = resolver_error(conn);
+-
+- destroy_async_data(&conn->async);
+-
+- if(!conn->async.dns)
+- connclose(conn, "asynch resolve failed");
+-
+- return result;
++ return thread_wait_resolv(conn, entry, TRUE);
+ }
+
+ /*
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index a8292a6..bed6823 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.64.0
-Release: 4%{?dist}
+Release: 5%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -14,6 +14,9 @@ Patch2: 0002-curl-7.64.0-nm-fd-leak.patch
# fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
Patch3: 0003-curl-7.64.0-cookie-segfault.patch
+# avoid spurious "Could not resolve host: [host name]" error messages
+Patch4: 0004-curl-7.64.0-spurious-resolver-error.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -178,6 +181,7 @@ be installed.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
# Fedora patches
%patch101 -p1
@@ -345,6 +349,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Mar 21 2019 Kamil Dudka - 7.64.0-5
+- avoid spurious "Could not resolve host: [host name]" error messages
+
* Wed Feb 27 2019 Kamil Dudka - 7.64.0-4
- fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
From 7594f15bcee986a1946575804b33fabc35d43792 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 25 Mar 2019 12:35:52 +0100
Subject: [PATCH 054/256] Related: #1690971 - remove verbose "Expire in" ...
messages
---
0005-curl-7.64.0-expire-in-verbose-msgs.patch | 32 +++++++++++++++++++
curl.spec | 9 +++++-
2 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 0005-curl-7.64.0-expire-in-verbose-msgs.patch
diff --git a/0005-curl-7.64.0-expire-in-verbose-msgs.patch b/0005-curl-7.64.0-expire-in-verbose-msgs.patch
new file mode 100644
index 0000000..43d3573
--- /dev/null
+++ b/0005-curl-7.64.0-expire-in-verbose-msgs.patch
@@ -0,0 +1,32 @@
+From 2e8f4d01cdd07779e0582257cb6b53c5a91d6504 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Mon, 11 Feb 2019 22:57:33 +0100
+Subject: [PATCH] multi: remove verbose "Expire in" ... messages
+
+Reported-by: James Brown
+Bug: https://curl.haxx.se/mail/archive-2019-02/0013.html
+Closes #3558
+
+Upstream-commit: aabc7ae5ecf70973add429b5acbc86d6a57e4da5
+Signed-off-by: Kamil Dudka
+---
+ lib/multi.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/lib/multi.c b/lib/multi.c
+index 28f4c47..856cc22 100644
+--- a/lib/multi.c
++++ b/lib/multi.c
+@@ -3028,9 +3028,6 @@ void Curl_expire(struct Curl_easy *data, time_t milli, expire_id id)
+
+ DEBUGASSERT(id < EXPIRE_LAST);
+
+- infof(data, "Expire in %ld ms for %x (transfer %p)\n",
+- (long)milli, id, data);
+-
+ set = Curl_now();
+ set.tv_sec += milli/1000;
+ set.tv_usec += (unsigned int)(milli%1000)*1000;
+--
+2.17.2
+
diff --git a/curl.spec b/curl.spec
index bed6823..d504c23 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.64.0
-Release: 5%{?dist}
+Release: 6%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -17,6 +17,9 @@ Patch3: 0003-curl-7.64.0-cookie-segfault.patch
# avoid spurious "Could not resolve host: [host name]" error messages
Patch4: 0004-curl-7.64.0-spurious-resolver-error.patch
+# remove verbose "Expire in" ... messages (#1690971)
+Patch5: 0005-curl-7.64.0-expire-in-verbose-msgs.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -182,6 +185,7 @@ be installed.
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
# Fedora patches
%patch101 -p1
@@ -349,6 +353,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Mon Mar 25 2019 Kamil Dudka - 7.64.0-6
+- remove verbose "Expire in" ... messages (#1690971)
+
* Wed Mar 21 2019 Kamil Dudka - 7.64.0-5
- avoid spurious "Could not resolve host: [host name]" error messages
From 0ed971f14f1e1a245d738142d3cd2b3489bc1008 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Mon, 25 Mar 2019 12:39:00 +0100
Subject: [PATCH 055/256] fix last but one change log entry
---
curl.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index d504c23..6cf125f 100644
--- a/curl.spec
+++ b/curl.spec
@@ -356,7 +356,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
* Mon Mar 25 2019 Kamil Dudka - 7.64.0-6
- remove verbose "Expire in" ... messages (#1690971)
-* Wed Mar 21 2019 Kamil Dudka - 7.64.0-5
+* Thu Mar 21 2019 Kamil Dudka - 7.64.0-5
- avoid spurious "Could not resolve host: [host name]" error messages
* Wed Feb 27 2019 Kamil Dudka - 7.64.0-4
From bbad3e0a620be7f54fd5e9af7570cab24a6a233d Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 27 Mar 2019 10:33:41 +0100
Subject: [PATCH 056/256] new upstream release - 7.64.1
---
0001-curl-7.64.0-zsh-completion.patch | 76 --------
0002-curl-7.64.0-nm-fd-leak.patch | 162 ------------------
0003-curl-7.64.0-cookie-segfault.patch | 42 -----
...-curl-7.64.0-spurious-resolver-error.patch | 118 -------------
0005-curl-7.64.0-expire-in-verbose-msgs.patch | 32 ----
0102-curl-7.36.0-debug.patch | 2 +-
0104-curl-7.19.7-localhost6.patch | 4 +-
0105-curl-7.63.0-lib1560-valgrind.patch | 2 +-
curl-7.64.0.tar.xz.asc | 11 --
curl-7.64.1.tar.xz.asc | 11 ++
curl.spec | 45 ++---
sources | 2 +-
12 files changed, 34 insertions(+), 473 deletions(-)
delete mode 100644 0001-curl-7.64.0-zsh-completion.patch
delete mode 100644 0002-curl-7.64.0-nm-fd-leak.patch
delete mode 100644 0003-curl-7.64.0-cookie-segfault.patch
delete mode 100644 0004-curl-7.64.0-spurious-resolver-error.patch
delete mode 100644 0005-curl-7.64.0-expire-in-verbose-msgs.patch
delete mode 100644 curl-7.64.0.tar.xz.asc
create mode 100644 curl-7.64.1.tar.xz.asc
diff --git a/0001-curl-7.64.0-zsh-completion.patch b/0001-curl-7.64.0-zsh-completion.patch
deleted file mode 100644
index 770a15b..0000000
--- a/0001-curl-7.64.0-zsh-completion.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From 082034e2334b2d0795b2b324ff3e0635bb7d2b86 Mon Sep 17 00:00:00 2001
-From: Alessandro Ghedini
-Date: Tue, 5 Feb 2019 20:44:14 +0000
-Subject: [PATCH 1/2] zsh.pl: update regex to better match curl -h output
-
-The current regex fails to match '<...>' arguments properly (e.g. those
-with spaces in them), which causes an completion script with wrong
-descriptions for some options.
-
-The problem can be reproduced as follows:
-
-% curl --reso
-
-Upstream-commit: dbd32f3241b297b96ee11a51da1a661f528ca026
-Signed-off-by: Kamil Dudka
----
- scripts/zsh.pl | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/scripts/zsh.pl b/scripts/zsh.pl
-index 1257190..941b322 100755
---- a/scripts/zsh.pl
-+++ b/scripts/zsh.pl
-@@ -7,7 +7,7 @@ use warnings;
-
- my $curl = $ARGV[0] || 'curl';
-
--my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s([^\s.]+)?\s+(.*)';
-+my $regex = '\s+(?:(-[^\s]+),\s)?(--[^\s]+)\s*(\<.+?\>)?\s+(.*)';
- my @opts = parse_main_opts('--help', $regex);
-
- my $opts_str;
---
-2.17.2
-
-
-From 45abc785e101346f19599aa5f9fa1617e525ec4d Mon Sep 17 00:00:00 2001
-From: Alessandro Ghedini
-Date: Tue, 5 Feb 2019 21:06:26 +0000
-Subject: [PATCH 2/2] zsh.pl: escape ':' character
-
-':' is interpreted as separator by zsh, so if used as part of the argument
-or option's description it needs to be escaped.
-
-The problem can be reproduced as follows:
-
-% curl -E
-
-Bug: https://bugs.debian.org/921452
-
-Upstream-commit: b3cc8017b7364f588365be2b2629c49c142efdb7
-Signed-off-by: Kamil Dudka
----
- scripts/zsh.pl | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/scripts/zsh.pl b/scripts/zsh.pl
-index 941b322..0f9cbec 100755
---- a/scripts/zsh.pl
-+++ b/scripts/zsh.pl
-@@ -45,9 +45,12 @@ sub parse_main_opts {
-
- my $option = '';
-
-+ $arg =~ s/\:/\\\:/g if defined $arg;
-+
- $desc =~ s/'/'\\''/g if defined $desc;
- $desc =~ s/\[/\\\[/g if defined $desc;
- $desc =~ s/\]/\\\]/g if defined $desc;
-+ $desc =~ s/\:/\\\:/g if defined $desc;
-
- $option .= '{' . trim($short) . ',' if defined $short;
- $option .= trim($long) if defined $long;
---
-2.17.2
-
diff --git a/0002-curl-7.64.0-nm-fd-leak.patch b/0002-curl-7.64.0-nm-fd-leak.patch
deleted file mode 100644
index 681e58f..0000000
--- a/0002-curl-7.64.0-nm-fd-leak.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-From 377101f138873bfa481785cb7d04c326006f0b5d Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Mon, 11 Feb 2019 07:56:00 +0100
-Subject: [PATCH 1/3] connection_check: set ->data to the transfer doing the
- check
-
-The http2 code for connection checking needs a transfer to use. Make
-sure a working one is set before handler->connection_check() is called.
-
-Reported-by: jnbr on github
-Fixes #3541
-Closes #3547
-
-Upstream-commit: 38d8e1bd4ed1ae52930ae466ecbac78e888b142f
-Signed-off-by: Kamil Dudka
----
- lib/url.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/lib/url.c b/lib/url.c
-index d5a9820..229c655 100644
---- a/lib/url.c
-+++ b/lib/url.c
-@@ -965,6 +965,7 @@ static bool extract_if_dead(struct connectdata *conn,
- /* The protocol has a special method for checking the state of the
- connection. Use it to check if the connection is dead. */
- unsigned int state;
-+ conn->data = data; /* use this transfer for now */
- state = conn->handler->connection_check(conn, CONNCHECK_ISDEAD);
- dead = (state & CONNRESULT_DEAD);
- }
---
-2.17.2
-
-
-From 287f5d70395b3833f8901a57b29a48b87d84a9fe Mon Sep 17 00:00:00 2001
-From: Jay Satiro
-Date: Mon, 11 Feb 2019 23:00:00 -0500
-Subject: [PATCH 2/3] connection_check: restore original conn->data after the
- check
-
-- Save the original conn->data before it's changed to the specified
- data transfer for the connection check and then restore it afterwards.
-
-This is a follow-up to 38d8e1b 2019-02-11.
-
-History:
-
-It was discovered a month ago that before checking whether to extract a
-dead connection that that connection should be associated with a "live"
-transfer for the check (ie original conn->data ignored and set to the
-passed in data). A fix was landed in 54b201b which did that and also
-cleared conn->data after the check. The original conn->data was not
-restored, so presumably it was thought that a valid conn->data was no
-longer needed.
-
-Several days later it was discovered that a valid conn->data was needed
-after the check and follow-up fix was landed in bbae24c which partially
-reverted the original fix and attempted to limit the scope of when
-conn->data was changed to only when pruning dead connections. In that
-case conn->data was not cleared and the original conn->data not
-restored.
-
-A month later it was discovered that the original fix was somewhat
-correct; a "live" transfer is needed for the check in all cases
-because original conn->data could be null which could cause a bad deref
-at arbitrary points in the check. A fix was landed in 38d8e1b which
-expanded the scope to all cases. conn->data was not cleared and the
-original conn->data not restored.
-
-A day later it was discovered that not restoring the original conn->data
-may lead to busy loops in applications that use the event interface, and
-given this observation it's a pretty safe assumption that there is some
-code path that still needs the original conn->data. This commit is the
-follow-up fix for that, it restores the original conn->data after the
-connection check.
-
-Assisted-by: tholin@users.noreply.github.com
-Reported-by: tholin@users.noreply.github.com
-
-Fixes https://github.com/curl/curl/issues/3542
-Closes #3559
-
-Upstream-commit: 4015fae044ce52a639c9358e22a9e948f287c89f
-Signed-off-by: Kamil Dudka
----
- lib/url.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/lib/url.c b/lib/url.c
-index 229c655..a77e92d 100644
---- a/lib/url.c
-+++ b/lib/url.c
-@@ -965,8 +965,10 @@ static bool extract_if_dead(struct connectdata *conn,
- /* The protocol has a special method for checking the state of the
- connection. Use it to check if the connection is dead. */
- unsigned int state;
-+ struct Curl_easy *olddata = conn->data;
- conn->data = data; /* use this transfer for now */
- state = conn->handler->connection_check(conn, CONNCHECK_ISDEAD);
-+ conn->data = olddata;
- dead = (state & CONNRESULT_DEAD);
- }
- else {
-@@ -995,7 +997,6 @@ struct prunedead {
- static int call_extract_if_dead(struct connectdata *conn, void *param)
- {
- struct prunedead *p = (struct prunedead *)param;
-- conn->data = p->data; /* transfer to use for this check */
- if(extract_if_dead(conn, p->data)) {
- /* stop the iteration here, pass back the connection that was extracted */
- p->extracted = conn;
---
-2.17.2
-
-
-From 15e3f2eef87bff1210f43921cb15f03c68be59f7 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Tue, 19 Feb 2019 15:56:54 +0100
-Subject: [PATCH 3/3] singlesocket: fix the 'sincebefore' placement
-
-The variable wasn't properly reset within the loop and thus could remain
-set for sockets that hadn't been set before and miss notifying the app.
-
-This is a follow-up to 4c35574 (shipped in curl 7.64.0)
-
-Reported-by: buzo-ffm on github
-Detected-by: Jan Alexander Steffens
-Fixes #3585
-Closes #3589
-
-Upstream-commit: afc00e047c773faeaa60a5f86a246cbbeeba5819
-Signed-off-by: Kamil Dudka
----
- lib/multi.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/lib/multi.c b/lib/multi.c
-index 130226f..28f4c47 100644
---- a/lib/multi.c
-+++ b/lib/multi.c
-@@ -2360,8 +2360,6 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
- int num;
- unsigned int curraction;
- int actions[MAX_SOCKSPEREASYHANDLE];
-- unsigned int comboaction;
-- bool sincebefore = FALSE;
-
- for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++)
- socks[i] = CURL_SOCKET_BAD;
-@@ -2380,6 +2378,8 @@ static CURLMcode singlesocket(struct Curl_multi *multi,
- i++) {
- unsigned int action = CURL_POLL_NONE;
- unsigned int prevaction = 0;
-+ unsigned int comboaction;
-+ bool sincebefore = FALSE;
-
- s = socks[i];
-
---
-2.17.2
-
diff --git a/0003-curl-7.64.0-cookie-segfault.patch b/0003-curl-7.64.0-cookie-segfault.patch
deleted file mode 100644
index 9539efa..0000000
--- a/0003-curl-7.64.0-cookie-segfault.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From d73dc8d3e70bde0ef999ecf7bcd5585b9892371c Mon Sep 17 00:00:00 2001
-From: Michael Wallner
-Date: Mon, 25 Feb 2019 19:05:02 +0100
-Subject: [PATCH] cookies: fix NULL dereference if flushing cookies with no
- CookieInfo set
-
-Regression brought by a52e46f3900fb0 (shipped in 7.63.0)
-
-Closes #3613
-
-Upstream-commit: 8eddb8f4259193633cfc95a42603958a89b31de5
-Signed-off-by: Kamil Dudka
----
- lib/cookie.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/lib/cookie.c b/lib/cookie.c
-index 4fb992a..d535170 100644
---- a/lib/cookie.c
-+++ b/lib/cookie.c
-@@ -1504,7 +1504,8 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
- struct Cookie **array;
-
- /* at first, remove expired cookies */
-- remove_expired(c);
-+ if(c)
-+ remove_expired(c);
-
- if(!strcmp("-", dumphere)) {
- /* use stdout */
-@@ -1523,7 +1524,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
- "# This file was generated by libcurl! Edit at your own risk.\n\n",
- out);
-
-- if(c->numcookies) {
-+ if(c && c->numcookies) {
- array = malloc(sizeof(struct Cookie *) * c->numcookies);
- if(!array) {
- if(!use_stdout)
---
-2.17.2
-
diff --git a/0004-curl-7.64.0-spurious-resolver-error.patch b/0004-curl-7.64.0-spurious-resolver-error.patch
deleted file mode 100644
index 3e05ad5..0000000
--- a/0004-curl-7.64.0-spurious-resolver-error.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From 5ddabe85b2e3e4fd08d06980719d71a2aed77a5b Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Thu, 28 Feb 2019 20:34:36 +0100
-Subject: [PATCH] threaded-resolver: shutdown the resolver thread without error
- message
-
-When a transfer is done, the resolver thread will be brought down. That
-could accidentally generate an error message in the error buffer even
-though this is not an error situationand the transfer would still return
-OK. An application that still reads the error buffer could find a
-"Could not resolve host: [host name]" message there and get confused.
-
-Reported-by: Michael Schmid
-Fixes #3629
-Closes #3630
-
-Upstream-commit: 754ae103989a6ad0869d23a6a427d652b5b4a2fe
-Signed-off-by: Kamil Dudka
----
- lib/asyn-thread.c | 68 ++++++++++++++++++++++++++---------------------
- 1 file changed, 38 insertions(+), 30 deletions(-)
-
-diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
-index a9679d0..55e0811 100644
---- a/lib/asyn-thread.c
-+++ b/lib/asyn-thread.c
-@@ -461,6 +461,42 @@ static CURLcode resolver_error(struct connectdata *conn)
- return result;
- }
-
-+static CURLcode thread_wait_resolv(struct connectdata *conn,
-+ struct Curl_dns_entry **entry,
-+ bool report)
-+{
-+ struct thread_data *td = (struct thread_data*) conn->async.os_specific;
-+ CURLcode result = CURLE_OK;
-+
-+ DEBUGASSERT(conn && td);
-+ DEBUGASSERT(td->thread_hnd != curl_thread_t_null);
-+
-+ /* wait for the thread to resolve the name */
-+ if(Curl_thread_join(&td->thread_hnd)) {
-+ if(entry)
-+ result = getaddrinfo_complete(conn);
-+ }
-+ else
-+ DEBUGASSERT(0);
-+
-+ conn->async.done = TRUE;
-+
-+ if(entry)
-+ *entry = conn->async.dns;
-+
-+ if(!conn->async.dns && report)
-+ /* a name was not resolved, report error */
-+ result = resolver_error(conn);
-+
-+ destroy_async_data(&conn->async);
-+
-+ if(!conn->async.dns && report)
-+ connclose(conn, "asynch resolve failed");
-+
-+ return result;
-+}
-+
-+
- /*
- * Until we gain a way to signal the resolver threads to stop early, we must
- * simply wait for them and ignore their results.
-@@ -473,7 +509,7 @@ void Curl_resolver_kill(struct connectdata *conn)
- unfortunately. Otherwise, we can simply cancel to clean up any resolver
- data. */
- if(td && td->thread_hnd != curl_thread_t_null)
-- (void)Curl_resolver_wait_resolv(conn, NULL);
-+ (void)thread_wait_resolv(conn, NULL, FALSE);
- else
- Curl_resolver_cancel(conn);
- }
-@@ -494,35 +530,7 @@ void Curl_resolver_kill(struct connectdata *conn)
- CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
- struct Curl_dns_entry **entry)
- {
-- struct thread_data *td = (struct thread_data*) conn->async.os_specific;
-- CURLcode result = CURLE_OK;
--
-- DEBUGASSERT(conn && td);
-- DEBUGASSERT(td->thread_hnd != curl_thread_t_null);
--
-- /* wait for the thread to resolve the name */
-- if(Curl_thread_join(&td->thread_hnd)) {
-- if(entry)
-- result = getaddrinfo_complete(conn);
-- }
-- else
-- DEBUGASSERT(0);
--
-- conn->async.done = TRUE;
--
-- if(entry)
-- *entry = conn->async.dns;
--
-- if(!conn->async.dns)
-- /* a name was not resolved, report error */
-- result = resolver_error(conn);
--
-- destroy_async_data(&conn->async);
--
-- if(!conn->async.dns)
-- connclose(conn, "asynch resolve failed");
--
-- return result;
-+ return thread_wait_resolv(conn, entry, TRUE);
- }
-
- /*
---
-2.17.2
-
diff --git a/0005-curl-7.64.0-expire-in-verbose-msgs.patch b/0005-curl-7.64.0-expire-in-verbose-msgs.patch
deleted file mode 100644
index 43d3573..0000000
--- a/0005-curl-7.64.0-expire-in-verbose-msgs.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 2e8f4d01cdd07779e0582257cb6b53c5a91d6504 Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Mon, 11 Feb 2019 22:57:33 +0100
-Subject: [PATCH] multi: remove verbose "Expire in" ... messages
-
-Reported-by: James Brown
-Bug: https://curl.haxx.se/mail/archive-2019-02/0013.html
-Closes #3558
-
-Upstream-commit: aabc7ae5ecf70973add429b5acbc86d6a57e4da5
-Signed-off-by: Kamil Dudka
----
- lib/multi.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/lib/multi.c b/lib/multi.c
-index 28f4c47..856cc22 100644
---- a/lib/multi.c
-+++ b/lib/multi.c
-@@ -3028,9 +3028,6 @@ void Curl_expire(struct Curl_easy *data, time_t milli, expire_id id)
-
- DEBUGASSERT(id < EXPIRE_LAST);
-
-- infof(data, "Expire in %ld ms for %x (transfer %p)\n",
-- (long)milli, id, data);
--
- set = Curl_now();
- set.tv_sec += milli/1000;
- set.tv_usec += (unsigned int)(milli%1000)*1000;
---
-2.17.2
-
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 57c05c6..265c3ff 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16250,18 +16250,11 @@ $as_echo "yes" >&6; }
+@@ -16273,18 +16273,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/0104-curl-7.19.7-localhost6.patch b/0104-curl-7.19.7-localhost6.patch
index 4f664d3..caa8bc2 100644
--- a/0104-curl-7.19.7-localhost6.patch
+++ b/0104-curl-7.19.7-localhost6.patch
@@ -14,8 +14,8 @@ index e441278..b0958b6 100644
+-g "http://%HOST6IP:%HTTP6PORT/1083" --interface localhost6
--perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test server host address';} else {exec './server/resolve --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}"
-+perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test server host address';} else {exec './server/resolve --ipv6 localhost6'; print 'Cannot run precheck resolve';}"
+-perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test client host address';} else {exec './server/resolve --ipv6 ip6-localhost'; print 'Cannot run precheck resolve';}"
++perl -e "if ('%CLIENT6IP' ne '[::1]') {print 'Test requires default test client host address';} else {exec './server/resolve --ipv6 localhost6'; print 'Cannot run precheck resolve';}"
diff --git a/0105-curl-7.63.0-lib1560-valgrind.patch b/0105-curl-7.63.0-lib1560-valgrind.patch
index 003655c..84a6ee7 100644
--- a/0105-curl-7.63.0-lib1560-valgrind.patch
+++ b/0105-curl-7.63.0-lib1560-valgrind.patch
@@ -26,7 +26,7 @@ diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
index 080421b..ea3b806 100644
--- a/tests/libtest/Makefile.inc
+++ b/tests/libtest/Makefile.inc
-@@ -521,6 +521,7 @@ lib1558_SOURCES = lib1558.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+@@ -530,6 +530,7 @@ lib1558_SOURCES = lib1558.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1558_LDADD = $(TESTUTIL_LIBS)
lib1560_SOURCES = lib1560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
diff --git a/curl-7.64.0.tar.xz.asc b/curl-7.64.0.tar.xz.asc
deleted file mode 100644
index 21f7542..0000000
--- a/curl-7.64.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlxahccACgkQXMkI/bce
-EsKdrAf+OoNH+Yz1HfJG5MtmEi2sgRC56iAvZBQujPG8SJYGnT3D2nLiuC2+bzA8
-eMCqisodW5f6lV/9JRvLmLS0dhxAfdf/NHlMOdtgSv+NzVGsggpHeYEZ7HucRHsQ
-AKZ6/wx7rby8yZqrn2s7yWWB0qgiajWx30r+CJEYXpuw+YwZ2qZo5ecM7fa/J9ko
-ESwb7BLF6KMkdSz1wSApwCdznB/BXOaPrUBMiOcwO7ftq/t1ZmqnUWLtdlSp8OoH
-Tw832H1kCP2OFHcOFTQmZJLagRQtLBhC522wNsagXaMwak6uhoFApcAPqoPdm4Pm
-PvTO6aAopZk+sX9VemdSQzx/4ysT3w==
-=HOlc
------END PGP SIGNATURE-----
diff --git a/curl-7.64.1.tar.xz.asc b/curl-7.64.1.tar.xz.asc
new file mode 100644
index 0000000..d0dc784
--- /dev/null
+++ b/curl-7.64.1.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlybHwMACgkQXMkI/bce
+EsIlxQf+LUj/zeWzTgxXIFgtfba+RKb66RpWhgzKLBpiGFQjhckILFJ+Li625SE3
+9fCrIslGuY2S4G6fRH1qEIZVglpA185sTeY241/JK788ftJFFQd2GtM/+Ysrla5h
+zc2wD3amDXcROWI+QIl/dBy7xRnW8TSTMu2sEPLarsNtXK9EC+h/WIkeYW1amMf2
+a8vRFwXFZ7OrEiq7A0avvmbrQVgIIGP/zyz44ZN00PPgLm40c1rngHGBJJzEMVSS
+ClZ+wUQ+AyamL3Ls9a+V3SF3IuVrFInjv5Y1OshPULaqL2VxPsCVw67sCVouePMS
+J0u3GZPsE+sVbx7cHCfZFdSnutFBKQ==
+=WUio
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 6cf125f..9ccaff4 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,25 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.64.0
-Release: 6%{?dist}
+Version: 7.64.1
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# make zsh completion work again
-Patch1: 0001-curl-7.64.0-zsh-completion.patch
-
-# prevent NetworkManager from leaking file descriptors (#1680198)
-Patch2: 0002-curl-7.64.0-nm-fd-leak.patch
-
-# fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
-Patch3: 0003-curl-7.64.0-cookie-segfault.patch
-
-# avoid spurious "Could not resolve host: [host name]" error messages
-Patch4: 0004-curl-7.64.0-spurious-resolver-error.patch
-
-# remove verbose "Expire in" ... messages (#1690971)
-Patch5: 0005-curl-7.64.0-expire-in-verbose-msgs.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -181,11 +166,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
# Fedora patches
%patch101 -p1
@@ -312,6 +292,10 @@ make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install
LD_LIBRARY_PATH="$RPM_BUILD_ROOT%{_libdir}:$LD_LIBRARY_PATH" \
make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install -C scripts
+# do not install /usr/share/fish/completions/curl.fish which is also installed
+# by fish-3.0.2-1.module_f31+3716+57207597 and would trigger a conflict
+rm -rf ${RPM_BUILD_ROOT}%{_datadir}/fish
+
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%ldconfig_scriptlets -n libcurl
@@ -319,13 +303,17 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%ldconfig_scriptlets -n libcurl-minimal
%files
-%doc CHANGES README*
-%doc docs/BUGS docs/FAQ docs/FEATURES
-%doc docs/MANUAL docs/RESOURCES
-%doc docs/TheArtOfHttpScripting docs/TODO
+%doc CHANGES
+%doc README
+%doc docs/BUGS
+%doc docs/FAQ
+%doc docs/FEATURES
+%doc docs/RESOURCES
+%doc docs/TODO
+%doc docs/TheArtOfHttpScripting
%{_bindir}/curl
%{_mandir}/man1/curl.1*
-%{_datadir}/zsh/site-functions
+%{_datadir}/zsh
%files -n libcurl
%license COPYING
@@ -353,6 +341,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Mar 27 2019 Kamil Dudka - 7.64.1-1
+- new upstream release
+
* Mon Mar 25 2019 Kamil Dudka - 7.64.0-6
- remove verbose "Expire in" ... messages (#1690971)
diff --git a/sources b/sources
index d5662be..1c4276d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.64.0.tar.xz) = 953f1f5336ce5dfd1b9f933624432d401552d91ee02d39ecde6f023c956f99ec6aae8d7746d7c34b6eb2d6452f114e67da4e64d9c8dd90b7644b7844e7b9b423
+SHA512 (curl-7.64.1.tar.xz) = 1629ba154691bf9d936e0bce69ec8fb54991a40d34bc16ffdfb117f91e3faa93164154fc9ae9043e963955862e69515018673b7239f2fd625684a59cdd1db81c
From 8fd906c5591f06c7eb3be5d0aa182333e6889703 Mon Sep 17 00:00:00 2001
From: Paul Howarth
Date: Fri, 5 Apr 2019 13:38:15 +0100
Subject: [PATCH 057/256] generation of shell completions now needs more perl
stuff
---
curl.spec | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/curl.spec b/curl.spec
index 9ccaff4..347018f 100644
--- a/curl.spec
+++ b/curl.spec
@@ -39,6 +39,7 @@ BuildRequires: openldap-devel
BuildRequires: openssh-clients
BuildRequires: openssh-server
BuildRequires: openssl-devel
+BuildRequires: perl-interpreter
BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: sed
@@ -48,6 +49,12 @@ BuildRequires: zlib-devel
# needed to compress content of tool_hugehelp.c after changing curl.1 man page
BuildRequires: perl(IO::Compress::Gzip)
+# needed for generation of shell completions
+BuildRequires: perl(Getopt::Long)
+BuildRequires: perl(Pod::Usage)
+BuildRequires: perl(strict)
+BuildRequires: perl(warnings)
+
# gnutls-serv is used by the upstream test-suite
BuildRequires: gnutls-utils
@@ -63,10 +70,8 @@ BuildRequires: perl(File::Copy)
BuildRequires: perl(File::Spec)
BuildRequires: perl(IPC::Open2)
BuildRequires: perl(MIME::Base64)
-BuildRequires: perl(strict)
BuildRequires: perl(Time::Local)
BuildRequires: perl(Time::HiRes)
-BuildRequires: perl(warnings)
BuildRequires: perl(vars)
# The test-suite runs automatically through valgrind if valgrind is available
From 9dd5d73f3b1c0fcae0ff35500e09e3c3574b2460 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 9 May 2019 09:59:31 +0200
Subject: [PATCH 058/256] do not treat failure of gss_init_sec_context() with
--negotiate as fatal
This commit fixes a major incompatibility introduced in curl-7.64.1.
Bug: https://github.com/curl/curl/issues/3726
---
...curl-7.64.1-negotiate-without-ticket.patch | 68 +++++++++++++++++++
curl.spec | 9 ++-
2 files changed, 76 insertions(+), 1 deletion(-)
create mode 100644 0001-curl-7.64.1-negotiate-without-ticket.patch
diff --git a/0001-curl-7.64.1-negotiate-without-ticket.patch b/0001-curl-7.64.1-negotiate-without-ticket.patch
new file mode 100644
index 0000000..125ee54
--- /dev/null
+++ b/0001-curl-7.64.1-negotiate-without-ticket.patch
@@ -0,0 +1,68 @@
+From f7c66081721ac54f68457f07994487f416db383f Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Mon, 6 May 2019 14:16:35 +0200
+Subject: [PATCH] spnego_gssapi: fix return code on gss_init_sec_context()
+ failure
+
+Fixes #3726
+Closes #3849
+
+Upstream-commit: f65845c1eccc02385cdfb22bf2e521e670f7b295
+Signed-off-by: Kamil Dudka
+---
+ lib/vauth/spnego_gssapi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c
+index 7c4bd4b59..de8bde2ba 100644
+--- a/lib/vauth/spnego_gssapi.c
++++ b/lib/vauth/spnego_gssapi.c
+@@ -170,7 +170,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
+ Curl_gss_log_error(data, "gss_init_sec_context() failed: ",
+ major_status, minor_status);
+
+- return CURLE_OUT_OF_MEMORY;
++ return CURLE_LOGIN_DENIED;
+ }
+
+ if(!output_token.value || !output_token.length) {
+--
+2.20.1
+
+From ce0dbcf6f028c84adf4ff3704c04a09d4450a596 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Mon, 6 May 2019 14:32:00 +0200
+Subject: [PATCH] http_negotiate: do not treat failure of
+ gss_init_sec_context() as fatal
+
+Fixes #3726
+Closes #3849
+
+Upstream-commit: f4603708af08f454bca8b74095d0af40a4516512
+Signed-off-by: Kamil Dudka
+---
+ lib/http_negotiate.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
+index 9415236fb..201c3a785 100644
+--- a/lib/http_negotiate.c
++++ b/lib/http_negotiate.c
+@@ -143,7 +143,13 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
+ }
+ if(!neg_ctx->context) {
+ result = Curl_input_negotiate(conn, proxy, "Negotiate");
+- if(result)
++ if(result == CURLE_LOGIN_DENIED) {
++ /* negotiate auth failed, let's continue unauthenticated to stay
++ * compatible with the behavior before curl-7_64_0-158-g6c6035532 */
++ conn->data->state.authproblem = TRUE;
++ return CURLE_OK;
++ }
++ else if(result)
+ return result;
+ }
+
+--
+2.20.1
+
diff --git a/curl.spec b/curl.spec
index 347018f..4f4198d 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,10 +1,13 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.64.1
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# do not treat failure of gss_init_sec_context() with --negotiate as fatal
+Patch1: 0001-curl-7.64.1-negotiate-without-ticket.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -171,6 +174,7 @@ be installed.
%setup -q
# upstream patches
+%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -346,6 +350,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu May 09 2019 Kamil Dudka - 7.64.1-2
+- do not treat failure of gss_init_sec_context() with --negotiate as fatal
+
* Wed Mar 27 2019 Kamil Dudka - 7.64.1-1
- new upstream release
From 3c7950da770ba435d85bfada130f9d0c512df60b Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 22 May 2019 10:37:45 +0200
Subject: [PATCH 059/256] new upstream release - 7.65.0
Resolves: CVE-2019-5436 - TFTP receive buffer overflow
Resolves: CVE-2019-5435 - integer overflows in curl_url_set()
---
...curl-7.64.1-negotiate-without-ticket.patch | 68 -------------------
0105-curl-7.63.0-lib1560-valgrind.patch | 4 +-
curl-7.64.1.tar.xz.asc | 11 ---
curl-7.65.0.tar.xz.asc | 11 +++
curl.spec | 13 ++--
sources | 2 +-
6 files changed, 21 insertions(+), 88 deletions(-)
delete mode 100644 0001-curl-7.64.1-negotiate-without-ticket.patch
delete mode 100644 curl-7.64.1.tar.xz.asc
create mode 100644 curl-7.65.0.tar.xz.asc
diff --git a/0001-curl-7.64.1-negotiate-without-ticket.patch b/0001-curl-7.64.1-negotiate-without-ticket.patch
deleted file mode 100644
index 125ee54..0000000
--- a/0001-curl-7.64.1-negotiate-without-ticket.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From f7c66081721ac54f68457f07994487f416db383f Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Mon, 6 May 2019 14:16:35 +0200
-Subject: [PATCH] spnego_gssapi: fix return code on gss_init_sec_context()
- failure
-
-Fixes #3726
-Closes #3849
-
-Upstream-commit: f65845c1eccc02385cdfb22bf2e521e670f7b295
-Signed-off-by: Kamil Dudka
----
- lib/vauth/spnego_gssapi.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c
-index 7c4bd4b59..de8bde2ba 100644
---- a/lib/vauth/spnego_gssapi.c
-+++ b/lib/vauth/spnego_gssapi.c
-@@ -170,7 +170,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data,
- Curl_gss_log_error(data, "gss_init_sec_context() failed: ",
- major_status, minor_status);
-
-- return CURLE_OUT_OF_MEMORY;
-+ return CURLE_LOGIN_DENIED;
- }
-
- if(!output_token.value || !output_token.length) {
---
-2.20.1
-
-From ce0dbcf6f028c84adf4ff3704c04a09d4450a596 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Mon, 6 May 2019 14:32:00 +0200
-Subject: [PATCH] http_negotiate: do not treat failure of
- gss_init_sec_context() as fatal
-
-Fixes #3726
-Closes #3849
-
-Upstream-commit: f4603708af08f454bca8b74095d0af40a4516512
-Signed-off-by: Kamil Dudka
----
- lib/http_negotiate.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
-index 9415236fb..201c3a785 100644
---- a/lib/http_negotiate.c
-+++ b/lib/http_negotiate.c
-@@ -143,7 +143,13 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
- }
- if(!neg_ctx->context) {
- result = Curl_input_negotiate(conn, proxy, "Negotiate");
-- if(result)
-+ if(result == CURLE_LOGIN_DENIED) {
-+ /* negotiate auth failed, let's continue unauthenticated to stay
-+ * compatible with the behavior before curl-7_64_0-158-g6c6035532 */
-+ conn->data->state.authproblem = TRUE;
-+ return CURLE_OK;
-+ }
-+ else if(result)
- return result;
- }
-
---
-2.20.1
-
diff --git a/0105-curl-7.63.0-lib1560-valgrind.patch b/0105-curl-7.63.0-lib1560-valgrind.patch
index 84a6ee7..652739c 100644
--- a/0105-curl-7.63.0-lib1560-valgrind.patch
+++ b/0105-curl-7.63.0-lib1560-valgrind.patch
@@ -26,8 +26,8 @@ diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
index 080421b..ea3b806 100644
--- a/tests/libtest/Makefile.inc
+++ b/tests/libtest/Makefile.inc
-@@ -530,6 +530,7 @@ lib1558_SOURCES = lib1558.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
- lib1558_LDADD = $(TESTUTIL_LIBS)
+@@ -528,6 +528,7 @@ lib1559_SOURCES = lib1559.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+ lib1559_LDADD = $(TESTUTIL_LIBS)
lib1560_SOURCES = lib1560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+lib1560_CFLAGS = $(AM_CFLAGS) -fno-builtin-strcmp
diff --git a/curl-7.64.1.tar.xz.asc b/curl-7.64.1.tar.xz.asc
deleted file mode 100644
index d0dc784..0000000
--- a/curl-7.64.1.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlybHwMACgkQXMkI/bce
-EsIlxQf+LUj/zeWzTgxXIFgtfba+RKb66RpWhgzKLBpiGFQjhckILFJ+Li625SE3
-9fCrIslGuY2S4G6fRH1qEIZVglpA185sTeY241/JK788ftJFFQd2GtM/+Ysrla5h
-zc2wD3amDXcROWI+QIl/dBy7xRnW8TSTMu2sEPLarsNtXK9EC+h/WIkeYW1amMf2
-a8vRFwXFZ7OrEiq7A0avvmbrQVgIIGP/zyz44ZN00PPgLm40c1rngHGBJJzEMVSS
-ClZ+wUQ+AyamL3Ls9a+V3SF3IuVrFInjv5Y1OshPULaqL2VxPsCVw67sCVouePMS
-J0u3GZPsE+sVbx7cHCfZFdSnutFBKQ==
-=WUio
------END PGP SIGNATURE-----
diff --git a/curl-7.65.0.tar.xz.asc b/curl-7.65.0.tar.xz.asc
new file mode 100644
index 0000000..21f3b0b
--- /dev/null
+++ b/curl-7.65.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlzk438ACgkQXMkI/bce
+EsITWggAgk129Kxp4Br7Nn2+vyygKwv3dDEm87wJVuQka8gT2pZ9ZVQ6rEX9j0sR
+RETf8KrEbSlOBgl2EJpgToL5kgiMCweTXced3VY2szVVibenBa2Zd9MpSl5Sf7hH
+axinhdvEPNH+w8WuprEqZh+d/T5grAxChPJz4bLqKQI5fw5T3IuMfYTjZqx8DkOt
+4FekihWCr6N/nW9BFOz8H19GFtotYSwoPvQJ+RmB7+Zt7ruHjRgyINCgxbWPvs4P
+eZNWykqQ9FaXLSoJQYjLvEx0smye0bxSu3EIYBeL60fiFWJaSHQPyfBgC3JC+dD6
+ufxhEk814I4XzPaRFTLjgzjmTqRMPw==
+=4VIp
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 4f4198d..cb35ee2 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.64.1
-Release: 2%{?dist}
+Version: 7.65.0
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# do not treat failure of gss_init_sec_context() with --negotiate as fatal
-Patch1: 0001-curl-7.64.1-negotiate-without-ticket.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -174,7 +171,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -350,6 +346,11 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed May 22 2019 Kamil Dudka - 7.65.0-1
+- new upstream release, which fixes the following vulnerabilities
+ CVE-2019-5436 - TFTP receive buffer overflow
+ CVE-2019-5435 - integer overflows in curl_url_set()
+
* Thu May 09 2019 Kamil Dudka - 7.64.1-2
- do not treat failure of gss_init_sec_context() with --negotiate as fatal
diff --git a/sources b/sources
index 1c4276d..36347c9 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.64.1.tar.xz) = 1629ba154691bf9d936e0bce69ec8fb54991a40d34bc16ffdfb117f91e3faa93164154fc9ae9043e963955862e69515018673b7239f2fd625684a59cdd1db81c
+SHA512 (curl-7.65.0.tar.xz) = 032c065c1d4bd07ba028625f8fab6a09e7cb8505a5f19339b3abdee5a9cda7d091c11f075fe3fc227d082690a66c558c770a4cd9fb17b52acc13794976a770c5
From b6ccff47ac093003674a469ec44541edbd8caaef Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 30 May 2019 15:27:58 +0200
Subject: [PATCH 060/256] Resolves: #1714893 - fix spurious timeout events with
speed-limit
---
0001-curl-7.65.0-speed-limit-timeout.patch | 203 +++++++++++++++++++++
curl.spec | 9 +-
2 files changed, 211 insertions(+), 1 deletion(-)
create mode 100644 0001-curl-7.65.0-speed-limit-timeout.patch
diff --git a/0001-curl-7.65.0-speed-limit-timeout.patch b/0001-curl-7.65.0-speed-limit-timeout.patch
new file mode 100644
index 0000000..f9e155b
--- /dev/null
+++ b/0001-curl-7.65.0-speed-limit-timeout.patch
@@ -0,0 +1,203 @@
+From f2cc9d8d194c4eef706cb5470bdf6f7483b4e3cf Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Wed, 22 May 2019 23:15:34 +0200
+Subject: [PATCH] Revert "progress: CURL_DISABLE_PROGRESS_METER"
+
+This reverts commit 3b06e68b7734cb10a555f9d7e804dd5d808236a4.
+
+Clearly this change wasn't good enough as it broke CURLOPT_LOW_SPEED_LIMIT +
+CURLOPT_LOW_SPEED_TIME
+
+Reported-by: Dave Reisner
+
+Fixes #3927
+Closes #3928
+
+Upstream-commit: c6b58137237a89081b4efc33ae0ecf7282e40132
+Signed-off-by: Kamil Dudka
+---
+ lib/progress.c | 110 ++++++++++++++++++++++---------------------------
+ 1 file changed, 49 insertions(+), 61 deletions(-)
+
+diff --git a/lib/progress.c b/lib/progress.c
+index f586d59b4..fe9929bb9 100644
+--- a/lib/progress.c
++++ b/lib/progress.c
+@@ -5,7 +5,7 @@
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
++ * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -31,7 +31,6 @@
+ /* check rate limits within this many recent milliseconds, at minimum. */
+ #define MIN_RATE_LIMIT_PERIOD 3000
+
+-#ifndef CURL_DISABLE_PROGRESS_METER
+ /* Provide a string that is 2 + 1 + 2 + 1 + 2 = 8 letters long (plus the zero
+ byte) */
+ static void time2str(char *r, curl_off_t seconds)
+@@ -120,7 +119,6 @@ static char *max5data(curl_off_t bytes, char *max5)
+
+ return max5;
+ }
+-#endif
+
+ /*
+
+@@ -364,13 +362,17 @@ void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size)
+ }
+ }
+
+-#ifndef CURL_DISABLE_PROGRESS_METER
+-static void progress_meter(struct connectdata *conn)
++/*
++ * Curl_pgrsUpdate() returns 0 for success or the value returned by the
++ * progress callback!
++ */
++int Curl_pgrsUpdate(struct connectdata *conn)
+ {
+ struct curltime now;
+ curl_off_t timespent;
+ curl_off_t timespent_ms; /* milliseconds */
+ struct Curl_easy *data = conn->data;
++ int nowindex = data->progress.speeder_c% CURR_TIME;
+ bool shownow = FALSE;
+ curl_off_t dl = data->progress.downloaded;
+ curl_off_t ul = data->progress.uploaded;
+@@ -397,9 +399,7 @@ static void progress_meter(struct connectdata *conn)
+ /* Calculations done at most once a second, unless end is reached */
+ if(data->progress.lastshow != now.tv_sec) {
+ int countindex; /* amount of seconds stored in the speeder array */
+- int nowindex = data->progress.speeder_c% CURR_TIME;
+- if(!(data->progress.flags & PGRS_HIDE))
+- shownow = TRUE;
++ shownow = TRUE;
+
+ data->progress.lastshow = now.tv_sec;
+
+@@ -461,12 +461,8 @@ static void progress_meter(struct connectdata *conn)
+ data->progress.ulspeed + data->progress.dlspeed;
+
+ } /* Calculations end */
+- if(!shownow)
+- /* only show the internal progress meter once per second */
+- return;
+- else {
+- /* If there's no external callback set, use internal code to show
+- progress */
++
++ if(!(data->progress.flags & PGRS_HIDE)) {
+ /* progress meter has not been shut off */
+ char max5[6][10];
+ curl_off_t dlpercen = 0;
+@@ -481,6 +477,42 @@ static void progress_meter(struct connectdata *conn)
+ curl_off_t dlestimate = 0;
+ curl_off_t total_estimate;
+
++ if(data->set.fxferinfo) {
++ int result;
++ /* There's a callback set, call that */
++ Curl_set_in_callback(data, true);
++ result = data->set.fxferinfo(data->set.progress_client,
++ data->progress.size_dl,
++ data->progress.downloaded,
++ data->progress.size_ul,
++ data->progress.uploaded);
++ Curl_set_in_callback(data, false);
++ if(result)
++ failf(data, "Callback aborted");
++ return result;
++ }
++ if(data->set.fprogress) {
++ int result;
++ /* The older deprecated callback is set, call that */
++ Curl_set_in_callback(data, true);
++ result = data->set.fprogress(data->set.progress_client,
++ (double)data->progress.size_dl,
++ (double)data->progress.downloaded,
++ (double)data->progress.size_ul,
++ (double)data->progress.uploaded);
++ Curl_set_in_callback(data, false);
++ if(result)
++ failf(data, "Callback aborted");
++ return result;
++ }
++
++ if(!shownow)
++ /* only show the internal progress meter once per second */
++ return 0;
++
++ /* If there's no external callback set, use internal code to show
++ progress */
++
+ if(!(data->progress.flags & PGRS_HEADERS_OUT)) {
+ if(data->state.resume_from) {
+ fprintf(data->set.err,
+@@ -563,57 +595,13 @@ static void progress_meter(struct connectdata *conn)
+ time_total, /* 8 letters */ /* total time */
+ time_spent, /* 8 letters */ /* time spent */
+ time_left, /* 8 letters */ /* time left */
+- max5data(data->progress.current_speed, max5[5])
+- );
++ max5data(data->progress.current_speed, max5[5]) /* current speed */
++ );
+
+ /* we flush the output stream to make it appear as soon as possible */
+ fflush(data->set.err);
+- } /* don't show now */
+-}
+-#else
+- /* progress bar disabled */
+-#define progress_meter(x)
+-#endif
+-
+
+-/*
+- * Curl_pgrsUpdate() returns 0 for success or the value returned by the
+- * progress callback!
+- */
+-int Curl_pgrsUpdate(struct connectdata *conn)
+-{
+- struct Curl_easy *data = conn->data;
+- if(!(data->progress.flags & PGRS_HIDE)) {
+- if(data->set.fxferinfo) {
+- int result;
+- /* There's a callback set, call that */
+- Curl_set_in_callback(data, true);
+- result = data->set.fxferinfo(data->set.progress_client,
+- data->progress.size_dl,
+- data->progress.downloaded,
+- data->progress.size_ul,
+- data->progress.uploaded);
+- Curl_set_in_callback(data, false);
+- if(result)
+- failf(data, "Callback aborted");
+- return result;
+- }
+- if(data->set.fprogress) {
+- int result;
+- /* The older deprecated callback is set, call that */
+- Curl_set_in_callback(data, true);
+- result = data->set.fprogress(data->set.progress_client,
+- (double)data->progress.size_dl,
+- (double)data->progress.downloaded,
+- (double)data->progress.size_ul,
+- (double)data->progress.uploaded);
+- Curl_set_in_callback(data, false);
+- if(result)
+- failf(data, "Callback aborted");
+- return result;
+- }
+- }
+- progress_meter(conn);
++ } /* !(data->progress.flags & PGRS_HIDE) */
+
+ return 0;
+ }
+--
+2.20.1
+
diff --git a/curl.spec b/curl.spec
index cb35ee2..79eb8a9 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,10 +1,13 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.65.0
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# fix spurious timeout events with speed-limit (#1714893)
+Patch1: 0001-curl-7.65.0-speed-limit-timeout.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -171,6 +174,7 @@ be installed.
%setup -q
# upstream patches
+%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -346,6 +350,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu May 30 2019 Kamil Dudka - 7.65.0-2
+- fix spurious timeout events with speed-limit (#1714893)
+
* Wed May 22 2019 Kamil Dudka - 7.65.0-1
- new upstream release, which fixes the following vulnerabilities
CVE-2019-5436 - TFTP receive buffer overflow
From 901da63160e081c2f0b4b2dce8b8afc2026e2431 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 5 Jun 2019 09:30:50 +0200
Subject: [PATCH 061/256] new upstream release - 7.65.1
---
0001-curl-7.65.0-speed-limit-timeout.patch | 203 ---------------------
0102-curl-7.36.0-debug.patch | 2 +-
curl-7.65.0.tar.xz.asc | 11 --
curl-7.65.1.tar.xz.asc | 11 ++
curl.spec | 11 +-
sources | 2 +-
6 files changed, 18 insertions(+), 222 deletions(-)
delete mode 100644 0001-curl-7.65.0-speed-limit-timeout.patch
delete mode 100644 curl-7.65.0.tar.xz.asc
create mode 100644 curl-7.65.1.tar.xz.asc
diff --git a/0001-curl-7.65.0-speed-limit-timeout.patch b/0001-curl-7.65.0-speed-limit-timeout.patch
deleted file mode 100644
index f9e155b..0000000
--- a/0001-curl-7.65.0-speed-limit-timeout.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-From f2cc9d8d194c4eef706cb5470bdf6f7483b4e3cf Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Wed, 22 May 2019 23:15:34 +0200
-Subject: [PATCH] Revert "progress: CURL_DISABLE_PROGRESS_METER"
-
-This reverts commit 3b06e68b7734cb10a555f9d7e804dd5d808236a4.
-
-Clearly this change wasn't good enough as it broke CURLOPT_LOW_SPEED_LIMIT +
-CURLOPT_LOW_SPEED_TIME
-
-Reported-by: Dave Reisner
-
-Fixes #3927
-Closes #3928
-
-Upstream-commit: c6b58137237a89081b4efc33ae0ecf7282e40132
-Signed-off-by: Kamil Dudka
----
- lib/progress.c | 110 ++++++++++++++++++++++---------------------------
- 1 file changed, 49 insertions(+), 61 deletions(-)
-
-diff --git a/lib/progress.c b/lib/progress.c
-index f586d59b4..fe9929bb9 100644
---- a/lib/progress.c
-+++ b/lib/progress.c
-@@ -5,7 +5,7 @@
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
-- * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al.
-+ * Copyright (C) 1998 - 2018, Daniel Stenberg, , et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
-@@ -31,7 +31,6 @@
- /* check rate limits within this many recent milliseconds, at minimum. */
- #define MIN_RATE_LIMIT_PERIOD 3000
-
--#ifndef CURL_DISABLE_PROGRESS_METER
- /* Provide a string that is 2 + 1 + 2 + 1 + 2 = 8 letters long (plus the zero
- byte) */
- static void time2str(char *r, curl_off_t seconds)
-@@ -120,7 +119,6 @@ static char *max5data(curl_off_t bytes, char *max5)
-
- return max5;
- }
--#endif
-
- /*
-
-@@ -364,13 +362,17 @@ void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size)
- }
- }
-
--#ifndef CURL_DISABLE_PROGRESS_METER
--static void progress_meter(struct connectdata *conn)
-+/*
-+ * Curl_pgrsUpdate() returns 0 for success or the value returned by the
-+ * progress callback!
-+ */
-+int Curl_pgrsUpdate(struct connectdata *conn)
- {
- struct curltime now;
- curl_off_t timespent;
- curl_off_t timespent_ms; /* milliseconds */
- struct Curl_easy *data = conn->data;
-+ int nowindex = data->progress.speeder_c% CURR_TIME;
- bool shownow = FALSE;
- curl_off_t dl = data->progress.downloaded;
- curl_off_t ul = data->progress.uploaded;
-@@ -397,9 +399,7 @@ static void progress_meter(struct connectdata *conn)
- /* Calculations done at most once a second, unless end is reached */
- if(data->progress.lastshow != now.tv_sec) {
- int countindex; /* amount of seconds stored in the speeder array */
-- int nowindex = data->progress.speeder_c% CURR_TIME;
-- if(!(data->progress.flags & PGRS_HIDE))
-- shownow = TRUE;
-+ shownow = TRUE;
-
- data->progress.lastshow = now.tv_sec;
-
-@@ -461,12 +461,8 @@ static void progress_meter(struct connectdata *conn)
- data->progress.ulspeed + data->progress.dlspeed;
-
- } /* Calculations end */
-- if(!shownow)
-- /* only show the internal progress meter once per second */
-- return;
-- else {
-- /* If there's no external callback set, use internal code to show
-- progress */
-+
-+ if(!(data->progress.flags & PGRS_HIDE)) {
- /* progress meter has not been shut off */
- char max5[6][10];
- curl_off_t dlpercen = 0;
-@@ -481,6 +477,42 @@ static void progress_meter(struct connectdata *conn)
- curl_off_t dlestimate = 0;
- curl_off_t total_estimate;
-
-+ if(data->set.fxferinfo) {
-+ int result;
-+ /* There's a callback set, call that */
-+ Curl_set_in_callback(data, true);
-+ result = data->set.fxferinfo(data->set.progress_client,
-+ data->progress.size_dl,
-+ data->progress.downloaded,
-+ data->progress.size_ul,
-+ data->progress.uploaded);
-+ Curl_set_in_callback(data, false);
-+ if(result)
-+ failf(data, "Callback aborted");
-+ return result;
-+ }
-+ if(data->set.fprogress) {
-+ int result;
-+ /* The older deprecated callback is set, call that */
-+ Curl_set_in_callback(data, true);
-+ result = data->set.fprogress(data->set.progress_client,
-+ (double)data->progress.size_dl,
-+ (double)data->progress.downloaded,
-+ (double)data->progress.size_ul,
-+ (double)data->progress.uploaded);
-+ Curl_set_in_callback(data, false);
-+ if(result)
-+ failf(data, "Callback aborted");
-+ return result;
-+ }
-+
-+ if(!shownow)
-+ /* only show the internal progress meter once per second */
-+ return 0;
-+
-+ /* If there's no external callback set, use internal code to show
-+ progress */
-+
- if(!(data->progress.flags & PGRS_HEADERS_OUT)) {
- if(data->state.resume_from) {
- fprintf(data->set.err,
-@@ -563,57 +595,13 @@ static void progress_meter(struct connectdata *conn)
- time_total, /* 8 letters */ /* total time */
- time_spent, /* 8 letters */ /* time spent */
- time_left, /* 8 letters */ /* time left */
-- max5data(data->progress.current_speed, max5[5])
-- );
-+ max5data(data->progress.current_speed, max5[5]) /* current speed */
-+ );
-
- /* we flush the output stream to make it appear as soon as possible */
- fflush(data->set.err);
-- } /* don't show now */
--}
--#else
-- /* progress bar disabled */
--#define progress_meter(x)
--#endif
--
-
--/*
-- * Curl_pgrsUpdate() returns 0 for success or the value returned by the
-- * progress callback!
-- */
--int Curl_pgrsUpdate(struct connectdata *conn)
--{
-- struct Curl_easy *data = conn->data;
-- if(!(data->progress.flags & PGRS_HIDE)) {
-- if(data->set.fxferinfo) {
-- int result;
-- /* There's a callback set, call that */
-- Curl_set_in_callback(data, true);
-- result = data->set.fxferinfo(data->set.progress_client,
-- data->progress.size_dl,
-- data->progress.downloaded,
-- data->progress.size_ul,
-- data->progress.uploaded);
-- Curl_set_in_callback(data, false);
-- if(result)
-- failf(data, "Callback aborted");
-- return result;
-- }
-- if(data->set.fprogress) {
-- int result;
-- /* The older deprecated callback is set, call that */
-- Curl_set_in_callback(data, true);
-- result = data->set.fprogress(data->set.progress_client,
-- (double)data->progress.size_dl,
-- (double)data->progress.downloaded,
-- (double)data->progress.size_ul,
-- (double)data->progress.uploaded);
-- Curl_set_in_callback(data, false);
-- if(result)
-- failf(data, "Callback aborted");
-- return result;
-- }
-- }
-- progress_meter(conn);
-+ } /* !(data->progress.flags & PGRS_HIDE) */
-
- return 0;
- }
---
-2.20.1
-
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 265c3ff..e757b9d 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16273,18 +16273,11 @@ $as_echo "yes" >&6; }
+@@ -16268,18 +16268,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/curl-7.65.0.tar.xz.asc b/curl-7.65.0.tar.xz.asc
deleted file mode 100644
index 21f3b0b..0000000
--- a/curl-7.65.0.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlzk438ACgkQXMkI/bce
-EsITWggAgk129Kxp4Br7Nn2+vyygKwv3dDEm87wJVuQka8gT2pZ9ZVQ6rEX9j0sR
-RETf8KrEbSlOBgl2EJpgToL5kgiMCweTXced3VY2szVVibenBa2Zd9MpSl5Sf7hH
-axinhdvEPNH+w8WuprEqZh+d/T5grAxChPJz4bLqKQI5fw5T3IuMfYTjZqx8DkOt
-4FekihWCr6N/nW9BFOz8H19GFtotYSwoPvQJ+RmB7+Zt7ruHjRgyINCgxbWPvs4P
-eZNWykqQ9FaXLSoJQYjLvEx0smye0bxSu3EIYBeL60fiFWJaSHQPyfBgC3JC+dD6
-ufxhEk814I4XzPaRFTLjgzjmTqRMPw==
-=4VIp
------END PGP SIGNATURE-----
diff --git a/curl-7.65.1.tar.xz.asc b/curl-7.65.1.tar.xz.asc
new file mode 100644
index 0000000..1fb59c8
--- /dev/null
+++ b/curl-7.65.1.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlz3WXoACgkQXMkI/bce
+EsLceAgAg0RTq0HLyI2DtJyR4b60vKXTFizjIxEEBJ9NCjpxwUTg4q3H6tzIOuCR
+PrPQXMADKtZpWwBDO1LV0CoUykw3vWxkG8uf5v/2GhdMdRGKm1TBgj1XN8SuAYTB
+Srpus7LtyiIuElpOGUNNTIMcVXjT4ykJbLU61ykNSPc8IxK3KSY0C+dc/IpQQWQe
+FmkMhuEpI4heu3uTmaj/UDs5LN+pv383XUTbMZvtgzDlquoyECGYX88+K6HC3doy
+HiulXv99BUckmnCvbzL9Ly/QsbYq41UJLfc8HN4B1VtKTXkZJFyHwd8NMlSl8rQq
+CLhRgj7IFk6VAEPpF3jJrmuvDxvdng==
+=hzYt
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 79eb8a9..e9de3c9 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.65.0
-Release: 2%{?dist}
+Version: 7.65.1
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# fix spurious timeout events with speed-limit (#1714893)
-Patch1: 0001-curl-7.65.0-speed-limit-timeout.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -174,7 +171,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -350,6 +346,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Jun 05 2019 Kamil Dudka - 7.65.1-1
+- new upstream release
+
* Thu May 30 2019 Kamil Dudka - 7.65.0-2
- fix spurious timeout events with speed-limit (#1714893)
diff --git a/sources b/sources
index 36347c9..242cb15 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.65.0.tar.xz) = 032c065c1d4bd07ba028625f8fab6a09e7cb8505a5f19339b3abdee5a9cda7d091c11f075fe3fc227d082690a66c558c770a4cd9fb17b52acc13794976a770c5
+SHA512 (curl-7.65.1.tar.xz) = aba2d979a416d14a0f0852d595665e49fc4f7bff3bee31f3a52b90ba9dc5ffdb09c092777f124215470b72c47ebca7ddb47844cbf5c0e9142099272b6ac55df4
From 6e794d5beb6b56607f163c5c7862b010982f7b69 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 17 Jul 2019 10:28:35 +0200
Subject: [PATCH 062/256] new upstream release - 7.65.2
---
0102-curl-7.36.0-debug.patch | 2 +-
0105-curl-7.63.0-lib1560-valgrind.patch | 2 +-
curl-7.65.1.tar.xz.asc | 11 -----------
curl-7.65.2.tar.xz.asc | 11 +++++++++++
curl.spec | 5 ++++-
sources | 2 +-
6 files changed, 18 insertions(+), 15 deletions(-)
delete mode 100644 curl-7.65.1.tar.xz.asc
create mode 100644 curl-7.65.2.tar.xz.asc
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index e757b9d..4f7991b 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16268,18 +16268,11 @@ $as_echo "yes" >&6; }
+@@ -16288,18 +16288,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/0105-curl-7.63.0-lib1560-valgrind.patch b/0105-curl-7.63.0-lib1560-valgrind.patch
index 652739c..6d05c67 100644
--- a/0105-curl-7.63.0-lib1560-valgrind.patch
+++ b/0105-curl-7.63.0-lib1560-valgrind.patch
@@ -26,7 +26,7 @@ diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc
index 080421b..ea3b806 100644
--- a/tests/libtest/Makefile.inc
+++ b/tests/libtest/Makefile.inc
-@@ -528,6 +528,7 @@ lib1559_SOURCES = lib1559.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
+@@ -531,6 +531,7 @@ lib1559_SOURCES = lib1559.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1559_LDADD = $(TESTUTIL_LIBS)
lib1560_SOURCES = lib1560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
diff --git a/curl-7.65.1.tar.xz.asc b/curl-7.65.1.tar.xz.asc
deleted file mode 100644
index 1fb59c8..0000000
--- a/curl-7.65.1.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAlz3WXoACgkQXMkI/bce
-EsLceAgAg0RTq0HLyI2DtJyR4b60vKXTFizjIxEEBJ9NCjpxwUTg4q3H6tzIOuCR
-PrPQXMADKtZpWwBDO1LV0CoUykw3vWxkG8uf5v/2GhdMdRGKm1TBgj1XN8SuAYTB
-Srpus7LtyiIuElpOGUNNTIMcVXjT4ykJbLU61ykNSPc8IxK3KSY0C+dc/IpQQWQe
-FmkMhuEpI4heu3uTmaj/UDs5LN+pv383XUTbMZvtgzDlquoyECGYX88+K6HC3doy
-HiulXv99BUckmnCvbzL9Ly/QsbYq41UJLfc8HN4B1VtKTXkZJFyHwd8NMlSl8rQq
-CLhRgj7IFk6VAEPpF3jJrmuvDxvdng==
-=hzYt
------END PGP SIGNATURE-----
diff --git a/curl-7.65.2.tar.xz.asc b/curl-7.65.2.tar.xz.asc
new file mode 100644
index 0000000..911a393
--- /dev/null
+++ b/curl-7.65.2.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAl0uzp8ACgkQXMkI/bce
+EsKvxggApofdiAeSY2lMwKfydA6vmZRhLmdBcBx4AvA3dD56Yzs2Y78EVcv7Mtz7
+Dix90SQEQLrf29DqZh6U3/z96hwbUU0sx0k8I38KhePxAEiFcIgnyXTt4PaRrAzr
+WlIk5GX+Xz9HbWEop8b2yIskVUd+VfnyR1VH/+mBzpAHn9tbPscyBT8xcKCN8LxM
+QiQdzyXcxfPbBthYPaf2+bWhicch3pS4u4El8o4BTdosZrpElZtSD3RKKCbgK4Kw
+688juLaWVfFhoVgyEUc1cMJRqF3Q093rbxH5Z97cW6XBQRlhFW7HFgEEHq1bhXCF
++sMUhfr1Wz+LHfVg4SasOS4fqX3Mlg==
+=I4Mq
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index e9de3c9..5d5b096 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,6 +1,6 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.65.1
+Version: 7.65.2
Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -346,6 +346,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Jul 17 2019 Kamil Dudka - 7.65.2-1
+- new upstream release
+
* Wed Jun 05 2019 Kamil Dudka - 7.65.1-1
- new upstream release
diff --git a/sources b/sources
index 242cb15..563e0f4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.65.1.tar.xz) = aba2d979a416d14a0f0852d595665e49fc4f7bff3bee31f3a52b90ba9dc5ffdb09c092777f124215470b72c47ebca7ddb47844cbf5c0e9142099272b6ac55df4
+SHA512 (curl-7.65.2.tar.xz) = a411cf19c389301473d74b85d775e3ba0c7c2f6e74d7e0f8de47dace1a709bfba552c483c3faf94101f741a5478800284c475422844cedb6a7a070e2f78af263
From a5c984a5907b2ccf14e4d1524b6135244a607b51 Mon Sep 17 00:00:00 2001
From: Paul Howarth
Date: Sat, 20 Jul 2019 12:02:57 +0100
Subject: [PATCH 063/256] new upstream release - 7.65.3
---
curl-7.65.2.tar.xz.asc | 11 -----------
curl-7.65.3.tar.xz.asc | 11 +++++++++++
curl.spec | 5 ++++-
sources | 2 +-
4 files changed, 16 insertions(+), 13 deletions(-)
delete mode 100644 curl-7.65.2.tar.xz.asc
create mode 100644 curl-7.65.3.tar.xz.asc
diff --git a/curl-7.65.2.tar.xz.asc b/curl-7.65.2.tar.xz.asc
deleted file mode 100644
index 911a393..0000000
--- a/curl-7.65.2.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAl0uzp8ACgkQXMkI/bce
-EsKvxggApofdiAeSY2lMwKfydA6vmZRhLmdBcBx4AvA3dD56Yzs2Y78EVcv7Mtz7
-Dix90SQEQLrf29DqZh6U3/z96hwbUU0sx0k8I38KhePxAEiFcIgnyXTt4PaRrAzr
-WlIk5GX+Xz9HbWEop8b2yIskVUd+VfnyR1VH/+mBzpAHn9tbPscyBT8xcKCN8LxM
-QiQdzyXcxfPbBthYPaf2+bWhicch3pS4u4El8o4BTdosZrpElZtSD3RKKCbgK4Kw
-688juLaWVfFhoVgyEUc1cMJRqF3Q093rbxH5Z97cW6XBQRlhFW7HFgEEHq1bhXCF
-+sMUhfr1Wz+LHfVg4SasOS4fqX3Mlg==
-=I4Mq
------END PGP SIGNATURE-----
diff --git a/curl-7.65.3.tar.xz.asc b/curl-7.65.3.tar.xz.asc
new file mode 100644
index 0000000..1671b07
--- /dev/null
+++ b/curl-7.65.3.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAl0xj7oACgkQXMkI/bce
+EsKYbgf9G41o5x73tc+2TOGt2QmJ7ukyHmd5Vq7XTSNdNU5dJ41Z3qh9Jm72x62i
+b4kJMjWyoL2j031ml5JevycpMpNa1v784UlPW2tzzL2B7v6vcA4xknJRLWlPlcTJ
+HOgub6r7g/zhOpdAeJh8o4jkBLUyN+S/HOyHLWcvdWDnhqUAmpZfIqtd8kjqzDul
+XAkdj7MxWqKZ3wXWwlpp4j81jpfOj7KCC/ZpxlJ0KfefgYEzV23O2hcJzw57jqTy
+SQZc39uTQOjbZPlBXJD55QeVISCwe53pn55aWQll90XfE3XRapuYZdiL8wLwtl/L
+tjugTKjfoy9qqOGH5YB/4kHqoSJqow==
+=Itbi
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 5d5b096..a3f320a 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,6 +1,6 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.65.2
+Version: 7.65.3
Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -346,6 +346,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Sat Jul 20 2019 Paul Howarth - 7.65.3-1
+- new upstream release
+
* Wed Jul 17 2019 Kamil Dudka - 7.65.2-1
- new upstream release
diff --git a/sources b/sources
index 563e0f4..e0d70dd 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.65.2.tar.xz) = a411cf19c389301473d74b85d775e3ba0c7c2f6e74d7e0f8de47dace1a709bfba552c483c3faf94101f741a5478800284c475422844cedb6a7a070e2f78af263
+SHA512 (curl-7.65.3.tar.xz) = fc4f041d3d6682378ce9eef2c6081e6ad83bb2502ea4c992c760266584c09e9ebca7c6d35958bd32a888702d9308cbce7aef69c431f97994107d7ff6b953941b
From 22186831fb63c0aa5cf7d145919801c20cd96780 Mon Sep 17 00:00:00 2001
From: Fedora Release Engineering
Date: Wed, 24 Jul 2019 21:21:56 +0000
Subject: [PATCH 064/256] - Rebuilt for
https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering
---
curl.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index a3f320a..3828aff 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.65.3
-Release: 1%{?dist}
+Release: 2%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
@@ -346,6 +346,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Jul 24 2019 Fedora Release Engineering - 7.65.3-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
+
* Sat Jul 20 2019 Paul Howarth - 7.65.3-1
- new upstream release
From 863394fd9543b71d6b01cfb325d20ddcf189b86e Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 1 Aug 2019 16:31:27 +0200
Subject: [PATCH 065/256] improve handling of gss_init_sec_context() failures
---
0001-curl-7.65.3-negotiate-fails.patch | 166 +++++++++++++++++++++++++
curl.spec | 9 +-
2 files changed, 174 insertions(+), 1 deletion(-)
create mode 100644 0001-curl-7.65.3-negotiate-fails.patch
diff --git a/0001-curl-7.65.3-negotiate-fails.patch b/0001-curl-7.65.3-negotiate-fails.patch
new file mode 100644
index 0000000..9cfae77
--- /dev/null
+++ b/0001-curl-7.65.3-negotiate-fails.patch
@@ -0,0 +1,166 @@
+From 90f7ca7bec18b49bf2706430aa6493eda7d7a573 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka
+Date: Tue, 30 Jul 2019 12:59:35 +0200
+Subject: [PATCH] http_negotiate: improve handling of gss_init_sec_context()
+ failures
+
+If HTTPAUTH_GSSNEGOTIATE was used for a POST request and
+gss_init_sec_context() failed, the POST request was sent
+with empty body. This commit also restores the original
+behavior of `curl --fail --negotiate`, which was changed
+by commit 6c6035532383e300c712e4c1cd9fdd749ed5cf59.
+
+Add regression tests 2077 and 2078 to cover this.
+
+Fixes #3992
+Closes #4171
+
+Upstream-commit: 4c187043c5aac57f354ebb96cc6ff3263411e98d
+Signed-off-by: Kamil Dudka
+---
+ lib/http_negotiate.c | 2 +-
+ tests/data/Makefile.inc | 3 ++-
+ tests/data/test2077 | 42 ++++++++++++++++++++++++++++++++
+ tests/data/test2078 | 54 +++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 99 insertions(+), 2 deletions(-)
+ create mode 100644 tests/data/test2077
+ create mode 100644 tests/data/test2078
+
+diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
+index c8f406444..fe15dcefb 100644
+--- a/lib/http_negotiate.c
++++ b/lib/http_negotiate.c
+@@ -151,7 +151,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
+ if(result == CURLE_LOGIN_DENIED) {
+ /* negotiate auth failed, let's continue unauthenticated to stay
+ * compatible with the behavior before curl-7_64_0-158-g6c6035532 */
+- conn->data->state.authproblem = TRUE;
++ authp->done = TRUE;
+ return CURLE_OK;
+ }
+ else if(result)
+diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
+index 693e53d7c..3ed4a03e4 100644
+--- a/tests/data/Makefile.inc
++++ b/tests/data/Makefile.inc
+@@ -199,7 +199,8 @@ test2040 test2041 test2042 test2043 test2044 test2045 test2046 test2047 \
+ test2048 test2049 test2050 test2051 test2052 test2053 test2054 test2055 \
+ test2056 test2057 test2058 test2059 test2060 test2061 test2062 test2063 \
+ test2064 test2065 test2066 test2067 test2068 test2069 \
+- test2071 test2072 test2073 test2074 test2075 test2076 \
++ test2071 test2072 test2073 test2074 test2075 test2076 test2077 \
++test2078 \
+ test2080 \
+ test2100 \
+ \
+diff --git a/tests/data/test2077 b/tests/data/test2077
+new file mode 100644
+index 000000000..0c600f5c3
+--- /dev/null
++++ b/tests/data/test2077
+@@ -0,0 +1,42 @@
++
++
++
++HTTP
++HTTP GET
++GSS-API
++
++
++
++# Server-side
++
++
++HTTP/1.1 200 OK swsclose
++Content-Length: 23
++
++This IS the real page!
++
++
++
++# Client-side
++
++
++http
++
++
++GSS-API
++
++
++curl --fail --negotiate to unauthenticated service fails
++
++
++http://%HOSTIP:%HTTPPORT/2077 -u : --fail --negotiate
++
++
++
++# Verify data after the test has been "shot"
++
++
++0
++
++
++
+diff --git a/tests/data/test2078 b/tests/data/test2078
+new file mode 100644
+index 000000000..99bc2dbee
+--- /dev/null
++++ b/tests/data/test2078
+@@ -0,0 +1,54 @@
++
++
++
++HTTP
++HTTP GET
++GSS-API
++
++
++
++# Server-side
++
++
++HTTP/1.1 200 OK swsclose
++Content-Length: 23
++
++This IS the real page!
++
++
++
++# Client-side
++
++
++http
++
++
++GSS-API
++
++
++curl --negotiate should not send empty POST request only
++
++
++http://%HOSTIP:%HTTPPORT/2078 -u : --negotiate --data name=value
++
++
++
++# Verify data after the test has been "shot"
++
++
++0
++
++
++^User-Agent:.*
++
++
++POST /2078 HTTP/1.1
++Host: 127.0.0.1:8990
++Accept: */*
++Content-Length: 10
++Content-Type: application/x-www-form-urlencoded
++
++name=value
++
++
++
+--
+2.20.1
+
diff --git a/curl.spec b/curl.spec
index 3828aff..ad0b460 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,10 +1,13 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.65.3
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
+# improve handling of gss_init_sec_context() failures
+Patch1: 0001-curl-7.65.3-negotiate-fails.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -171,6 +174,7 @@ be installed.
%setup -q
# upstream patches
+%patch1 -p1
# Fedora patches
%patch101 -p1
@@ -346,6 +350,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Thu Aug 01 2019 Kamil Dudka - 7.65.3-3
+- new upstream release
+
* Wed Jul 24 2019 Fedora Release Engineering - 7.65.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
From 8559ecc1d99f43ecedecf06c588afe20286680ce Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Thu, 1 Aug 2019 16:41:42 +0200
Subject: [PATCH 066/256] changelog: fix copy/paste error in the last entry
---
curl.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/curl.spec b/curl.spec
index ad0b460..e6799f9 100644
--- a/curl.spec
+++ b/curl.spec
@@ -351,7 +351,7 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%changelog
* Thu Aug 01 2019 Kamil Dudka - 7.65.3-3
-- new upstream release
+- improve handling of gss_init_sec_context() failures
* Wed Jul 24 2019 Fedora Release Engineering - 7.65.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
From 91c50ee6d4c7512577cf97fbdb6b8038bf8b6de3 Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Tue, 27 Aug 2019 18:10:11 +0200
Subject: [PATCH 067/256] Resolves: #1690971 - avoid reporting spurious error
in the HTTP2 framing layer
---
0002-curl-7.65.3-h2-framing-layer-error.patch | 37 +++++++++++++++++++
curl.spec | 9 ++++-
2 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 0002-curl-7.65.3-h2-framing-layer-error.patch
diff --git a/0002-curl-7.65.3-h2-framing-layer-error.patch b/0002-curl-7.65.3-h2-framing-layer-error.patch
new file mode 100644
index 0000000..24db142
--- /dev/null
+++ b/0002-curl-7.65.3-h2-framing-layer-error.patch
@@ -0,0 +1,37 @@
+From 98d59387c749256c2421b22dc3419b94d381986a Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg
+Date: Mon, 26 Aug 2019 16:00:05 +0200
+Subject: [PATCH] http2: when marked for closure and wanted to close == OK
+
+It could otherwise return an error even when closed correctly if GOAWAY
+had been received previously.
+
+Reported-by: Tom van der Woerdt
+Fixes #4267
+Closes #4268
+
+Upstream-commit: c1b6a384f9c8a91197c20adb49d43f30dc0e917d
+Signed-off-by: Kamil Dudka
+---
+ lib/http2.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/lib/http2.c b/lib/http2.c
+index 930e85165..31d2d698a 100644
+--- a/lib/http2.c
++++ b/lib/http2.c
+@@ -1566,6 +1566,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
+ if(should_close_session(httpc)) {
+ H2BUGF(infof(data,
+ "http2_recv: nothing to do in this session\n"));
++ if(conn->bits.close) {
++ /* already marked for closure, return OK and we're done */
++ *err = CURLE_OK;
++ return 0;
++ }
+ *err = CURLE_HTTP2;
+ return -1;
+ }
+--
+2.20.1
+
diff --git a/curl.spec b/curl.spec
index e6799f9..54654c4 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.65.3
-Release: 3%{?dist}
+Release: 4%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
# improve handling of gss_init_sec_context() failures
Patch1: 0001-curl-7.65.3-negotiate-fails.patch
+# avoid reporting spurious error in the HTTP2 framing layer (#1690971)
+Patch2: 0002-curl-7.65.3-h2-framing-layer-error.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -175,6 +178,7 @@ be installed.
# upstream patches
%patch1 -p1
+%patch2 -p1
# Fedora patches
%patch101 -p1
@@ -350,6 +354,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Tue Aug 27 2019 Kamil Dudka - 7.65.3-4
+- avoid reporting spurious error in the HTTP2 framing layer (#1690971)
+
* Thu Aug 01 2019 Kamil Dudka - 7.65.3-3
- improve handling of gss_init_sec_context() failures
From da9af162568dfb4338fd422cf398964fda75b72e Mon Sep 17 00:00:00 2001
From: Kamil Dudka
Date: Wed, 11 Sep 2019 09:57:42 +0200
Subject: [PATCH 068/256] new upstream release - 7.66.0
Resolves: CVE-2019-5481 - double free due to subsequent call of realloc()
Resolves: CVE-2019-5482 - heap buffer overflow in function tftp_receive_packet()
---
0001-curl-7.65.3-negotiate-fails.patch | 166 ------------------
0002-curl-7.65.3-h2-framing-layer-error.patch | 37 ----
0102-curl-7.36.0-debug.patch | 2 +-
curl-7.65.3.tar.xz.asc | 11 --
curl-7.66.0.tar.xz.asc | 11 ++
curl.spec | 17 +-
sources | 2 +-
7 files changed, 20 insertions(+), 226 deletions(-)
delete mode 100644 0001-curl-7.65.3-negotiate-fails.patch
delete mode 100644 0002-curl-7.65.3-h2-framing-layer-error.patch
delete mode 100644 curl-7.65.3.tar.xz.asc
create mode 100644 curl-7.66.0.tar.xz.asc
diff --git a/0001-curl-7.65.3-negotiate-fails.patch b/0001-curl-7.65.3-negotiate-fails.patch
deleted file mode 100644
index 9cfae77..0000000
--- a/0001-curl-7.65.3-negotiate-fails.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-From 90f7ca7bec18b49bf2706430aa6493eda7d7a573 Mon Sep 17 00:00:00 2001
-From: Kamil Dudka
-Date: Tue, 30 Jul 2019 12:59:35 +0200
-Subject: [PATCH] http_negotiate: improve handling of gss_init_sec_context()
- failures
-
-If HTTPAUTH_GSSNEGOTIATE was used for a POST request and
-gss_init_sec_context() failed, the POST request was sent
-with empty body. This commit also restores the original
-behavior of `curl --fail --negotiate`, which was changed
-by commit 6c6035532383e300c712e4c1cd9fdd749ed5cf59.
-
-Add regression tests 2077 and 2078 to cover this.
-
-Fixes #3992
-Closes #4171
-
-Upstream-commit: 4c187043c5aac57f354ebb96cc6ff3263411e98d
-Signed-off-by: Kamil Dudka
----
- lib/http_negotiate.c | 2 +-
- tests/data/Makefile.inc | 3 ++-
- tests/data/test2077 | 42 ++++++++++++++++++++++++++++++++
- tests/data/test2078 | 54 +++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 99 insertions(+), 2 deletions(-)
- create mode 100644 tests/data/test2077
- create mode 100644 tests/data/test2078
-
-diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c
-index c8f406444..fe15dcefb 100644
---- a/lib/http_negotiate.c
-+++ b/lib/http_negotiate.c
-@@ -151,7 +151,7 @@ CURLcode Curl_output_negotiate(struct connectdata *conn, bool proxy)
- if(result == CURLE_LOGIN_DENIED) {
- /* negotiate auth failed, let's continue unauthenticated to stay
- * compatible with the behavior before curl-7_64_0-158-g6c6035532 */
-- conn->data->state.authproblem = TRUE;
-+ authp->done = TRUE;
- return CURLE_OK;
- }
- else if(result)
-diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
-index 693e53d7c..3ed4a03e4 100644
---- a/tests/data/Makefile.inc
-+++ b/tests/data/Makefile.inc
-@@ -199,7 +199,8 @@ test2040 test2041 test2042 test2043 test2044 test2045 test2046 test2047 \
- test2048 test2049 test2050 test2051 test2052 test2053 test2054 test2055 \
- test2056 test2057 test2058 test2059 test2060 test2061 test2062 test2063 \
- test2064 test2065 test2066 test2067 test2068 test2069 \
-- test2071 test2072 test2073 test2074 test2075 test2076 \
-+ test2071 test2072 test2073 test2074 test2075 test2076 test2077 \
-+test2078 \
- test2080 \
- test2100 \
- \
-diff --git a/tests/data/test2077 b/tests/data/test2077
-new file mode 100644
-index 000000000..0c600f5c3
---- /dev/null
-+++ b/tests/data/test2077
-@@ -0,0 +1,42 @@
-+
-+
-+
-+HTTP
-+HTTP GET
-+GSS-API
-+
-+
-+
-+# Server-side
-+
-+
-+HTTP/1.1 200 OK swsclose
-+Content-Length: 23
-+
-+This IS the real page!
-+
-+
-+
-+# Client-side
-+
-+
-+http
-+
-+
-+GSS-API
-+
-+
-+curl --fail --negotiate to unauthenticated service fails
-+
-+
-+http://%HOSTIP:%HTTPPORT/2077 -u : --fail --negotiate
-+
-+
-+
-+# Verify data after the test has been "shot"
-+
-+
-+0
-+
-+
-+
-diff --git a/tests/data/test2078 b/tests/data/test2078
-new file mode 100644
-index 000000000..99bc2dbee
---- /dev/null
-+++ b/tests/data/test2078
-@@ -0,0 +1,54 @@
-+
-+
-+
-+HTTP
-+HTTP GET
-+GSS-API
-+
-+
-+
-+# Server-side
-+
-+
-+HTTP/1.1 200 OK swsclose
-+Content-Length: 23
-+
-+This IS the real page!
-+
-+
-+
-+# Client-side
-+
-+
-+http
-+
-+
-+GSS-API
-+
-+
-+curl --negotiate should not send empty POST request only
-+
-+
-+http://%HOSTIP:%HTTPPORT/2078 -u : --negotiate --data name=value
-+
-+
-+
-+# Verify data after the test has been "shot"
-+
-+
-+0
-+
-+
-+^User-Agent:.*
-+
-+
-+POST /2078 HTTP/1.1
-+Host: 127.0.0.1:8990
-+Accept: */*
-+Content-Length: 10
-+Content-Type: application/x-www-form-urlencoded
-+
-+name=value
-+
-+
-+
---
-2.20.1
-
diff --git a/0002-curl-7.65.3-h2-framing-layer-error.patch b/0002-curl-7.65.3-h2-framing-layer-error.patch
deleted file mode 100644
index 24db142..0000000
--- a/0002-curl-7.65.3-h2-framing-layer-error.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 98d59387c749256c2421b22dc3419b94d381986a Mon Sep 17 00:00:00 2001
-From: Daniel Stenberg
-Date: Mon, 26 Aug 2019 16:00:05 +0200
-Subject: [PATCH] http2: when marked for closure and wanted to close == OK
-
-It could otherwise return an error even when closed correctly if GOAWAY
-had been received previously.
-
-Reported-by: Tom van der Woerdt
-Fixes #4267
-Closes #4268
-
-Upstream-commit: c1b6a384f9c8a91197c20adb49d43f30dc0e917d
-Signed-off-by: Kamil Dudka
----
- lib/http2.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/lib/http2.c b/lib/http2.c
-index 930e85165..31d2d698a 100644
---- a/lib/http2.c
-+++ b/lib/http2.c
-@@ -1566,6 +1566,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
- if(should_close_session(httpc)) {
- H2BUGF(infof(data,
- "http2_recv: nothing to do in this session\n"));
-+ if(conn->bits.close) {
-+ /* already marked for closure, return OK and we're done */
-+ *err = CURLE_OK;
-+ return 0;
-+ }
- *err = CURLE_HTTP2;
- return -1;
- }
---
-2.20.1
-
diff --git a/0102-curl-7.36.0-debug.patch b/0102-curl-7.36.0-debug.patch
index 4f7991b..affe9f0 100644
--- a/0102-curl-7.36.0-debug.patch
+++ b/0102-curl-7.36.0-debug.patch
@@ -12,7 +12,7 @@ diff --git a/configure b/configure
index 8f079a3..53b4774 100755
--- a/configure
+++ b/configure
-@@ -16288,18 +16288,11 @@ $as_echo "yes" >&6; }
+@@ -16301,18 +16301,11 @@ $as_echo "yes" >&6; }
gccvhi=`echo $gccver | cut -d . -f1`
gccvlo=`echo $gccver | cut -d . -f2`
compiler_num=`(expr $gccvhi "*" 100 + $gccvlo) 2>/dev/null`
diff --git a/curl-7.65.3.tar.xz.asc b/curl-7.65.3.tar.xz.asc
deleted file mode 100644
index 1671b07..0000000
--- a/curl-7.65.3.tar.xz.asc
+++ /dev/null
@@ -1,11 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAl0xj7oACgkQXMkI/bce
-EsKYbgf9G41o5x73tc+2TOGt2QmJ7ukyHmd5Vq7XTSNdNU5dJ41Z3qh9Jm72x62i
-b4kJMjWyoL2j031ml5JevycpMpNa1v784UlPW2tzzL2B7v6vcA4xknJRLWlPlcTJ
-HOgub6r7g/zhOpdAeJh8o4jkBLUyN+S/HOyHLWcvdWDnhqUAmpZfIqtd8kjqzDul
-XAkdj7MxWqKZ3wXWwlpp4j81jpfOj7KCC/ZpxlJ0KfefgYEzV23O2hcJzw57jqTy
-SQZc39uTQOjbZPlBXJD55QeVISCwe53pn55aWQll90XfE3XRapuYZdiL8wLwtl/L
-tjugTKjfoy9qqOGH5YB/4kHqoSJqow==
-=Itbi
------END PGP SIGNATURE-----
diff --git a/curl-7.66.0.tar.xz.asc b/curl-7.66.0.tar.xz.asc
new file mode 100644
index 0000000..83e8258
--- /dev/null
+++ b/curl-7.66.0.tar.xz.asc
@@ -0,0 +1,11 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQEzBAABCgAdFiEEJ+3q8i86vOtQ25oSXMkI/bceEsIFAl14i4AACgkQXMkI/bce
+EsJwgwf/WauX31s687pdOgpPE4ymPuxIrdVl+NovWdOBdQQfIA0c/4lu4onJYPAT
+K6wq86me5y8fj/Q3ymqQ3H1EcJE2vTHPx/w+zEHNsEILtBMFHdm84CJzhdLlI1GC
+9iBkjVKk/2s0tBOdC3HuskYLY2y02dHACvTvDJjx42nK4IbsdjoamVdMa7vep1TG
+abmLRNHkOHKjioYWi0N04c5H5YDpdWOOjFY+EPO+m+YQuJlYkgw90nlmOaqiLcHL
+3zGCMNXb209wxuNEVKenlhPQ/3FQZ9+8a4b6mMqBX7PDwhDiZLhqIJgVseWdw1r0
+Qm2suW4eUtlC2DTqTMtusG7EMN8pag==
+=pFLb
+-----END PGP SIGNATURE-----
diff --git a/curl.spec b/curl.spec
index 54654c4..7d8f9f8 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,16 +1,10 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
-Version: 7.65.3
-Release: 4%{?dist}
+Version: 7.66.0
+Release: 1%{?dist}
License: MIT
Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
-# improve handling of gss_init_sec_context() failures
-Patch1: 0001-curl-7.65.3-negotiate-fails.patch
-
-# avoid reporting spurious error in the HTTP2 framing layer (#1690971)
-Patch2: 0002-curl-7.65.3-h2-framing-layer-error.patch
-
# patch making libcurl multilib ready
Patch101: 0101-curl-7.32.0-multilib.patch
@@ -177,8 +171,6 @@ be installed.
%setup -q
# upstream patches
-%patch1 -p1
-%patch2 -p1
# Fedora patches
%patch101 -p1
@@ -354,6 +346,11 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
%{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
%changelog
+* Wed Sep 11 2019 Kamil Dudka - 7.66.0-1
+- new upstream release, which fixes the following vulnerabilities
+ CVE-2019-5481 - double free due to subsequent call of realloc()
+ CVE-2019-5482 - heap buffer overflow in function tftp_receive_packet()
+
* Tue Aug 27 2019 Kamil Dudka - 7.65.3-4
- avoid reporting spurious error in the HTTP2 framing layer (#1690971)
diff --git a/sources b/sources
index e0d70dd..aea53b9 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (curl-7.65.3.tar.xz) = fc4f041d3d6682378ce9eef2c6081e6ad83bb2502ea4c992c760266584c09e9ebca7c6d35958bd32a888702d9308cbce7aef69c431f97994107d7ff6b953941b
+SHA512 (curl-7.66.0.tar.xz) = 81170e7e4fa9d99ee2038d96d7f2ab10dcf52435331c818c7565c1a733891720f845a08029915e52ba532c6a344c346e1678474624aac1cc333aea6d1eacde35
From e0bf66ef6c403a5f93199b6f5a29105f5e4c244f Mon Sep 17 00:00:00 2001
From: Kamil Dudka