Skip to content

Commit c9e3a2d

Browse files
authored
Merge pull request #1506 from FreeRDP/issue_1505-sshcomp
Removed compression option as not compatible with all SSH servers. Fixes #1505
2 parents e3f5bd8 + e95784c commit c9e3a2d

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

remmina/src/remmina_ssh.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ remmina_ssh_init_session(RemminaSSH *ssh)
490490
ssh->session = ssh_new();
491491
ssh_options_set(ssh->session, SSH_OPTIONS_HOST, ssh->server);
492492
ssh_options_set(ssh->session, SSH_OPTIONS_PORT, &ssh->port);
493-
ssh_options_set(ssh->session, SSH_OPTIONS_COMPRESSION, "yes");
493+
/** @todo add an option to set the compression nad set it to no as the default option */
494+
//ssh_options_set(ssh->session, SSH_OPTIONS_COMPRESSION, "yes");
494495
/* When SSH_OPTIONS_USER is not set, the local user account is used */
495496
if (*ssh->user != 0)
496497
ssh_options_set(ssh->session, SSH_OPTIONS_USER, ssh->user);
@@ -536,6 +537,12 @@ remmina_ssh_init_session(RemminaSSH *ssh)
536537
}else {
537538
remmina_log_printf("[SSH] SSH_OPTIONS_STRICTHOSTKEYCHECK does not have a valid value: %d\n", ssh->stricthostkeycheck);
538539
}
540+
rc = ssh_options_set(ssh->session, SSH_OPTIONS_COMPRESSION, ssh->compression);
541+
if (rc == 0) {
542+
remmina_log_printf("[SSH] SSH_OPTIONS_COMPRESSION has been set to: %s\n", ssh->compression);
543+
}else {
544+
remmina_log_printf("[SSH] SSH_OPTIONS_COMPRESSION does not have a valid value: %s\n", ssh->compression);
545+
}
539546

540547
ssh_callbacks_init(ssh->callback);
541548
if (remmina_log_running()) {
@@ -646,6 +653,8 @@ remmina_ssh_init_from_file(RemminaSSH *ssh, RemminaFile *remminafile)
646653
ssh->hostkeytypes = g_strdup(remmina_file_get_string(remminafile, "ssh_hostkeytypes"));
647654
ssh->proxycommand = g_strdup(remmina_file_get_string(remminafile, "ssh_proxycommand"));
648655
ssh->stricthostkeycheck = remmina_file_get_int(remminafile, "ssh_stricthostkeycheck", 0);
656+
gint c = remmina_file_get_int(remminafile, "ssh_compression", 0);
657+
ssh->compression = (c == 1) ? "yes" : "no";
649658

650659
/* Public/Private keys */
651660
s = (ssh_privatekey ? g_strdup(ssh_privatekey) : remmina_ssh_find_identity());
@@ -679,7 +688,7 @@ remmina_ssh_init_from_ssh(RemminaSSH *ssh, const RemminaSSH *ssh_src)
679688
ssh->kex_algorithms = g_strdup(ssh_src->kex_algorithms);
680689
ssh->ciphers = g_strdup(ssh_src->ciphers);
681690
ssh->hostkeytypes = g_strdup(ssh_src->hostkeytypes);
682-
ssh->stricthostkeycheck = ssh_src->stricthostkeycheck;
691+
ssh->compression = ssh_src->compression;
683692

684693
return TRUE;
685694
}

remmina/src/remmina_ssh.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ typedef struct _RemminaSSH {
7474
gchar *hostkeytypes;
7575
gchar *proxycommand;
7676
gint stricthostkeycheck;
77+
const gchar *compression;
7778

7879
gchar *error;
7980

remmina/src/remmina_ssh_plugin.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ static const RemminaProtocolSetting remmina_ssh_advanced_settings[] =
10041004
{ REMMINA_PROTOCOL_SETTING_TYPE_FOLDER, "sshlogfolder", N_("SSH session log folder"), FALSE, NULL, NULL },
10051005
{ REMMINA_PROTOCOL_SETTING_TYPE_TEXT, "sshlogname", N_("SSH session log file name"), FALSE, NULL, NULL },
10061006
{ REMMINA_PROTOCOL_SETTING_TYPE_CHECK, "sshlogenabled", N_("Enable SSH session logging at exit"), FALSE, NULL, NULL },
1007+
{ REMMINA_PROTOCOL_SETTING_TYPE_CHECK, "ssh_compression", N_("Enable SSH compression"), FALSE, NULL, NULL },
10071008
{ REMMINA_PROTOCOL_SETTING_TYPE_CHECK, "disablepasswordstoring", N_("Disable password storing"), TRUE, NULL, NULL },
10081009
{ REMMINA_PROTOCOL_SETTING_TYPE_CHECK, "ssh_stricthostkeycheck", N_("Strict host key checking"), TRUE, NULL, NULL },
10091010
{ REMMINA_PROTOCOL_SETTING_TYPE_END, NULL, NULL, FALSE, NULL, NULL }

0 commit comments

Comments
 (0)