net-ssh 2.0.2 → 2.0.3

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.
@@ -1,3 +1,15 @@
1
+ === 2.0.3 / 27 Jun 2008
2
+
3
+ * Make Net::SSH::Version comparable [Brian Candler]
4
+
5
+ * Fix errors in port forwarding when a channel could not be opened due to a typo in the exception name [Matthew Todd]
6
+
7
+ * Use #chomp instead of #strip when cleaning the version string reported by the remote host, so that trailing whitespace is preserved (this is to play nice with servers like Mocana SSH) [Timo Gatsonides]
8
+
9
+ * Correctly parse ssh_config entries with eq-sign delimiters [Jamis Buck]
10
+
11
+ * Ignore malformed ssh_config entries [Jamis Buck]
12
+
1
13
  === 2.0.2 / 29 May 2008
2
14
 
3
15
  * Make sure the agent client understands both RSA "identities answers" [Jamis Buck]
@@ -62,10 +62,18 @@ module Net; module SSH
62
62
  IO.foreach(file) do |line|
63
63
  next if line =~ /^\s*(?:#.*)?$/
64
64
 
65
- key, value = line.strip.split(/\s+/, 2)
66
- key.downcase!
65
+ if line =~ /^\s*(\S+)\s*=(.*)$/
66
+ key, value = $1, $2
67
+ else
68
+ key, value = line.strip.split(/\s+/, 2)
69
+ end
70
+
71
+ # silently ignore malformed entries
72
+ next if value.nil?
67
73
 
74
+ key.downcase!
68
75
  value = $1 if value =~ /^"(.*)"$/
76
+
69
77
  value = case value.strip
70
78
  when /^\d+$/ then value.to_i
71
79
  when /^no$/i then false
@@ -259,7 +259,7 @@ module Net; module SSH; module Service
259
259
  prepare_client(agent.socket, channel, :agent)
260
260
  rescue Exception => e
261
261
  error { "attempted to connect to agent but failed: #{e.class.name} (#{e.message})" }
262
- raise ChannelOpenFailure.new(2, "could not connect to authentication agent")
262
+ raise Net::SSH::ChannelOpenFailed.new(2, "could not connect to authentication agent")
263
263
  end
264
264
  end
265
265
  end
@@ -46,15 +46,14 @@ module Net; module SSH; module Transport
46
46
  @header << @version
47
47
  end
48
48
 
49
- debug { "remote is #{@version.strip}" }
49
+ @version.chomp!
50
+ debug { "remote is `#{@version}'" }
50
51
 
51
52
  unless @version.match(/^SSH-(1\.99|2\.0)-/)
52
53
  raise Net::SSH::Exception, "incompatible SSH version `#{@version}'"
53
54
  end
54
55
 
55
- @version.strip!
56
-
57
- debug { "local is #{PROTO_VERSION}" }
56
+ debug { "local is `#{PROTO_VERSION}'" }
58
57
  socket.write "#{PROTO_VERSION}\r\n"
59
58
  end
60
59
  end
@@ -12,6 +12,8 @@ module Net; module SSH
12
12
  # abort "your software is too old!"
13
13
  # end
14
14
  class Version
15
+ include Comparable
16
+
15
17
  # A convenience method for instantiating a new Version instance with the
16
18
  # given +major+, +minor+, and +tiny+ components.
17
19
  def self.[](major, minor, tiny)
@@ -49,7 +51,7 @@ module Net; module SSH
49
51
  MINOR = 0
50
52
 
51
53
  # The tiny component of this version of the Net::SSH library
52
- TINY = 2
54
+ TINY = 3
53
55
 
54
56
  # The current version of the Net::SSH library as a Version instance
55
57
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -1,16 +1,14 @@
1
1
 
2
- # Gem::Specification for Net-ssh-2.0.2
2
+ # Gem::Specification for Net-ssh-2.0.3
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.2"
8
-
9
- s.specification_version = 2 if s.respond_to? :specification_version=
7
+ s.version = "2.0.3"
10
8
 
11
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
10
  s.authors = ["Jamis Buck"]
13
- s.date = %q{2008-05-29}
11
+ s.date = %q{2008-06-27}
14
12
  s.description = %q{a pure-Ruby implementation of the SSH2 client protocol}
15
13
  s.email = %q{jamis@jamisbuck.org}
16
14
  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"]
@@ -20,9 +18,19 @@ Gem::Specification.new do |s|
20
18
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Net-ssh", "--main", "README.rdoc"]
21
19
  s.require_paths = ["lib"]
22
20
  s.rubyforge_project = %q{net-ssh}
23
- s.rubygems_version = %q{1.1.1}
21
+ s.rubygems_version = %q{1.2.0}
24
22
  s.summary = %q{a pure-Ruby implementation of the SSH2 client protocol}
25
23
  s.test_files = ["test/test_all.rb"]
24
+
25
+ if s.respond_to? :specification_version then
26
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
27
+ s.specification_version = 2
28
+
29
+ if current_version >= 3 then
30
+ else
31
+ end
32
+ else
33
+ end
26
34
  end
27
35
 
28
36
 
@@ -38,6 +38,12 @@ class TestConfig < Test::Unit::TestCase
38
38
  assert !config.key?(:rekey_limit)
39
39
  end
40
40
 
41
+ def test_load_should_parse_equal_sign_delimiters
42
+ config = Net::SSH::Config.load(config(:eqsign), "test.test")
43
+ assert config['compression']
44
+ assert_equal 1234, config['port']
45
+ end
46
+
41
47
  def test_translate_should_correctly_translate_from_openssh_to_net_ssh_names
42
48
  open_ssh = {
43
49
  'ciphers' => "a,b,c",
@@ -17,9 +17,11 @@ module Transport
17
17
  assert_equal "SSH-2.0-Testing_1.0", s.version
18
18
  end
19
19
 
20
- def test_trailing_whitespace_should_be_stripped
20
+ def test_trailing_whitespace_should_be_preserved
21
+ # some servers, like Mocana, send a version string with trailing
22
+ # spaces, which are significant when exchanging keys later.
21
23
  s = subject(socket(true, "SSH-2.0-Testing_1.0 \r\n"))
22
- assert_equal "SSH-2.0-Testing_1.0", s.version
24
+ assert_equal "SSH-2.0-Testing_1.0 ", s.version
23
25
  end
24
26
 
25
27
  def test_unacceptible_server_version_should_raise_exception
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.2
4
+ version: 2.0.3
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-29 00:00:00 -06:00
12
+ date: 2008-06-27 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  requirements: []
215
215
 
216
216
  rubyforge_project: net-ssh
217
- rubygems_version: 1.1.1
217
+ rubygems_version: 1.2.0
218
218
  signing_key:
219
219
  specification_version: 2
220
220
  summary: a pure-Ruby implementation of the SSH2 client protocol