net-ssh 2.6.6 → 2.6.7

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,10 @@
1
1
 
2
+ === 2.6.7 / 11 Apr 2013
3
+
4
+ * Decreased default packet size to 32768 as described in RFC 4253 [Olipro]
5
+ * Added max_pkt_size and max_win_size options to Net::SSH.start [Olipro]
6
+
7
+
2
8
  === 2.6.6 / 03 Mar 2013
3
9
 
4
10
  * Fix for ruby 2.0 in windows [jansegre]
@@ -61,12 +61,13 @@ module Net
61
61
  # This is the set of options that Net::SSH.start recognizes. See
62
62
  # Net::SSH.start for a description of each option.
63
63
  VALID_OPTIONS = [
64
- :auth_methods, :bind_address, :compression, :compression_level, :config,
65
- :encryption, :forward_agent, :hmac, :host_key, :kex, :keys, :key_data,
66
- :languages, :logger, :paranoid, :password, :port, :proxy,
64
+ :auth_methods, :bind_address, :compression, :compression_level, :config,
65
+ :encryption, :forward_agent, :hmac, :host_key, :kex, :keys, :key_data,
66
+ :languages, :logger, :paranoid, :password, :port, :proxy,
67
67
  :rekey_blocks_limit,:rekey_limit, :rekey_packet_limit, :timeout, :verbose,
68
68
  :global_known_hosts_file, :user_known_hosts_file, :host_key_alias,
69
- :host_name, :user, :properties, :passphrase, :keys_only
69
+ :host_name, :user, :properties, :passphrase, :keys_only, :max_pkt_size,
70
+ :max_win_size
70
71
  ]
71
72
 
72
73
  # The standard means of starting a new SSH connection. When used with a
@@ -120,7 +121,7 @@ module Net
120
121
  # host to a known_hosts dictionary file
121
122
  # * :host_name => the real host name or IP to log into. This is used
122
123
  # instead of the +host+ parameter, and is primarily only useful when
123
- # specified in an SSH configuration file. It lets you specify an
124
+ # specified in an SSH configuration file. It lets you specify an
124
125
  # "alias", similarly to adding an entry in /etc/hosts but without needing
125
126
  # to modify /etc/hosts.
126
127
  # * :kex => the key exchange algorithm (or algorithms) to use
@@ -133,6 +134,11 @@ module Net
133
134
  # option is intended for situations where ssh-agent offers many different
134
135
  # identites.
135
136
  # * :logger => the logger instance to use when logging
137
+ # * :max_pkt_size => maximum size we tell the other side that is supported per
138
+ # packet. Default is 0x8000 (32768 bytes). Increase to 0x10000 (65536 bytes)
139
+ # for better performance if your SSH server supports it (most do).
140
+ # * :max_win_size => maximum size we tell the other side that is supported for
141
+ # the window.
136
142
  # * :paranoid => either false, true, :very, or :secure specifying how
137
143
  # strict host-key verification should be (in increasing order here)
138
144
  # * :passphrase => the passphrase to use when loading a private key (default
@@ -217,7 +223,7 @@ module Net
217
223
  when false, nil then return {}
218
224
  else Array(use_ssh_config)
219
225
  end
220
-
226
+
221
227
  Net::SSH::Config.for(host, files)
222
228
  end
223
229
  end
@@ -107,15 +107,15 @@ module Net; module SSH; module Connection
107
107
  # that time (see #do_open_confirmation).
108
108
  #
109
109
  # This also sets the default maximum packet size and maximum window size.
110
- def initialize(connection, type, local_id, &on_confirm_open)
110
+ def initialize(connection, type, local_id, max_pkt_size = 0x8000, max_win_size = 0x20000, &on_confirm_open)
111
111
  self.logger = connection.logger
112
112
 
113
113
  @connection = connection
114
114
  @type = type
115
115
  @local_id = local_id
116
116
 
117
- @local_maximum_packet_size = 0x10000
118
- @local_window_size = @local_maximum_window_size = 0x20000
117
+ @local_maximum_packet_size = max_pkt_size
118
+ @local_window_size = @local_maximum_window_size = max_win_size
119
119
 
120
120
  @on_confirm_open = on_confirm_open
121
121
 
@@ -72,6 +72,9 @@ module Net; module SSH; module Connection
72
72
  @channel_open_handlers = {}
73
73
  @on_global_request = {}
74
74
  @properties = (options[:properties] || {}).dup
75
+
76
+ @max_pkt_size = (options.has_key?(:max_pkt_size) ? options[:max_pkt_size] : 0x8000)
77
+ @max_win_size = (options.has_key?(:max_win_size) ? options[:max_win_size] : 0x20000)
75
78
  end
76
79
 
77
80
  # Retrieves a custom property from this instance. This can be used to
@@ -286,8 +289,8 @@ module Net; module SSH; module Connection
286
289
  # channel.wait
287
290
  def open_channel(type="session", *extra, &on_confirm)
288
291
  local_id = get_next_channel_id
289
- channel = Channel.new(self, type, local_id, &on_confirm)
290
292
 
293
+ channel = Channel.new(self, type, local_id, @max_pkt_size, @max_win_size, &on_confirm)
291
294
  msg = Buffer.from(:byte, CHANNEL_OPEN, :string, type, :long, local_id,
292
295
  :long, channel.local_maximum_window_size,
293
296
  :long, channel.local_maximum_packet_size, *extra)
@@ -503,7 +506,8 @@ module Net; module SSH; module Connection
503
506
  info { "channel open #{packet[:channel_type]}" }
504
507
 
505
508
  local_id = get_next_channel_id
506
- channel = Channel.new(self, packet[:channel_type], local_id)
509
+
510
+ channel = Channel.new(self, packet[:channel_type], local_id, @max_pkt_size, @max_win_size)
507
511
  channel.do_open_confirmation(packet[:remote_id], packet[:window_size], packet[:packet_size])
508
512
 
509
513
  callback = channel_open_handlers[packet[:channel_type]]
@@ -51,7 +51,7 @@ module Net; module SSH
51
51
  MINOR = 6
52
52
 
53
53
  # The tiny component of this version of the Net::SSH library
54
- TINY = 6
54
+ TINY = 7
55
55
 
56
56
  # The current version of the Net::SSH library as a Version instance
57
57
  CURRENT = new(MAJOR, MINOR, TINY)
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "net-ssh"
8
- s.version = "2.6.6"
8
+ s.version = "2.6.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jamis Buck", "Delano Mandelbaum"]
12
12
  s.cert_chain = ["gem-public_cert.pem"]
13
- s.date = "2013-03-03"
13
+ s.date = "2013-04-11"
14
14
  s.description = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2."
15
15
  s.email = "net-ssh@solutious.com"
16
16
  s.extra_rdoc_files = [
@@ -11,7 +11,7 @@ module Connection
11
11
  end
12
12
 
13
13
  def test_constructor_should_set_defaults
14
- assert_equal 0x10000, channel.local_maximum_packet_size
14
+ assert_equal 0x8000, channel.local_maximum_packet_size
15
15
  assert_equal 0x20000, channel.local_maximum_window_size
16
16
  assert channel.pending_requests.empty?
17
17
  end
@@ -126,7 +126,7 @@ module Connection
126
126
  assert_equal CHANNEL_DATA, packet.type
127
127
  assert_equal 0, packet[:local_id]
128
128
  assert_equal "hello wo", packet[:data]
129
-
129
+
130
130
  t.expect do |t2,packet2|
131
131
  assert_equal CHANNEL_DATA, packet2.type
132
132
  assert_equal 0, packet2[:local_id]
@@ -225,7 +225,7 @@ module Connection
225
225
  result = nil
226
226
  session.on_open_channel("auth-agent") { |*args| result = args }
227
227
  process_times(2)
228
- assert_equal P(:byte, CHANNEL_OPEN_CONFIRMATION, :long, 14, :long, 0, :long, 0x20000, :long, 0x10000).to_s, socket.write_buffer
228
+ assert_equal P(:byte, CHANNEL_OPEN_CONFIRMATION, :long, 14, :long, 0, :long, 0x20000, :long, 0x8000).to_s, socket.write_buffer
229
229
  assert_not_nil(ch = session.channels[0])
230
230
  assert_equal [session, ch, P(:byte, CHANNEL_OPEN, :string, "auth-agent", :long, 14, :long, 0x20001, :long, 0x10001)], result
231
231
  assert_equal 0, ch.local_id
@@ -233,7 +233,7 @@ module Connection
233
233
  assert_equal 0x20001, ch.remote_maximum_window_size
234
234
  assert_equal 0x10001, ch.remote_maximum_packet_size
235
235
  assert_equal 0x20000, ch.local_maximum_window_size
236
- assert_equal 0x10000, ch.local_maximum_packet_size
236
+ assert_equal 0x8000, ch.local_maximum_packet_size
237
237
  assert_equal "auth-agent", ch.type
238
238
  end
239
239
 
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.6.6
4
+ version: 2.6.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -38,7 +38,7 @@ cert_chain:
38
38
  MVhNUThCTTJKejBYb1BhblBlMzU0K2xXd2pwa1JLYkZvdy9aYlFIY0NMQ3Ey
39
39
  NCtONmI2ZwpkZ0tmTkR6d2lEcHFDQT09Ci0tLS0tRU5EIENFUlRJRklDQVRF
40
40
  LS0tLS0K
41
- date: 2013-03-03 00:00:00.000000000 Z
41
+ date: 2013-04-11 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: test-unit
metadata.gz.sig CHANGED
Binary file