mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
Disabled preauth compression (zlib) by default
Removed it from the wanted methods list in the ssh_options_set function. Now users have to set the compression value to 'zlib' explicitly to enable it. Updated unit tests to reflect removing zlib compression algo from the defaults compression algorithms. Signed-off-by: Khalid Mamdouh <khalidmamdou7@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -940,9 +940,9 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
||||
} else {
|
||||
const char *tmp = v;
|
||||
if (strcasecmp(value, "yes") == 0){
|
||||
tmp = "zlib@openssh.com,zlib,none";
|
||||
tmp = "zlib@openssh.com,none";
|
||||
} else if (strcasecmp(value, "no") == 0){
|
||||
tmp = "none,zlib@openssh.com,zlib";
|
||||
tmp = "none,zlib@openssh.com";
|
||||
}
|
||||
rc = ssh_options_set_algo(session,
|
||||
SSH_COMP_C_S,
|
||||
@@ -960,9 +960,9 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
||||
} else {
|
||||
const char *tmp = v;
|
||||
if (strcasecmp(value, "yes") == 0){
|
||||
tmp = "zlib@openssh.com,zlib,none";
|
||||
tmp = "zlib@openssh.com,none";
|
||||
} else if (strcasecmp(value, "no") == 0){
|
||||
tmp = "none,zlib@openssh.com,zlib";
|
||||
tmp = "none,zlib@openssh.com";
|
||||
}
|
||||
|
||||
rc = ssh_options_set_algo(session,
|
||||
|
||||
@@ -579,9 +579,9 @@ static void torture_config_new(void ** state,
|
||||
assert_string_equal(session->opts.bindaddr, BIND_ADDRESS);
|
||||
#ifdef WITH_ZLIB
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"zlib@openssh.com,zlib,none");
|
||||
"zlib@openssh.com,none");
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_S_C],
|
||||
"zlib@openssh.com,zlib,none");
|
||||
"zlib@openssh.com,none");
|
||||
#else
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"none");
|
||||
|
||||
@@ -982,9 +982,9 @@ static void torture_options_getopt(void **state)
|
||||
assert_string_equal(session->opts.identity_non_exp->root->data, "id_rsa");
|
||||
#ifdef WITH_ZLIB
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"zlib@openssh.com,zlib,none");
|
||||
"zlib@openssh.com,none");
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_S_C],
|
||||
"zlib@openssh.com,zlib,none");
|
||||
"zlib@openssh.com,none");
|
||||
#else
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"none");
|
||||
@@ -1052,9 +1052,9 @@ static void torture_options_getopt(void **state)
|
||||
assert_ssh_return_code(session, rc);
|
||||
#ifdef WITH_ZLIB
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"none,zlib@openssh.com,zlib");
|
||||
"none,zlib@openssh.com");
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_S_C],
|
||||
"none,zlib@openssh.com,zlib");
|
||||
"none,zlib@openssh.com");
|
||||
#else
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"none");
|
||||
@@ -1068,9 +1068,9 @@ static void torture_options_getopt(void **state)
|
||||
assert_string_equal(argv[0], EXECUTABLE_NAME);
|
||||
#ifdef WITH_ZLIB
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"zlib@openssh.com,zlib,none");
|
||||
"zlib@openssh.com,none");
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_S_C],
|
||||
"zlib@openssh.com,zlib,none");
|
||||
"zlib@openssh.com,none");
|
||||
#else
|
||||
assert_string_equal(session->opts.wanted_methods[SSH_COMP_C_S],
|
||||
"none");
|
||||
|
||||
Reference in New Issue
Block a user