File: kex.rb

package info (click to toggle)
ruby-net-ssh 1%3A6.1.0-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,884 kB
  • sloc: ruby: 15,997; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 1,345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'net/ssh/transport/kex/diffie_hellman_group1_sha1'
require 'net/ssh/transport/kex/diffie_hellman_group14_sha1'
require 'net/ssh/transport/kex/diffie_hellman_group_exchange_sha1'
require 'net/ssh/transport/kex/diffie_hellman_group_exchange_sha256'
require 'net/ssh/transport/kex/ecdh_sha2_nistp256'
require 'net/ssh/transport/kex/ecdh_sha2_nistp384'
require 'net/ssh/transport/kex/ecdh_sha2_nistp521'
require 'net/ssh/transport/kex/curve25519_sha256_loader'

module Net::SSH::Transport
  module Kex
    # Maps the supported key-exchange algorithms as named by the SSH protocol
    # to their corresponding implementors.
    MAP = {
      'diffie-hellman-group1-sha1'           => DiffieHellmanGroup1SHA1,
      'diffie-hellman-group14-sha1'          => DiffieHellmanGroup14SHA1,
      'diffie-hellman-group-exchange-sha1'   => DiffieHellmanGroupExchangeSHA1,
      'diffie-hellman-group-exchange-sha256' => DiffieHellmanGroupExchangeSHA256,
      'ecdh-sha2-nistp256'                   => EcdhSHA2NistP256,
      'ecdh-sha2-nistp384'                   => EcdhSHA2NistP384,
      'ecdh-sha2-nistp521'                   => EcdhSHA2NistP521
    }

    if Net::SSH::Transport::Kex::Curve25519Sha256Loader::LOADED
      MAP['curve25519-sha256'] = Curve25519Sha256
      MAP['curve25519-sha256@libssh.org'] = Curve25519Sha256
    end
  end
end