From f65628136faa35d0c4d3b5e7332275c7b35fcd96 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 3 Nov 2018 08:36:22 +0000 Subject: gentoo resync : 03.11.2018 --- net-libs/libssh/files/libssh-0.5.0-tests.patch | 11 -- .../files/libssh-0.7.5-add-macro-for-MAX.patch | 30 ---- .../libssh-0.7.5-fix-config-buffer-underflow.patch | 25 ---- .../files/libssh-0.7.5-fix-config-parsing.patch | 32 ----- .../libssh-0.7.5-fix-internal-algo-selection.patch | 156 --------------------- 5 files changed, 254 deletions(-) delete mode 100644 net-libs/libssh/files/libssh-0.5.0-tests.patch delete mode 100644 net-libs/libssh/files/libssh-0.7.5-add-macro-for-MAX.patch delete mode 100644 net-libs/libssh/files/libssh-0.7.5-fix-config-buffer-underflow.patch delete mode 100644 net-libs/libssh/files/libssh-0.7.5-fix-config-parsing.patch delete mode 100644 net-libs/libssh/files/libssh-0.7.5-fix-internal-algo-selection.patch (limited to 'net-libs/libssh/files') diff --git a/net-libs/libssh/files/libssh-0.5.0-tests.patch b/net-libs/libssh/files/libssh-0.5.0-tests.patch deleted file mode 100644 index dde770ce5b2a..000000000000 --- a/net-libs/libssh/files/libssh-0.5.0-tests.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/tests/unittests/torture_misc.c -+++ b/tests/unittests/torture_misc.c -@@ -195,7 +195,7 @@ - #ifdef _WIN32 - unit_test(torture_path_expand_tilde_win), - #else -- unit_test(torture_path_expand_tilde_unix), -+ //unit_test(torture_path_expand_tilde_unix), - #endif - unit_test_setup_teardown(torture_path_expand_escape, setup, teardown), - unit_test_setup_teardown(torture_path_expand_known_hosts, setup, teardown), diff --git a/net-libs/libssh/files/libssh-0.7.5-add-macro-for-MAX.patch b/net-libs/libssh/files/libssh-0.7.5-add-macro-for-MAX.patch deleted file mode 100644 index d9226d697000..000000000000 --- a/net-libs/libssh/files/libssh-0.7.5-add-macro-for-MAX.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 310d423d36ae7bb6dac5a2ae2fb7b57bda72dcb5 Mon Sep 17 00:00:00 2001 -From: Andreas Schneider -Date: Thu, 24 Aug 2017 17:27:08 +0200 -Subject: [PATCH 1/2] priv: Add macro for MAX - -Signed-off-by: Andreas Schneider -(cherry picked from commit de35212789d11086621e176a11399de0d75ab3a6) -Signed-off-by: Mihai Moldovan ---- - include/libssh/priv.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/include/libssh/priv.h b/include/libssh/priv.h -index 5a74915e..c3373c00 100644 ---- a/include/libssh/priv.h -+++ b/include/libssh/priv.h -@@ -263,6 +263,10 @@ int match_hostname(const char *host, const char *pattern, unsigned int len); - #define MIN(a,b) ((a) < (b) ? (a) : (b)) - #endif - -+#ifndef MAX -+#define MAX(a,b) ((a) > (b) ? (a) : (b)) -+#endif -+ - /** Free memory space */ - #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) - --- -2.15.1 - diff --git a/net-libs/libssh/files/libssh-0.7.5-fix-config-buffer-underflow.patch b/net-libs/libssh/files/libssh-0.7.5-fix-config-buffer-underflow.patch deleted file mode 100644 index 7ff03263d198..000000000000 --- a/net-libs/libssh/files/libssh-0.7.5-fix-config-buffer-underflow.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0cffb88b80b1e8b7e292646b955e9b9ca02315c4 Mon Sep 17 00:00:00 2001 -From: Aris Adamantiadis -Date: Thu, 8 Jun 2017 00:22:02 +0200 -Subject: config: fix buffer underflow with unrecognized opcodes - ---- - src/config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/config.c b/src/config.c -index 519926e7..6187c90f 100644 ---- a/src/config.c -+++ b/src/config.c -@@ -218,7 +218,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line, - } - - opcode = ssh_config_get_opcode(keyword); -- if (*parsing == 1 && opcode != SOC_HOST) { -+ if (*parsing == 1 && opcode != SOC_HOST && opcode != SOC_UNSUPPORTED) { - if (seen[opcode] != 0) { - return 0; - } --- -cgit v1.1 - diff --git a/net-libs/libssh/files/libssh-0.7.5-fix-config-parsing.patch b/net-libs/libssh/files/libssh-0.7.5-fix-config-parsing.patch deleted file mode 100644 index 3596cf02105d..000000000000 --- a/net-libs/libssh/files/libssh-0.7.5-fix-config-parsing.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 5333be5988c3789e7011598995f4df90d50d84d0 Mon Sep 17 00:00:00 2001 -From: "Artyom V. Poptsov" -Date: Sun, 4 Jun 2017 11:54:55 +0300 -Subject: config: Bugfix: Don't skip unseen opcodes - -libssh fails to read the configuration from a config file due to a -wrong check in 'ssh_config_parse_line' procedure in 'config.c'; it's -effectively skipping every opcode (and therefore every option) from -the file. The change fixes that behaviour. - -Signed-off-by: Artyom V. Poptsov -Reviewed-by: Andreas Schneider ---- - src/config.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/config.c b/src/config.c -index 6478fc5f..519926e7 100644 ---- a/src/config.c -+++ b/src/config.c -@@ -219,7 +219,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line, - - opcode = ssh_config_get_opcode(keyword); - if (*parsing == 1 && opcode != SOC_HOST) { -- if (seen[opcode] == 0) { -+ if (seen[opcode] != 0) { - return 0; - } - seen[opcode] = 1; --- -cgit v1.1 - diff --git a/net-libs/libssh/files/libssh-0.7.5-fix-internal-algo-selection.patch b/net-libs/libssh/files/libssh-0.7.5-fix-internal-algo-selection.patch deleted file mode 100644 index 931d63360a12..000000000000 --- a/net-libs/libssh/files/libssh-0.7.5-fix-internal-algo-selection.patch +++ /dev/null @@ -1,156 +0,0 @@ -From 4893f9515da2696490e6bbe9aaf51f2ef9678b0f Mon Sep 17 00:00:00 2001 -From: Nikos Mavrogiannopoulos -Date: Thu, 24 Aug 2017 16:28:39 +0200 -Subject: [PATCH 2/2] ssh_options_set_algo: ensure we only set known algorithms - internally - -That way, we will not fail later on key exchange phase when something -unknown is negotiated. - -Fixes T37 - -Signed-off-by: Nikos Mavrogiannopoulos -Reviewed-by: Andreas Schneider -(cherry picked from commit 895055ab38e7716390019aae5e11771a88b99d26) -Signed-off-by: Mihai Moldovan ---- - include/libssh/kex.h | 1 + - src/kex.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/options.c | 11 ++++---- - 3 files changed, 81 insertions(+), 6 deletions(-) - -diff --git a/include/libssh/kex.h b/include/libssh/kex.h -index 1a5b6d41..23594985 100644 ---- a/include/libssh/kex.h -+++ b/include/libssh/kex.h -@@ -41,6 +41,7 @@ void ssh_list_kex(struct ssh_kex_struct *kex); - int set_client_kex(ssh_session session); - int ssh_kex_select_methods(ssh_session session); - int verify_existing_algo(int algo, const char *name); -+char *keep_known_algos(int algo, const char *list); - char **space_tokenize(const char *chain); - int ssh_get_kex1(ssh_session session); - char *ssh_find_matching(const char *in_d, const char *what_d); -diff --git a/src/kex.c b/src/kex.c -index 519d79ce..f0c9d067 100644 ---- a/src/kex.c -+++ b/src/kex.c -@@ -281,6 +281,71 @@ char *ssh_find_matching(const char *available_d, const char *preferred_d){ - return NULL; - } - -+static char *ssh_find_all_matching(const char *available_d, -+ const char *preferred_d) -+{ -+ char **tok_available, **tok_preferred; -+ int i_avail, i_pref; -+ char *ret; -+ unsigned max, len, pos = 0; -+ -+ if ((available_d == NULL) || (preferred_d == NULL)) { -+ return NULL; /* don't deal with null args */ -+ } -+ -+ max = MAX(strlen(available_d), strlen(preferred_d)); -+ -+ ret = malloc(max+1); -+ if (ret == NULL) { -+ return NULL; -+ } -+ ret[0] = 0; -+ -+ tok_available = tokenize(available_d); -+ if (tok_available == NULL) { -+ SAFE_FREE(ret); -+ return NULL; -+ } -+ -+ tok_preferred = tokenize(preferred_d); -+ if (tok_preferred == NULL) { -+ SAFE_FREE(ret); -+ SAFE_FREE(tok_available[0]); -+ SAFE_FREE(tok_available); -+ return NULL; -+ } -+ -+ for (i_pref = 0; tok_preferred[i_pref] ; ++i_pref) { -+ for (i_avail = 0; tok_available[i_avail]; ++i_avail) { -+ int cmp = strcmp(tok_available[i_avail],tok_preferred[i_pref]); -+ if (cmp == 0) { -+ /* match */ -+ if (pos != 0) { -+ ret[pos] = ','; -+ pos++; -+ } -+ -+ len = strlen(tok_available[i_avail]); -+ memcpy(&ret[pos], tok_available[i_avail], len); -+ pos += len; -+ ret[pos] = '\0'; -+ } -+ } -+ } -+ -+ if (ret[0] == '\0') { -+ SAFE_FREE(ret); -+ ret = NULL; -+ } -+ -+ SAFE_FREE(tok_available[0]); -+ SAFE_FREE(tok_preferred[0]); -+ SAFE_FREE(tok_available); -+ SAFE_FREE(tok_preferred); -+ -+ return ret; -+} -+ - /** - * @internal - * @brief returns whether the first client key exchange algorithm or -@@ -668,4 +733,14 @@ int verify_existing_algo(int algo, const char *name){ - return 0; - } - -+/* returns a copy of the provided list if everything is supported, -+ * otherwise a new list of the supported algorithms */ -+char *keep_known_algos(int algo, const char *list) -+{ -+ if ((algo > 9) || (algo < 0)) { -+ return NULL; -+ } -+ -+ return ssh_find_all_matching(supported_methods[algo], list); -+} - /* vim: set ts=2 sw=2 et cindent: */ -diff --git a/src/options.c b/src/options.c -index aed2dda5..34fe9cc7 100644 ---- a/src/options.c -+++ b/src/options.c -@@ -164,7 +164,10 @@ int ssh_options_copy(ssh_session src, ssh_session *dest) { - - int ssh_options_set_algo(ssh_session session, int algo, - const char *list) { -- if (!verify_existing_algo(algo, list)) { -+ char *p = NULL; -+ -+ p = keep_known_algos(algo, list); -+ if (p == NULL) { - ssh_set_error(session, SSH_REQUEST_DENIED, - "Setting method: no algorithm for method \"%s\" (%s)\n", - ssh_kex_get_description(algo), list); -@@ -172,11 +175,7 @@ int ssh_options_set_algo(ssh_session session, int algo, - } - - SAFE_FREE(session->opts.wanted_methods[algo]); -- session->opts.wanted_methods[algo] = strdup(list); -- if (session->opts.wanted_methods[algo] == NULL) { -- ssh_set_error_oom(session); -- return -1; -- } -+ session->opts.wanted_methods[algo] = p; - - return 0; - } --- -2.15.1 - -- cgit v1.2.3