net-ssh 4.0.0.rc1 → 4.0.0.rc2
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/.rubocop_todo.yml +189 -208
- data/.travis.yml +9 -8
- data/CHANGES.txt +6 -0
- data/Gemfile +5 -4
- data/Gemfile.norbnacl +2 -2
- data/Gemfile.norbnacl.lock +2 -2
- data/README.rdoc +14 -0
- data/Rakefile +2 -2
- data/lib/net/ssh.rb +20 -13
- data/lib/net/ssh/authentication/key_manager.rb +6 -6
- data/lib/net/ssh/authentication/pageant.rb +11 -7
- data/lib/net/ssh/buffer.rb +21 -8
- data/lib/net/ssh/config.rb +2 -2
- data/lib/net/ssh/connection/channel.rb +6 -6
- data/lib/net/ssh/connection/event_loop.rb +12 -8
- data/lib/net/ssh/connection/session.rb +2 -2
- data/lib/net/ssh/errors.rb +6 -6
- data/lib/net/ssh/key_factory.rb +5 -8
- data/lib/net/ssh/prompt.rb +4 -6
- data/lib/net/ssh/proxy/http.rb +5 -5
- data/lib/net/ssh/test.rb +1 -1
- data/lib/net/ssh/test/kex.rb +4 -4
- data/lib/net/ssh/transport/algorithms.rb +49 -46
- data/lib/net/ssh/transport/cipher_factory.rb +4 -4
- data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +20 -9
- data/lib/net/ssh/transport/session.rb +1 -1
- data/lib/net/ssh/version.rb +1 -1
- data/net-ssh-public_cert.pem +19 -18
- data/net-ssh.gemspec +4 -5
- data/support/arcfour_check.rb +1 -1
- data/support/ssh_tunnel_bug.rb +1 -1
- metadata +52 -52
- metadata.gz.sig +0 -0
data/lib/net/ssh/key_factory.rb
CHANGED
@@ -37,7 +37,7 @@ module Net; module SSH
|
|
37
37
|
# whether the file describes an RSA or DSA key, and will load it
|
38
38
|
# appropriately. The new key is returned. If the key itself is
|
39
39
|
# encrypted (requiring a passphrase to use), the user will be
|
40
|
-
# prompted to enter their password unless passphrase works.
|
40
|
+
# prompted to enter their password unless passphrase works.
|
41
41
|
def load_private_key(filename, passphrase=nil, ask_passphrase=true, prompt=Prompt.default)
|
42
42
|
data = File.read(File.expand_path(filename))
|
43
43
|
load_data_private_key(data, passphrase, ask_passphrase, filename, prompt)
|
@@ -47,7 +47,7 @@ module Net; module SSH
|
|
47
47
|
# whether the file describes an RSA or DSA key, and will load it
|
48
48
|
# appropriately. The new key is returned. If the key itself is
|
49
49
|
# encrypted (requiring a passphrase to use), the user will be
|
50
|
-
# prompted to enter their password unless passphrase works.
|
50
|
+
# prompted to enter their password unless passphrase works.
|
51
51
|
def load_data_private_key(data, passphrase=nil, ask_passphrase=true, filename="", prompt=Prompt.default)
|
52
52
|
key_read, error_classes = classify_key(data, filename)
|
53
53
|
|
@@ -55,7 +55,7 @@ module Net; module SSH
|
|
55
55
|
tries = 0
|
56
56
|
|
57
57
|
prompter = nil
|
58
|
-
result =
|
58
|
+
result =
|
59
59
|
begin
|
60
60
|
key_read[data, passphrase || 'invalid']
|
61
61
|
rescue *error_classes
|
@@ -109,11 +109,8 @@ module Net; module SSH
|
|
109
109
|
# appropriately.
|
110
110
|
def classify_key(data, filename)
|
111
111
|
if data.match(/-----BEGIN OPENSSH PRIVATE KEY-----/)
|
112
|
-
|
113
|
-
|
114
|
-
else
|
115
|
-
raise OpenSSL::PKey::PKeyError, "OpenSSH keys only supported if ED25519 is available - #{ED25519_LOAD_ERROR}"
|
116
|
-
end
|
112
|
+
Net::SSH::Authentication::ED25519Loader.raiseUnlessLoaded("OpenSSH keys only supported if ED25519 is available")
|
113
|
+
return ->(key_data, passphrase) { Net::SSH::Authentication::ED25519::PrivKey.read(key_data, passphrase) }, [ArgumentError]
|
117
114
|
elsif OpenSSL::PKey.respond_to?(:read)
|
118
115
|
return ->(key_data, passphrase) { OpenSSL::PKey.read(key_data, passphrase) }, [ArgumentError, OpenSSL::PKey::PKeyError]
|
119
116
|
elsif data.match(/-----BEGIN DSA PRIVATE KEY-----/)
|
data/lib/net/ssh/prompt.rb
CHANGED
@@ -24,14 +24,13 @@ module Net; module SSH
|
|
24
24
|
@default ||= new(options)
|
25
25
|
end
|
26
26
|
|
27
|
-
def initialize(options = {})
|
28
|
-
end
|
27
|
+
def initialize(options = {}); end
|
29
28
|
|
30
29
|
# default prompt object implementation. More sophisticated implemenetations
|
31
30
|
# might implement caching.
|
32
31
|
class Prompter
|
33
32
|
def initialize(info)
|
34
|
-
if info[:type] == 'keyboard-interactive'
|
33
|
+
if info[:type] == 'keyboard-interactive'
|
35
34
|
$stdout.puts(info[:name]) unless info[:name].empty?
|
36
35
|
$stdout.puts(info[:instruction]) unless info[:instruction].empty?
|
37
36
|
end
|
@@ -49,8 +48,7 @@ module Net; module SSH
|
|
49
48
|
|
50
49
|
# success method will be called when the password was accepted
|
51
50
|
# It's a good time to save password asked to a cache.
|
52
|
-
def success
|
53
|
-
end
|
51
|
+
def success; end
|
54
52
|
end
|
55
53
|
|
56
54
|
# start password session. Multiple questions might be asked multiple times
|
@@ -61,4 +59,4 @@ module Net; module SSH
|
|
61
59
|
end
|
62
60
|
end
|
63
61
|
|
64
|
-
end; end
|
62
|
+
end; end
|
data/lib/net/ssh/proxy/http.rb
CHANGED
@@ -87,11 +87,11 @@ module Net; module SSH; module Proxy
|
|
87
87
|
body = socket.read(headers["Content-Length"].to_i)
|
88
88
|
end
|
89
89
|
|
90
|
-
return { :
|
91
|
-
:
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
90
|
+
return { version: version,
|
91
|
+
code: code.to_i,
|
92
|
+
reason: reason,
|
93
|
+
headers: headers,
|
94
|
+
body: body }
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
data/lib/net/ssh/test.rb
CHANGED
@@ -71,7 +71,7 @@ module Net; module SSH
|
|
71
71
|
# in these tests. It is a fully functional SSH transport session, operating
|
72
72
|
# over a mock socket (#socket).
|
73
73
|
def transport(options={})
|
74
|
-
@transport ||= Net::SSH::Transport::Session.new(options[:host] || "localhost", options.merge(:
|
74
|
+
@transport ||= Net::SSH::Transport::Session.new(options[:host] || "localhost", options.merge(kex: "test", host_key: "ssh-rsa", paranoid: false, proxy: socket(options)))
|
75
75
|
end
|
76
76
|
|
77
77
|
# First asserts that a story has been described (see #story). Then yields,
|
data/lib/net/ssh/test/kex.rb
CHANGED
@@ -31,10 +31,10 @@ module Net; module SSH; module Test
|
|
31
31
|
buffer = @connection.next_message
|
32
32
|
raise Net::SSH::Exception, "expected NEWKEYS" unless buffer.type == NEWKEYS
|
33
33
|
|
34
|
-
{ :
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
34
|
+
{ session_id: "abc-xyz",
|
35
|
+
server_key: OpenSSL::PKey::RSA.new(512),
|
36
|
+
shared_secret: OpenSSL::BN.new("1234567890", 10),
|
37
|
+
hashing_algorithm: OpenSSL::Digest::SHA1 }
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -6,6 +6,7 @@ require 'net/ssh/transport/constants'
|
|
6
6
|
require 'net/ssh/transport/hmac'
|
7
7
|
require 'net/ssh/transport/kex'
|
8
8
|
require 'net/ssh/transport/server_version'
|
9
|
+
require 'net/ssh/authentication/ed25519_loader'
|
9
10
|
|
10
11
|
module Net; module SSH; module Transport
|
11
12
|
|
@@ -22,32 +23,34 @@ module Net; module SSH; module Transport
|
|
22
23
|
# Define the default algorithms, in order of preference, supported by
|
23
24
|
# Net::SSH.
|
24
25
|
ALGORITHMS = {
|
25
|
-
:
|
26
|
-
|
27
|
-
|
28
|
-
:
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
:
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
:
|
45
|
-
:language => %w()
|
26
|
+
host_key: %w(ssh-rsa ssh-dss
|
27
|
+
ssh-rsa-cert-v01@openssh.com
|
28
|
+
ssh-rsa-cert-v00@openssh.com),
|
29
|
+
kex: %w(diffie-hellman-group-exchange-sha1
|
30
|
+
diffie-hellman-group1-sha1
|
31
|
+
diffie-hellman-group14-sha1
|
32
|
+
diffie-hellman-group-exchange-sha256),
|
33
|
+
encryption: %w(aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
|
34
|
+
aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se
|
35
|
+
idea-cbc none arcfour128 arcfour256 arcfour
|
36
|
+
aes128-ctr aes192-ctr aes256-ctr
|
37
|
+
cast128-ctr blowfish-ctr 3des-ctr),
|
38
|
+
|
39
|
+
hmac: %w(hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96
|
40
|
+
hmac-ripemd160 hmac-ripemd160@openssh.com
|
41
|
+
hmac-sha2-256 hmac-sha2-512 hmac-sha2-256-96
|
42
|
+
hmac-sha2-512-96 none),
|
43
|
+
|
44
|
+
compression: %w(none zlib@openssh.com zlib),
|
45
|
+
language: %w()
|
46
46
|
}
|
47
47
|
if defined?(OpenSSL::PKey::EC)
|
48
48
|
ALGORITHMS[:host_key] += %w(ecdsa-sha2-nistp256
|
49
49
|
ecdsa-sha2-nistp384
|
50
50
|
ecdsa-sha2-nistp521)
|
51
|
+
if Net::SSH::Authentication::ED25519Loader::LOADED
|
52
|
+
ALGORITHMS[:host_key] += %w(ssh-ed25519)
|
53
|
+
end
|
51
54
|
ALGORITHMS[:kex] += %w(ecdh-sha2-nistp256
|
52
55
|
ecdh-sha2-nistp384
|
53
56
|
ecdh-sha2-nistp521)
|
@@ -251,7 +254,7 @@ module Net; module SSH; module Transport
|
|
251
254
|
|
252
255
|
# Parses a KEXINIT packet from the server.
|
253
256
|
def parse_server_algorithm_packet(packet)
|
254
|
-
data = { :
|
257
|
+
data = { raw: packet.content }
|
255
258
|
|
256
259
|
packet.read(16) # skip the cookie value
|
257
260
|
|
@@ -352,13 +355,13 @@ module Net; module SSH; module Transport
|
|
352
355
|
debug { "exchanging keys" }
|
353
356
|
|
354
357
|
algorithm = Kex::MAP[kex].new(self, session,
|
355
|
-
:
|
356
|
-
:
|
357
|
-
:
|
358
|
-
:
|
359
|
-
:
|
360
|
-
:
|
361
|
-
:
|
358
|
+
client_version_string: Net::SSH::Transport::ServerVersion::PROTO_VERSION,
|
359
|
+
server_version_string: session.server_version.version,
|
360
|
+
server_algorithm_packet: @server_packet,
|
361
|
+
client_algorithm_packet: @client_packet,
|
362
|
+
need_bytes: kex_byte_requirement,
|
363
|
+
minimum_dh_bits: options[:minimum_dh_bits],
|
364
|
+
logger: logger)
|
362
365
|
result = algorithm.exchange_keys
|
363
366
|
|
364
367
|
secret = result[:shared_secret].to_ssh
|
@@ -368,7 +371,7 @@ module Net; module SSH; module Transport
|
|
368
371
|
@session_id ||= hash
|
369
372
|
|
370
373
|
key = Proc.new { |salt| digester.digest(secret + hash + salt + @session_id) }
|
371
|
-
|
374
|
+
|
372
375
|
iv_client = key["A"]
|
373
376
|
iv_server = key["B"]
|
374
377
|
key_client = key["C"]
|
@@ -376,26 +379,26 @@ module Net; module SSH; module Transport
|
|
376
379
|
mac_key_client = key["E"]
|
377
380
|
mac_key_server = key["F"]
|
378
381
|
|
379
|
-
parameters = { :
|
380
|
-
|
381
|
-
cipher_client = CipherFactory.get(encryption_client, parameters.merge(:
|
382
|
-
cipher_server = CipherFactory.get(encryption_server, parameters.merge(:
|
382
|
+
parameters = { shared: secret, hash: hash, digester: digester }
|
383
|
+
|
384
|
+
cipher_client = CipherFactory.get(encryption_client, parameters.merge(iv: iv_client, key: key_client, encrypt: true))
|
385
|
+
cipher_server = CipherFactory.get(encryption_server, parameters.merge(iv: iv_server, key: key_server, decrypt: true))
|
383
386
|
|
384
387
|
mac_client = HMAC.get(hmac_client, mac_key_client, parameters)
|
385
388
|
mac_server = HMAC.get(hmac_server, mac_key_server, parameters)
|
386
389
|
|
387
|
-
session.configure_client :
|
388
|
-
:
|
389
|
-
:
|
390
|
-
:
|
391
|
-
:
|
392
|
-
:
|
393
|
-
|
394
|
-
session.configure_server :
|
395
|
-
:
|
396
|
-
:
|
397
|
-
:
|
398
|
-
:
|
390
|
+
session.configure_client cipher: cipher_client, hmac: mac_client,
|
391
|
+
compression: normalize_compression_name(compression_client),
|
392
|
+
compression_level: options[:compression_level],
|
393
|
+
rekey_limit: options[:rekey_limit],
|
394
|
+
max_packets: options[:rekey_packet_limit],
|
395
|
+
max_blocks: options[:rekey_blocks_limit]
|
396
|
+
|
397
|
+
session.configure_server cipher: cipher_server, hmac: mac_server,
|
398
|
+
compression: normalize_compression_name(compression_server),
|
399
|
+
rekey_limit: options[:rekey_limit],
|
400
|
+
max_packets: options[:rekey_packet_limit],
|
401
|
+
max_blocks: options[:rekey_blocks_limit]
|
399
402
|
|
400
403
|
@initialized = true
|
401
404
|
end
|
@@ -33,8 +33,8 @@ module Net; module SSH; module Transport
|
|
33
33
|
}
|
34
34
|
|
35
35
|
# Ruby's OpenSSL bindings always return a key length of 16 for RC4 ciphers
|
36
|
-
# resulting in the error: OpenSSL::CipherError: key length too short.
|
37
|
-
# The following ciphers will override this key length.
|
36
|
+
# resulting in the error: OpenSSL::CipherError: key length too short.
|
37
|
+
# The following ciphers will override this key length.
|
38
38
|
KEY_LEN_OVERRIDE = {
|
39
39
|
"arcfour256" => 32,
|
40
40
|
"arcfour512" => 64
|
@@ -57,7 +57,7 @@ module Net; module SSH; module Transport
|
|
57
57
|
def self.get(name, options={})
|
58
58
|
ossl_name = SSH_TO_OSSL[name] or raise NotImplementedError, "unimplemented cipher `#{name}'"
|
59
59
|
return IdentityCipher if ossl_name == "none"
|
60
|
-
cipher = OpenSSL::Cipher
|
60
|
+
cipher = OpenSSL::Cipher.new(ossl_name)
|
61
61
|
|
62
62
|
cipher.send(options[:encrypt] ? :encrypt : :decrypt)
|
63
63
|
|
@@ -85,7 +85,7 @@ module Net; module SSH; module Transport
|
|
85
85
|
result = [0, 0]
|
86
86
|
result << 0 if options[:iv_len]
|
87
87
|
else
|
88
|
-
cipher = OpenSSL::Cipher
|
88
|
+
cipher = OpenSSL::Cipher.new(ossl_name)
|
89
89
|
key_len = KEY_LEN_OVERRIDE[name] || cipher.key_len
|
90
90
|
cipher.key_len = key_len
|
91
91
|
|
@@ -69,10 +69,10 @@ module Net; module SSH; module Transport; module Kex
|
|
69
69
|
session_id = verify_signature(result)
|
70
70
|
confirm_newkeys
|
71
71
|
|
72
|
-
return { :
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
72
|
+
return { session_id: session_id,
|
73
|
+
server_key: result[:server_key],
|
74
|
+
shared_secret: result[:shared_secret],
|
75
|
+
hashing_algorithm: digester }
|
76
76
|
end
|
77
77
|
|
78
78
|
private
|
@@ -115,11 +115,22 @@ module Net; module SSH; module Transport; module Kex
|
|
115
115
|
def generate_key #:nodoc:
|
116
116
|
dh = OpenSSL::PKey::DH.new
|
117
117
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
118
|
+
if dh.respond_to?(:set_pqg)
|
119
|
+
p, g = get_parameters
|
120
|
+
dh.set_pqg(p, nil, g)
|
121
|
+
else
|
122
|
+
dh.p, dh.g = get_parameters
|
123
|
+
end
|
122
124
|
|
125
|
+
dh.generate_key!
|
126
|
+
until dh.valid? && dh.priv_key.num_bytes == data[:need_bytes]
|
127
|
+
if dh.respond_to?(:set_key)
|
128
|
+
dh.set_key(nil, OpenSSL::BN.rand(data[:need_bytes] * 8))
|
129
|
+
else
|
130
|
+
dh.priv_key = OpenSSL::BN.rand(data[:need_bytes] * 8)
|
131
|
+
end
|
132
|
+
dh.generate_key!
|
133
|
+
end
|
123
134
|
dh
|
124
135
|
end
|
125
136
|
|
@@ -170,7 +181,7 @@ module Net; module SSH; module Transport; module Kex
|
|
170
181
|
|
171
182
|
blob, fingerprint = generate_key_fingerprint(key)
|
172
183
|
|
173
|
-
unless connection.host_key_verifier.verify(:
|
184
|
+
unless connection.host_key_verifier.verify(key: key, key_blob: blob, fingerprint: fingerprint, session: connection)
|
174
185
|
raise Net::SSH::Exception, "host key verification failed"
|
175
186
|
end
|
176
187
|
end
|
@@ -164,7 +164,7 @@ module Net; module SSH; module Transport
|
|
164
164
|
# Returns a hash of information about the peer (remote) side of the socket,
|
165
165
|
# including :ip, :port, :host, and :canonized (see #host_as_string).
|
166
166
|
def peer
|
167
|
-
@peer ||= { :
|
167
|
+
@peer ||= { ip: socket.peer_ip, port: @port.to_i, host: @host, canonized: host_as_string }
|
168
168
|
end
|
169
169
|
|
170
170
|
# Blocks until a new packet is available to be read, and returns that
|
data/lib/net/ssh/version.rb
CHANGED
@@ -55,7 +55,7 @@ module Net; module SSH
|
|
55
55
|
|
56
56
|
# The prerelease component of this version of the Net::SSH library
|
57
57
|
# nil allowed
|
58
|
-
PRE = "
|
58
|
+
PRE = "rc2"
|
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,21 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
2
|
+
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMQ8wDQYDVQQDDAZuZXRz
|
3
|
+
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
4
|
+
b20wHhcNMTYxMjE1MTgwNTIyWhcNMTcxMjE1MTgwNTIyWjBBMQ8wDQYDVQQDDAZu
|
5
|
+
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
6
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
7
|
+
pQfJhPJTHaDCyQvCsKTFrL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
|
37
37
|
spec.add_development_dependency "bundler", "~> 1.11"
|
38
|
-
spec.add_development_dependency "rake", "~> 11.1"
|
39
|
-
spec.add_development_dependency "minitest", "~> 5.0"
|
40
|
-
spec.add_development_dependency "rubocop", "~> 0.39.0"
|
41
|
-
spec.add_development_dependency "mocha", ">= 1.1.0"
|
42
38
|
|
43
|
-
spec.
|
39
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
40
|
+
spec.add_development_dependency "minitest", "~> 5.10"
|
41
|
+
spec.add_development_dependency "rubocop", "~> 0.46.0"
|
42
|
+
spec.add_development_dependency "mocha", ">= 1.2.1"
|
44
43
|
end
|
data/support/arcfour_check.rb
CHANGED
@@ -14,7 +14,7 @@ require 'net/ssh'
|
|
14
14
|
[['arcfour128', 16], ['arcfour256', 32], ['arcfour512', 64]].each do |cipher|
|
15
15
|
print "#{cipher[0]}: "
|
16
16
|
a = Net::SSH::Transport::CipherFactory.get_lengths(cipher[0])
|
17
|
-
b = Net::SSH::Transport::CipherFactory.get(cipher[0], :
|
17
|
+
b = Net::SSH::Transport::CipherFactory.get(cipher[0], key: ([].fill('x', 0, cipher[1]).join))
|
18
18
|
puts "#{a} #{b.class}"
|
19
19
|
end
|
20
20
|
|
data/support/ssh_tunnel_bug.rb
CHANGED
@@ -37,7 +37,7 @@ pass = ask("Password: ") { |q| q.echo = "*" }
|
|
37
37
|
puts "Configure your browser proxy to localhost:#{LOCAL_PORT}"
|
38
38
|
|
39
39
|
begin
|
40
|
-
session = Net::SSH.start(host, user, :
|
40
|
+
session = Net::SSH.start(host, user, password: pass)
|
41
41
|
session.forward.local(LOCAL_PORT, host, PROXY_PORT)
|
42
42
|
session.loop{true}
|
43
43
|
rescue => e
|
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: 4.0.0.
|
4
|
+
version: 4.0.0.rc2
|
5
5
|
platform: ru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AgSwMB0GA1UdDgQW
|
26
|
+
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
27
|
+
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
28
|
+
9w0BAQUFAAOCAQEATd8If+Ytmhf5lELy24j76ahGv64m518WTCdV2nIViGXB2BnV
|
29
|
+
uLQylGRb1rcgUS3Eh9TE28hqrfhotKS6a96qF9kN0mY2H6UwPWswJ+tj3gA1vLW8
|
30
|
+
wlZNlYGJ91Ig9zULPSbATyOOprUZyggy5p1260BaaI3LQYDeGJOSqpHCVu+TuMcy
|
31
|
+
k00ofiLT1crDSUl2WE/OIFK8AXpmd798AMsef8okHeoo+Dj7zCXn0VSimN+MO1mE
|
32
|
+
L4d54WIy4HkZCqQXoTSiK5HZMIdXkPk3F1bZdJ8Dy1sMRru0rUkkM5mW7TQ75mfW
|
33
|
+
Zp0QrZyNZhtitrXFbZneGRrIA/8G2Krft5Ly/A==
|
33
34
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-
|
35
|
+
date: 2016-12-15 00:00:00.000000000 Z
|
35
36
|
dependencies:
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
38
|
name: rbnacl-libsodium
|
38
39
|
requirement: !ruby/object:Gem::Requirement
|
39
40
|
requirements:
|
40
|
-
- - ~>
|
41
|
+
- - "~>"
|
41
42
|
- !ruby/object:Gem::Version
|
42
43
|
version: 1.0.10
|
43
44
|
type: :development
|
44
45
|
prerelease: false
|
45
46
|
version_requirements: !ruby/object:Gem::Requirement
|
46
47
|
requirements:
|
47
|
-
- - ~>
|
48
|
+
- - "~>"
|
48
49
|
- !ruby/object:Gem::Version
|
49
50
|
version: 1.0.10
|
50
51
|
- !ruby/object:Gem::Dependency
|
51
52
|
name: rbnacl
|
52
53
|
requirement: !ruby/object:Gem::Requirement
|
53
54
|
requirements:
|
54
|
-
- - ~>
|
55
|
+
- - "~>"
|
55
56
|
- !ruby/object:Gem::Version
|
56
57
|
version: 3.4.0
|
57
58
|
type: :development
|
58
59
|
prerelease: false
|
59
60
|
version_requirements: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
|
-
- - ~>
|
62
|
+
- - "~>"
|
62
63
|
- !ruby/object:Gem::Version
|
63
64
|
version: 3.4.0
|
64
65
|
- !ruby/object:Gem::Dependency
|
65
66
|
name: bcrypt_pbkdf
|
66
67
|
requirement: !ruby/object:Gem::Requirement
|
67
68
|
requirements:
|
68
|
-
- - ~>
|
69
|
+
- - "~>"
|
69
70
|
- !ruby/object:Gem::Version
|
70
71
|
version: 1.0.0
|
71
72
|
type: :development
|
72
73
|
prerelease: false
|
73
74
|
version_requirements: !ruby/object:Gem::Requirement
|
74
75
|
requirements:
|
75
|
-
- - ~>
|
76
|
+
- - "~>"
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: 1.0.0
|
78
79
|
- !ruby/object:Gem::Dependency
|
79
80
|
name: bundler
|
80
81
|
requirement: !ruby/object:Gem::Requirement
|
81
82
|
requirements:
|
82
|
-
- - ~>
|
83
|
+
- - "~>"
|
83
84
|
- !ruby/object:Gem::Version
|
84
85
|
version: '1.11'
|
85
86
|
type: :development
|
86
87
|
prerelease: false
|
87
88
|
version_requirements: !ruby/object:Gem::Requirement
|
88
89
|
requirements:
|
89
|
-
- - ~>
|
90
|
+
- - "~>"
|
90
91
|
- !ruby/object:Gem::Version
|
91
92
|
version: '1.11'
|
92
93
|
- !ruby/object:Gem::Dependency
|
93
94
|
name: rake
|
94
95
|
requirement: !ruby/object:Gem::Requirement
|
95
96
|
requirements:
|
96
|
-
- - ~>
|
97
|
+
- - "~>"
|
97
98
|
- !ruby/object:Gem::Version
|
98
|
-
version: '
|
99
|
+
version: '12.0'
|
99
100
|
type: :development
|
100
101
|
prerelease: false
|
101
102
|
version_requirements: !ruby/object:Gem::Requirement
|
102
103
|
requirements:
|
103
|
-
- - ~>
|
104
|
+
- - "~>"
|
104
105
|
- !ruby/object:Gem::Version
|
105
|
-
version: '
|
106
|
+
version: '12.0'
|
106
107
|
- !ruby/object:Gem::Dependency
|
107
108
|
name: minitest
|
108
109
|
requirement: !ruby/object:Gem::Requirement
|
109
110
|
requirements:
|
110
|
-
- - ~>
|
111
|
+
- - "~>"
|
111
112
|
- !ruby/object:Gem::Version
|
112
|
-
version: '5.
|
113
|
+
version: '5.10'
|
113
114
|
type: :development
|
114
115
|
prerelease: false
|
115
116
|
version_requirements: !ruby/object:Gem::Requirement
|
116
117
|
requirements:
|
117
|
-
- - ~>
|
118
|
+
- - "~>"
|
118
119
|
- !ruby/object:Gem::Version
|
119
|
-
version: '5.
|
120
|
+
version: '5.10'
|
120
121
|
- !ruby/object:Gem::Dependency
|
121
122
|
name: rubocop
|
122
123
|
requirement: !ruby/object:Gem::Requirement
|
123
124
|
requirements:
|
124
|
-
- - ~>
|
125
|
+
- - "~>"
|
125
126
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.
|
127
|
+
version: 0.46.0
|
127
128
|
type: :development
|
128
129
|
prerelease: false
|
129
130
|
version_requirements: !ruby/object:Gem::Requirement
|
130
131
|
requirements:
|
131
|
-
- - ~>
|
132
|
+
- - "~>"
|
132
133
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
134
|
+
version: 0.46.0
|
134
135
|
- !ruby/object:Gem::Dependency
|
135
136
|
name: mocha
|
136
137
|
requirement: !ruby/object:Gem::Requirement
|
137
138
|
requirements:
|
138
|
-
- -
|
139
|
+
- - ">="
|
139
140
|
- !ruby/object:Gem::Version
|
140
|
-
version: 1.1
|
141
|
+
version: 1.2.1
|
141
142
|
type: :development
|
142
143
|
prerelease: false
|
143
144
|
version_requirements: !ruby/object:Gem::Requirement
|
144
145
|
requirements:
|
145
|
-
- -
|
146
|
+
- - ">="
|
146
147
|
- !ruby/object:Gem::Version
|
147
|
-
version: 1.1
|
148
|
+
version: 1.2.1
|
148
149
|
description: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It
|
149
150
|
allows you to write programs that invoke and interact with processes on remote servers,
|
150
151
|
via SSH2.'
|
@@ -156,10 +157,10 @@ extra_rdoc_files:
|
|
156
157
|
- LICENSE.txt
|
157
158
|
- README.rdoc
|
158
159
|
files:
|
159
|
-
- .gitignore
|
160
|
-
- .rubocop.yml
|
161
|
-
- .rubocop_todo.yml
|
162
|
-
- .travis.yml
|
160
|
+
- ".gitignore"
|
161
|
+
- ".rubocop.yml"
|
162
|
+
- ".rubocop_todo.yml"
|
163
|
+
- ".travis.yml"
|
163
164
|
- CHANGES.txt
|
164
165
|
- Gemfile
|
165
166
|
- Gemfile.norbnacl
|
@@ -267,19 +268,18 @@ require_paths:
|
|
267
268
|
- lib
|
268
269
|
required_ruby_version: !ruby/object:Gem::Requirement
|
269
270
|
requirements:
|
270
|
-
- -
|
271
|
+
- - ">="
|
271
272
|
- !ruby/object:Gem::Version
|
272
273
|
version: '2.0'
|
273
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
274
275
|
requirements:
|
275
|
-
- -
|
276
|
+
- - ">"
|
276
277
|
- !ruby/object:Gem::Version
|
277
278
|
version: 1.3.1
|
278
279
|
requirements: []
|
279
280
|
rubyforge_project:
|
280
|
-
rubygems_version: 2.
|
281
|
+
rubygems_version: 2.5.1
|
281
282
|
signing_key:
|
282
283
|
specification_version: 4
|
283
284
|
summary: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'
|
284
285
|
test_files: []
|
285
|
-
has_rdoc:
|