diff options
-rw-r--r-- | CHANGELOG.rdoc | 4 | ||||
-rw-r--r-- | lib/net/ssh/known_hosts.rb | 20 | ||||
-rw-r--r-- | lib/net/ssh/version.rb | 2 | ||||
-rw-r--r-- | net-ssh.gemspec | 4 | ||||
-rw-r--r-- | test/known_hosts/github | 1 | ||||
-rw-r--r-- | test/test_known_hosts.rb | 13 |
6 files changed, 33 insertions, 11 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 15ae6f9..0b9e58c 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,4 +1,8 @@ +=== 2.5.2 / 25 May 2012 + +* Fix for Net::SSH::KnownHosts::SUPPORTED_TYPE [Marco Sandrini] + === 2.5.1 / 24 May 2012 * Added missing file to manifest [Marco Sandrini] diff --git a/lib/net/ssh/known_hosts.rb b/lib/net/ssh/known_hosts.rb index 7cbbdaf..2b2419a 100644 --- a/lib/net/ssh/known_hosts.rb +++ b/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) - 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 + 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. diff --git a/lib/net/ssh/version.rb b/lib/net/ssh/version.rb index f28010c..a6894fc 100644 --- a/lib/net/ssh/version.rb +++ b/lib/net/ssh/version.rb @@ -51,7 +51,7 @@ module Net; module SSH MINOR = 5 # The tiny component of this version of the Net::SSH library - TINY = 1 + TINY = 2 # The current version of the Net::SSH library as a Version instance CURRENT = new(MAJOR, MINOR, TINY) diff --git a/net-ssh.gemspec b/net-ssh.gemspec index ce683e9..56454a9 100644 --- a/net-ssh.gemspec +++ b/net-ssh.gemspec @@ -1,7 +1,7 @@ @spec = Gem::Specification.new do |s| s.name = "net-ssh" s.rubyforge_project = 'net-ssh' - s.version = "2.5.1" + s.version = "2.5.2" s.summary = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol." s.description = s.summary + " It allows you to write programs that invoke and interact with processes on remote servers, via SSH2." s.authors = ["Jamis Buck", "Delano Mandelbaum"] @@ -135,11 +135,13 @@ test/connection/test_session.rb test/manual/test_forward.rb test/start/test_transport.rb + test/known_hosts/github test/test_all.rb test/test_buffer.rb test/test_buffered_io.rb test/test_config.rb test/test_key_factory.rb + test/test_known_hosts.rb test/transport/hmac/test_md5.rb test/transport/hmac/test_md5_96.rb test/transport/hmac/test_none.rb diff --git a/test/known_hosts/github b/test/known_hosts/github new file mode 100644 index 0000000..138000b --- /dev/null +++ b/test/known_hosts/github @@ -0,0 +1 @@ +github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
\ No newline at end of file diff --git a/test/test_known_hosts.rb b/test/test_known_hosts.rb new file mode 100644 index 0000000..053d079 --- /dev/null +++ b/test/test_known_hosts.rb @@ -0,0 +1,13 @@ +require 'common' + +class TestKnownHosts < Test::Unit::TestCase + + def test_key_for_when_all_hosts_are_recognized + source = File.join(File.dirname(__FILE__),"known_hosts/github") + kh = Net::SSH::KnownHosts.new(source) + keys = kh.keys_for("github.com") + assert_equal(1, keys.count) + assert_equal("ssh-rsa", keys[0].ssh_type) + end + +end
\ No newline at end of file |