diff options
author | delano <delano@solutious.com> | 2012-05-24 07:51:03 -0400 |
---|---|---|
committer | delano <delano@solutious.com> | 2012-05-24 07:51:03 -0400 |
commit | 17709188e36e701d6f44dd74b61d6b294148956b (patch) | |
tree | bcbc3c5c4653dd0de488393d509c0482c08536e0 /lib/net/ssh/known_hosts.rb | |
parent | c6aec69413433966ff169d98cc10c18f220f72a2 (diff) | |
parent | 3a74662c52f52c0d1dac69b427c40b7580f12cd1 (diff) | |
download | net-ssh-addalgos.tar.gz |
Merged addalgosaddalgos
Diffstat (limited to 'lib/net/ssh/known_hosts.rb')
-rw-r--r-- | lib/net/ssh/known_hosts.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/net/ssh/known_hosts.rb b/lib/net/ssh/known_hosts.rb index 7b153d4..7cbbdaf 100644 --- a/lib/net/ssh/known_hosts.rb +++ b/lib/net/ssh/known_hosts.rb @@ -11,6 +11,16 @@ module Net; module SSH # by consumers of the library. class KnownHosts class <<self + + 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 + # Searches all known host files (see KnownHosts.hostfiles) for all keys # of the given host. Returns an array of keys found. def search_for(host, options={}) @@ -104,7 +114,7 @@ module Net; module SSH scanner.skip(/\s*/) type = scanner.scan(/\S+/) - next unless %w(ssh-rsa ssh-dss).include?(type) + next unless SUPPORTED_TYPE.include?(type) scanner.skip(/\s*/) blob = scanner.rest.unpack("m*").first @@ -126,4 +136,4 @@ module Net; module SSH end end -end; end
\ No newline at end of file +end; end |