Module: DeprecatedRsaSha1::AuthenticationSession

Defined in:
lib/vagrant/patches/net-ssh.rb

Instance Method Summary collapse

Instance Method Details

#initialize(transport, options = {}) ⇒ Object


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/vagrant/patches/net-ssh.rb', line 96

def initialize(transport, options={})
  s_ver_str = transport.server_version.version.
    match(/OpenSSH_.*?(?<version>\d+\.\d+)/)&.[](:version).to_s
  Vagrant.global_logger.debug("ssh server version detected: #{s_ver_str}")
  if !s_ver_str.empty?
    begin
      ver = Gem::Version.new(s_ver_str)
      if ver >= Gem::Version.new("7.2")
        Vagrant.global_logger.debug("ssh server supports deprecation of RSA SHA1, deprecating")
        options[:deprecated_rsa_sha1] = true
      else
        Vagrant.global_logger.debug("ssh server does not support deprecation of RSA SHA1")
      end
    rescue ArgumentError => err
      Vagrant.global_logger.debug("failed to determine valid ssh server version - #{err}")
    end
  end
  super
end