vagrant-unbundled 2.3.2.0 → 2.3.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Gemfile.lock +12 -12
  4. data/LICENSE +1 -3
  5. data/lib/vagrant/errors.rb +4 -0
  6. data/lib/vagrant/util/install_cli_autocomplete.rb +3 -3
  7. data/lib/vagrant.rb +0 -3
  8. data/pkg/vagrant-unbundled-2.3.2.0.gem +0 -0
  9. data/plugins/commands/serve/command.rb +1 -1
  10. data/plugins/guests/solaris/cap/remove_public_key.rb +2 -2
  11. data/plugins/hosts/gentoo/host.rb +1 -1
  12. data/plugins/hosts/slackware/host.rb +1 -1
  13. data/plugins/providers/virtualbox/action/network.rb +8 -5
  14. data/plugins/providers/virtualbox/driver/base.rb +3 -1
  15. data/plugins/providers/virtualbox/driver/version_5_0.rb +40 -36
  16. data/plugins/providers/virtualbox/driver/version_7_0.rb +223 -5
  17. data/plugins/provisioners/ansible/cap/guest/debian/ansible_install.rb +1 -1
  18. data/plugins/provisioners/ansible/provisioner/host.rb +1 -1
  19. data/plugins/provisioners/chef/config/chef_zero.rb +1 -1
  20. data/plugins/synced_folders/rsync/helper.rb +1 -0
  21. data/templates/locales/en.yml +4 -0
  22. data/thirdparty/proto/api-common-protos/.bazelrc +2 -0
  23. data/thirdparty/proto/api-common-protos/.git +1 -0
  24. data/thirdparty/proto/api-common-protos/.gitignore +11 -0
  25. data/thirdparty/proto/api-common-protos/BUILD.bazel +129 -0
  26. data/thirdparty/proto/api-common-protos/CODE_OF_CONDUCT.md +43 -0
  27. data/thirdparty/proto/api-common-protos/CONTRIBUTING.md +42 -0
  28. data/thirdparty/proto/api-common-protos/Dockerfile +18 -0
  29. data/thirdparty/proto/api-common-protos/LICENSE +201 -0
  30. data/thirdparty/proto/api-common-protos/README.md +113 -0
  31. data/thirdparty/proto/api-common-protos/SECURITY.md +7 -0
  32. data/thirdparty/proto/api-common-protos/WORKSPACE +154 -0
  33. data/thirdparty/proto/api-common-protos/google/api/BUILD.bazel +246 -0
  34. data/thirdparty/proto/api-common-protos/google/api/README.md +46 -0
  35. data/thirdparty/proto/api-common-protos/google/api/annotations.proto +31 -0
  36. data/thirdparty/proto/api-common-protos/google/api/auth.proto +181 -0
  37. data/thirdparty/proto/api-common-protos/google/api/backend.proto +51 -0
  38. data/thirdparty/proto/api-common-protos/google/api/billing.proto +67 -0
  39. data/thirdparty/proto/api-common-protos/google/api/client.proto +99 -0
  40. data/thirdparty/proto/api-common-protos/google/api/config_change.proto +85 -0
  41. data/thirdparty/proto/api-common-protos/google/api/consumer.proto +83 -0
  42. data/thirdparty/proto/api-common-protos/google/api/context.proto +63 -0
  43. data/thirdparty/proto/api-common-protos/google/api/control.proto +33 -0
  44. data/thirdparty/proto/api-common-protos/google/api/distribution.proto +213 -0
  45. data/thirdparty/proto/api-common-protos/google/api/documentation.proto +157 -0
  46. data/thirdparty/proto/api-common-protos/google/api/endpoint.proto +71 -0
  47. data/thirdparty/proto/api-common-protos/google/api/field_behavior.proto +84 -0
  48. data/thirdparty/proto/api-common-protos/google/api/http.proto +318 -0
  49. data/thirdparty/proto/api-common-protos/google/api/httpbody.proto +76 -0
  50. data/thirdparty/proto/api-common-protos/google/api/label.proto +49 -0
  51. data/thirdparty/proto/api-common-protos/google/api/launch_stage.proto +67 -0
  52. data/thirdparty/proto/api-common-protos/google/api/log.proto +55 -0
  53. data/thirdparty/proto/api-common-protos/google/api/logging.proto +83 -0
  54. data/thirdparty/proto/api-common-protos/google/api/metric.proto +192 -0
  55. data/thirdparty/proto/api-common-protos/google/api/monitored_resource.proto +116 -0
  56. data/thirdparty/proto/api-common-protos/google/api/monitoring.proto +89 -0
  57. data/thirdparty/proto/api-common-protos/google/api/quota.proto +259 -0
  58. data/thirdparty/proto/api-common-protos/google/api/resource.proto +299 -0
  59. data/thirdparty/proto/api-common-protos/google/api/routing.proto +461 -0
  60. data/thirdparty/proto/api-common-protos/google/api/service.proto +175 -0
  61. data/thirdparty/proto/api-common-protos/google/api/source_info.proto +32 -0
  62. data/thirdparty/proto/api-common-protos/google/api/system_parameter.proto +96 -0
  63. data/thirdparty/proto/api-common-protos/google/api/usage.proto +92 -0
  64. data/thirdparty/proto/api-common-protos/google/cloud/extended_operations.proto +150 -0
  65. data/thirdparty/proto/api-common-protos/google/iam/README.md +14 -0
  66. data/thirdparty/proto/api-common-protos/google/iam/admin/v1/iam.proto +1087 -0
  67. data/thirdparty/proto/api-common-protos/google/iam/v1/iam_policy.proto +145 -0
  68. data/thirdparty/proto/api-common-protos/google/iam/v1/logging/audit_data.proto +34 -0
  69. data/thirdparty/proto/api-common-protos/google/iam/v1/options.proto +41 -0
  70. data/thirdparty/proto/api-common-protos/google/iam/v1/policy.proto +240 -0
  71. data/thirdparty/proto/api-common-protos/google/logging/type/README.md +12 -0
  72. data/thirdparty/proto/api-common-protos/google/logging/type/http_request.proto +92 -0
  73. data/thirdparty/proto/api-common-protos/google/logging/type/log_severity.proto +72 -0
  74. data/thirdparty/proto/api-common-protos/google/longrunning/README.md +31 -0
  75. data/thirdparty/proto/api-common-protos/google/longrunning/operations.proto +247 -0
  76. data/thirdparty/proto/api-common-protos/google/rpc/README.md +18 -0
  77. data/thirdparty/proto/api-common-protos/google/rpc/code.proto +186 -0
  78. data/thirdparty/proto/api-common-protos/google/rpc/context/attribute_context.proto +287 -0
  79. data/thirdparty/proto/api-common-protos/google/rpc/error_details.proto +246 -0
  80. data/thirdparty/proto/api-common-protos/google/rpc/status.proto +47 -0
  81. data/thirdparty/proto/api-common-protos/google/type/README.md +7 -0
  82. data/thirdparty/proto/api-common-protos/google/type/calendar_period.proto +57 -0
  83. data/thirdparty/proto/api-common-protos/google/type/color.proto +170 -0
  84. data/thirdparty/proto/api-common-protos/google/type/date.proto +50 -0
  85. data/thirdparty/proto/api-common-protos/google/type/datetime.proto +97 -0
  86. data/thirdparty/proto/api-common-protos/google/type/dayofweek.proto +51 -0
  87. data/thirdparty/proto/api-common-protos/google/type/expr.proto +51 -0
  88. data/thirdparty/proto/api-common-protos/google/type/fraction.proto +34 -0
  89. data/thirdparty/proto/api-common-protos/google/type/latlng.proto +37 -0
  90. data/thirdparty/proto/api-common-protos/google/type/money.proto +43 -0
  91. data/thirdparty/proto/api-common-protos/google/type/month.proto +66 -0
  92. data/thirdparty/proto/api-common-protos/google/type/postal_address.proto +135 -0
  93. data/thirdparty/proto/api-common-protos/google/type/quaternion.proto +95 -0
  94. data/thirdparty/proto/api-common-protos/google/type/timeofday.proto +44 -0
  95. data/thirdparty/proto/api-common-protos/renovate.json +5 -0
  96. data/thirdparty/proto/api-common-protos/repository_rules.bzl +222 -0
  97. data/vagrant.gemspec +4 -4
  98. data/version.txt +1 -1
  99. metadata +89 -20
  100. data/lib/vagrant/patches/net-ssh.rb +0 -286
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-unbundled
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2.0
4
+ version: 2.3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitchell Hashimoto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-10-20 00:00:00.000000000 Z
12
+ date: 2022-11-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bcrypt_pbkdf
@@ -189,50 +189,44 @@ dependencies:
189
189
  name: net-ssh
190
190
  requirement: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: 6.1.0
195
- - - "<"
192
+ - - "~>"
196
193
  - !ruby/object:Gem::Version
197
- version: '6.2'
194
+ version: '7.0'
198
195
  type: :runtime
199
196
  prerelease: false
200
197
  version_requirements: !ruby/object:Gem::Requirement
201
198
  requirements:
202
- - - ">="
203
- - !ruby/object:Gem::Version
204
- version: 6.1.0
205
- - - "<"
199
+ - - "~>"
206
200
  - !ruby/object:Gem::Version
207
- version: '6.2'
201
+ version: '7.0'
208
202
  - !ruby/object:Gem::Dependency
209
203
  name: net-sftp
210
204
  requirement: !ruby/object:Gem::Requirement
211
205
  requirements:
212
206
  - - "~>"
213
207
  - !ruby/object:Gem::Version
214
- version: '3.0'
208
+ version: '4.0'
215
209
  type: :runtime
216
210
  prerelease: false
217
211
  version_requirements: !ruby/object:Gem::Requirement
218
212
  requirements:
219
213
  - - "~>"
220
214
  - !ruby/object:Gem::Version
221
- version: '3.0'
215
+ version: '4.0'
222
216
  - !ruby/object:Gem::Dependency
223
217
  name: net-scp
224
218
  requirement: !ruby/object:Gem::Requirement
225
219
  requirements:
226
220
  - - "~>"
227
221
  - !ruby/object:Gem::Version
228
- version: 3.0.0
222
+ version: '4.0'
229
223
  type: :runtime
230
224
  prerelease: false
231
225
  version_requirements: !ruby/object:Gem::Requirement
232
226
  requirements:
233
227
  - - "~>"
234
228
  - !ruby/object:Gem::Version
235
- version: 3.0.0
229
+ version: '4.0'
236
230
  - !ruby/object:Gem::Dependency
237
231
  name: rb-kqueue
238
232
  requirement: !ruby/object:Gem::Requirement
@@ -425,14 +419,14 @@ dependencies:
425
419
  requirements:
426
420
  - - "~>"
427
421
  - !ruby/object:Gem::Version
428
- version: 3.11.0
422
+ version: '3.11'
429
423
  type: :development
430
424
  prerelease: false
431
425
  version_requirements: !ruby/object:Gem::Requirement
432
426
  requirements:
433
427
  - - "~>"
434
428
  - !ruby/object:Gem::Version
435
- version: 3.11.0
429
+ version: '3.11'
436
430
  - !ruby/object:Gem::Dependency
437
431
  name: rspec-its
438
432
  requirement: !ruby/object:Gem::Requirement
@@ -607,7 +601,6 @@ files:
607
601
  - lib/vagrant/machine_state.rb
608
602
  - lib/vagrant/patches/fake_ftp.rb
609
603
  - lib/vagrant/patches/log4r.rb
610
- - lib/vagrant/patches/net-ssh.rb
611
604
  - lib/vagrant/plugin.rb
612
605
  - lib/vagrant/plugin/manager.rb
613
606
  - lib/vagrant/plugin/remote.rb
@@ -724,6 +717,7 @@ files:
724
717
  - nix/grpc-tools.nix
725
718
  - nix/overlay.nix
726
719
  - nix/vagrant.nix
720
+ - pkg/vagrant-unbundled-2.3.2.0.gem
727
721
  - plugins/README.md
728
722
  - plugins/commands/autocomplete/command/install.rb
729
723
  - plugins/commands/autocomplete/command/root.rb
@@ -1723,6 +1717,81 @@ files:
1723
1717
  - templates/provisioners/chef_solo/solo.erb
1724
1718
  - templates/provisioners/chef_zero/zero.erb
1725
1719
  - templates/rgloader.rb
1720
+ - thirdparty/proto/api-common-protos/.bazelrc
1721
+ - thirdparty/proto/api-common-protos/.git
1722
+ - thirdparty/proto/api-common-protos/.gitignore
1723
+ - thirdparty/proto/api-common-protos/BUILD.bazel
1724
+ - thirdparty/proto/api-common-protos/CODE_OF_CONDUCT.md
1725
+ - thirdparty/proto/api-common-protos/CONTRIBUTING.md
1726
+ - thirdparty/proto/api-common-protos/Dockerfile
1727
+ - thirdparty/proto/api-common-protos/LICENSE
1728
+ - thirdparty/proto/api-common-protos/README.md
1729
+ - thirdparty/proto/api-common-protos/SECURITY.md
1730
+ - thirdparty/proto/api-common-protos/WORKSPACE
1731
+ - thirdparty/proto/api-common-protos/google/api/BUILD.bazel
1732
+ - thirdparty/proto/api-common-protos/google/api/README.md
1733
+ - thirdparty/proto/api-common-protos/google/api/annotations.proto
1734
+ - thirdparty/proto/api-common-protos/google/api/auth.proto
1735
+ - thirdparty/proto/api-common-protos/google/api/backend.proto
1736
+ - thirdparty/proto/api-common-protos/google/api/billing.proto
1737
+ - thirdparty/proto/api-common-protos/google/api/client.proto
1738
+ - thirdparty/proto/api-common-protos/google/api/config_change.proto
1739
+ - thirdparty/proto/api-common-protos/google/api/consumer.proto
1740
+ - thirdparty/proto/api-common-protos/google/api/context.proto
1741
+ - thirdparty/proto/api-common-protos/google/api/control.proto
1742
+ - thirdparty/proto/api-common-protos/google/api/distribution.proto
1743
+ - thirdparty/proto/api-common-protos/google/api/documentation.proto
1744
+ - thirdparty/proto/api-common-protos/google/api/endpoint.proto
1745
+ - thirdparty/proto/api-common-protos/google/api/field_behavior.proto
1746
+ - thirdparty/proto/api-common-protos/google/api/http.proto
1747
+ - thirdparty/proto/api-common-protos/google/api/httpbody.proto
1748
+ - thirdparty/proto/api-common-protos/google/api/label.proto
1749
+ - thirdparty/proto/api-common-protos/google/api/launch_stage.proto
1750
+ - thirdparty/proto/api-common-protos/google/api/log.proto
1751
+ - thirdparty/proto/api-common-protos/google/api/logging.proto
1752
+ - thirdparty/proto/api-common-protos/google/api/metric.proto
1753
+ - thirdparty/proto/api-common-protos/google/api/monitored_resource.proto
1754
+ - thirdparty/proto/api-common-protos/google/api/monitoring.proto
1755
+ - thirdparty/proto/api-common-protos/google/api/quota.proto
1756
+ - thirdparty/proto/api-common-protos/google/api/resource.proto
1757
+ - thirdparty/proto/api-common-protos/google/api/routing.proto
1758
+ - thirdparty/proto/api-common-protos/google/api/service.proto
1759
+ - thirdparty/proto/api-common-protos/google/api/source_info.proto
1760
+ - thirdparty/proto/api-common-protos/google/api/system_parameter.proto
1761
+ - thirdparty/proto/api-common-protos/google/api/usage.proto
1762
+ - thirdparty/proto/api-common-protos/google/cloud/extended_operations.proto
1763
+ - thirdparty/proto/api-common-protos/google/iam/README.md
1764
+ - thirdparty/proto/api-common-protos/google/iam/admin/v1/iam.proto
1765
+ - thirdparty/proto/api-common-protos/google/iam/v1/iam_policy.proto
1766
+ - thirdparty/proto/api-common-protos/google/iam/v1/logging/audit_data.proto
1767
+ - thirdparty/proto/api-common-protos/google/iam/v1/options.proto
1768
+ - thirdparty/proto/api-common-protos/google/iam/v1/policy.proto
1769
+ - thirdparty/proto/api-common-protos/google/logging/type/README.md
1770
+ - thirdparty/proto/api-common-protos/google/logging/type/http_request.proto
1771
+ - thirdparty/proto/api-common-protos/google/logging/type/log_severity.proto
1772
+ - thirdparty/proto/api-common-protos/google/longrunning/README.md
1773
+ - thirdparty/proto/api-common-protos/google/longrunning/operations.proto
1774
+ - thirdparty/proto/api-common-protos/google/rpc/README.md
1775
+ - thirdparty/proto/api-common-protos/google/rpc/code.proto
1776
+ - thirdparty/proto/api-common-protos/google/rpc/context/attribute_context.proto
1777
+ - thirdparty/proto/api-common-protos/google/rpc/error_details.proto
1778
+ - thirdparty/proto/api-common-protos/google/rpc/status.proto
1779
+ - thirdparty/proto/api-common-protos/google/type/README.md
1780
+ - thirdparty/proto/api-common-protos/google/type/calendar_period.proto
1781
+ - thirdparty/proto/api-common-protos/google/type/color.proto
1782
+ - thirdparty/proto/api-common-protos/google/type/date.proto
1783
+ - thirdparty/proto/api-common-protos/google/type/datetime.proto
1784
+ - thirdparty/proto/api-common-protos/google/type/dayofweek.proto
1785
+ - thirdparty/proto/api-common-protos/google/type/expr.proto
1786
+ - thirdparty/proto/api-common-protos/google/type/fraction.proto
1787
+ - thirdparty/proto/api-common-protos/google/type/latlng.proto
1788
+ - thirdparty/proto/api-common-protos/google/type/money.proto
1789
+ - thirdparty/proto/api-common-protos/google/type/month.proto
1790
+ - thirdparty/proto/api-common-protos/google/type/postal_address.proto
1791
+ - thirdparty/proto/api-common-protos/google/type/quaternion.proto
1792
+ - thirdparty/proto/api-common-protos/google/type/timeofday.proto
1793
+ - thirdparty/proto/api-common-protos/renovate.json
1794
+ - thirdparty/proto/api-common-protos/repository_rules.bzl
1726
1795
  - vagrant-config.hcl
1727
1796
  - vagrant-spec.config.example.rb
1728
1797
  - vagrant.gemspec
@@ -1746,7 +1815,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1746
1815
  - !ruby/object:Gem::Version
1747
1816
  version: 1.3.6
1748
1817
  requirements: []
1749
- rubygems_version: 3.3.23
1818
+ rubygems_version: 3.3.25
1750
1819
  signing_key:
1751
1820
  specification_version: 4
1752
1821
  summary: Build and distribute virtualized development environments.
@@ -1,286 +0,0 @@
1
- require "net/ssh/version"
2
-
3
- # Only patch if we have version 6.1.0 loaded as
4
- # these patches pull 6.1.0 up to the as of now
5
- # current 6.2.0 beta
6
- if Net::SSH::Version::STRING == "6.1.0"
7
- module DeprecatedRsaSha1
8
- module KeyManager
9
- def initialize(logger, options={})
10
- @deprecated_rsa_sha1 = options.delete(:deprecated_rsa_sha1)
11
- super
12
- end
13
-
14
- def sign(identity, data)
15
- info = known_identities[identity] or raise Net::SSH::Authentication::KeyManager::KeyManagerError, "the given identity is unknown to the key manager"
16
-
17
- if info[:key].nil? && info[:from] == :file
18
- begin
19
- info[:key] = Net::SSH::KeyFactory.load_private_key(info[:file], options[:passphrase], !options[:non_interactive], options[:password_prompt])
20
- if @deprecated_rsa_sha1 && info[:key].respond_to?(:deprecated_rsa_sha1=)
21
- info[:key].deprecated_rsa_sha1 = true
22
- Vagrant.global_logger.debug("set RSA SHA1 deprecation on private key: #{info[:key].fingerprint}")
23
- end
24
- rescue OpenSSL::OpenSSLError, Exception => e
25
- raise Net::SSH::Authentication::KeyManager::KeyManagerError, "the given identity is known, but the private key could not be loaded: #{e.class} (#{e.message})"
26
- end
27
- end
28
-
29
- if info[:key]
30
- return Net::SSH::Buffer.from(:string, identity.ssh_signature_type,
31
- :mstring, info[:key].ssh_do_sign(data.to_s)).to_s
32
- end
33
-
34
- if info[:from] == :agent
35
- raise Net::SSH::Authentication::KeyManager::KeyManagerError, "the agent is no longer available" unless agent
36
- return agent.sign(info[:identity], data.to_s)
37
- end
38
-
39
- raise Net::SSH::Authentication::KeyManager::KeyManagerError, "[BUG] can't determine identity origin (#{info.inspect})"
40
- end
41
-
42
- def load_identities(identities, ask_passphrase, ignore_decryption_errors)
43
- identities.map do |identity|
44
- begin
45
- case identity[:load_from]
46
- when :pubkey_file
47
- key = Net::SSH::KeyFactory.load_public_key(identity[:pubkey_file])
48
- if @deprecated_rsa_sha1 && key.respond_to?(:deprecated_rsa_sha1=)
49
- key.deprecated_rsa_sha1 = true
50
- Vagrant.global_logger.debug("set RSA SHA1 deprecation on public key: #{key.fingerprint}")
51
- end
52
- { public_key: key, from: :file, file: identity[:privkey_file] }
53
- when :privkey_file
54
- private_key = Net::SSH::KeyFactory.load_private_key(
55
- identity[:privkey_file], options[:passphrase], ask_passphrase, options[:password_prompt]
56
- )
57
- key = private_key.send(:public_key)
58
- if @deprecated_rsa_sha1 && key.respond_to?(:deprecated_rsa_sha1=)
59
- key.deprecated_rsa_sha1 = true
60
- private_key.deprecated_rsa_sha1 = true
61
- Vagrant.global_logger.debug("set RSA SHA1 deprecation on public key: #{key.fingerprint}")
62
- Vagrant.global_logger.debug("set RSA SHA1 deprecation on private key: #{private_key.fingerprint}")
63
- end
64
- { public_key: key, from: :file, file: identity[:privkey_file], key: private_key }
65
- when :data
66
- private_key = Net::SSH::KeyFactory.load_data_private_key(
67
- identity[:data], options[:passphrase], ask_passphrase, "<key in memory>", options[:password_prompt]
68
- )
69
- key = private_key.send(:public_key)
70
- if @deprecated_rsa_sha1 && key.respond_to?(:deprecated_rsa_sha1=)
71
- key.deprecated_rsa_sha1 = true
72
- private_key.deprecated_rsa_sha1 = true
73
- Vagrant.global_logger.debug("set RSA SHA1 deprecation on public key: #{key.fingerprint}")
74
- Vagrant.global_logger.debug("set RSA SHA1 deprecation on private key: #{private_key.fingerprint}")
75
- end
76
- { public_key: key, from: :key_data, data: identity[:data], key: private_key }
77
- else
78
- identity
79
- end
80
- rescue OpenSSL::PKey::RSAError, OpenSSL::PKey::DSAError, OpenSSL::PKey::ECError, OpenSSL::PKey::PKeyError, ArgumentError => e
81
- if ignore_decryption_errors
82
- identity
83
- else
84
- process_identity_loading_error(identity, e)
85
- nil
86
- end
87
- rescue Exception => e
88
- process_identity_loading_error(identity, e)
89
- nil
90
- end
91
- end.compact
92
- end
93
- end
94
-
95
- module AuthenticationSession
96
- def initialize(transport, options={})
97
- s_ver_str = transport.server_version.version.
98
- match(/OpenSSH_.*?(?<version>\d+\.\d+)/)&.[](:version).to_s
99
- Vagrant.global_logger.debug("ssh server version detected: #{s_ver_str}")
100
- if !s_ver_str.empty?
101
- begin
102
- ver = Gem::Version.new(s_ver_str)
103
- if ver >= Gem::Version.new("7.2")
104
- Vagrant.global_logger.debug("ssh server supports deprecation of RSA SHA1, deprecating")
105
- options[:deprecated_rsa_sha1] = true
106
- else
107
- Vagrant.global_logger.debug("ssh server does not support deprecation of RSA SHA1")
108
- end
109
- rescue ArgumentError => err
110
- Vagrant.global_logger.debug("failed to determine valid ssh server version - #{err}")
111
- end
112
- end
113
- super
114
- end
115
- end
116
- end
117
-
118
- require "net/ssh/transport/algorithms"
119
- # net/ssh/transport/algorithms
120
- [:kex, :host_key].each do |key|
121
- idx = Net::SSH::Transport::Algorithms::ALGORITHMS[key].index(
122
- Net::SSH::Transport::Algorithms::DEFAULT_ALGORITHMS[key].last
123
- )
124
- Net::SSH::Transport::Algorithms::DEFAULT_ALGORITHMS[key].push("rsa-sha2-512")
125
- Net::SSH::Transport::Algorithms::DEFAULT_ALGORITHMS[key].push("rsa-sha2-256")
126
- Net::SSH::Transport::Algorithms::ALGORITHMS[key].insert(idx, "rsa-sha2-256")
127
- Net::SSH::Transport::Algorithms::ALGORITHMS[key].insert(idx, "rsa-sha2-512")
128
- end
129
-
130
- require "net/ssh/authentication/key_manager"
131
- Net::SSH::Authentication::KeyManager.prepend(DeprecatedRsaSha1::KeyManager)
132
- require "net/ssh/authentication/session"
133
- Net::SSH::Authentication::Session.prepend(DeprecatedRsaSha1::AuthenticationSession)
134
-
135
- require "net/ssh/authentication/agent"
136
- # net/ssh/authentication/agent
137
- Net::SSH::Authentication::Agent.class_eval do
138
- SSH2_AGENT_LOCK = 22
139
- SSH2_AGENT_UNLOCK = 23
140
-
141
- # lock the ssh agent with password
142
- def lock(password)
143
- type, = send_and_wait(SSH2_AGENT_LOCK, :string, password)
144
- raise AgentError, "could not lock agent" if type != SSH_AGENT_SUCCESS
145
- end
146
-
147
- # unlock the ssh agent with password
148
- def unlock(password)
149
- type, = send_and_wait(SSH2_AGENT_UNLOCK, :string, password)
150
- raise AgentError, "could not unlock agent" if type != SSH_AGENT_SUCCESS
151
- end
152
- end
153
-
154
- require "net/ssh/authentication/certificate"
155
- # net/ssh/authentication/certificate
156
- Net::SSH::Authentication::Certificate.class_eval do
157
- def ssh_do_verify(sig, data, options = {})
158
- key.ssh_do_verify(sig, data, options)
159
- end
160
- end
161
-
162
- require "net/ssh/authentication/ed25519"
163
- # net/ssh/authentication/ed25519
164
- Net::SSH::Authentication::ED25519::PubKey.class_eval do
165
- def ssh_do_verify(sig, data, options = {})
166
- @verify_key.verify(sig,data)
167
- end
168
- end
169
-
170
- require "net/ssh/transport/cipher_factory"
171
- # net/ssh/transport/cipher_factory
172
- Net::SSH::Transport::CipherFactory::SSH_TO_OSSL["aes256-ctr"] = ::OpenSSL::Cipher.ciphers.include?("aes-256-ctr") ? "aes-256-ctr" : "aes-256-ecb"
173
- Net::SSH::Transport::CipherFactory::SSH_TO_OSSL["aes192-ctr"] = ::OpenSSL::Cipher.ciphers.include?("aes-192-ctr") ? "aes-192-ctr" : "aes-192-ecb"
174
- Net::SSH::Transport::CipherFactory::SSH_TO_OSSL["aes128-ctr"] = ::OpenSSL::Cipher.ciphers.include?("aes-128-ctr") ? "aes-128-ctr" : "aes-128-ecb"
175
-
176
- require "net/ssh/transport/kex/abstract"
177
- # net/ssh/transport/kex/abstract
178
- Net::SSH::Transport::Kex::Abstract.class_eval do
179
- def matching?(key_ssh_type, host_key_alg)
180
- return true if key_ssh_type == host_key_alg
181
- return true if key_ssh_type == 'ssh-rsa' && ['rsa-sha2-512', 'rsa-sha2-256'].include?(host_key_alg)
182
- end
183
-
184
- def verify_server_key(key) #:nodoc:
185
- unless matching?(key.ssh_type, algorithms.host_key)
186
- raise Net::SSH::Exception, "host key algorithm mismatch '#{key.ssh_type}' != '#{algorithms.host_key}'"
187
- end
188
-
189
- blob, fingerprint = generate_key_fingerprint(key)
190
-
191
- unless connection.host_key_verifier.verify(key: key, key_blob: blob, fingerprint: fingerprint, session: connection)
192
- raise Net::SSH::Exception, 'host key verification failed'
193
- end
194
- end
195
-
196
- def verify_signature(result) #:nodoc:
197
- response = build_signature_buffer(result)
198
-
199
- hash = digester.digest(response.to_s)
200
-
201
- server_key = result[:server_key]
202
- server_sig = result[:server_sig]
203
- unless connection.host_key_verifier.verify_signature { server_key.ssh_do_verify(server_sig, hash, host_key: algorithms.host_key) }
204
- raise Net::SSH::Exception, 'could not verify server signature'
205
- end
206
-
207
- hash
208
- end
209
- end
210
-
211
- require "net/ssh/transport/openssl"
212
- # net/ssh/transport/openssl
213
- OpenSSL::PKey::RSA.class_eval do
214
- attr_accessor :deprecated_rsa_sha1
215
-
216
- def ssh_do_verify(sig, data, options = {})
217
- digester =
218
- if options[:host_key] == "rsa-sha2-512"
219
- OpenSSL::Digest::SHA512.new
220
- elsif options[:host_key] == "rsa-sha2-256"
221
- OpenSSL::Digest::SHA256.new
222
- else
223
- OpenSSL::Digest::SHA1.new
224
- end
225
-
226
- verify(digester, sig, data)
227
- end
228
-
229
- def ssh_type
230
- deprecated_rsa_sha1 ? signature_algorithm : "ssh-rsa"
231
- end
232
-
233
- def signature_algorithm
234
- "rsa-sha2-256"
235
- end
236
-
237
- def ssh_do_sign(data)
238
- if deprecated_rsa_sha1
239
- sign(OpenSSL::Digest::SHA256.new, data)
240
- else
241
- sign(OpenSSL::Digest::SHA1.new, data)
242
- end
243
- end
244
- end
245
-
246
- OpenSSL::PKey::DSA.class_eval do
247
- def ssh_do_verify(sig, data, options = {})
248
- sig_r = sig[0,20].unpack("H*")[0].to_i(16)
249
- sig_s = sig[20,20].unpack("H*")[0].to_i(16)
250
- a1sig = OpenSSL::ASN1::Sequence([
251
- OpenSSL::ASN1::Integer(sig_r),
252
- OpenSSL::ASN1::Integer(sig_s)
253
- ])
254
- return verify(OpenSSL::Digest::SHA1.new, a1sig.to_der, data)
255
- end
256
- end
257
-
258
- OpenSSL::PKey::EC.class_eval do
259
- def ssh_do_verify(sig, data, options = {})
260
- digest = digester.digest(data)
261
- a1sig = nil
262
-
263
- begin
264
- sig_r_len = sig[0, 4].unpack('H*')[0].to_i(16)
265
- sig_l_len = sig[4 + sig_r_len, 4].unpack('H*')[0].to_i(16)
266
-
267
- sig_r = sig[4, sig_r_len].unpack('H*')[0]
268
- sig_s = sig[4 + sig_r_len + 4, sig_l_len].unpack('H*')[0]
269
-
270
- a1sig = OpenSSL::ASN1::Sequence([
271
- OpenSSL::ASN1::Integer(sig_r.to_i(16)),
272
- OpenSSL::ASN1::Integer(sig_s.to_i(16))
273
- ])
274
- rescue StandardError
275
- end
276
-
277
- if a1sig.nil?
278
- return false
279
- else
280
- dsa_verify_asn1(digest, a1sig.to_der)
281
- end
282
- end
283
- end
284
- end
285
-
286
- require "net/ssh"