|
|
@@ -1029,16 +1029,23 @@ func dialSsh(
|
|
|
ClientVersion: SSHClientVersion,
|
|
|
}
|
|
|
|
|
|
- // This is the list of supported non-Encrypt-then-MAC algorithms from
|
|
|
- // https://github.com/Psiphon-Labs/psiphon-tunnel-core/blob/3ef11effe6acd92c3aefd140ee09c42a1f15630b/psiphon/common/crypto/ssh/common.go#L60
|
|
|
- //
|
|
|
- // With Encrypt-then-MAC algorithms, packet length is transmitted in
|
|
|
- // plaintext, which aids in traffic analysis.
|
|
|
- //
|
|
|
- // TUNNEL_PROTOCOL_SSH is excepted since its KEX appears in plaintext,
|
|
|
- // and the protocol is intended to look like SSH on the wire.
|
|
|
- if selectedProtocol != protocol.TUNNEL_PROTOCOL_SSH {
|
|
|
- sshClientConfig.MACs = []string{"hmac-sha2-256", "hmac-sha1", "hmac-sha1-96"}
|
|
|
+ if protocol.TunnelProtocolUsesObfuscatedSSH(selectedProtocol) {
|
|
|
+ if config.ObfuscatedSSHAlgorithms != nil {
|
|
|
+ sshClientConfig.KeyExchanges = []string{config.ObfuscatedSSHAlgorithms[0]}
|
|
|
+ sshClientConfig.Ciphers = []string{config.ObfuscatedSSHAlgorithms[1]}
|
|
|
+ sshClientConfig.MACs = []string{config.ObfuscatedSSHAlgorithms[2]}
|
|
|
+ sshClientConfig.HostKeyAlgorithms = []string{config.ObfuscatedSSHAlgorithms[3]}
|
|
|
+ } else {
|
|
|
+ // This is the list of supported non-Encrypt-then-MAC algorithms from
|
|
|
+ // https://github.com/Psiphon-Labs/psiphon-tunnel-core/blob/3ef11effe6acd92c3aefd140ee09c42a1f15630b/psiphon/common/crypto/ssh/common.go#L60
|
|
|
+ //
|
|
|
+ // With Encrypt-then-MAC algorithms, packet length is transmitted in
|
|
|
+ // plaintext, which aids in traffic analysis.
|
|
|
+ //
|
|
|
+ // TUNNEL_PROTOCOL_SSH is excepted since its KEX appears in plaintext,
|
|
|
+ // and the protocol is intended to look like SSH on the wire.
|
|
|
+ sshClientConfig.MACs = []string{"hmac-sha2-256", "hmac-sha1", "hmac-sha1-96"}
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// The ssh session establishment (via ssh.NewClientConn) is wrapped
|