net-ssh 2.9.3.beta1 → 2.9.4.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +4 -12
- data/CHANGES.txt +5 -5
- data/Rakefile +5 -10
- data/lib/net/ssh/authentication/key_manager.rb +4 -8
- data/lib/net/ssh/authentication/pageant.rb +4 -19
- data/lib/net/ssh/connection/channel.rb +26 -7
- data/lib/net/ssh/connection/session.rb +11 -2
- data/lib/net/ssh/proxy/command.rb +5 -18
- data/lib/net/ssh/transport/cipher_factory.rb +1 -0
- data/lib/net/ssh/transport/session.rb +7 -8
- data/lib/net/ssh/version.rb +2 -2
- data/net-ssh-public_cert.pem +15 -15
- data/net-ssh.gemspec +4 -4
- data/test/authentication/test_key_manager.rb +0 -4
- data/test/connection/test_channel.rb +3 -0
- data/test/connection/test_session.rb +14 -5
- data/test/transport/test_session.rb +1 -1
- metadata +25 -25
- metadata.gz.sig +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c78d95e1a6a176a5758703ee6bae1641841b7ece
|
4
|
+
data.tar.gz: b26c48f7574e6f456e7e96fd745989b3435aa253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43193bcd4fd4af80ab1e92cd42a94afb062fa46d098bc5ec5231adb2df27e26ac64972ec9ad39c76cee3ca5a0940bebe2307571bbdd64afb523f59daaa5876b5
|
7
|
+
data.tar.gz: 91d433f19a523bdaf7389567f1892c73606873e3c0694d7b34b6f58729716068aa8567f7779ca90f036b3cece67a74d08ca4aff4aabc0f65705e0e8d576d3e85
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
@@ -1,18 +1,10 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 1.9.3
|
4
|
-
- 2.0.0
|
5
|
-
- 2.1.0
|
6
|
-
- 2.2.0
|
7
|
-
- jruby-head
|
8
|
-
- jruby-19mode
|
9
|
-
- 1.8.7
|
3
|
+
- "1.9.3"
|
4
|
+
- "2.0.0"
|
10
5
|
|
11
|
-
|
6
|
+
|
7
|
+
install: gem install jeweler test-unit mocha
|
12
8
|
|
13
9
|
script: rake test
|
14
10
|
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- rvm: jruby-head
|
18
|
-
- rvm: 1.8.7
|
data/CHANGES.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
=== 2.9.4-
|
1
|
+
=== 2.9.4-rc1
|
2
2
|
|
3
|
-
*
|
4
|
-
* Windows/peagant: use fiddle on ruby 2.2+/windows [Charlie Savage]
|
5
|
-
* Check if ssh key is a file [kiela]
|
3
|
+
* Bugfix: CHANNEL_CLOSE was sent before draining ouput buffer #280 [Christopher F. Auston]
|
6
4
|
|
7
|
-
|
5
|
+
[Note: 2.9.3 release changes went to 3.0, 2.9.4 is backport of fix form 3.0]
|
6
|
+
|
7
|
+
=== 2.9.2
|
8
8
|
=== 2.9.2-rc3
|
9
9
|
|
10
10
|
* Remove advertised algorithms that were not working (curve25519-sha256@libssh.org) [mfazekas]
|
data/Rakefile
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
require "rubygems"
|
9
9
|
require "rake"
|
10
10
|
require "rake/clean"
|
11
|
-
if RUBY_VERSION >= '1.9.0'
|
12
11
|
require "rdoc/task"
|
13
12
|
|
14
13
|
task :default => ["build"]
|
@@ -56,6 +55,11 @@ rescue LoadError
|
|
56
55
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
57
56
|
end
|
58
57
|
|
58
|
+
require 'rake/testtask'
|
59
|
+
Rake::TestTask.new do |t|
|
60
|
+
t.libs = ["lib", "test"]
|
61
|
+
end
|
62
|
+
|
59
63
|
extra_files = %w[LICENSE.txt THANKS.txt CHANGES.txt ]
|
60
64
|
RDoc::Task.new do |rdoc|
|
61
65
|
rdoc.rdoc_dir = "rdoc"
|
@@ -69,12 +73,3 @@ RDoc::Task.new do |rdoc|
|
|
69
73
|
rdoc.rdoc_files.include(file) if File.exists?(file)
|
70
74
|
}
|
71
75
|
end
|
72
|
-
end
|
73
|
-
|
74
|
-
require 'rake/testtask'
|
75
|
-
Rake::TestTask.new do |t|
|
76
|
-
t.libs = ["lib", "test"]
|
77
|
-
if RUBY_VERSION < '1.9.0'
|
78
|
-
t.ruby_opts << '-rubygems'
|
79
|
-
end
|
80
|
-
end
|
@@ -188,18 +188,14 @@ module Net
|
|
188
188
|
def prepare_identities_from_files
|
189
189
|
key_files.map do |file|
|
190
190
|
public_key_file = file + ".pub"
|
191
|
-
if
|
192
|
-
{ :load_from => :pubkey_file, :file =>
|
193
|
-
elsif
|
191
|
+
if File.readable?(public_key_file)
|
192
|
+
{ :load_from => :pubkey_file, :file => file }
|
193
|
+
elsif File.readable?(file)
|
194
194
|
{ :load_from => :privkey_file, :file => file }
|
195
195
|
end
|
196
196
|
end.compact
|
197
197
|
end
|
198
198
|
|
199
|
-
def readable_file?(path)
|
200
|
-
File.file?(path) && File.readable?(path)
|
201
|
-
end
|
202
|
-
|
203
199
|
# Prepared identities from user key_data, preserving their order and sources.
|
204
200
|
def prepare_identities_from_data
|
205
201
|
key_data.map do |data|
|
@@ -213,7 +209,7 @@ module Net
|
|
213
209
|
begin
|
214
210
|
case identity[:load_from]
|
215
211
|
when :pubkey_file
|
216
|
-
key = KeyFactory.load_public_key(identity[:file])
|
212
|
+
key = KeyFactory.load_public_key(identity[:file] + ".pub")
|
217
213
|
{ :public_key => key, :from => :file, :file => identity[:file] }
|
218
214
|
when :privkey_file
|
219
215
|
private_key = KeyFactory.load_private_key(identity[:file], options[:passphrase], ask_passphrase)
|
@@ -1,20 +1,10 @@
|
|
1
|
+
require 'dl/import'
|
2
|
+
|
1
3
|
if RUBY_VERSION < "1.9"
|
2
|
-
require 'dl/import'
|
3
4
|
require 'dl/struct'
|
4
|
-
|
5
|
-
require 'dl/import'
|
5
|
+
else
|
6
6
|
require 'dl/types'
|
7
7
|
require 'dl'
|
8
|
-
else
|
9
|
-
require 'fiddle'
|
10
|
-
require 'fiddle/types'
|
11
|
-
require 'fiddle/import'
|
12
|
-
|
13
|
-
# For now map DL to Fiddler versus updating all the code below
|
14
|
-
module DL
|
15
|
-
CPtr = Fiddle::Pointer
|
16
|
-
RUBY_FREE = Fiddle::RUBY_FREE
|
17
|
-
end
|
18
8
|
end
|
19
9
|
|
20
10
|
require 'net/ssh/errors'
|
@@ -46,17 +36,12 @@ module Net; module SSH; module Authentication
|
|
46
36
|
dlload 'advapi32'
|
47
37
|
|
48
38
|
SIZEOF_DWORD = DL.sizeof('L')
|
49
|
-
|
39
|
+
else
|
50
40
|
extend DL::Importer
|
51
41
|
dlload 'user32','kernel32', 'advapi32'
|
52
42
|
include DL::Win32Types
|
53
43
|
|
54
44
|
SIZEOF_DWORD = DL::SIZEOF_LONG
|
55
|
-
else
|
56
|
-
extend Fiddle::Importer
|
57
|
-
dlload 'user32','kernel32', 'advapi32'
|
58
|
-
include Fiddle::Win32Types
|
59
|
-
SIZEOF_DWORD = Fiddle::SIZEOF_LONG
|
60
45
|
end
|
61
46
|
|
62
47
|
typealias("LPCTSTR", "char *") # From winnt.h
|
@@ -126,7 +126,7 @@ module Net; module SSH; module Connection
|
|
126
126
|
@pending_requests = []
|
127
127
|
@on_open_failed = @on_data = @on_extended_data = @on_process = @on_close = @on_eof = nil
|
128
128
|
@on_request = {}
|
129
|
-
@closing = @eof = @sent_eof = false
|
129
|
+
@closing = @eof = @sent_eof = @local_closed = @remote_closed = false
|
130
130
|
end
|
131
131
|
|
132
132
|
# A shortcut for accessing properties of the channel (see #properties).
|
@@ -269,14 +269,28 @@ module Net; module SSH; module Connection
|
|
269
269
|
connection.loop { active? }
|
270
270
|
end
|
271
271
|
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
272
|
+
# True if close() has been called; NOTE: if the channel has data waiting to
|
273
|
+
# be sent then the channel will close after all the data is sent. See
|
274
|
+
# closed?() to determine if we have actually sent CHANNEL_CLOSE to server.
|
275
|
+
# This may be true for awhile before closed? returns true if we are still
|
276
|
+
# sending buffered output to server.
|
276
277
|
def closing?
|
277
278
|
@closing
|
278
279
|
end
|
279
280
|
|
281
|
+
# True if we have sent CHANNEL_CLOSE to the remote server.
|
282
|
+
def local_closed?
|
283
|
+
@local_closed
|
284
|
+
end
|
285
|
+
|
286
|
+
def remote_closed?
|
287
|
+
@remote_closed
|
288
|
+
end
|
289
|
+
|
290
|
+
def remote_closed!
|
291
|
+
@remote_closed = true
|
292
|
+
end
|
293
|
+
|
280
294
|
# Requests that the channel be closed. If the channel is already closing,
|
281
295
|
# this does nothing, nor does it do anything if the channel has not yet
|
282
296
|
# been confirmed open (see #do_open_confirmation). Otherwise, it sends a
|
@@ -285,7 +299,6 @@ module Net; module SSH; module Connection
|
|
285
299
|
return if @closing
|
286
300
|
if remote_id
|
287
301
|
@closing = true
|
288
|
-
connection.send_message(Buffer.from(:byte, CHANNEL_CLOSE, :long, remote_id))
|
289
302
|
end
|
290
303
|
end
|
291
304
|
|
@@ -311,10 +324,16 @@ module Net; module SSH; module Connection
|
|
311
324
|
@on_process.call(self) if @on_process
|
312
325
|
enqueue_pending_output
|
313
326
|
|
314
|
-
if @eof and not @sent_eof and output.empty? and remote_id
|
327
|
+
if @eof and not @sent_eof and output.empty? and remote_id and not @local_closed
|
315
328
|
connection.send_message(Buffer.from(:byte, CHANNEL_EOF, :long, remote_id))
|
316
329
|
@sent_eof = true
|
317
330
|
end
|
331
|
+
|
332
|
+
if @closing and not @local_closed and output.empty? and remote_id
|
333
|
+
connection.send_message(Buffer.from(:byte, CHANNEL_CLOSE, :long, remote_id))
|
334
|
+
@local_closed = true
|
335
|
+
connection.cleanup_channel(self)
|
336
|
+
end
|
318
337
|
end
|
319
338
|
|
320
339
|
# Registers a callback to be invoked when data packets are received by the
|
@@ -220,7 +220,7 @@ module Net; module SSH; module Connection
|
|
220
220
|
def preprocess
|
221
221
|
return false if block_given? && !yield(self)
|
222
222
|
dispatch_incoming_packets
|
223
|
-
channels.each { |id, channel| channel.process unless channel.
|
223
|
+
channels.each { |id, channel| channel.process unless channel.local_closed? }
|
224
224
|
return false if block_given? && !yield(self)
|
225
225
|
return true
|
226
226
|
end
|
@@ -453,6 +453,14 @@ module Net; module SSH; module Connection
|
|
453
453
|
old
|
454
454
|
end
|
455
455
|
|
456
|
+
def cleanup_channel(channel)
|
457
|
+
if channel.local_closed? and channel.remote_closed?
|
458
|
+
info { "#{host} delete channel #{channel.local_id} which closed locally and remotely" }
|
459
|
+
channels.delete(channel.local_id)
|
460
|
+
end
|
461
|
+
end
|
462
|
+
|
463
|
+
|
456
464
|
private
|
457
465
|
|
458
466
|
# Read all pending packets from the connection and dispatch them as
|
@@ -581,9 +589,10 @@ module Net; module SSH; module Connection
|
|
581
589
|
info { "channel_close: #{packet[:local_id]}" }
|
582
590
|
|
583
591
|
channel = channels[packet[:local_id]]
|
592
|
+
channel.remote_closed!
|
584
593
|
channel.close
|
585
594
|
|
586
|
-
|
595
|
+
cleanup_channel(channel)
|
587
596
|
channel.do_close
|
588
597
|
end
|
589
598
|
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'socket'
|
2
|
-
require 'rubygems'
|
3
2
|
require 'net/ssh/proxy/errors'
|
4
3
|
require 'net/ssh/ruby_compat'
|
5
4
|
|
@@ -68,24 +67,12 @@ module Net; module SSH; module Proxy
|
|
68
67
|
end
|
69
68
|
@command_line = command_line
|
70
69
|
class << io
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
def send(data, flag)
|
75
|
-
syswrite(data)
|
76
|
-
end
|
77
|
-
|
78
|
-
def recv(size)
|
79
|
-
sysread(size)
|
80
|
-
end
|
81
|
-
else
|
82
|
-
def send(data, flag)
|
83
|
-
write_nonblock(data)
|
84
|
-
end
|
70
|
+
def send(data, flag)
|
71
|
+
write_nonblock(data)
|
72
|
+
end
|
85
73
|
|
86
|
-
|
87
|
-
|
88
|
-
end
|
74
|
+
def recv(size)
|
75
|
+
read_nonblock(size)
|
89
76
|
end
|
90
77
|
end
|
91
78
|
io
|
@@ -76,6 +76,7 @@ module Net; module SSH; module Transport
|
|
76
76
|
cipher.padding = 0
|
77
77
|
|
78
78
|
cipher.extend(Net::SSH::Transport::CTR) if (name =~ /-ctr(@openssh.org)?$/)
|
79
|
+
|
79
80
|
cipher.iv = Net::SSH::Transport::KeyExpander.expand_key(cipher.iv_len, options[:iv], options) if ossl_name != "rc4"
|
80
81
|
|
81
82
|
key_len = KEY_LEN_OVERRIDE[name] || cipher.key_len
|
@@ -63,15 +63,14 @@ module Net; module SSH; module Transport
|
|
63
63
|
@options = options
|
64
64
|
|
65
65
|
debug { "establishing connection to #{@host}:#{@port}" }
|
66
|
-
|
67
|
-
@socket = timeout(options[:timeout] || 0)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
66
|
+
factory = options[:proxy] || TCPSocket
|
67
|
+
@socket = timeout(options[:timeout] || 0) {
|
68
|
+
case
|
69
|
+
when options[:proxy] then factory.open(@host, @port, options)
|
70
|
+
when @bind_address.nil? then factory.open(@host, @port)
|
71
|
+
else factory.open(@host, @port, @bind_address)
|
72
72
|
end
|
73
|
-
|
74
|
-
|
73
|
+
}
|
75
74
|
@socket.extend(PacketStream)
|
76
75
|
@socket.logger = @logger
|
77
76
|
|
data/lib/net/ssh/version.rb
CHANGED
@@ -51,11 +51,11 @@ module Net; module SSH
|
|
51
51
|
MINOR = 9
|
52
52
|
|
53
53
|
# The tiny component of this version of the Net::SSH library
|
54
|
-
TINY =
|
54
|
+
TINY = 4
|
55
55
|
|
56
56
|
# The prerelease component of this version of the Net::SSH library
|
57
57
|
# nil allowed
|
58
|
-
PRE =
|
58
|
+
PRE = "rc1"
|
59
59
|
|
60
60
|
# The current version of the Net::SSH library as a Version instance
|
61
61
|
CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
|
data/net-ssh-public_cert.pem
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
2
|
MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRAwDgYDVQQDDAduZXQt
|
3
3
|
c3NoMRkwFwYKCZImiZPyLGQBGRYJc29sdXRpb3VzMRMwEQYKCZImiZPyLGQBGRYD
|
4
|
-
|
4
|
+
Y29tMB4XDTE1MTIwNjIxMDYyNFoXDTE2MTIwNTIxMDYyNFowQjEQMA4GA1UEAwwH
|
5
5
|
bmV0LXNzaDEZMBcGCgmSJomT8ixkARkWCXNvbHV0aW91czETMBEGCgmSJomT8ixk
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
6
|
+
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMYnhNtn0f6p
|
7
|
+
nTylB8mE8lMdoMLJC8KwpMWsvk73Pe2WVDsH/OSwwwz6oUGk1i70cJyDjIEBNpwT
|
8
|
+
88GpVXJSumvqVsf9fCg3mWNeb5t0J+aeNm9MIvYVMTqj5tydoXQiwnILRDYHV9tZ
|
9
|
+
1c3o59/VlahSTpZ7YEgzVufpAkvEGkbJiG849exiipK7MN/ZIkMOxYVnyRXk43Xc
|
10
|
+
6GYlsHOfSgPwcXwW5g57DCwLQLWrjDsTka28dxDmO7B5Lv5EqzINxVxWsu43OgZG
|
11
|
+
21Io/jIyf5PNpeKPKNGDuAQJ8mvdMYBJoDhtCwgsUYbl0BZzA7g4ytl51HtIeP+j
|
12
|
+
Qp/eAvs/RrECAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUBfKiwO2eM4NE
|
13
|
+
iRrVG793qEPLYyMwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQCfZFdb
|
14
|
+
p4jzkfIzGDbiOxd0R8sdqJoC4nMLEgnQ7dLulawwA3IXe3sHAKgA5kmH3prsKc5H
|
15
|
+
zVmM5NlH2P1nRbegIkQTYiIod1hZQCNxdmVG/fprMqPq0ybpUOjjrP5pj0OtszE1
|
16
|
+
F2dQia1hOEstMR+n0nAtWII9HJAEyeZjVV0s2Cl7Pt85XJ3hxFcCKwzqsK5xRI7a
|
17
|
+
B3vwh3/JJYrFonIohQ//Lg9qTZASEkoKLlq1/hFeICoCGGIGLq45ZB7CzXLooCKi
|
18
|
+
s/ZUKye79ELwFYKJOhjW5g725OL3hy+llhEleytwKRwgXFQBPTC4f5UkdxZVVWGH
|
19
|
+
e2C9M1m/2odPZo8h
|
20
20
|
-----END CERTIFICATE-----
|
data/net-ssh.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: net-ssh 2.9.
|
5
|
+
# stub: net-ssh 2.9.4.rc1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "net-ssh"
|
9
|
-
s.version = "2.9.
|
9
|
+
s.version = "2.9.4.rc1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Jamis Buck", "Delano Mandelbaum", "Mikl\u{f3}s Fazekas"]
|
14
14
|
s.cert_chain = ["net-ssh-public_cert.pem"]
|
15
|
-
s.date = "2015-
|
15
|
+
s.date = "2015-12-10"
|
16
16
|
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."
|
17
17
|
s.email = "net-ssh@solutious.com"
|
18
18
|
s.extra_rdoc_files = [
|
@@ -181,7 +181,7 @@ Gem::Specification.new do |s|
|
|
181
181
|
s.homepage = "https://github.com/net-ssh/net-ssh"
|
182
182
|
s.licenses = ["MIT"]
|
183
183
|
s.rubyforge_project = "net-ssh"
|
184
|
-
s.rubygems_version = "2.
|
184
|
+
s.rubygems_version = "2.4.6"
|
185
185
|
s.signing_key = "/mnt/gem/net-ssh-private_key.pem"
|
186
186
|
s.summary = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol."
|
187
187
|
|
@@ -156,9 +156,7 @@ module Authentication
|
|
156
156
|
|
157
157
|
def stub_file_private_key(name, key, options = {})
|
158
158
|
manager.add(name)
|
159
|
-
File.stubs(:file?).with(name).returns(true)
|
160
159
|
File.stubs(:readable?).with(name).returns(true)
|
161
|
-
File.stubs(:file?).with(name + ".pub").returns(true)
|
162
160
|
File.stubs(:readable?).with(name + ".pub").returns(false)
|
163
161
|
|
164
162
|
case options.fetch(:passphrase, :indifferently)
|
@@ -181,9 +179,7 @@ module Authentication
|
|
181
179
|
|
182
180
|
def stub_file_public_key(name, key)
|
183
181
|
manager.add(name)
|
184
|
-
File.stubs(:file?).with(name).returns(true)
|
185
182
|
File.stubs(:readable?).with(name).returns(false)
|
186
|
-
File.stubs(:file?).with(name + ".pub").returns(true)
|
187
183
|
File.stubs(:readable?).with(name + ".pub").returns(true)
|
188
184
|
|
189
185
|
Net::SSH::KeyFactory.expects(:load_public_key).with(name + ".pub").returns(key).at_least_once
|
@@ -74,8 +74,11 @@ module Connection
|
|
74
74
|
assert !channel.closing?
|
75
75
|
|
76
76
|
connection.expect { |t,packet| assert_equal CHANNEL_CLOSE, packet.type }
|
77
|
+
connection.expects(:cleanup_channel).with(channel)
|
77
78
|
channel.close
|
78
79
|
|
80
|
+
channel.process
|
81
|
+
|
79
82
|
assert channel.closing?
|
80
83
|
end
|
81
84
|
|
@@ -117,14 +117,14 @@ module Connection
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def test_process_should_exit_after_processing_if_block_is_true_then_false
|
120
|
-
session.channels[0] = stub("channel", :
|
120
|
+
session.channels[0] = stub("channel", :local_closed? => false)
|
121
121
|
session.channels[0].expects(:process)
|
122
122
|
IO.expects(:select).never
|
123
123
|
process_times(2)
|
124
124
|
end
|
125
125
|
|
126
126
|
def test_process_should_not_process_channels_that_are_closing
|
127
|
-
session.channels[0] = stub("channel", :
|
127
|
+
session.channels[0] = stub("channel", :local_closed? => true)
|
128
128
|
session.channels[0].expects(:process).never
|
129
129
|
IO.expects(:select).never
|
130
130
|
process_times(2)
|
@@ -299,8 +299,17 @@ module Connection
|
|
299
299
|
end
|
300
300
|
|
301
301
|
def test_channel_close_packet_should_be_routed_to_corresponding_channel_and_channel_should_be_closed_and_removed
|
302
|
-
|
303
|
-
|
302
|
+
session.channels[14] = stub("channel") do
|
303
|
+
# this simulates the case where we closed the channel first, sent
|
304
|
+
# CHANNEL_CLOSE to server and are waiting for server's response.
|
305
|
+
expects(:local_closed?).returns(true)
|
306
|
+
expects(:do_close)
|
307
|
+
expects(:close).with()
|
308
|
+
expects(:remote_closed!).with()
|
309
|
+
expects(:remote_closed?).with().returns(true)
|
310
|
+
expects(:local_id).returns(14)
|
311
|
+
end
|
312
|
+
|
304
313
|
transport.return(CHANNEL_CLOSE, :long, 14)
|
305
314
|
process_times(2)
|
306
315
|
assert session.channels.empty?
|
@@ -523,7 +532,7 @@ module Connection
|
|
523
532
|
end
|
524
533
|
|
525
534
|
def channel_at(local_id)
|
526
|
-
session.channels[local_id] = stub("channel", :process => true, :
|
535
|
+
session.channels[local_id] = stub("channel", :process => true, :local_closed? => false)
|
527
536
|
end
|
528
537
|
|
529
538
|
def transport(options={})
|
@@ -315,7 +315,7 @@ module Transport
|
|
315
315
|
def session(options={})
|
316
316
|
@session ||= begin
|
317
317
|
host = options.delete(:host) || "net.ssh.test"
|
318
|
-
TCPSocket.stubs(:open).with(host, options[:port] || 22
|
318
|
+
TCPSocket.stubs(:open).with(host, options[:port] || 22).returns(socket)
|
319
319
|
Net::SSH::Transport::ServerVersion.stubs(:new).returns(server_version)
|
320
320
|
Net::SSH::Transport::Algorithms.stubs(:new).returns(algorithms)
|
321
321
|
|
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.9.
|
4
|
+
version: 2.9.4.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -14,51 +14,51 @@ cert_chain:
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
15
|
MIIDODCCAiCgAwIBAgIBADANBgkqhkiG9w0BAQUFADBCMRAwDgYDVQQDDAduZXQt
|
16
16
|
c3NoMRkwFwYKCZImiZPyLGQBGRYJc29sdXRpb3VzMRMwEQYKCZImiZPyLGQBGRYD
|
17
|
-
|
17
|
+
Y29tMB4XDTE1MTIwNjIxMDYyNFoXDTE2MTIwNTIxMDYyNFowQjEQMA4GA1UEAwwH
|
18
18
|
bmV0LXNzaDEZMBcGCgmSJomT8ixkARkWCXNvbHV0aW91czETMBEGCgmSJomT8ixk
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
19
|
+
ARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMYnhNtn0f6p
|
20
|
+
nTylB8mE8lMdoMLJC8KwpMWsvk73Pe2WVDsH/OSwwwz6oUGk1i70cJyDjIEBNpwT
|
21
|
+
88GpVXJSumvqVsf9fCg3mWNeb5t0J+aeNm9MIvYVMTqj5tydoXQiwnILRDYHV9tZ
|
22
|
+
1c3o59/VlahSTpZ7YEgzVufpAkvEGkbJiG849exiipK7MN/ZIkMOxYVnyRXk43Xc
|
23
|
+
6GYlsHOfSgPwcXwW5g57DCwLQLWrjDsTka28dxDmO7B5Lv5EqzINxVxWsu43OgZG
|
24
|
+
21Io/jIyf5PNpeKPKNGDuAQJ8mvdMYBJoDhtCwgsUYbl0BZzA7g4ytl51HtIeP+j
|
25
|
+
Qp/eAvs/RrECAwEAAaM5MDcwCQYDVR0TBAIwADAdBgNVHQ4EFgQUBfKiwO2eM4NE
|
26
|
+
iRrVG793qEPLYyMwCwYDVR0PBAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQCfZFdb
|
27
|
+
p4jzkfIzGDbiOxd0R8sdqJoC4nMLEgnQ7dLulawwA3IXe3sHAKgA5kmH3prsKc5H
|
28
|
+
zVmM5NlH2P1nRbegIkQTYiIod1hZQCNxdmVG/fprMqPq0ybpUOjjrP5pj0OtszE1
|
29
|
+
F2dQia1hOEstMR+n0nAtWII9HJAEyeZjVV0s2Cl7Pt85XJ3hxFcCKwzqsK5xRI7a
|
30
|
+
B3vwh3/JJYrFonIohQ//Lg9qTZASEkoKLlq1/hFeICoCGGIGLq45ZB7CzXLooCKi
|
31
|
+
s/ZUKye79ELwFYKJOhjW5g725OL3hy+llhEleytwKRwgXFQBPTC4f5UkdxZVVWGH
|
32
|
+
e2C9M1m/2odPZo8h
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-12-10 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: test-unit
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
type: :development
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: mocha
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
description: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It
|
@@ -71,7 +71,7 @@ extra_rdoc_files:
|
|
71
71
|
- LICENSE.txt
|
72
72
|
- README.rdoc
|
73
73
|
files:
|
74
|
-
- .travis.yml
|
74
|
+
- ".travis.yml"
|
75
75
|
- CHANGES.txt
|
76
76
|
- LICENSE.txt
|
77
77
|
- Manifest
|
@@ -238,17 +238,17 @@ require_paths:
|
|
238
238
|
- lib
|
239
239
|
required_ruby_version: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- -
|
241
|
+
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
|
-
- -
|
246
|
+
- - ">"
|
247
247
|
- !ruby/object:Gem::Version
|
248
248
|
version: 1.3.1
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project: net-ssh
|
251
|
-
rubygems_version: 2.
|
251
|
+
rubygems_version: 2.4.6
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'
|
metadata.gz.sig
CHANGED
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
�`|���t�#"r��'j��5�+��A
|
2
|
+
�Ǒ��v1��-5�[��t
|
3
|
+
��K��]0�k��-��B�u 3���Э[7�_�pο�l�8���_�������;Z��u�XhuKe�?{�w�j>HqGK��[ ᡴ�~Y�TU����K���^�s�Ų�������˿´{�z����Z��L<��w�"Z��6����-kZ�+� ���o�5$s5L9
|
4
|
+
@4���$��6?�
|
2
|
-
>��#tn=Ѹ�:�M��f4
|