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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5614d2fa5b1b6396aae6c99ee8dab8a7c4c9dfddfaed4ba2f2666539b56d22df
4
- data.tar.gz: f999a5eb2e98e9e81efe4f628d02350fd33d3fd4e101f286ec36d83a538a7d60
3
+ metadata.gz: e826fa24d57e2f9f2e4ce6424282dc5e8912f1cdd8d5ab6bcfaefc94f7488c0a
4
+ data.tar.gz: 94c14149e603eb570116d1c079c4f6ff8b3905b7f44153056a0bd417054ab62e
5
5
  SHA512:
6
- metadata.gz: 389e60f10a0db01d775135b59837cd8d115777f6587d866c9afc821f239139d77f874cea4128672ef7a3d102a96c25be7dce025fda2667c89e9111f2ac6fc809
7
- data.tar.gz: fed18846ef1d1e99407ae179b143f88338d258ed8e89bc5c18d4d31d0f15f8c75a004f0c93d25259c9f35e51cdaa581d4a066cc1f51a28e394b29d5afeda1910
6
+ metadata.gz: 9165be4e0cc1805d5a2d21f022e13ec81e0508cddc3db5d440b7b785a8725d46626bc1b4fc913b6e57339baf15ccc4be4efe0a390cc0db0e156d63bc8a5f4d3f
7
+ data.tar.gz: 849355397eb35de823d9244b923983a82fd4014941be88b3cb62dbbf7965851d50b406e655a38767e842534d6ba9a3c3783d60ac4be17272bee7a0d9011010af
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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'
@@ -7,10 +7,11 @@ addon:
7
7
  gateway.netssh
8
8
 
9
9
  rvm:
10
- - 2.3.7
11
- - 2.4.5
12
- - 2.5.3
13
- - 2.6.2
10
+ - 2.3.8
11
+ - 2.4.8
12
+ - 2.5.7
13
+ - 2.6.5
14
+ - 2.7.0
14
15
  - jruby-9.2.8.0
15
16
  - rbx-3.107
16
17
  - ruby-head
@@ -1,6 +1,6 @@
1
1
  === 6.0.0 beta2
2
2
 
3
- * Support :certkeys and CertificateFile configuration option [Ander Scarling, #722]
3
+ * Support :certkeys and CertificateFile configuration option [Anders Carling, #722]
4
4
 
5
5
  === 6.0.0 beta1
6
6
 
@@ -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
- cert.valid_before = Time.at(buffer.read_int64)
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-----\n"
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]
@@ -3,7 +3,7 @@ module Net
3
3
  module Authentication
4
4
 
5
5
  # Loads ED25519 support which requires optinal dependecies like
6
- # rbnacl, bcrypt_pbkdf
6
+ # ed25519, bcrypt_pbkdf
7
7
  module ED25519Loader
8
8
 
9
9
  begin
@@ -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
@@ -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
- next unless hosts || hosts.start_with?('#')
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
 
@@ -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.name.gsub(/::/, ".").gsub(/([a-z])([A-Z])/, "\\1_\\2").downcase + "[%x]" % object_id
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
@@ -58,7 +58,7 @@ module Net
58
58
  if Net::SSH::Transport::Kex::Curve25519Sha256Loader::LOADED
59
59
  DEFAULT_ALGORITHMS[:kex].unshift(
60
60
  'curve25519-sha256',
61
- 'curve22519-sha256@libssh.org'
61
+ 'curve25519-sha256@libssh.org'
62
62
  )
63
63
  end
64
64
 
@@ -23,6 +23,7 @@ module Net::SSH::Transport
23
23
 
24
24
  if Net::SSH::Transport::Kex::Curve25519Sha256Loader::LOADED
25
25
  MAP['curve25519-sha256'] = Curve25519Sha256
26
+ MAP['curve25519-sha256@libssh.org'] = Curve25519Sha256
26
27
  end
27
28
  end
28
29
  end
@@ -56,7 +56,7 @@ module Net
56
56
 
57
57
  # The prerelease component of this version of the Net::SSH library
58
58
  # nil allowed
59
- PRE = "beta2"
59
+ PRE = "rc1"
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)
@@ -1,7 +1,7 @@
1
1
  -----BEGIN CERTIFICATE-----
2
2
  MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
3
- c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0xOTAzMTEwOTQ1MzZaFw0yMDAzMTAw
4
- OTQ1MzZaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
3
+ c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMDA0MTEwNTQyMTZaFw0yMTA0MTEw
4
+ NTQyMTZaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
5
5
  IjANBgkqhki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 3163oCKuJvMW1w8kdUMQqvlLJkVKaxz9K64r2+a04Ok1cKloTB3OSowfAYFoRlqP
18
+ voajiJNS75Pw/2j13WnPB4Q6w7dHSb57E/VluBpVKmcQZN0dGdAkEIVty3v7kw9g
19
+ y++VpCpWM/PstIFv4ApZMf501UY=
20
20
  -----END CERTIFICATE-----
@@ -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", ">= 1.2.1"
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.beta2
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
- c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0xOTAzMTEwOTQ1MzZaFw0yMDAzMTAw
17
- OTQ1MzZaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
16
+ c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMDA0MTEwNTQyMTZaFw0yMTA0MTEw
17
+ NTQyMTZaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
18
18
  IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
19
19
  wskLwrCkxay+Tvc97ZZ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y++VpCpWM/PstIFv4ApZMf501UY=
33
33
  -----END CERTIFICATE-----
34
- date: 2020-01-19 00:00:00.000000000 Z
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.1
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.1
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�trBzv��G�&N_��XR��"���� f{LEEOwr1���.�a�C��|����2##-4�����{�Ru�?����RT1���X?�s���vj.1S^�(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������(;�&����8CAmi5QmRI1k^d��5'ф��ki><��-�ӽ9 �=�=�����.�������{��ڐ�إ����̢���n~�Ԛ��fvaMfCE�*W��v�����5!��)�����/4׽婶X�>��v���Z�̿y������n�G~��5��+T���s��v ��