Skip to content

Commit

Permalink
Removed the requirement for the public key, needed to store the hash …
Browse files Browse the repository at this point in the history
…of identities. All tests pass
  • Loading branch information
Ari Lerner committed Dec 17, 2008
1 parent e674951 commit 215cf83
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 3 deletions.
104 changes: 104 additions & 0 deletions Manifest
@@ -0,0 +1,104 @@
CHANGELOG.rdoc
lib/net/ssh/authentication/agent.rb
lib/net/ssh/authentication/constants.rb
lib/net/ssh/authentication/key_manager.rb
lib/net/ssh/authentication/methods/abstract.rb
lib/net/ssh/authentication/methods/hostbased.rb
lib/net/ssh/authentication/methods/keyboard_interactive.rb
lib/net/ssh/authentication/methods/password.rb
lib/net/ssh/authentication/methods/publickey.rb
lib/net/ssh/authentication/pageant.rb
lib/net/ssh/authentication/session.rb
lib/net/ssh/buffer.rb
lib/net/ssh/buffered_io.rb
lib/net/ssh/config.rb
lib/net/ssh/connection/channel.rb
lib/net/ssh/connection/constants.rb
lib/net/ssh/connection/session.rb
lib/net/ssh/connection/term.rb
lib/net/ssh/errors.rb
lib/net/ssh/key_factory.rb
lib/net/ssh/known_hosts.rb
lib/net/ssh/loggable.rb
lib/net/ssh/packet.rb
lib/net/ssh/prompt.rb
lib/net/ssh/proxy/errors.rb
lib/net/ssh/proxy/http.rb
lib/net/ssh/proxy/socks4.rb
lib/net/ssh/proxy/socks5.rb
lib/net/ssh/ruby_compat.rb
lib/net/ssh/service/forward.rb
lib/net/ssh/test/channel.rb
lib/net/ssh/test/extensions.rb
lib/net/ssh/test/kex.rb
lib/net/ssh/test/local_packet.rb
lib/net/ssh/test/packet.rb
lib/net/ssh/test/remote_packet.rb
lib/net/ssh/test/script.rb
lib/net/ssh/test/socket.rb
lib/net/ssh/test.rb
lib/net/ssh/transport/algorithms.rb
lib/net/ssh/transport/cipher_factory.rb
lib/net/ssh/transport/constants.rb
lib/net/ssh/transport/hmac/abstract.rb
lib/net/ssh/transport/hmac/md5.rb
lib/net/ssh/transport/hmac/md5_96.rb
lib/net/ssh/transport/hmac/none.rb
lib/net/ssh/transport/hmac/sha1.rb
lib/net/ssh/transport/hmac/sha1_96.rb
lib/net/ssh/transport/hmac.rb
lib/net/ssh/transport/identity_cipher.rb
lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
lib/net/ssh/transport/kex.rb
lib/net/ssh/transport/openssl.rb
lib/net/ssh/transport/packet_stream.rb
lib/net/ssh/transport/server_version.rb
lib/net/ssh/transport/session.rb
lib/net/ssh/transport/state.rb
lib/net/ssh/verifiers/lenient.rb
lib/net/ssh/verifiers/null.rb
lib/net/ssh/verifiers/strict.rb
lib/net/ssh/version.rb
lib/net/ssh.rb
Manifest
net-ssh.gemspec
Rakefile
README.rdoc
setup.rb
test/authentication/methods/common.rb
test/authentication/methods/test_abstract.rb
test/authentication/methods/test_hostbased.rb
test/authentication/methods/test_keyboard_interactive.rb
test/authentication/methods/test_password.rb
test/authentication/methods/test_publickey.rb
test/authentication/test_agent.rb
test/authentication/test_key_manager.rb
test/authentication/test_session.rb
test/common.rb
test/configs/eqsign
test/configs/exact_match
test/configs/wild_cards
test/connection/test_channel.rb
test/connection/test_session.rb
test/test_all.rb
test/test_buffer.rb
test/test_buffered_io.rb
test/test_config.rb
test/test_key_factory.rb
test/transport/hmac/test_md5.rb
test/transport/hmac/test_md5_96.rb
test/transport/hmac/test_none.rb
test/transport/hmac/test_sha1.rb
test/transport/hmac/test_sha1_96.rb
test/transport/kex/test_diffie_hellman_group1_sha1.rb
test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
test/transport/test_algorithms.rb
test/transport/test_cipher_factory.rb
test/transport/test_hmac.rb
test/transport/test_identity_cipher.rb
test/transport/test_packet_stream.rb
test/transport/test_server_version.rb
test/transport/test_session.rb
test/transport/test_state.rb
THANKS.rdoc
2 changes: 1 addition & 1 deletion lib/net/ssh/authentication/key_manager.rb
Expand Up @@ -93,7 +93,7 @@ def identities
public_key_file = file# + '.pub'
if File.readable?(public_key_file)
begin
key = KeyFactory.load_public_key(public_key_file)
key = KeyFactory.load_private_key(public_key_file)
identities.push key
known_identities[key] = { :from => :file, :file => file }
rescue Exception => e
Expand Down
4 changes: 2 additions & 2 deletions test/authentication/test_key_manager.rb
Expand Up @@ -75,8 +75,8 @@ def test_sign_with_file_originated_key_should_load_private_key_and_sign_with_it
def stub_file_key(name, key, also_private=false)
manager.add(name)
File.expects(:readable?).returns(true)
Net::SSH::KeyFactory.expects(:load_public_key).with("#{name}").returns(key)
Net::SSH::KeyFactory.expects(:load_private_key).with(name, nil).returns(key) if also_private
# Net::SSH::KeyFactory.expects(:load_public_key).with("#{name}").returns(key)
Net::SSH::KeyFactory.expects(:load_private_key).with(name, nil).returns(key).at_least_once
end

def rsa(size=32)
Expand Down

0 comments on commit 215cf83

Please sign in to comment.