xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-support/curl/curl/CVE-2023-23914_5-4.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From dc0725244a3163f1e2d5f51165db3a1a430f3ba0 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Tue, 27 Dec 2022 11:50:23 +0100
4Subject: [PATCH] runtests: support crlf="yes" for verify/proxy
5
6CVE: CVE-2023-23914 CVE-2023-23915
7Upstream-Status: Backport [https://github.com/curl/curl/pull/10138/commits/fd7e1a557e414dd803c9225e37a2ca84e1df2269]
8Comment: Refreshed hunk from FILEFORMAT.md
9Signed-off-by: Pawan Badganchi <Pawan.Badganchi@kpit.com>
10Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
11---
12 tests/FILEFORMAT.md | 4 ++--
13 tests/runtests.pl   | 5 +++++
14 2 files changed, 7 insertions(+), 2 deletions(-)
15
16--- a/tests/FILEFORMAT.md
17+++ b/tests/FILEFORMAT.md
18@@ -540,14 +540,14 @@
19 One perl op per line that operates on the protocol dump. This is pretty
20 advanced. Example: `s/^EPRT .*/EPRT stripped/`.
21
22-### `<protocol [nonewline="yes"]>`
23+### `<protocol [nonewline="yes"][crlf="yes"]>`
24
25 the protocol dump curl should transmit, if 'nonewline' is set, we will cut off
26 the trailing newline of this given data before comparing with the one actually
27 sent by the client The `<strip>` and `<strippart>` rules are applied before
28 comparisons are made.
29
30-### `<proxy [nonewline="yes"]>`
31+### `<proxy [nonewline="yes"][crlf="yes"]>`
32
33 The protocol dump curl should transmit to a HTTP proxy (when the http-proxy
34 server is used), if 'nonewline' is set, we will cut off the trailing newline
35--- a/tests/runtests.pl
36+++ b/tests/runtests.pl
37@@ -4744,6 +4744,11 @@ sub singletest {
38             }
39         }
40
41+        if($hash{'crlf'} ||
42+           ($has_hyper && ($keywords{"HTTP"} || $keywords{"HTTPS"}))) {
43+            map subNewlines(0, \$_), @protstrip;
44+        }
45+
46         $res = compare($testnum, $testname, "proxy", \@out, \@protstrip);
47         if($res) {
48             return $errorreturncode;
49