Back to FlowSsh Documentation

KeyExchangeAlgs Structure/Class

[C]

struct FlowSshC_ExitSignal
{
  byte m_dhGexSha256;
  byte m_dhGexSha1;
  byte m_dhG14Sha1;
  byte m_dhG1Sha1;
};

[C++]

struct KeyExchangeAlgs : public FlowSshC_KeyExchangeAlgs
{
  KeyExchangeAlgs()
  {
    m_dhGexSha256 = m_dhGexSha1 = 1;
    m_dhG14Sha1 = m_dhG1Sha1 = 1;
  }
};

[C#]

public sealed class KeyExchangeAlgs
{
  public byte DhGexSha256;
  public byte DhGexSha1;
  public byte DhG14Sha1;
  public byte DhG1Sha1;
  
  public KeyExchangeAlgs()
  {
    DhGexSha1 = DhG1Sha1 = 1;
    DhG14Sha1 = DhGexSha256 = 1;
  }
}

Members

  • DhGexSha256: Priority of "diffie-hellman-group-exchange-sha256". This algorithm allows the server to choose a suitable size DH group for key exchange using SHA-1.
  • DhGexSha1: Priority of "diffie-hellman-group-exchange-sha1". This algorithm allows the server to choose a suitable size DH group for key exchange using SHA-256.
  • DhG14Sha1: Priority of "diffie-hellman-group14-sha1". This algorithm performs session key exchange with a 2048-bit keypair.
  • DhG1Sha1: Priority of "diffie-hellman-group1-sha1". This algorithm performs session key exchange with a 1024-bit keypair. It is the original SSH2 key exchange algorithm and is required for interoperability with most SSH2 servers.

Remarks

The KeyExchangeAlgs structure/class is used to enable and prioritize or disable various Diffie Hellman key exchange algorithms for the session. For member values the following rules apply:

  • An algorithm is enabled if it holds a non-zero value.
  • Algorithms with lower non-zero values precede algorithms with higher values.
  • Algorithms holding the same non-zero value are ordered by their declaration order.

By default, all supported DH key exchange algorithms are enabled. They are ordered by their declaration order.