net-ssh 6.0.0.beta2 → 6.0.0.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/.rubocop_todo.yml +3 -0
- data/.travis.yml +5 -4
- data/CHANGES.txt +1 -1
- data/lib/net/ssh.rb +4 -1
- data/lib/net/ssh/authentication/certificate.rb +10 -1
- data/lib/net/ssh/authentication/ed25519.rb +2 -1
- data/lib/net/ssh/authentication/ed25519_loader.rb +1 -1
- data/lib/net/ssh/config.rb +2 -0
- data/lib/net/ssh/connection/channel.rb +10 -2
- data/lib/net/ssh/known_hosts.rb +2 -1
- data/lib/net/ssh/loggable.rb +2 -2
- data/lib/net/ssh/transport/algorithms.rb +1 -1
- data/lib/net/ssh/transport/kex.rb +1 -0
- data/lib/net/ssh/version.rb +1 -1
- data/net-ssh-public_cert.pem +8 -8
- data/net-ssh.gemspec +1 -1
- metadata +14 -14
- metadata.gz.sig +1 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e826fa24d57e2f9f2e4ce6424282dc5e8912f1cdd8d5ab6bcfaefc94f7488c0a
|
4
|
+
data.tar.gz: 94c14149e603eb570116d1c079c4f6ff8b3905b7f44153056a0bd417054ab62e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9165be4e0cc1805d5a2d21f022e13ec81e0508cddc3db5d440b7b785a8725d46626bc1b4fc913b6e57339baf15ccc4be4efe0a390cc0db0e156d63bc8a5f4d3f
|
7
|
+
data.tar.gz: 849355397eb35de823d9244b923983a82fd4014941be88b3cb62dbbf7965851d50b406e655a38767e842534d6ba9a3c3783d60ac4be17272bee7a0d9011010af
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.rubocop_todo.yml
CHANGED
@@ -274,6 +274,8 @@ Metrics/ClassLength:
|
|
274
274
|
# Offense count: 38
|
275
275
|
Metrics/CyclomaticComplexity:
|
276
276
|
Max: 27
|
277
|
+
Exclude:
|
278
|
+
- 'lib/net/ssh/config.rb'
|
277
279
|
|
278
280
|
# Offense count: 211
|
279
281
|
# Configuration parameters: CountComments, ExcludedMethods.
|
@@ -299,6 +301,7 @@ Naming/AccessorMethodName:
|
|
299
301
|
Exclude:
|
300
302
|
- 'lib/net/ssh/authentication/methods/password.rb'
|
301
303
|
- 'lib/net/ssh/authentication/pageant.rb'
|
304
|
+
- 'lib/net/ssh/connection/channel.rb'
|
302
305
|
- 'lib/net/ssh/connection/session.rb'
|
303
306
|
- 'lib/net/ssh/transport/kex/abstract5656.rb'
|
304
307
|
- 'lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb'
|
data/.travis.yml
CHANGED
data/CHANGES.txt
CHANGED
data/lib/net/ssh.rb
CHANGED
@@ -4,6 +4,7 @@ ENV['HOME'] ||= ENV['HOMEPATH'] ? "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" : Dir.
|
|
4
4
|
|
5
5
|
require 'logger'
|
6
6
|
require 'etc'
|
7
|
+
require 'shellwords'
|
7
8
|
|
8
9
|
require 'net/ssh/config'
|
9
10
|
require 'net/ssh/errors'
|
@@ -70,7 +71,7 @@ module Net
|
|
70
71
|
rekey_blocks_limit rekey_limit rekey_packet_limit timeout verbose
|
71
72
|
known_hosts global_known_hosts_file user_known_hosts_file host_key_alias
|
72
73
|
host_name user properties passphrase keys_only max_pkt_size
|
73
|
-
max_win_size send_env use_agent number_of_password_prompts
|
74
|
+
max_win_size send_env set_env use_agent number_of_password_prompts
|
74
75
|
append_all_supported_algorithms non_interactive password_prompt
|
75
76
|
agent_socket_factory minimum_dh_bits verify_host_key
|
76
77
|
fingerprint_hash check_host_ip
|
@@ -175,6 +176,8 @@ module Net
|
|
175
176
|
# * :rekey_packet_limit => the max number of packets to process before rekeying
|
176
177
|
# * :send_env => an array of local environment variable names to export to the
|
177
178
|
# remote environment. Names may be given as String or Regexp.
|
179
|
+
# * :set_env => a hash of environment variable names and values to set to the
|
180
|
+
# remote environment. Override the ones if specified in +send_env+.
|
178
181
|
# * :timeout => how long to wait for the initial connection to be made
|
179
182
|
# * :user => the user name to log in as; this overrides the +user+
|
180
183
|
# parameter, and is primarily only useful when provided via an SSH
|
@@ -31,7 +31,16 @@ module Net
|
|
31
31
|
cert.key_id = buffer.read_string
|
32
32
|
cert.valid_principals = buffer.read_buffer.read_all(&:read_string)
|
33
33
|
cert.valid_after = Time.at(buffer.read_int64)
|
34
|
-
|
34
|
+
|
35
|
+
cert.valid_before = if RUBY_PLATFORM == "java"
|
36
|
+
# 0x20c49ba5e353f7 = 0x7fffffffffffffff/1000, the largest value possible for JRuby
|
37
|
+
# JRuby Time.at multiplies the arg by 1000, and then stores it in a signed long.
|
38
|
+
# 0x20c49ba5e353f7 = 292278994-08-17 01:12:55 -0600
|
39
|
+
Time.at([0x20c49ba5e353f7, buffer.read_int64].min)
|
40
|
+
else
|
41
|
+
Time.at(buffer.read_int64)
|
42
|
+
end
|
43
|
+
|
35
44
|
cert.critical_options = read_options(buffer)
|
36
45
|
cert.extensions = read_options(buffer)
|
37
46
|
cert.reserved = buffer.read_string
|
@@ -26,7 +26,7 @@ module Net
|
|
26
26
|
CipherFactory = Net::SSH::Transport::CipherFactory
|
27
27
|
|
28
28
|
MBEGIN = "-----BEGIN OPENSSH PRIVATE KEY-----\n"
|
29
|
-
MEND = "-----END OPENSSH PRIVATE KEY
|
29
|
+
MEND = "-----END OPENSSH PRIVATE KEY-----"
|
30
30
|
MAGIC = "openssh-key-v1"
|
31
31
|
|
32
32
|
class DecryptError < ArgumentError
|
@@ -41,6 +41,7 @@ module Net
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.read(datafull, password)
|
44
|
+
datafull = datafull.strip
|
44
45
|
raise ArgumentError.new("Expected #{MBEGIN} at start of private key") unless datafull.start_with?(MBEGIN)
|
45
46
|
raise ArgumentError.new("Expected #{MEND} at end of private key") unless datafull.end_with?(MEND)
|
46
47
|
datab64 = datafull[MBEGIN.size...-MEND.size]
|
data/lib/net/ssh/config.rb
CHANGED
@@ -276,6 +276,8 @@ module Net
|
|
276
276
|
when :sendenv
|
277
277
|
multi_send_env = value.to_s.split(/\s+/)
|
278
278
|
hash[:send_env] = multi_send_env.map { |e| Regexp.new pattern2regex(e).source, false }
|
279
|
+
when :setenv
|
280
|
+
hash[:set_env] = Shellwords.split(value.to_s).map { |e| e.split '=', 2 }.to_h
|
279
281
|
when :numberofpasswordprompts
|
280
282
|
hash[:number_of_password_prompts] = value.to_i
|
281
283
|
when *TRANSLATE_CONFIG_KEY_RENAME_MAP.keys
|
@@ -2,8 +2,8 @@ require 'net/ssh/loggable'
|
|
2
2
|
require 'net/ssh/connection/constants'
|
3
3
|
require 'net/ssh/connection/term'
|
4
4
|
|
5
|
-
module Net
|
6
|
-
module SSH
|
5
|
+
module Net
|
6
|
+
module SSH
|
7
7
|
module Connection
|
8
8
|
|
9
9
|
# The channel abstraction. Multiple "channels" can be multiplexed onto a
|
@@ -530,6 +530,7 @@ module Net
|
|
530
530
|
@remote_maximum_packet_size = max_packet
|
531
531
|
connection.forward.agent(self) if connection.options[:forward_agent] && type == "session"
|
532
532
|
forward_local_env(connection.options[:send_env]) if connection.options[:send_env]
|
533
|
+
set_remote_env(connection.options[:set_env]) if connection.options[:set_env]
|
533
534
|
@on_confirm_open.call(self) if @on_confirm_open
|
534
535
|
end
|
535
536
|
|
@@ -677,6 +678,13 @@ module Net
|
|
677
678
|
end
|
678
679
|
end
|
679
680
|
end
|
681
|
+
|
682
|
+
# Set a +Hash+ of environment variables in the remote process' environment.
|
683
|
+
#
|
684
|
+
# channel.set_remote_env foo: 'bar', baz: 'whale'
|
685
|
+
def set_remote_env(env)
|
686
|
+
env.each { |key, value| self.env(key, value) }
|
687
|
+
end
|
680
688
|
end
|
681
689
|
|
682
690
|
end
|
data/lib/net/ssh/known_hosts.rb
CHANGED
@@ -131,7 +131,8 @@ module Net
|
|
131
131
|
File.open(source) do |file|
|
132
132
|
file.each_line do |line|
|
133
133
|
hosts, type, key_content = line.split(' ')
|
134
|
-
|
134
|
+
# Skip empty line or one that is commented
|
135
|
+
next if hosts.nil? || hosts.start_with?('#')
|
135
136
|
|
136
137
|
hostlist = hosts.split(',')
|
137
138
|
|
data/lib/net/ssh/loggable.rb
CHANGED
@@ -56,8 +56,8 @@ module Net
|
|
56
56
|
# originates. It defaults to the name of class with the object_id
|
57
57
|
# appended.
|
58
58
|
def facility
|
59
|
-
@facility ||= self.class.
|
59
|
+
@facility ||= self.class.to_s.gsub(/::/, ".").gsub(/([a-z])([A-Z])/, "\\1_\\2").downcase + "[%x]" % object_id
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
-
end
|
63
|
+
end
|
data/lib/net/ssh/version.rb
CHANGED
data/net-ssh-public_cert.pem
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
2
|
MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
|
3
|
-
|
4
|
-
|
3
|
+
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMDA0MTEwNTQyMTZaFw0yMTA0MTEw
|
4
|
+
NTQyMTZaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
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
|
+
ggEBAJTylLYXo5AybI+tLq79+OXQ8/nbGZ7iydU1uTHQud1JZQ1MRV5dRDjeBmCT
|
15
|
+
lRxaEZT4NopEzuHO0sm3nVpSYtQwTaQyVKmnllNI3kc0f4H6i7dpPd7eUAQ3/O2I
|
16
|
+
eWjDJlzu0zwqTa+N6vzS8Y3ypDSGgb1gJKzluOv7viVUAthmuuJws7XQq/qMMaNw
|
17
|
+
3163oCKuJvMW1w8kdUMQqvlLJkVKaxz9K64r2+a04Ok1cKloTB3OSowfAYFoRlqP
|
18
|
+
voajiJNS75Pw/2j13WnPB4Q6w7dHSb57E/VluBpVKmcQZN0dGdAkEIVty3v7kw9g
|
19
|
+
y++VpCpWM/PstIFv4ApZMf501UY=
|
20
20
|
-----END CERTIFICATE-----
|
data/net-ssh.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
|
39
39
|
spec.add_development_dependency "bundler", ">= 1.17"
|
40
40
|
spec.add_development_dependency "minitest", "~> 5.10"
|
41
|
-
spec.add_development_dependency "mocha", "
|
41
|
+
spec.add_development_dependency "mocha", "~> 1.11.2"
|
42
42
|
spec.add_development_dependency "rake", "~> 12.0"
|
43
43
|
spec.add_development_dependency "rubocop", "~> 0.74.0"
|
44
44
|
end
|
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.0.0.
|
4
|
+
version: 6.0.0.rc1
|
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
|
+
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMDA0MTEwNTQyMTZaFw0yMTA0MTEw
|
17
|
+
NTQyMTZaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
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
|
+
ggEBAJTylLYXo5AybI+tLq79+OXQ8/nbGZ7iydU1uTHQud1JZQ1MRV5dRDjeBmCT
|
28
|
+
lRxaEZT4NopEzuHO0sm3nVpSYtQwTaQyVKmnllNI3kc0f4H6i7dpPd7eUAQ3/O2I
|
29
|
+
eWjDJlzu0zwqTa+N6vzS8Y3ypDSGgb1gJKzluOv7viVUAthmuuJws7XQq/qMMaNw
|
30
|
+
3163oCKuJvMW1w8kdUMQqvlLJkVKaxz9K64r2+a04Ok1cKloTB3OSowfAYFoRlqP
|
31
|
+
voajiJNS75Pw/2j13WnPB4Q6w7dHSb57E/VluBpVKmcQZN0dGdAkEIVty3v7kw9g
|
32
|
+
y++VpCpWM/PstIFv4ApZMf501UY=
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2020-
|
34
|
+
date: 2020-04-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bcrypt_pbkdf
|
@@ -107,16 +107,16 @@ dependencies:
|
|
107
107
|
name: mocha
|
108
108
|
requirement: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- - "
|
110
|
+
- - "~>"
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 1.2
|
112
|
+
version: 1.11.2
|
113
113
|
type: :development
|
114
114
|
prerelease: false
|
115
115
|
version_requirements: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- - "
|
117
|
+
- - "~>"
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 1.2
|
119
|
+
version: 1.11.2
|
120
120
|
- !ruby/object:Gem::Dependency
|
121
121
|
name: rake
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
@@ -1,5 +1 @@
|
|
1
|
-
L�
|
2
|
-
)�
|
3
|
-
��(��
|
4
|
-
Cs43NU�p���
|
5
|
-
����ATn�"w�H�Ѫ�rl�U/Pg\E�B�s�e�ʏ���(��aJ��x����R�GFX��ӆ
|
1
|
+
Ia�O���@�X�uw��Ē�m-<�|�c����Y��:L������3#��I������(;�&����8C�A�mi�5QmRI1�k^d��5�'ф��ki><��-�ӽ9� �=�=�����.�������{��ڐ�إ����̢���n~�Ԛ��fva�Mf�CE�*W��v�����5!��)�����/4婶X�>��v���Z�̿y������n�G~��5��+T���s��v ��
|