Skip to content
Browse files

Moved definition of SUPPORTED_TYPE out of metaclass

  • Loading branch information...
1 parent 97917a9 commit 8c7892e84d47db32495d23ef00acda8d1fc4bb75 @nessche nessche committed May 24, 2012
Showing with 11 additions and 9 deletions.
  1. +11 −9 lib/net/ssh/known_hosts.rb
View
20 lib/net/ssh/known_hosts.rb
@@ -10,16 +10,18 @@ module Net; module SSH
# This is used internally by Net::SSH, and will never need to be used directly
# by consumers of the library.
class KnownHosts
- class <<self
- if defined?(OpenSSL::PKey::EC)
- KnownHosts::SUPPORTED_TYPE = %w(ssh-rsa ssh-dss
- ecdsa-sha2-nistp256
- ecdsa-sha2-nistp384
- ecdsa-sha2-nistp521)
- else
- KnownHosts::SUPPORTED_TYPE = %w(ssh-rsa ssh-dss)
- end
+ if defined?(OpenSSL::PKey::EC)
+ SUPPORTED_TYPE = %w(ssh-rsa ssh-dss
+ ecdsa-sha2-nistp256
+ ecdsa-sha2-nistp384
+ ecdsa-sha2-nistp521)
+ else
+ SUPPORTED_TYPE = %w(ssh-rsa ssh-dss)
+ end
+
+
+ class <<self
# Searches all known host files (see KnownHosts.hostfiles) for all keys
# 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.