net-ssh 6.2.0.rc2 → 6.3.0.beta1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.github/workflows/ci.yml +27 -10
- data/.rubocop.yml +11 -1
- data/.rubocop_todo.yml +374 -173
- data/.travis.yml +10 -11
- data/CHANGES.txt +6 -0
- data/Gemfile +2 -0
- data/Gemfile.noed25519 +2 -0
- data/README.md +2 -2
- data/Rakefile +1 -0
- data/lib/net/ssh.rb +1 -2
- data/lib/net/ssh/authentication/agent.rb +4 -2
- data/lib/net/ssh/authentication/certificate.rb +3 -1
- data/lib/net/ssh/authentication/constants.rb +0 -1
- data/lib/net/ssh/authentication/ed25519.rb +6 -2
- data/lib/net/ssh/authentication/ed25519_loader.rb +4 -7
- data/lib/net/ssh/authentication/key_manager.rb +28 -29
- data/lib/net/ssh/authentication/methods/abstract.rb +0 -1
- data/lib/net/ssh/authentication/methods/hostbased.rb +0 -2
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +1 -1
- data/lib/net/ssh/authentication/methods/none.rb +5 -8
- data/lib/net/ssh/authentication/methods/password.rb +1 -2
- data/lib/net/ssh/authentication/methods/publickey.rb +0 -2
- data/lib/net/ssh/authentication/pageant.rb +89 -89
- data/lib/net/ssh/authentication/session.rb +14 -15
- data/lib/net/ssh/buffer.rb +10 -5
- data/lib/net/ssh/buffered_io.rb +18 -19
- data/lib/net/ssh/config.rb +29 -16
- data/lib/net/ssh/connection/channel.rb +71 -69
- data/lib/net/ssh/connection/constants.rb +0 -4
- data/lib/net/ssh/connection/event_loop.rb +22 -16
- data/lib/net/ssh/connection/keepalive.rb +12 -12
- data/lib/net/ssh/connection/session.rb +95 -94
- data/lib/net/ssh/connection/term.rb +56 -58
- data/lib/net/ssh/errors.rb +10 -10
- data/lib/net/ssh/key_factory.rb +0 -1
- data/lib/net/ssh/known_hosts.rb +79 -11
- data/lib/net/ssh/loggable.rb +8 -9
- data/lib/net/ssh/packet.rb +1 -1
- data/lib/net/ssh/prompt.rb +8 -10
- data/lib/net/ssh/proxy/command.rb +1 -1
- data/lib/net/ssh/proxy/errors.rb +2 -4
- data/lib/net/ssh/proxy/http.rb +17 -19
- data/lib/net/ssh/proxy/https.rb +6 -8
- data/lib/net/ssh/proxy/jump.rb +8 -10
- data/lib/net/ssh/proxy/socks4.rb +1 -3
- data/lib/net/ssh/proxy/socks5.rb +2 -4
- data/lib/net/ssh/service/forward.rb +3 -3
- data/lib/net/ssh/test.rb +1 -2
- data/lib/net/ssh/test/channel.rb +20 -22
- data/lib/net/ssh/test/extensions.rb +29 -29
- data/lib/net/ssh/test/kex.rb +6 -8
- data/lib/net/ssh/test/local_packet.rb +0 -2
- data/lib/net/ssh/test/packet.rb +2 -2
- data/lib/net/ssh/test/remote_packet.rb +5 -7
- data/lib/net/ssh/test/script.rb +21 -23
- data/lib/net/ssh/test/socket.rb +11 -14
- data/lib/net/ssh/transport/algorithms.rb +2 -1
- data/lib/net/ssh/transport/cipher_factory.rb +13 -13
- data/lib/net/ssh/transport/constants.rb +3 -3
- data/lib/net/ssh/transport/ctr.rb +4 -4
- data/lib/net/ssh/transport/hmac/abstract.rb +0 -1
- data/lib/net/ssh/transport/hmac/md5.rb +0 -2
- data/lib/net/ssh/transport/hmac/md5_96.rb +0 -2
- data/lib/net/ssh/transport/hmac/none.rb +0 -2
- data/lib/net/ssh/transport/hmac/ripemd160.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha1.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha1_96.rb +0 -2
- data/lib/net/ssh/transport/identity_cipher.rb +10 -12
- data/lib/net/ssh/transport/kex.rb +2 -0
- data/lib/net/ssh/transport/kex/curve25519_sha256.rb +1 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +4 -4
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb +11 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +0 -1
- data/lib/net/ssh/transport/key_expander.rb +6 -7
- data/lib/net/ssh/transport/openssl.rb +6 -11
- data/lib/net/ssh/transport/packet_stream.rb +1 -2
- data/lib/net/ssh/transport/server_version.rb +17 -16
- data/lib/net/ssh/transport/session.rb +3 -1
- data/lib/net/ssh/transport/state.rb +42 -42
- data/lib/net/ssh/verifiers/accept_new.rb +0 -2
- data/lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb +1 -2
- data/lib/net/ssh/verifiers/always.rb +6 -4
- data/lib/net/ssh/verifiers/never.rb +0 -2
- data/lib/net/ssh/version.rb +2 -2
- data/net-ssh-public_cert.pem +8 -8
- data/net-ssh.gemspec +2 -2
- data/support/ssh_tunnel_bug.rb +3 -3
- metadata +14 -13
- metadata.gz.sig +0 -0
|
@@ -5,7 +5,6 @@ require 'net/ssh/verifiers/always'
|
|
|
5
5
|
module Net
|
|
6
6
|
module SSH
|
|
7
7
|
module Verifiers
|
|
8
|
-
|
|
9
8
|
# Does a strict host verification, looking the server up in the known
|
|
10
9
|
# host files to see if a key has already been seen for this server. If this
|
|
11
10
|
# server does not appear in any host file, this will silently add the
|
|
@@ -29,7 +28,6 @@ module Net
|
|
|
29
28
|
return true
|
|
30
29
|
end
|
|
31
30
|
end
|
|
32
|
-
|
|
33
31
|
end
|
|
34
32
|
end
|
|
35
33
|
end
|
|
@@ -3,7 +3,6 @@ require 'net/ssh/verifiers/accept_new'
|
|
|
3
3
|
module Net
|
|
4
4
|
module SSH
|
|
5
5
|
module Verifiers
|
|
6
|
-
|
|
7
6
|
# Basically the same as the AcceptNew verifier, but does not try to actually
|
|
8
7
|
# verify a connection if the server is the localhost and the port is a
|
|
9
8
|
# nonstandard port number. Those two conditions will typically mean the
|
|
@@ -14,6 +13,7 @@ module Net
|
|
|
14
13
|
# returns true. Otherwise, performs the standard strict verification.
|
|
15
14
|
def verify(arguments)
|
|
16
15
|
return true if tunnelled?(arguments)
|
|
16
|
+
|
|
17
17
|
super
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -28,7 +28,6 @@ module Net
|
|
|
28
28
|
return ip == "127.0.0.1" || ip == "::1"
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
|
|
32
31
|
end
|
|
33
32
|
end
|
|
34
33
|
end
|
|
@@ -4,7 +4,6 @@ require 'net/ssh/known_hosts'
|
|
|
4
4
|
module Net
|
|
5
5
|
module SSH
|
|
6
6
|
module Verifiers
|
|
7
|
-
|
|
8
7
|
# Does a strict host verification, looking the server up in the known
|
|
9
8
|
# host files to see if a key has already been seen for this server. If this
|
|
10
9
|
# server does not appear in any host file, an exception will be raised
|
|
@@ -22,9 +21,13 @@ module Net
|
|
|
22
21
|
|
|
23
22
|
# If we found any matches, check to see that the key type and
|
|
24
23
|
# blob also match.
|
|
24
|
+
|
|
25
25
|
found = host_keys.any? do |key|
|
|
26
|
-
key.
|
|
27
|
-
|
|
26
|
+
if key.respond_to?(:matches_key?)
|
|
27
|
+
key.matches_key?(arguments[:key])
|
|
28
|
+
else
|
|
29
|
+
key.ssh_type == arguments[:key].ssh_type && key.to_blob == arguments[:key].to_blob
|
|
30
|
+
end
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
# If a match was found, return true. Otherwise, raise an exception
|
|
@@ -50,7 +53,6 @@ module Net
|
|
|
50
53
|
raise exception
|
|
51
54
|
end
|
|
52
55
|
end
|
|
53
|
-
|
|
54
56
|
end
|
|
55
57
|
end
|
|
56
58
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
module Net
|
|
2
2
|
module SSH
|
|
3
3
|
module Verifiers
|
|
4
|
-
|
|
5
4
|
# This host key verifier simply allows every key it sees, without
|
|
6
5
|
# any verification. This is simple, but very insecure because it
|
|
7
6
|
# exposes you to MiTM attacks.
|
|
@@ -15,7 +14,6 @@ module Net
|
|
|
15
14
|
true
|
|
16
15
|
end
|
|
17
16
|
end
|
|
18
|
-
|
|
19
17
|
end
|
|
20
18
|
end
|
|
21
19
|
end
|
data/lib/net/ssh/version.rb
CHANGED
|
@@ -49,14 +49,14 @@ module Net
|
|
|
49
49
|
MAJOR = 6
|
|
50
50
|
|
|
51
51
|
# The minor component of this version of the Net::SSH library
|
|
52
|
-
MINOR =
|
|
52
|
+
MINOR = 3
|
|
53
53
|
|
|
54
54
|
# The tiny component of this version of the Net::SSH library
|
|
55
55
|
TINY = 0
|
|
56
56
|
|
|
57
57
|
# The prerelease component of this version of the Net::SSH library
|
|
58
58
|
# nil allowed
|
|
59
|
-
PRE = "
|
|
59
|
+
PRE = "beta1"
|
|
60
60
|
|
|
61
61
|
# The current version of the Net::SSH library as a Version instance
|
|
62
62
|
CURRENT = new(*[MAJOR, MINOR, TINY, PRE].compact)
|
data/net-ssh-public_cert.pem
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
|
2
2
|
MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMTA4MTAwODMyMzBaFw0yMjA4MTAw
|
|
4
|
+
ODMyMzBaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
|
5
5
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
|
|
6
6
|
wskLwrCkxay+Tvc97ZZUOwf85LDDDPqhQaTWLvRwnIOMgQE2nBPzwalVclK6a+pW
|
|
7
7
|
x/18KDeZY15vm3Qn5p42b0wi9hUxOqPm3J2hdCLCcgtENgdX21nVzejn39WVqFJO
|
|
@@ -11,10 +11,10 @@ fBbmDnsMLAtAtauMOxORrbx3EOY7sHku/kSrMg3FXFay7jc6BkbbUij+MjJ/k82l
|
|
|
11
11
|
AQABo3sweTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUBfKiwO2e
|
|
12
12
|
M4NEiRrVG793qEPLYyMwHwYDVR0RBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20w
|
|
13
13
|
HwYDVR0SBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20wDQYJKoZIhvcNAQELBQAD
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
ggEBABRChgo0Jo+iXSnTpODNongzZoU0sWqwx3/FQVo8nyAyr1qFuiqpSPb4bDbU
|
|
15
|
+
DsVnUn3t0X/gGA8qJhutlmfTpEQCjUeyj2x9rWpD3lvttlGWV6btQ0qN4Dfc2gsw
|
|
16
|
+
rCp9Jpful0HGWhiwfjWfsarqAdtLzIG0UC47IN7LGeCMRJIijOsXQhiZ915eNBEw
|
|
17
|
+
g9+WSSGHkMFt/7vi2pFkvXSC0+RF8ovvRWf4Zw2aYXtJ1GElgi4ZS/s6ZU0gmv20
|
|
18
|
+
i4SfC5m5UXIVZvOBYiMuZ/1B2m6R9xU41027zfOVwRFNtlVDiNfQRq6sDmz44At/
|
|
19
|
+
dv8pkxXDgySe41vzlRXFsgIgz5A=
|
|
20
20
|
-----END CERTIFICATE-----
|
data/net-ssh.gemspec
CHANGED
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.description = %q{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.}
|
|
16
16
|
spec.homepage = "https://github.com/net-ssh/net-ssh"
|
|
17
17
|
spec.license = "MIT"
|
|
18
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
|
18
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5")
|
|
19
19
|
spec.metadata = {
|
|
20
20
|
"changelog_uri" => "https://github.com/net-ssh/net-ssh/blob/master/CHANGES.txt"
|
|
21
21
|
}
|
|
@@ -40,5 +40,5 @@ Gem::Specification.new do |spec|
|
|
|
40
40
|
spec.add_development_dependency "minitest", "~> 5.10"
|
|
41
41
|
spec.add_development_dependency "mocha", "~> 1.11.2"
|
|
42
42
|
spec.add_development_dependency "rake", "~> 12.0"
|
|
43
|
-
spec.add_development_dependency "rubocop", "~>
|
|
43
|
+
spec.add_development_dependency "rubocop", "~> 1.12.1"
|
|
44
44
|
end
|
data/support/ssh_tunnel_bug.rb
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
# visible_hostname netsshtest
|
|
16
16
|
# * Start squid squid -N -d 1 -D
|
|
17
17
|
# * Run this script
|
|
18
|
-
# * Configure browser proxy to use localhost with LOCAL_PORT.
|
|
18
|
+
# * Configure browser proxy to use localhost with LOCAL_PORT.
|
|
19
19
|
# * Load any page, wait for it to load fully. If the page loads
|
|
20
20
|
# correctly, move on. If not, something needs to be corrected.
|
|
21
21
|
# * Refresh the page several times. This should cause this
|
|
22
22
|
# script to failed with the error: "closed stream". You may
|
|
23
|
-
# need to try a few times.
|
|
23
|
+
# need to try a few times.
|
|
24
24
|
#
|
|
25
25
|
|
|
26
26
|
require 'highline/import'
|
|
@@ -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, password: pass)
|
|
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 StandardError => 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: 6.
|
|
4
|
+
version: 6.3.0.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
@@ -13,8 +13,8 @@ cert_chain:
|
|
|
13
13
|
- |
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
|
15
15
|
MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMTA4MTAwODMyMzBaFw0yMjA4MTAw
|
|
17
|
+
ODMyMzBaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
|
18
18
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
|
|
19
19
|
wskLwrCkxay+Tvc97ZZUOwf85LDDDPqhQaTWLvRwnIOMgQE2nBPzwalVclK6a+pW
|
|
20
20
|
x/18KDeZY15vm3Qn5p42b0wi9hUxOqPm3J2hdCLCcgtENgdX21nVzejn39WVqFJO
|
|
@@ -24,14 +24,14 @@ cert_chain:
|
|
|
24
24
|
AQABo3sweTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUBfKiwO2e
|
|
25
25
|
M4NEiRrVG793qEPLYyMwHwYDVR0RBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20w
|
|
26
26
|
HwYDVR0SBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20wDQYJKoZIhvcNAQELBQAD
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
ggEBABRChgo0Jo+iXSnTpODNongzZoU0sWqwx3/FQVo8nyAyr1qFuiqpSPb4bDbU
|
|
28
|
+
DsVnUn3t0X/gGA8qJhutlmfTpEQCjUeyj2x9rWpD3lvttlGWV6btQ0qN4Dfc2gsw
|
|
29
|
+
rCp9Jpful0HGWhiwfjWfsarqAdtLzIG0UC47IN7LGeCMRJIijOsXQhiZ915eNBEw
|
|
30
|
+
g9+WSSGHkMFt/7vi2pFkvXSC0+RF8ovvRWf4Zw2aYXtJ1GElgi4ZS/s6ZU0gmv20
|
|
31
|
+
i4SfC5m5UXIVZvOBYiMuZ/1B2m6R9xU41027zfOVwRFNtlVDiNfQRq6sDmz44At/
|
|
32
|
+
dv8pkxXDgySe41vzlRXFsgIgz5A=
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2021-
|
|
34
|
+
date: 2021-08-10 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: bcrypt_pbkdf
|
|
@@ -137,14 +137,14 @@ dependencies:
|
|
|
137
137
|
requirements:
|
|
138
138
|
- - "~>"
|
|
139
139
|
- !ruby/object:Gem::Version
|
|
140
|
-
version:
|
|
140
|
+
version: 1.12.1
|
|
141
141
|
type: :development
|
|
142
142
|
prerelease: false
|
|
143
143
|
version_requirements: !ruby/object:Gem::Requirement
|
|
144
144
|
requirements:
|
|
145
145
|
- - "~>"
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
|
-
version:
|
|
147
|
+
version: 1.12.1
|
|
148
148
|
description: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It
|
|
149
149
|
allows you to write programs that invoke and interact with processes on remote servers,
|
|
150
150
|
via SSH2.'
|
|
@@ -244,6 +244,7 @@ files:
|
|
|
244
244
|
- lib/net/ssh/transport/kex/curve25519_sha256.rb
|
|
245
245
|
- lib/net/ssh/transport/kex/curve25519_sha256_loader.rb
|
|
246
246
|
- lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb
|
|
247
|
+
- lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb
|
|
247
248
|
- lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
|
248
249
|
- lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
|
249
250
|
- lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb
|
|
@@ -277,7 +278,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
277
278
|
requirements:
|
|
278
279
|
- - ">="
|
|
279
280
|
- !ruby/object:Gem::Version
|
|
280
|
-
version: '2.
|
|
281
|
+
version: '2.5'
|
|
281
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
282
283
|
requirements:
|
|
283
284
|
- - ">"
|
metadata.gz.sig
CHANGED
|
Binary file
|