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/authentication | |
parent | c6aec69413433966ff169d98cc10c18f220f72a2 (diff) | |
parent | 3a74662c52f52c0d1dac69b427c40b7580f12cd1 (diff) | |
download | net-ssh-addalgos.tar.gz |
Merged addalgosaddalgos
Diffstat (limited to 'lib/net/ssh/authentication')
-rw-r--r-- | lib/net/ssh/authentication/key_manager.rb | 2 | ||||
-rw-r--r-- | lib/net/ssh/authentication/session.rb | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/net/ssh/authentication/key_manager.rb b/lib/net/ssh/authentication/key_manager.rb index 6c1704e..80bff95 100644 --- a/lib/net/ssh/authentication/key_manager.rb +++ b/lib/net/ssh/authentication/key_manager.rb @@ -222,7 +222,7 @@ module Net identity end - rescue OpenSSL::PKey::RSAError, OpenSSL::PKey::DSAError => e + rescue OpenSSL::PKey::RSAError, OpenSSL::PKey::DSAError, OpenSSL::PKey::ECError => e if ask_passphrase process_identity_loading_error(identity, e) nil diff --git a/lib/net/ssh/authentication/session.rb b/lib/net/ssh/authentication/session.rb index 4470650..f3f18e7 100644 --- a/lib/net/ssh/authentication/session.rb +++ b/lib/net/ssh/authentication/session.rb @@ -128,13 +128,21 @@ module Net; module SSH; module Authentication private + # Returns an array of paths to the key files usually defined + # by system default. + def default_keys + if defined?(OpenSSL::PKey::EC) + %w(~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh/id_ecdsa + ~/.ssh2/id_dsa ~/.ssh2/id_rsa ~/.ssh2/id_ecdsa) + else + %w(~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_rsa) + end + end + # Returns an array of paths to the key files that should be used when # attempting any key-based authentication mechanism. def keys - Array( - options[:keys] || - %w(~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_rsa) - ) + Array(options[:keys] || default_keys) end # Returns an array of the key data that should be used when |