Skip to content
This repository
Browse code

Moved definition of SUPPORTED_TYPE out of metaclass

  • Loading branch information...
commit 8c7892e84d47db32495d23ef00acda8d1fc4bb75 1 parent 97917a9
Marco Sandrini nessche authored

Showing 1 changed file with 11 additions and 9 deletions. Show diff stats Hide diff stats

  1. +11 9 lib/net/ssh/known_hosts.rb
20 lib/net/ssh/known_hosts.rb
@@ -10,16 +10,18 @@ module Net; module SSH
10 10 # This is used internally by Net::SSH, and will never need to be used directly
11 11 # by consumers of the library.
12 12 class KnownHosts
13   - class <<self
14 13
15   - if defined?(OpenSSL::PKey::EC)
16   - KnownHosts::SUPPORTED_TYPE = %w(ssh-rsa ssh-dss
17   - ecdsa-sha2-nistp256
18   - ecdsa-sha2-nistp384
19   - ecdsa-sha2-nistp521)
20   - else
21   - KnownHosts::SUPPORTED_TYPE = %w(ssh-rsa ssh-dss)
22   - end
  14 + if defined?(OpenSSL::PKey::EC)
  15 + SUPPORTED_TYPE = %w(ssh-rsa ssh-dss
  16 + ecdsa-sha2-nistp256
  17 + ecdsa-sha2-nistp384
  18 + ecdsa-sha2-nistp521)
  19 + else
  20 + SUPPORTED_TYPE = %w(ssh-rsa ssh-dss)
  21 + end
  22 +
  23 +
  24 + class <<self
23 25
24 26 # Searches all known host files (see KnownHosts.hostfiles) for all keys
25 27 # of the given host. Returns an array of keys found.

0 comments on commit 8c7892e

Please sign in to comment.
Something went wrong with that request. Please try again.