From c2a71d63b47df8bd23cd307bf8b48429270993fe Mon Sep 17 00:00:00 2001 From: HD Moore Date: Fri, 6 Jan 2012 00:53:23 -0600 Subject: [PATCH] Tweak the logic here --- lib/net/ssh/authentication/methods/publickey.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/net/ssh/authentication/methods/publickey.rb b/lib/net/ssh/authentication/methods/publickey.rb index c529361b6f..e5eafebbba 100644 --- a/lib/net/ssh/authentication/methods/publickey.rb +++ b/lib/net/ssh/authentication/methods/publickey.rb @@ -61,7 +61,15 @@ module Net session.accepted_key_callback.call({ :user => username, :fingerprint => identity.fingerprint, :key => identity.dup }) end - return false if session.skip_private_keys + if session.skip_private_keys + if session.options[:record_auth_info] + session.auth_info[:method] = "publickey" + session.auth_info[:user] = username + session.auth_info[:pubkey_data] = identity.inspect + session.auth_info[:pubkey_id] = identity.fingerprint + end + return true + end buffer = build_request(identity, username, next_service, true) sig_data = Net::SSH::Buffer.new