net-ssh 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +9 -0
- data/lib/net/ssh/authentication/agent.rb +3 -2
- data/lib/net/ssh/authentication/key_manager.rb +3 -2
- data/lib/net/ssh/transport/hmac/abstract.rb +8 -2
- data/lib/net/ssh/version.rb +1 -1
- data/net-ssh.gemspec +5 -3
- data/test/common.rb +1 -1
- data/test/transport/hmac/test_md5.rb +5 -0
- data/test/transport/test_hmac.rb +1 -1
- metadata +74 -6
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
=== 2.0.2 / 29 May 2008
|
2
|
+
|
3
|
+
* Make sure the agent client understands both RSA "identities answers" [Jamis Buck]
|
4
|
+
|
5
|
+
* Fixed key truncation bug that caused hmacs other than SHA1 to fail with "corrupt hmac" errors [Jamis Buck]
|
6
|
+
|
7
|
+
* Fix detection and loading of public keys when the keys don't actually exist [David Dollar]
|
8
|
+
|
9
|
+
|
1
10
|
=== 2.0.1 / 5 May 2008
|
2
11
|
|
3
12
|
* Teach Net::SSH about a handful of default key names [Jamis Buck]
|
@@ -39,7 +39,8 @@ module Net; module SSH; module Authentication
|
|
39
39
|
SSH_COM_AGENT2_FAILURE = 102
|
40
40
|
|
41
41
|
SSH_AGENT_REQUEST_RSA_IDENTITIES = 1
|
42
|
-
|
42
|
+
SSH_AGENT_RSA_IDENTITIES_ANSWER1 = 2
|
43
|
+
SSH_AGENT_RSA_IDENTITIES_ANSWER2 = 5
|
43
44
|
SSH_AGENT_FAILURE = 5
|
44
45
|
|
45
46
|
# The underlying socket being used to communicate with the SSH agent.
|
@@ -82,7 +83,7 @@ module Net; module SSH; module Authentication
|
|
82
83
|
|
83
84
|
if type == SSH2_AGENT_VERSION_RESPONSE
|
84
85
|
raise NotImplementedError, "SSH2 agents are not yet supported"
|
85
|
-
elsif type !=
|
86
|
+
elsif type != SSH_AGENT_RSA_IDENTITIES_ANSWER1 && type != SSH_AGENT_RSA_IDENTITIES_ANSWER2
|
86
87
|
raise AgentError, "unknown response from agent: #{type}, #{body.to_s.inspect}"
|
87
88
|
end
|
88
89
|
end
|
@@ -89,9 +89,10 @@ module Net
|
|
89
89
|
end
|
90
90
|
|
91
91
|
key_files.each do |file|
|
92
|
-
|
92
|
+
public_key_file = file + '.pub'
|
93
|
+
if File.readable?(public_key_file)
|
93
94
|
begin
|
94
|
-
key = KeyFactory.load_public_key(
|
95
|
+
key = KeyFactory.load_public_key(public_key_file)
|
95
96
|
identities.push key
|
96
97
|
known_identities[key] = { :from => :file, :file => file }
|
97
98
|
rescue Exception => e
|
@@ -31,13 +31,19 @@ module Net; module SSH; module Transport; module HMAC
|
|
31
31
|
define_method(attribute) { self.class.send(attribute) }
|
32
32
|
end
|
33
33
|
|
34
|
-
# The key
|
35
|
-
|
34
|
+
# The key in use for this instance.
|
35
|
+
attr_reader :key
|
36
36
|
|
37
37
|
def initialize(key=nil)
|
38
38
|
self.key = key
|
39
39
|
end
|
40
40
|
|
41
|
+
# Sets the key to the given value, truncating it so that it is the correct
|
42
|
+
# length.
|
43
|
+
def key=(value)
|
44
|
+
@key = value ? value.to_s[0,key_length] : nil
|
45
|
+
end
|
46
|
+
|
41
47
|
# Compute the HMAC digest for the given data string.
|
42
48
|
def digest(data)
|
43
49
|
OpenSSL::HMAC.digest(digest_class.new, key, data)[0,mac_length]
|
data/lib/net/ssh/version.rb
CHANGED
data/net-ssh.gemspec
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Net-ssh-2.0.
|
2
|
+
# Gem::Specification for Net-ssh-2.0.2
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{net-ssh}
|
7
|
-
s.version = "2.0.
|
7
|
+
s.version = "2.0.2"
|
8
8
|
|
9
9
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Jamis Buck"]
|
13
|
-
s.date = %q{2008-05-
|
13
|
+
s.date = %q{2008-05-29}
|
14
14
|
s.description = %q{a pure-Ruby implementation of the SSH2 client protocol}
|
15
15
|
s.email = %q{jamis@jamisbuck.org}
|
16
|
+
s.extra_rdoc_files = ["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/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", "README.rdoc", "THANKS.rdoc"]
|
16
17
|
s.files = ["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/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", "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/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", "Manifest", "net-ssh.gemspec"]
|
17
18
|
s.has_rdoc = true
|
18
19
|
s.homepage = %q{http://net-ssh.rubyforge.org/ssh}
|
20
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Net-ssh", "--main", "README.rdoc"]
|
19
21
|
s.require_paths = ["lib"]
|
20
22
|
s.rubyforge_project = %q{net-ssh}
|
21
23
|
s.rubygems_version = %q{1.1.1}
|
data/test/common.rb
CHANGED
@@ -24,6 +24,11 @@ module Transport; module HMAC
|
|
24
24
|
assert_equal "\275\345\006\307y~Oi\035<.\341\031\250<\257", hmac.digest("hello world")
|
25
25
|
end
|
26
26
|
|
27
|
+
def test_key_should_be_truncated_to_required_length
|
28
|
+
hmac = subject.new("12345678901234567890")
|
29
|
+
assert_equal "1234567890123456", hmac.key
|
30
|
+
end
|
31
|
+
|
27
32
|
private
|
28
33
|
|
29
34
|
def subject
|
data/test/transport/test_hmac.rb
CHANGED
@@ -7,7 +7,7 @@ module Transport
|
|
7
7
|
Net::SSH::Transport::HMAC::MAP.each do |name, value|
|
8
8
|
method = name.tr("-", "_")
|
9
9
|
define_method("test_get_with_#{method}_returns_new_hmac_instance") do
|
10
|
-
key = "abcdefghijklmnopqrstuvwxyz"[0
|
10
|
+
key = "abcdefghijklmnopqrstuvwxyz"[0,Net::SSH::Transport::HMAC::MAP[name].key_length]
|
11
11
|
hmac = Net::SSH::Transport::HMAC.get(name, key)
|
12
12
|
assert_instance_of Net::SSH::Transport::HMAC::MAP[name], hmac
|
13
13
|
assert_equal key, hmac.key
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-29 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -19,8 +19,71 @@ executables: []
|
|
19
19
|
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
22
|
+
extra_rdoc_files:
|
23
|
+
- CHANGELOG.rdoc
|
24
|
+
- lib/net/ssh/authentication/agent.rb
|
25
|
+
- lib/net/ssh/authentication/constants.rb
|
26
|
+
- lib/net/ssh/authentication/key_manager.rb
|
27
|
+
- lib/net/ssh/authentication/methods/abstract.rb
|
28
|
+
- lib/net/ssh/authentication/methods/hostbased.rb
|
29
|
+
- lib/net/ssh/authentication/methods/keyboard_interactive.rb
|
30
|
+
- lib/net/ssh/authentication/methods/password.rb
|
31
|
+
- lib/net/ssh/authentication/methods/publickey.rb
|
32
|
+
- lib/net/ssh/authentication/pageant.rb
|
33
|
+
- lib/net/ssh/authentication/session.rb
|
34
|
+
- lib/net/ssh/buffer.rb
|
35
|
+
- lib/net/ssh/buffered_io.rb
|
36
|
+
- lib/net/ssh/config.rb
|
37
|
+
- lib/net/ssh/connection/channel.rb
|
38
|
+
- lib/net/ssh/connection/constants.rb
|
39
|
+
- lib/net/ssh/connection/session.rb
|
40
|
+
- lib/net/ssh/connection/term.rb
|
41
|
+
- lib/net/ssh/errors.rb
|
42
|
+
- lib/net/ssh/key_factory.rb
|
43
|
+
- lib/net/ssh/known_hosts.rb
|
44
|
+
- lib/net/ssh/loggable.rb
|
45
|
+
- lib/net/ssh/packet.rb
|
46
|
+
- lib/net/ssh/prompt.rb
|
47
|
+
- lib/net/ssh/proxy/errors.rb
|
48
|
+
- lib/net/ssh/proxy/http.rb
|
49
|
+
- lib/net/ssh/proxy/socks4.rb
|
50
|
+
- lib/net/ssh/proxy/socks5.rb
|
51
|
+
- lib/net/ssh/service/forward.rb
|
52
|
+
- lib/net/ssh/test/channel.rb
|
53
|
+
- lib/net/ssh/test/extensions.rb
|
54
|
+
- lib/net/ssh/test/kex.rb
|
55
|
+
- lib/net/ssh/test/local_packet.rb
|
56
|
+
- lib/net/ssh/test/packet.rb
|
57
|
+
- lib/net/ssh/test/remote_packet.rb
|
58
|
+
- lib/net/ssh/test/script.rb
|
59
|
+
- lib/net/ssh/test/socket.rb
|
60
|
+
- lib/net/ssh/test.rb
|
61
|
+
- lib/net/ssh/transport/algorithms.rb
|
62
|
+
- lib/net/ssh/transport/cipher_factory.rb
|
63
|
+
- lib/net/ssh/transport/constants.rb
|
64
|
+
- lib/net/ssh/transport/hmac/abstract.rb
|
65
|
+
- lib/net/ssh/transport/hmac/md5.rb
|
66
|
+
- lib/net/ssh/transport/hmac/md5_96.rb
|
67
|
+
- lib/net/ssh/transport/hmac/none.rb
|
68
|
+
- lib/net/ssh/transport/hmac/sha1.rb
|
69
|
+
- lib/net/ssh/transport/hmac/sha1_96.rb
|
70
|
+
- lib/net/ssh/transport/hmac.rb
|
71
|
+
- lib/net/ssh/transport/identity_cipher.rb
|
72
|
+
- lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
73
|
+
- lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
74
|
+
- lib/net/ssh/transport/kex.rb
|
75
|
+
- lib/net/ssh/transport/openssl.rb
|
76
|
+
- lib/net/ssh/transport/packet_stream.rb
|
77
|
+
- lib/net/ssh/transport/server_version.rb
|
78
|
+
- lib/net/ssh/transport/session.rb
|
79
|
+
- lib/net/ssh/transport/state.rb
|
80
|
+
- lib/net/ssh/verifiers/lenient.rb
|
81
|
+
- lib/net/ssh/verifiers/null.rb
|
82
|
+
- lib/net/ssh/verifiers/strict.rb
|
83
|
+
- lib/net/ssh/version.rb
|
84
|
+
- lib/net/ssh.rb
|
85
|
+
- README.rdoc
|
86
|
+
- THANKS.rdoc
|
24
87
|
files:
|
25
88
|
- CHANGELOG.rdoc
|
26
89
|
- lib/net/ssh/authentication/agent.rb
|
@@ -127,8 +190,13 @@ files:
|
|
127
190
|
has_rdoc: true
|
128
191
|
homepage: http://net-ssh.rubyforge.org/ssh
|
129
192
|
post_install_message:
|
130
|
-
rdoc_options:
|
131
|
-
|
193
|
+
rdoc_options:
|
194
|
+
- --line-numbers
|
195
|
+
- --inline-source
|
196
|
+
- --title
|
197
|
+
- Net-ssh
|
198
|
+
- --main
|
199
|
+
- README.rdoc
|
132
200
|
require_paths:
|
133
201
|
- lib
|
134
202
|
required_ruby_version: !ruby/object:Gem::Requirement
|