summaryrefslogtreecommitdiff
path: root/lib/net/ssh/authentication/session.rb
diff options
context:
space:
mode:
authordelano <delano@solutious.com>2012-05-24 07:51:03 -0400
committerdelano <delano@solutious.com>2012-05-24 07:51:03 -0400
commit17709188e36e701d6f44dd74b61d6b294148956b (patch)
treebcbc3c5c4653dd0de488393d509c0482c08536e0 /lib/net/ssh/authentication/session.rb
parentc6aec69413433966ff169d98cc10c18f220f72a2 (diff)
parent3a74662c52f52c0d1dac69b427c40b7580f12cd1 (diff)
downloadnet-ssh-addalgos.tar.gz
Merged addalgosaddalgos
Diffstat (limited to 'lib/net/ssh/authentication/session.rb')
-rw-r--r--lib/net/ssh/authentication/session.rb16
1 files changed, 12 insertions, 4 deletions
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