diff --git a/tabby-ssh/src/algorithms.ts b/tabby-ssh/src/algorithms.ts index 5452e24a..4ab2c63f 100644 --- a/tabby-ssh/src/algorithms.ts +++ b/tabby-ssh/src/algorithms.ts @@ -6,6 +6,7 @@ export const supportedAlgorithms = { [SSHAlgorithmType.HOSTKEY]: russh.getSupportedKeyTypes().filter(x => x !== 'none'), [SSHAlgorithmType.CIPHER]: russh.getSupportedCiphers().filter(x => x !== 'clear'), [SSHAlgorithmType.HMAC]: russh.getSupportedMACs().filter(x => x !== 'none'), + [SSHAlgorithmType.COMPRESSION]: russh.getSupportedCompressionAlgorithms().reverse(), } export const defaultAlgorithms = { @@ -42,4 +43,9 @@ export const defaultAlgorithms = { 'hmac-sha1-etm@openssh.com', 'hmac-sha1', ], + [SSHAlgorithmType.COMPRESSION]: [ + 'zlib@openssh.com', + 'zlib', + 'none', + ], } diff --git a/tabby-ssh/src/api/interfaces.ts b/tabby-ssh/src/api/interfaces.ts index 56cbaf56..eb3fd0b8 100644 --- a/tabby-ssh/src/api/interfaces.ts +++ b/tabby-ssh/src/api/interfaces.ts @@ -5,6 +5,8 @@ export enum SSHAlgorithmType { KEX = 'kex', CIPHER = 'cipher', HOSTKEY = 'serverHostKey', + COMPRESSION = 'compression', + } export interface SSHProfile extends ConnectableTerminalProfile { diff --git a/tabby-ssh/src/components/sshProfileSettings.component.pug b/tabby-ssh/src/components/sshProfileSettings.component.pug index 59aea5b5..60a2bb7d 100644 --- a/tabby-ssh/src/components/sshProfileSettings.component.pug +++ b/tabby-ssh/src/components/sshProfileSettings.component.pug @@ -285,7 +285,13 @@ ul.nav-tabs(ngbNav, #nav='ngbNav') .w-75 div(*ngFor='let alg of supportedAlgorithms.serverHostKey') checkbox([text]='alg', [(ngModel)]='algorithms.serverHostKey[alg]') - + + .form-line.align-items-start + .header + .title Compression + .w-75 + div(*ngFor='let alg of supportedAlgorithms.compression') + checkbox([text]='alg', [(ngModel)]='algorithms.compression[alg]') li(ngbNavItem) a(ngbNavLink, translate) Colors ng-template(ngbNavContent) diff --git a/tabby-ssh/src/components/sshProfileSettings.component.ts b/tabby-ssh/src/components/sshProfileSettings.component.ts index 105c29fc..7e787849 100644 --- a/tabby-ssh/src/components/sshProfileSettings.component.ts +++ b/tabby-ssh/src/components/sshProfileSettings.component.ts @@ -107,7 +107,7 @@ export class SSHProfileSettingsComponent { this.profile.options.algorithms![k] = Object.entries(this.algorithms[k]) .filter(([_, v]) => !!v) .map(([key, _]) => key) - this.profile.options.algorithms![k].sort() + if(k !== SSHAlgorithmType.COMPRESSION) { this.profile.options.algorithms![k].sort() } } if (this.connectionMode !== 'jumpHost') { diff --git a/tabby-ssh/src/profiles.ts b/tabby-ssh/src/profiles.ts index cf75105b..f1fa70cd 100644 --- a/tabby-ssh/src/profiles.ts +++ b/tabby-ssh/src/profiles.ts @@ -55,7 +55,7 @@ export class SSHProfilesService extends QuickConnectProfileProvider super() for (const k of Object.values(SSHAlgorithmType)) { this.configDefaults.options.algorithms[k] = [...defaultAlgorithms[k]] - this.configDefaults.options.algorithms[k].sort() + if (k !== SSHAlgorithmType.COMPRESSION) { this.configDefaults.options.algorithms[k].sort() } } } diff --git a/tabby-ssh/src/session/ssh.ts b/tabby-ssh/src/session/ssh.ts index 65e13559..5d75a30a 100644 --- a/tabby-ssh/src/session/ssh.ts +++ b/tabby-ssh/src/session/ssh.ts @@ -315,6 +315,7 @@ export class SSHSession { kex: this.profile.options.algorithms?.[SSHAlgorithmType.KEX]?.filter(x => supportedAlgorithms[SSHAlgorithmType.KEX].includes(x)), mac: this.profile.options.algorithms?.[SSHAlgorithmType.HMAC]?.filter(x => supportedAlgorithms[SSHAlgorithmType.HMAC].includes(x)), key: this.profile.options.algorithms?.[SSHAlgorithmType.HOSTKEY]?.filter(x => supportedAlgorithms[SSHAlgorithmType.HOSTKEY].includes(x)), + compression: this.profile.options.algorithms?.[SSHAlgorithmType.COMPRESSION]?.filter(x => supportedAlgorithms[SSHAlgorithmType.COMPRESSION].includes(x)), }, keepaliveIntervalSeconds: Math.round((this.profile.options.keepaliveInterval ?? 15000) / 1000), keepaliveCountMax: this.profile.options.keepaliveCountMax,