net-ssh 7.2.3 → 7.3.8
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/.dockerignore +3 -0
- data/.github/workflows/ci-with-docker.yml +21 -7
- data/.github/workflows/ci.yml +12 -7
- data/.rubocop_todo.yml +3 -1
- data/CHANGES.txt +47 -0
- data/Dockerfile +3 -0
- data/Dockerfile.zlib_ng +29 -0
- data/README.md +3 -0
- data/Rakefile +20 -12
- data/docker-compose.yml +0 -2
- data/lib/net/ssh/authentication/ed25519.rb +10 -0
- data/lib/net/ssh/authentication/ed25519_loader.rb +2 -2
- data/lib/net/ssh/authentication/key_manager.rb +21 -6
- data/lib/net/ssh/config.rb +2 -1
- data/lib/net/ssh/key_factory.rb +4 -3
- data/lib/net/ssh/known_hosts.rb +44 -0
- data/lib/net/ssh/proxy/command.rb +28 -3
- data/lib/net/ssh/proxy/jump.rb +38 -7
- data/lib/net/ssh/service/forward.rb +9 -3
- data/lib/net/ssh/test/extensions.rb +3 -2
- data/lib/net/ssh/test/socket.rb +1 -1
- data/lib/net/ssh/transport/aes128_gcm.rb +40 -0
- data/lib/net/ssh/transport/aes256_gcm.rb +40 -0
- data/lib/net/ssh/transport/algorithms.rb +8 -1
- data/lib/net/ssh/transport/cipher_factory.rb +9 -7
- data/lib/net/ssh/transport/gcm_cipher.rb +207 -0
- data/lib/net/ssh/transport/hmac/abstract.rb +16 -0
- data/lib/net/ssh/transport/packet_stream.rb +7 -3
- data/lib/net/ssh/transport/server_version.rb +33 -13
- data/lib/net/ssh/transport/session.rb +21 -3
- data/lib/net/ssh/transport/state.rb +1 -1
- data/lib/net/ssh/verifiers/always.rb +46 -8
- data/lib/net/ssh/version.rb +2 -2
- data/lib/net/ssh.rb +1 -5
- data/net-ssh-public_cert.pem +7 -7
- data/net-ssh.gemspec +3 -0
- data.tar.gz.sig +0 -0
- metadata +44 -12
- metadata.gz.sig +0 -0
|
@@ -19,10 +19,8 @@ module Net
|
|
|
19
19
|
# We've never seen this host before, so raise an exception.
|
|
20
20
|
process_cache_miss(host_keys, arguments, HostKeyUnknown, "is unknown") if host_keys.empty?
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
found = host_keys.any? do |key|
|
|
22
|
+
# Find the known-hosts entry whose key matches the presented certificate.
|
|
23
|
+
found_key = host_keys.find do |key|
|
|
26
24
|
if key.respond_to?(:matches_key?)
|
|
27
25
|
key.matches_key?(arguments[:key])
|
|
28
26
|
else
|
|
@@ -30,11 +28,17 @@ module Net
|
|
|
30
28
|
end
|
|
31
29
|
end
|
|
32
30
|
|
|
33
|
-
#
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
# No matching entry found — key is not recognized.
|
|
32
|
+
process_cache_miss(host_keys, arguments, HostKeyMismatch, "does not match") unless found_key
|
|
33
|
+
|
|
34
|
+
# For @cert-authority entries, enforce the certificate constraints
|
|
35
|
+
# OpenSSH checks in sshkey_cert_check_authority. A certificate signed by
|
|
36
|
+
# the trusted CA but failing any of these is rejected with
|
|
37
|
+
# HostKeyMismatch (not HostKeyUnknown) so AcceptNew does not swallow the
|
|
38
|
+
# failure and remember the rejected certificate.
|
|
39
|
+
verify_certificate!(found_key, host_keys, arguments)
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
true
|
|
38
42
|
end
|
|
39
43
|
|
|
40
44
|
def verify_signature(&block)
|
|
@@ -43,6 +47,40 @@ module Net
|
|
|
43
47
|
|
|
44
48
|
private
|
|
45
49
|
|
|
50
|
+
# Enforces the @cert-authority certificate constraints for entries that
|
|
51
|
+
# implement them (Net::SSH::HostKeyEntries::CertAuthority). Non-certificate
|
|
52
|
+
# entries do not respond to these predicates and are left untouched.
|
|
53
|
+
def verify_certificate!(entry, host_keys, arguments)
|
|
54
|
+
# Plain keys carry no certificate constraints, and respond_to? on this delegator prints a deprecation warning (#1026).
|
|
55
|
+
return if entry.is_a?(Net::SSH::HostKeyEntries::PubKey)
|
|
56
|
+
|
|
57
|
+
cert = arguments[:key]
|
|
58
|
+
|
|
59
|
+
if entry.respond_to?(:matches_validity?) && !entry.matches_validity?(cert)
|
|
60
|
+
reason = if cert.valid_before && cert.valid_before < Time.now
|
|
61
|
+
"Certificate has expired"
|
|
62
|
+
else
|
|
63
|
+
"Certificate is not yet valid"
|
|
64
|
+
end
|
|
65
|
+
process_cache_miss(host_keys, arguments, HostKeyMismatch, reason)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
if entry.respond_to?(:matches_principal?) && !entry.matches_principal?(cert, host_keys.hostname)
|
|
69
|
+
process_cache_miss(host_keys, arguments, HostKeyMismatch,
|
|
70
|
+
"Certificate invalid: name is not a listed principal")
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
if entry.respond_to?(:matches_type?) && !entry.matches_type?(cert)
|
|
74
|
+
process_cache_miss(host_keys, arguments, HostKeyMismatch,
|
|
75
|
+
"Certificate invalid: not a host certificate")
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
return unless entry.respond_to?(:critical_options_supported?) && !entry.critical_options_supported?(cert)
|
|
79
|
+
|
|
80
|
+
process_cache_miss(host_keys, arguments, HostKeyMismatch,
|
|
81
|
+
"Certificate invalid: unsupported critical option")
|
|
82
|
+
end
|
|
83
|
+
|
|
46
84
|
def process_cache_miss(host_keys, args, exc_class, message)
|
|
47
85
|
exception = exc_class.new("fingerprint #{args[:fingerprint]} " +
|
|
48
86
|
"#{message} for #{host_keys.host.inspect}")
|
data/lib/net/ssh/version.rb
CHANGED
|
@@ -49,10 +49,10 @@ module Net
|
|
|
49
49
|
MAJOR = 7
|
|
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
|
-
TINY =
|
|
55
|
+
TINY = 8
|
|
56
56
|
|
|
57
57
|
# The prerelease component of this version of the Net::SSH library
|
|
58
58
|
# nil allowed
|
data/lib/net/ssh.rb
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
# Make sure HOME is set, regardless of OS, so that File.expand_path works
|
|
2
|
-
# as expected with tilde characters.
|
|
3
|
-
ENV['HOME'] ||= ENV['HOMEPATH'] ? "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" : Dir.pwd
|
|
4
|
-
|
|
5
1
|
require 'logger'
|
|
6
2
|
require 'etc'
|
|
7
3
|
require 'shellwords'
|
|
@@ -108,7 +104,7 @@ module Net
|
|
|
108
104
|
# * :bind_address => the IP address on the connecting machine to use in
|
|
109
105
|
# establishing connection. (:bind_address is discarded if :proxy
|
|
110
106
|
# is set.)
|
|
111
|
-
# * :check_host_ip => Also
|
|
107
|
+
# * :check_host_ip => Also check IP address when connecting to remote host.
|
|
112
108
|
# Defaults to +true+.
|
|
113
109
|
# * :compression => the compression algorithm to use, or +true+ to use
|
|
114
110
|
# whatever is supported.
|
data/net-ssh-public_cert.pem
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
|
2
2
|
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQ8wDQYDVQQDDAZuZXRz
|
|
3
3
|
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
|
4
|
-
|
|
4
|
+
b20wHhcNMjYwMjE1MTAxNzUyWhcNMjcwMjE1MTAxNzUyWjBBMQ8wDQYDVQQDDAZu
|
|
5
5
|
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
|
6
6
|
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
|
7
7
|
pQfJhPJTHaDCyQvCsKTFrL5O9z3tllQ7B/zksMMM+qFBpNYu9HCcg4yBATacE/PB
|
|
@@ -12,10 +12,10 @@ KP4yMn+TzaXijyjRg7gECfJr3TGASaA4bQsILFGG5dAWcwO4OMrZedR7SHj/o0Kf
|
|
|
12
12
|
3gL7P0axAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
|
13
13
|
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
|
14
14
|
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
9w0BAQsFAAOCAQEASsiVybehJLRPztFeFV8+SKa2BwbBSNJoAkhARVJKhpJxCfeY
|
|
16
|
+
gO7Kqb7JCykzb0anb1s6xTrzD03cWRNGE2YaoBLqnzeUqW1LPqVwmcySmnSIGH9F
|
|
17
|
+
DlFYlHaAn3oSqglyDxQx9bLngKatetx+tSfB3bLAb7Tr9PO8/lhBENbjlD4+UUwD
|
|
18
|
+
gApoZuD9pknWDH3KsITgzphswETBdo0hd9aLnRNR3EifD0lUIEit/0Yx6euSxWtI
|
|
19
|
+
ufHf4AX2UIkJbh7zCPkiNCqIr7MSWLNFG/9lOlHYsEJM8XujT1ofPobYx6YSFx/C
|
|
20
|
+
7HBrI7UX7awt6UvBZebhcHzyMHxg/B5PVQllPA==
|
|
21
21
|
-----END CERTIFICATE-----
|
data/net-ssh.gemspec
CHANGED
|
@@ -30,6 +30,8 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
31
31
|
spec.require_paths = ["lib"]
|
|
32
32
|
|
|
33
|
+
spec.add_dependency("logger")
|
|
34
|
+
|
|
33
35
|
unless ENV['NET_SSH_NO_ED25519']
|
|
34
36
|
spec.add_development_dependency("bcrypt_pbkdf", "~> 1.0") unless RUBY_PLATFORM == "java"
|
|
35
37
|
spec.add_development_dependency("ed25519", "~> 1.2")
|
|
@@ -42,6 +44,7 @@ Gem::Specification.new do |spec|
|
|
|
42
44
|
spec.add_development_dependency "bundler", ">= 1.17"
|
|
43
45
|
spec.add_development_dependency "minitest", "~> 5.19"
|
|
44
46
|
spec.add_development_dependency "mocha", "~> 2.1.0"
|
|
47
|
+
spec.add_development_dependency "ostruct"
|
|
45
48
|
spec.add_development_dependency "rake", "~> 12.0"
|
|
46
49
|
spec.add_development_dependency "rubocop", "~> 1.28.0"
|
|
47
50
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: net-ssh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.
|
|
4
|
+
version: 7.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
8
8
|
- Delano Mandelbaum
|
|
9
9
|
- Miklós Fazekas
|
|
10
|
-
autorequire:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain:
|
|
13
13
|
- |
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
|
15
15
|
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMQ8wDQYDVQQDDAZuZXRz
|
|
16
16
|
c2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZFgNj
|
|
17
|
-
|
|
17
|
+
b20wHhcNMjYwMjE1MTAxNzUyWhcNMjcwMjE1MTAxNzUyWjBBMQ8wDQYDVQQDDAZu
|
|
18
18
|
ZXRzc2gxGTAXBgoJkiaJk/IsZAEZFglzb2x1dGlvdXMxEzARBgoJkiaJk/IsZAEZ
|
|
19
19
|
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJ4TbZ9H+qZ08
|
|
20
20
|
pQfJhPJTHaDCyQvCsKTFrL5O9z3tllQ7B/zksMMM+qFBpNYu9HCcg4yBATacE/PB
|
|
@@ -25,15 +25,29 @@ cert_chain:
|
|
|
25
25
|
3gL7P0axAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
|
26
26
|
BBQF8qLA7Z4zg0SJGtUbv3eoQ8tjIzAfBgNVHREEGDAWgRRuZXRzc2hAc29sdXRp
|
|
27
27
|
b3VzLmNvbTAfBgNVHRIEGDAWgRRuZXRzc2hAc29sdXRpb3VzLmNvbTANBgkqhkiG
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
9w0BAQsFAAOCAQEASsiVybehJLRPztFeFV8+SKa2BwbBSNJoAkhARVJKhpJxCfeY
|
|
29
|
+
gO7Kqb7JCykzb0anb1s6xTrzD03cWRNGE2YaoBLqnzeUqW1LPqVwmcySmnSIGH9F
|
|
30
|
+
DlFYlHaAn3oSqglyDxQx9bLngKatetx+tSfB3bLAb7Tr9PO8/lhBENbjlD4+UUwD
|
|
31
|
+
gApoZuD9pknWDH3KsITgzphswETBdo0hd9aLnRNR3EifD0lUIEit/0Yx6euSxWtI
|
|
32
|
+
ufHf4AX2UIkJbh7zCPkiNCqIr7MSWLNFG/9lOlHYsEJM8XujT1ofPobYx6YSFx/C
|
|
33
|
+
7HBrI7UX7awt6UvBZebhcHzyMHxg/B5PVQllPA==
|
|
34
34
|
-----END CERTIFICATE-----
|
|
35
|
-
date:
|
|
35
|
+
date: 2026-10-25 00:00:00.000000000 Z
|
|
36
36
|
dependencies:
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
38
|
+
name: logger
|
|
39
|
+
requirement: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '0'
|
|
44
|
+
type: :runtime
|
|
45
|
+
prerelease: false
|
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
47
|
+
requirements:
|
|
48
|
+
- - ">="
|
|
49
|
+
- !ruby/object:Gem::Version
|
|
50
|
+
version: '0'
|
|
37
51
|
- !ruby/object:Gem::Dependency
|
|
38
52
|
name: bcrypt_pbkdf
|
|
39
53
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -146,6 +160,20 @@ dependencies:
|
|
|
146
160
|
- - "~>"
|
|
147
161
|
- !ruby/object:Gem::Version
|
|
148
162
|
version: 2.1.0
|
|
163
|
+
- !ruby/object:Gem::Dependency
|
|
164
|
+
name: ostruct
|
|
165
|
+
requirement: !ruby/object:Gem::Requirement
|
|
166
|
+
requirements:
|
|
167
|
+
- - ">="
|
|
168
|
+
- !ruby/object:Gem::Version
|
|
169
|
+
version: '0'
|
|
170
|
+
type: :development
|
|
171
|
+
prerelease: false
|
|
172
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
173
|
+
requirements:
|
|
174
|
+
- - ">="
|
|
175
|
+
- !ruby/object:Gem::Version
|
|
176
|
+
version: '0'
|
|
149
177
|
- !ruby/object:Gem::Dependency
|
|
150
178
|
name: rake
|
|
151
179
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -198,6 +226,7 @@ files:
|
|
|
198
226
|
- DEVELOPMENT.md
|
|
199
227
|
- Dockerfile
|
|
200
228
|
- Dockerfile.openssl3
|
|
229
|
+
- Dockerfile.zlib_ng
|
|
201
230
|
- Gemfile
|
|
202
231
|
- Gemfile.noed25519
|
|
203
232
|
- Gemfile.norbnacl
|
|
@@ -258,12 +287,15 @@ files:
|
|
|
258
287
|
- lib/net/ssh/test/remote_packet.rb
|
|
259
288
|
- lib/net/ssh/test/script.rb
|
|
260
289
|
- lib/net/ssh/test/socket.rb
|
|
290
|
+
- lib/net/ssh/transport/aes128_gcm.rb
|
|
291
|
+
- lib/net/ssh/transport/aes256_gcm.rb
|
|
261
292
|
- lib/net/ssh/transport/algorithms.rb
|
|
262
293
|
- lib/net/ssh/transport/chacha20_poly1305_cipher.rb
|
|
263
294
|
- lib/net/ssh/transport/chacha20_poly1305_cipher_loader.rb
|
|
264
295
|
- lib/net/ssh/transport/cipher_factory.rb
|
|
265
296
|
- lib/net/ssh/transport/constants.rb
|
|
266
297
|
- lib/net/ssh/transport/ctr.rb
|
|
298
|
+
- lib/net/ssh/transport/gcm_cipher.rb
|
|
267
299
|
- lib/net/ssh/transport/hmac.rb
|
|
268
300
|
- lib/net/ssh/transport/hmac/abstract.rb
|
|
269
301
|
- lib/net/ssh/transport/hmac/md5.rb
|
|
@@ -312,7 +344,7 @@ licenses:
|
|
|
312
344
|
- MIT
|
|
313
345
|
metadata:
|
|
314
346
|
changelog_uri: https://github.com/net-ssh/net-ssh/blob/master/CHANGES.txt
|
|
315
|
-
post_install_message:
|
|
347
|
+
post_install_message:
|
|
316
348
|
rdoc_options: []
|
|
317
349
|
require_paths:
|
|
318
350
|
- lib
|
|
@@ -328,7 +360,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
328
360
|
version: '0'
|
|
329
361
|
requirements: []
|
|
330
362
|
rubygems_version: 3.3.3
|
|
331
|
-
signing_key:
|
|
363
|
+
signing_key:
|
|
332
364
|
specification_version: 4
|
|
333
365
|
summary: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'
|
|
334
366
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|