summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2021-09-08 20:01:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-11 18:41:38 +0100
commit0f89346baa40887ad3c7a170f5d0c19566e2c3c5 (patch)
treefbff387b5f542b685de524e9d5eb4c6c348cc7f0
parent8bddba7249e5aaec5952c507c123d0269139a4ad (diff)
downloadpoky-0f89346baa40887ad3c7a170f5d0c19566e2c3c5.tar.gz
libssh2: update 1.9.0 -> 1.10.0
0001-configure-Conditionally-undefine-backend-m4-macro.patch no longer needed; code removed upstream. License-Update: copyright years (From OE-Core rev: 6547e565cc1685eb4e42f61d88203cf743a06284) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch6
-rw-r--r--meta/recipes-support/libssh2/files/0001-configure-Conditionally-undefine-backend-m4-macro.patch30
-rw-r--r--meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch112
-rw-r--r--meta/recipes-support/libssh2/files/CVE-2019-17498.patch131
-rw-r--r--meta/recipes-support/libssh2/libssh2_1.10.0.bb (renamed from meta/recipes-support/libssh2/libssh2_1.9.0.bb)10
5 files changed, 5 insertions, 284 deletions
diff --git a/meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch b/meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch
index 5ff9bf8462..b1204e49eb 100644
--- a/meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch
+++ b/meta/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch
@@ -1,4 +1,4 @@
1From f9e3e2ee7b18ba5bb8efe083171f3e701eb0a663 Mon Sep 17 00:00:00 2001 1From f6abce5ba41a412a247250dcd80e387e53474466 Mon Sep 17 00:00:00 2001
2From: Your Name <you@example.com> 2From: Your Name <you@example.com>
3Date: Mon, 28 Dec 2020 02:08:03 +0000 3Date: Mon, 28 Dec 2020 02:08:03 +0000
4Subject: [PATCH] Don't let host enviroment to decide if a test is build 4Subject: [PATCH] Don't let host enviroment to decide if a test is build
@@ -9,6 +9,7 @@ don't use SSHD on host to decide weither to build a test
9Upstream-Status: Inappropriate[oe specific] 9Upstream-Status: Inappropriate[oe specific]
10 10
11Signed-off-by: Changqing Li <changqing.li@windriver.com> 11Signed-off-by: Changqing Li <changqing.li@windriver.com>
12
12--- 13---
13 tests/Makefile.am | 6 +----- 14 tests/Makefile.am | 6 +-----
14 1 file changed, 1 insertion(+), 5 deletions(-) 15 1 file changed, 1 insertion(+), 5 deletions(-)
@@ -41,6 +42,3 @@ index dc0922f..6cbc35d 100644
41-endif 42-endif
42\ No newline at end of file 43\ No newline at end of file
43+endif 44+endif
44--
452.20.1
46
diff --git a/meta/recipes-support/libssh2/files/0001-configure-Conditionally-undefine-backend-m4-macro.patch b/meta/recipes-support/libssh2/files/0001-configure-Conditionally-undefine-backend-m4-macro.patch
deleted file mode 100644
index 1128c7ea0c..0000000000
--- a/meta/recipes-support/libssh2/files/0001-configure-Conditionally-undefine-backend-m4-macro.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From efe7101786193eaddb749c0583af6b54aec6f289 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 2 Feb 2021 18:45:16 -0800
4Subject: [PATCH] configure: Conditionally undefine backend m4 macro
5
6Unlike the M4 builtin, this macro fails if macro is not defined
7therefore recover the behavior of the builtin.
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 configure.ac | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/configure.ac b/configure.ac
16index fe5054a..758f8c2 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -127,7 +127,7 @@ fi
20 m4_set_foreach([crypto_backends], [backend],
21 [AM_CONDITIONAL(m4_toupper(backend), test "$found_crypto" = "backend")]
22 )
23-m4_undefine([backend])
24+m4_ifdef([backend], [m4_undefine([backend])])
25
26
27 # libz
28--
292.30.0
30
diff --git a/meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch b/meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch
deleted file mode 100644
index b331c1bf81..0000000000
--- a/meta/recipes-support/libssh2/files/0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch
+++ /dev/null
@@ -1,112 +0,0 @@
1From 1f76151c92e1b52e9c24ebf06adc77fbd6c062bc Mon Sep 17 00:00:00 2001
2From: Will Cosgrove <will@panic.com>
3Date: Tue, 26 Jan 2021 11:41:21 -0800
4Subject: [PATCH] kex.c: move EC macro outside of if check #549 (#550)
5
6File: kex.c
7
8Notes:
9Moved the macro LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY outside of the LIBSSH2_ECDSA since it's also now used by the ED25519 code.
10
11Sha 256, 384 and 512 need to be defined for all backends now even if they aren't used directly. I believe this is already the case, but just a heads up.
12
13Credit:
14Stefan-Ghinea
15
16Upstream-Status: Backport
17
18Reference to upstream patch:
19https://github.com/libssh2/libssh2/commit/1f76151c92e1b52e9c24ebf06adc77fbd6c062bc
20
21Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
22---
23 src/kex.c | 66 +++++++++++++++++++++++++++----------------------------
24 1 file changed, 33 insertions(+), 33 deletions(-)
25
26diff --git a/src/kex.c b/src/kex.c
27index cb16639..19ab6ec 100644
28--- a/src/kex.c
29+++ b/src/kex.c
30@@ -1885,39 +1885,6 @@ kex_method_diffie_hellman_group_exchange_sha256_key_exchange
31 }
32
33
34-#if LIBSSH2_ECDSA
35-
36-/* kex_session_ecdh_curve_type
37- * returns the EC curve type by name used in key exchange
38- */
39-
40-static int
41-kex_session_ecdh_curve_type(const char *name, libssh2_curve_type *out_type)
42-{
43- int ret = 0;
44- libssh2_curve_type type;
45-
46- if(name == NULL)
47- return -1;
48-
49- if(strcmp(name, "ecdh-sha2-nistp256") == 0)
50- type = LIBSSH2_EC_CURVE_NISTP256;
51- else if(strcmp(name, "ecdh-sha2-nistp384") == 0)
52- type = LIBSSH2_EC_CURVE_NISTP384;
53- else if(strcmp(name, "ecdh-sha2-nistp521") == 0)
54- type = LIBSSH2_EC_CURVE_NISTP521;
55- else {
56- ret = -1;
57- }
58-
59- if(ret == 0 && out_type) {
60- *out_type = type;
61- }
62-
63- return ret;
64-}
65-
66-
67 /* LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY
68 *
69 * Macro that create and verifies EC SHA hash with a given digest bytes
70@@ -2027,6 +1994,39 @@ kex_session_ecdh_curve_type(const char *name, libssh2_curve_type *out_type)
71 } \
72
73
74+#if LIBSSH2_ECDSA
75+
76+/* kex_session_ecdh_curve_type
77+ * returns the EC curve type by name used in key exchange
78+ */
79+
80+static int
81+kex_session_ecdh_curve_type(const char *name, libssh2_curve_type *out_type)
82+{
83+ int ret = 0;
84+ libssh2_curve_type type;
85+
86+ if(name == NULL)
87+ return -1;
88+
89+ if(strcmp(name, "ecdh-sha2-nistp256") == 0)
90+ type = LIBSSH2_EC_CURVE_NISTP256;
91+ else if(strcmp(name, "ecdh-sha2-nistp384") == 0)
92+ type = LIBSSH2_EC_CURVE_NISTP384;
93+ else if(strcmp(name, "ecdh-sha2-nistp521") == 0)
94+ type = LIBSSH2_EC_CURVE_NISTP521;
95+ else {
96+ ret = -1;
97+ }
98+
99+ if(ret == 0 && out_type) {
100+ *out_type = type;
101+ }
102+
103+ return ret;
104+}
105+
106+
107 /* ecdh_sha2_nistp
108 * Elliptic Curve Diffie Hellman Key Exchange
109 */
110--
1112.17.1
112
diff --git a/meta/recipes-support/libssh2/files/CVE-2019-17498.patch b/meta/recipes-support/libssh2/files/CVE-2019-17498.patch
deleted file mode 100644
index 001080072b..0000000000
--- a/meta/recipes-support/libssh2/files/CVE-2019-17498.patch
+++ /dev/null
@@ -1,131 +0,0 @@
1From dedcbd106f8e52d5586b0205bc7677e4c9868f9c Mon Sep 17 00:00:00 2001
2From: Will Cosgrove <will@panic.com>
3Date: Fri, 30 Aug 2019 09:57:38 -0700
4Subject: [PATCH] packet.c: improve message parsing (#402)
5
6* packet.c: improve parsing of packets
7
8file: packet.c
9
10notes:
11Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST.
12
13Upstream-Status: Backport
14CVE: CVE-2019-17498
15Signed-off-by: Li Zhou <li.zhou@windriver.com>
16---
17 src/packet.c | 68 ++++++++++++++++++++++------------------------------
18 1 file changed, 29 insertions(+), 39 deletions(-)
19
20diff --git a/src/packet.c b/src/packet.c
21index 38ab629..2e01bfc 100644
22--- a/src/packet.c
23+++ b/src/packet.c
24@@ -419,8 +419,8 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
25 size_t datalen, int macstate)
26 {
27 int rc = 0;
28- char *message = NULL;
29- char *language = NULL;
30+ unsigned char *message = NULL;
31+ unsigned char *language = NULL;
32 size_t message_len = 0;
33 size_t language_len = 0;
34 LIBSSH2_CHANNEL *channelp = NULL;
35@@ -472,33 +472,23 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
36
37 case SSH_MSG_DISCONNECT:
38 if(datalen >= 5) {
39- size_t reason = _libssh2_ntohu32(data + 1);
40+ uint32_t reason = 0;
41+ struct string_buf buf;
42+ buf.data = (unsigned char *)data;
43+ buf.dataptr = buf.data;
44+ buf.len = datalen;
45+ buf.dataptr++; /* advance past type */
46
47- if(datalen >= 9) {
48- message_len = _libssh2_ntohu32(data + 5);
49+ _libssh2_get_u32(&buf, &reason);
50+ _libssh2_get_string(&buf, &message, &message_len);
51+ _libssh2_get_string(&buf, &language, &language_len);
52
53- if(message_len < datalen-13) {
54- /* 9 = packet_type(1) + reason(4) + message_len(4) */
55- message = (char *) data + 9;
56-
57- language_len =
58- _libssh2_ntohu32(data + 9 + message_len);
59- language = (char *) data + 9 + message_len + 4;
60-
61- if(language_len > (datalen-13-message_len)) {
62- /* bad input, clear info */
63- language = message = NULL;
64- language_len = message_len = 0;
65- }
66- }
67- else
68- /* bad size, clear it */
69- message_len = 0;
70- }
71 if(session->ssh_msg_disconnect) {
72- LIBSSH2_DISCONNECT(session, reason, message,
73- message_len, language, language_len);
74+ LIBSSH2_DISCONNECT(session, reason, (const char *)message,
75+ message_len, (const char *)language,
76+ language_len);
77 }
78+
79 _libssh2_debug(session, LIBSSH2_TRACE_TRANS,
80 "Disconnect(%d): %s(%s)", reason,
81 message, language);
82@@ -539,24 +529,24 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
83 int always_display = data[1];
84
85 if(datalen >= 6) {
86- message_len = _libssh2_ntohu32(data + 2);
87-
88- if(message_len <= (datalen - 10)) {
89- /* 6 = packet_type(1) + display(1) + message_len(4) */
90- message = (char *) data + 6;
91- language_len = _libssh2_ntohu32(data + 6 +
92- message_len);
93-
94- if(language_len <= (datalen - 10 - message_len))
95- language = (char *) data + 10 + message_len;
96- }
97+ struct string_buf buf;
98+ buf.data = (unsigned char *)data;
99+ buf.dataptr = buf.data;
100+ buf.len = datalen;
101+ buf.dataptr += 2; /* advance past type & always display */
102+
103+ _libssh2_get_string(&buf, &message, &message_len);
104+ _libssh2_get_string(&buf, &language, &language_len);
105 }
106
107 if(session->ssh_msg_debug) {
108- LIBSSH2_DEBUG(session, always_display, message,
109- message_len, language, language_len);
110+ LIBSSH2_DEBUG(session, always_display,
111+ (const char *)message,
112+ message_len, (const char *)language,
113+ language_len);
114 }
115 }
116+
117 /*
118 * _libssh2_debug will actually truncate this for us so
119 * that it's not an inordinate about of data
120@@ -579,7 +569,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
121 uint32_t len = 0;
122 unsigned char want_reply = 0;
123 len = _libssh2_ntohu32(data + 1);
124- if(datalen >= (6 + len)) {
125+ if((len <= (UINT_MAX - 6)) && (datalen >= (6 + len))) {
126 want_reply = data[5 + len];
127 _libssh2_debug(session,
128 LIBSSH2_TRACE_CONN,
129--
1302.17.1
131
diff --git a/meta/recipes-support/libssh2/libssh2_1.9.0.bb b/meta/recipes-support/libssh2/libssh2_1.10.0.bb
index a0cbb6af6b..072d6819c0 100644
--- a/meta/recipes-support/libssh2/libssh2_1.9.0.bb
+++ b/meta/recipes-support/libssh2/libssh2_1.10.0.bb
@@ -5,19 +5,15 @@ SECTION = "libs"
5DEPENDS = "zlib" 5DEPENDS = "zlib"
6 6
7LICENSE = "BSD-3-Clause" 7LICENSE = "BSD-3-Clause"
8LIC_FILES_CHKSUM = "file://COPYING;md5=c5cf34fc0acb44b082ef50ef5e4354ca" 8LIC_FILES_CHKSUM = "file://COPYING;md5=3e089ad0cf27edf1e7f261dfcd06acc7"
9 9
10SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \ 10SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \
11 file://CVE-2019-17498.patch \
12 file://0001-configure-Conditionally-undefine-backend-m4-macro.patch \
13 file://run-ptest \ 11 file://run-ptest \
14 file://0001-kex.c-move-EC-macro-outside-of-if-check-549-550.patch \ 12 "
15"
16 13
17SRC_URI:append:ptest = " file://0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch" 14SRC_URI:append:ptest = " file://0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch"
18 15
19SRC_URI[md5sum] = "1beefafe8963982adc84b408b2959927" 16SRC_URI[sha256sum] = "2d64e90f3ded394b91d3a2e774ca203a4179f69aebee03003e5a6fa621e41d51"
20SRC_URI[sha256sum] = "d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd"
21 17
22inherit autotools pkgconfig ptest 18inherit autotools pkgconfig ptest
23 19