net-ssh 5.2.0 → 6.0.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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +7 -4
  6. data/.rubocop_todo.yml +389 -379
  7. data/.travis.yml +13 -14
  8. data/CHANGES.txt +7 -0
  9. data/README.md +286 -0
  10. data/Rakefile +1 -2
  11. data/appveyor.yml +4 -2
  12. data/lib/net/ssh/authentication/key_manager.rb +7 -3
  13. data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +3 -1
  14. data/lib/net/ssh/authentication/pub_key_fingerprint.rb +0 -1
  15. data/lib/net/ssh/authentication/session.rb +2 -6
  16. data/lib/net/ssh/buffer.rb +1 -9
  17. data/lib/net/ssh/config.rb +25 -10
  18. data/lib/net/ssh/connection/channel.rb +7 -3
  19. data/lib/net/ssh/connection/session.rb +7 -3
  20. data/lib/net/ssh/key_factory.rb +6 -8
  21. data/lib/net/ssh/known_hosts.rb +26 -29
  22. data/lib/net/ssh/service/forward.rb +2 -1
  23. data/lib/net/ssh/test.rb +3 -2
  24. data/lib/net/ssh/transport/algorithms.rb +67 -42
  25. data/lib/net/ssh/transport/cipher_factory.rb +11 -27
  26. data/lib/net/ssh/transport/constants.rb +10 -6
  27. data/lib/net/ssh/transport/ctr.rb +1 -7
  28. data/lib/net/ssh/transport/hmac.rb +15 -13
  29. data/lib/net/ssh/transport/hmac/abstract.rb +16 -0
  30. data/lib/net/ssh/transport/hmac/sha2_256.rb +7 -11
  31. data/lib/net/ssh/transport/hmac/sha2_256_96.rb +4 -8
  32. data/lib/net/ssh/transport/hmac/sha2_256_etm.rb +12 -0
  33. data/lib/net/ssh/transport/hmac/sha2_512.rb +6 -9
  34. data/lib/net/ssh/transport/hmac/sha2_512_96.rb +4 -8
  35. data/lib/net/ssh/transport/hmac/sha2_512_etm.rb +12 -0
  36. data/lib/net/ssh/transport/kex.rb +13 -11
  37. data/lib/net/ssh/transport/kex/abstract.rb +123 -0
  38. data/lib/net/ssh/transport/kex/abstract5656.rb +72 -0
  39. data/lib/net/ssh/transport/kex/curve25519_sha256.rb +38 -0
  40. data/lib/net/ssh/transport/kex/curve25519_sha256_loader.rb +30 -0
  41. data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +1 -15
  42. data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +9 -118
  43. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +0 -6
  44. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +5 -9
  45. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +18 -79
  46. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +5 -4
  47. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +5 -4
  48. data/lib/net/ssh/transport/openssl.rb +104 -107
  49. data/lib/net/ssh/transport/packet_stream.rb +44 -10
  50. data/lib/net/ssh/transport/state.rb +1 -1
  51. data/lib/net/ssh/version.rb +3 -3
  52. data/net-ssh.gemspec +8 -6
  53. metadata +35 -16
  54. metadata.gz.sig +0 -0
  55. data/Gemfile.noed25519.lock +0 -41
  56. data/README.rdoc +0 -194
  57. data/support/arcfour_check.rb +0 -20
@@ -7,12 +7,11 @@ addon:
7
7
  gateway.netssh
8
8
 
9
9
  rvm:
10
- - 2.2.10
11
10
  - 2.3.7
12
11
  - 2.4.5
13
12
  - 2.5.3
14
- - 2.6.0-rc2
15
- - jruby-9.2.5.0
13
+ - 2.6.2
14
+ - jruby-9.2.8.0
16
15
  - rbx-3.107
17
16
  - ruby-head
18
17
  env:
@@ -21,33 +20,33 @@ env:
21
20
  matrix:
22
21
  exclude:
23
22
  - rvm: rbx-3.107
24
- - rvm: jruby-9.2.5.0
23
+ - rvm: jruby-9.2.8.0
25
24
  include:
26
25
  - rvm: rbx-3.107
27
26
  env: NET_SSH_RUN_INTEGRATION_TESTS=
28
- - rvm: jruby-9.2.5.0
27
+ - rvm: jruby-9.2.8.0
29
28
  env: JRUBY_OPTS='--client -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -Xcext.enabled=false -J-Xss2m -Xcompile.invokedynamic=false' NET_SSH_RUN_INTEGRATION_TESTS=
30
29
  fast_finish: true
31
30
  allow_failures:
32
31
  - rvm: rbx-3.107
33
- - rvm: jruby-9.2.5.0
32
+ - rvm: jruby-9.2.8.0
34
33
  - rvm: ruby-head
35
34
 
36
35
  install:
37
36
  - export JRUBY_OPTS='--client -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -Xcext.enabled=false -J-Xss2m -Xcompile.invokedynamic=false'
38
37
  - sudo pip install ansible urllib3 pyOpenSSL ndg-httpsclient pyasn1
39
- - gem install bundler -v "= 1.16"
38
+ - gem install bundler -v "= 1.17"
40
39
  - gem list bundler
41
- - bundle _1.16_ install
42
- - bundle _1.16_ -v
43
- - BUNDLE_GEMFILE=./Gemfile.noed25519 bundle _1.16_ install
40
+ - bundle _1.17_ install
41
+ - bundle _1.17_ -v
42
+ - BUNDLE_GEMFILE=./Gemfile.noed25519 bundle _1.17_ install
44
43
  - sudo ansible-galaxy install rvm.ruby
45
44
  - sudo chown -R travis:travis /home/travis/.ansible
46
45
  - ansible-playbook ./test/integration/playbook.yml -i "localhost," --become -c local -e 'no_rvm=true' -e 'myuser=travis' -e 'mygroup=travis' -e 'homedir=/home/travis'
47
46
 
48
47
  script:
49
48
  - ssh -V
50
- - bundle _1.16_ exec rake test
51
- - BUNDLE_GEMFILE=./Gemfile.noed25519 bundle _1.16_ exec rake test
52
- - bundle _1.16_ exec rake test_test
53
- - bundle _1.16_ exec rubocop
49
+ - bundle _1.17_ exec rake test
50
+ - BUNDLE_GEMFILE=./Gemfile.noed25519 bundle _1.17_ exec rake test
51
+ - bundle _1.17_ exec rake test_test
52
+ - bundle _1.17_ exec rubocop
@@ -1,3 +1,10 @@
1
+ === 6.0.0 beta1
2
+
3
+ * curve25519sha256 support [Florian Wininger ,#690]
4
+ * disabled insecure algs [Florian Wininger , #709]
5
+
6
+ === 5.2.0
7
+
1
8
  === 5.2.0.rc3
2
9
 
3
10
  * Fix check_host_ip read from config
@@ -0,0 +1,286 @@
1
+ [![Gem Version](https://badge.fury.io/rb/net-ssh.svg)](https://badge.fury.io/rb/net-ssh)
2
+ [![Join the chat at https://gitter.im/net-ssh/net-ssh](https://badges.gitter.im/net-ssh/net-ssh.svg)](https://gitter.im/net-ssh/net-ssh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
3
+ [![Build Status](https://travis-ci.org/net-ssh/net-ssh.svg?branch=master)](https://travis-ci.org/net-ssh/net-ssh)
4
+ [![Coverage status](https://codecov.io/gh/net-ssh/net-ssh/branch/master/graph/badge.svg)](https://codecov.io/gh/net-ssh/net-ssh)
5
+ [![Backers on Open Collective](https://opencollective.com/net-ssh/backers/badge.svg)](#backers])
6
+ [![Sponsors on Open Collective](https://opencollective.com/net-ssh/sponsors/badge.svg)](#sponsors)
7
+
8
+ # Net::SSH 6.x
9
+
10
+ * Docs: http://net-ssh.github.com/net-ssh
11
+ * Issues: https://github.com/net-ssh/net-ssh/issues
12
+ * Codes: https://github.com/net-ssh/net-ssh
13
+ * Email: net-ssh@solutious.com
14
+
15
+ *As of v2.6.4, all gem releases are signed. See [INSTALL](#install).*
16
+
17
+ ## DESCRIPTION:
18
+
19
+ Net::SSH is a pure-Ruby implementation of the SSH2 client protocol.
20
+ It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.
21
+
22
+ ## FEATURES:
23
+
24
+ * Execute processes on remote servers and capture their output
25
+ * Run multiple processes in parallel over a single SSH connection
26
+ * Support for SSH subsystems
27
+ * Forward local and remote ports via an SSH connection
28
+
29
+ ## Supported Algorithms
30
+
31
+ Net::SSH 6.0 disables by default the usage of weak algorithms.
32
+ We strongly recommend that you install a servers's version that supports the latest algorithms.
33
+
34
+ It is possible to return to the previous behavior by adding the option : `append_all_supported_algorithms: true`
35
+
36
+ Unsecure algoritms will be definively remove in Net::SSH 7.*.
37
+
38
+ ### Host Keys
39
+
40
+ | Name | Support | Details |
41
+ |----------------------|-----------------------|----------|
42
+ | ssh-rsa | OK | |
43
+ | ssh-ed25519 | OK | Require the gem `ed25519` |
44
+ | ecdsa-sha2-nistp521 | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
45
+ | ecdsa-sha2-nistp384 | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
46
+ | ecdsa-sha2-nistp256 | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
47
+ | ssh-dss | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
48
+
49
+ ### Key Exchange
50
+
51
+ | Name | Support | Details |
52
+ |--------------------------------------|-----------------------|----------|
53
+ | curve25519-sha256 | OK | Require the gem `x25519` |
54
+ | ecdh-sha2-nistp521 | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
55
+ | ecdh-sha2-nistp384 | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
56
+ | ecdh-sha2-nistp256 | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
57
+ | diffie-hellman-group1-sha1 | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
58
+ | diffie-hellman-group14-sha1 | OK | |
59
+ | diffie-hellman-group-exchange-sha1 | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
60
+ | diffie-hellman-group-exchange-sha256 | OK | |
61
+
62
+ ### Encryption algorithms (ciphers)
63
+
64
+ | Name | Support | Details |
65
+ |--------------------------------------|-----------------------|----------|
66
+ | aes256-ctr / aes192-ctr / aes128-ctr | OK | [using weak elliptic curves](https://safecurves.cr.yp.to/) |
67
+ | aes256-cbc / aes192-cbc / aes128-cbc | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
68
+ | rijndael-cbc@lysator.liu.se | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
69
+ | blowfish-ctr blowfish-cbc | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
70
+ | cast128-ctr cast128-cbc | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
71
+ | 3des-ctr 3des-cbc | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
72
+ | idea-cbc | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
73
+ | none | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
74
+
75
+ ### Message Authentication Code algorithms
76
+
77
+ | Name | Support | Details |
78
+ |----------------------|-----------------------|----------|
79
+ | hmac-sha2-512-etm | OK | |
80
+ | hmac-sha2-256-etm | OK | |
81
+ | hmac-sha2-512 | OK | |
82
+ | hmac-sha2-256 | OK | |
83
+ | hmac-sha2-512-96 | Deprecated in 6.0 | removed from the specification, will be removed in 7.0 |
84
+ | hmac-sha2-256-96 | Deprecated in 6.0 | removed from the specification, will be removed in 7.0 |
85
+ | hmac-sha1 | OK | for backward compatibility |
86
+ | hmac-sha1-96 | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
87
+ | hmac-ripemd160 | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
88
+ | hmac-md5 | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
89
+ | hmac-md5-96 | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
90
+ | none | Deprecated in 6.0 | unsecure, will be removed in 7.0 |
91
+
92
+ ## SYNOPSIS:
93
+
94
+ In a nutshell:
95
+
96
+ ```ruby
97
+ require 'net/ssh'
98
+
99
+ Net::SSH.start('host', 'user', password: "password") do |ssh|
100
+ # capture all stderr and stdout output from a remote process
101
+ output = ssh.exec!("hostname")
102
+ puts output
103
+
104
+ # capture only stdout matching a particular pattern
105
+ stdout = ""
106
+ ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
107
+ stdout << data if stream == :stdout
108
+ end
109
+ puts stdout
110
+
111
+ # run multiple processes in parallel to completion
112
+ ssh.exec "sed ..."
113
+ ssh.exec "awk ..."
114
+ ssh.exec "rm -rf ..."
115
+ ssh.loop
116
+
117
+ # open a new channel and configure a minimal set of callbacks, then run
118
+ # the event loop until the channel finishes (closes)
119
+ channel = ssh.open_channel do |ch|
120
+ ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
121
+ raise "could not execute command" unless success
122
+
123
+ # "on_data" is called when the process writes something to stdout
124
+ ch.on_data do |c, data|
125
+ $stdout.print data
126
+ end
127
+
128
+ # "on_extended_data" is called when the process writes something to stderr
129
+ ch.on_extended_data do |c, type, data|
130
+ $stderr.print data
131
+ end
132
+
133
+ ch.on_close { puts "done!" }
134
+ end
135
+ end
136
+
137
+ channel.wait
138
+
139
+ # forward connections on local port 1234 to port 80 of www.capify.org
140
+ ssh.forward.local(1234, "www.capify.org", 80)
141
+ ssh.loop { true }
142
+ end
143
+ ```
144
+
145
+ See Net::SSH for more documentation, and links to further information.
146
+
147
+ ## REQUIREMENTS:
148
+
149
+ The only requirement you might be missing is the OpenSSL bindings for Ruby with a version greather than `1.0.1`.
150
+ These are built by default on most platforms, but you can verify that they're built and installed on your system by running the following command line:
151
+
152
+ ```sh
153
+ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
154
+ ```
155
+
156
+ If that spits out something like `OpenSSL 1.0.1 14 Mar 2012`, then you're set.
157
+ If you get an error, then you'll need to see about rebuilding ruby with OpenSSL support,
158
+ or (if your platform supports it) installing the OpenSSL bindings separately.
159
+
160
+ ## INSTALL:
161
+
162
+ ```sh
163
+ gem install net-ssh # might need sudo privileges
164
+ ```
165
+
166
+ NOTE: If you are running on jruby on windows you need to install `jruby-pageant` manually
167
+ (gemspec doesn't allow for platform specific dependencies).
168
+
169
+ However, in order to be sure the code you're installing hasn't been tampered with,
170
+ it's recommended that you verify the [signature](http://docs.rubygems.org/read/chapter/21).
171
+ To do this, you need to add my public key as a trusted certificate (you only need to do this once):
172
+
173
+ ```sh
174
+ # Add the public key as a trusted certificate
175
+ # (You only need to do this once)
176
+ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
177
+ gem cert --add net-ssh-public_cert.pem
178
+ ```
179
+
180
+ Then, when install the gem, do so with high security:
181
+
182
+ ```sh
183
+ gem install net-ssh -P HighSecurity
184
+ ```
185
+
186
+ If you don't add the public key, you'll see an error like "Couldn't verify data signature".
187
+ If you're still having trouble let me know and I'll give you a hand.
188
+
189
+ For ed25519 public key auth support your bundle file should contain `ed25519`, `bcrypt_pbkdf` dependencies.
190
+
191
+ ```sh
192
+ gem install ed25519
193
+ gem install bcrypt_pbkdf
194
+ ```
195
+
196
+ For curve25519-sha256 kex exchange support your bundle file should contain `x25519` dependency.
197
+
198
+ ## RUBY SUPPORT
199
+
200
+ * See [net-ssh.gemspec](https://github.com/net-ssh/net-ssh/blob/master/net-ssh.gemspec) for current versions ruby requirements
201
+
202
+ ## RUNNING TESTS
203
+
204
+ If you want to run the tests or use any of the Rake tasks, you'll need Mocha and
205
+ other dependencies listed in Gemfile
206
+
207
+ Run the test suite from the net-ssh directory with the following command:
208
+
209
+ ```sh
210
+ bundle exec rake test
211
+ ```
212
+
213
+ Run a single test file like this:
214
+
215
+ ```sh
216
+ ruby -Ilib -Itest test/transport/test_server_version.rb
217
+ ```
218
+
219
+ To run integration tests see test/integration/README.txt
220
+
221
+ ### BUILDING GEM
222
+
223
+ ```sh
224
+ rake build
225
+ ```
226
+
227
+ ### GEM SIGNING (for maintainers)
228
+
229
+ If you have the net-ssh private signing key, you will be able to create signed release builds. Make sure the private key path matches the `signing_key` path set in `net-ssh.gemspec` and tell rake to sign the gem by setting the `NET_SSH_BUILDGEM_SIGNED` flag:
230
+
231
+ ```sh
232
+ NET_SSH_BUILDGEM_SIGNED=true rake build
233
+ ```
234
+
235
+ For time to time, the public certificate associated to the private key needs to be renewed. You can do this with the following command:
236
+
237
+ ```sh
238
+ gem cert --build netssh@solutious.com --private-key path/2/net-ssh-private_key.pem
239
+ mv gem-public_cert.pem net-ssh-public_cert.pem
240
+ gem cert --add net-ssh-public_cert.pem
241
+ ```
242
+
243
+ ## CREDITS
244
+
245
+ ### Contributors
246
+
247
+ This project exists thanks to all the people who contribute.
248
+
249
+ [![contributors](https://opencollective.com/net-ssh/contributors.svg?width=890&button=false)](graphs/contributors)
250
+
251
+ ### Backers
252
+
253
+ Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/net-ssh#backer)
254
+
255
+ [![backers](https://opencollective.com/net-ssh/backers.svg?width=890)](https://opencollective.com/net-ssh#backers)
256
+
257
+ ### Sponsors
258
+
259
+ Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor](https://opencollective.com/net-ssh#sponsor)
260
+
261
+ [![Sponsor](https://opencollective.com/net-ssh/sponsor/0/avatar.svg)](https://opencollective.com/net-ssh/sponsor/0/website)
262
+
263
+ ## LICENSE:
264
+
265
+ (The MIT License)
266
+
267
+ Copyright (c) 2008 Jamis Buck
268
+
269
+ Permission is hereby granted, free of charge, to any person obtaining
270
+ a copy of this software and associated documentation files (the
271
+ 'Software'), to deal in the Software without restriction, including
272
+ without limitation the rights to use, copy, modify, merge, publish,
273
+ distribute, sublicense, and/or sell copies of the Software, and to
274
+ permit persons to whom the Software is furnished to do so, subject to
275
+ the following conditions:
276
+
277
+ The above copyright notice and this permission notice shall be
278
+ included in all copies or substantial portions of the Software.
279
+
280
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
281
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
282
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
283
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
284
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
285
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
286
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  #
3
2
  # Also in your terminal environment run:
4
3
  # $ export LANG=en_US.UTF-8
@@ -32,7 +31,7 @@ RDoc::Task.new do |rdoc|
32
31
  rdoc.rdoc_dir = "rdoc"
33
32
  rdoc.title = "#{name} #{version}"
34
33
  rdoc.generator = 'hanna' # gem install hanna-nouveau
35
- rdoc.main = 'README.rdoc'
34
+ rdoc.main = 'README.md'
36
35
  rdoc.rdoc_files.include("README*")
37
36
  rdoc.rdoc_files.include("bin/*.rb")
38
37
  rdoc.rdoc_files.include("lib/**/*.rb")
@@ -5,9 +5,11 @@ skip_tags: true
5
5
  environment:
6
6
  matrix:
7
7
  - ruby_version: "jruby-9.1.2.0"
8
+ - ruby_version: "26-x64"
9
+ - ruby_version: "25-x64"
10
+ - ruby_version: "24-x64"
8
11
  - ruby_version: "23"
9
12
  - ruby_version: "23-x64"
10
- - ruby_version: "22-x64"
11
13
 
12
14
  matrix:
13
15
  allow_failures:
@@ -29,7 +31,7 @@ install:
29
31
  - if "%ruby_version%" == "jruby-9.1.2.0" ( cinst jruby --version 9.1.2.0 -i --allow-empty-checksums )
30
32
  - if "%ruby_version%" == "jruby-9.1.2.0" ( SET "PATH=C:\jruby-9.1.2.0\bin\;%PATH%" )
31
33
  - ruby --version
32
- - gem install bundler --no-document --user-install -v 1.16
34
+ - gem install bundler --no-document --user-install -v 1.17
33
35
  - SET BUNDLE_GEMFILE=Gemfile.noed25519
34
36
  - bundle install --retry=3
35
37
  - cinst freesshd
@@ -139,7 +139,7 @@ module Net
139
139
 
140
140
  if info[:key].nil? && info[:from] == :file
141
141
  begin
142
- info[:key] = KeyFactory.load_private_key(info[:file], options[:passphrase], !options[:non_interactive])
142
+ info[:key] = KeyFactory.load_private_key(info[:file], options[:passphrase], !options[:non_interactive], options[:password_prompt])
143
143
  rescue OpenSSL::OpenSSLError, Exception => e
144
144
  raise KeyManagerError, "the given identity is known, but the private key could not be loaded: #{e.class} (#{e.message})"
145
145
  end
@@ -229,11 +229,15 @@ module Net
229
229
  key = KeyFactory.load_public_key(identity[:pubkey_file])
230
230
  { public_key: key, from: :file, file: identity[:privkey_file] }
231
231
  when :privkey_file
232
- private_key = KeyFactory.load_private_key(identity[:privkey_file], options[:passphrase], ask_passphrase, options[:password_prompt])
232
+ private_key = KeyFactory.load_private_key(
233
+ identity[:privkey_file], options[:passphrase], ask_passphrase, options[:password_prompt]
234
+ )
233
235
  key = private_key.send(:public_key)
234
236
  { public_key: key, from: :file, file: identity[:privkey_file], key: private_key }
235
237
  when :data
236
- private_key = KeyFactory.load_data_private_key(identity[:data], options[:passphrase], ask_passphrase, "<key in memory>", options[:password_prompt])
238
+ private_key = KeyFactory.load_data_private_key(
239
+ identity[:data], options[:passphrase], ask_passphrase, "<key in memory>", options[:password_prompt]
240
+ )
237
241
  key = private_key.send(:public_key)
238
242
  { public_key: key, from: :key_data, data: identity[:data], key: private_key }
239
243
  else
@@ -40,7 +40,9 @@ module Net
40
40
  instruction = message.read_string
41
41
  debug { "keyboard-interactive info request" }
42
42
 
43
- prompter = prompt.start(type: 'keyboard-interactive', name: name, instruction: instruction) if password.nil? && interactive? && prompter.nil?
43
+ if password.nil? && interactive? && prompter.nil?
44
+ prompter = prompt.start(type: 'keyboard-interactive', name: name, instruction: instruction)
45
+ end
44
46
 
45
47
  _ = message.read_string # lang_tag
46
48
  responses = []
@@ -1,4 +1,3 @@
1
-
2
1
  require 'openssl'
3
2
 
4
3
  module Net
@@ -136,12 +136,8 @@ module Net
136
136
  # Returns an array of paths to the key files usually defined
137
137
  # by system default.
138
138
  def default_keys
139
- if defined?(OpenSSL::PKey::EC)
140
- %w[~/.ssh/id_ed25519 ~/.ssh/id_rsa ~/.ssh/id_dsa ~/.ssh/id_ecdsa
141
- ~/.ssh2/id_ed25519 ~/.ssh2/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_ecdsa]
142
- else
143
- %w[~/.ssh/id_dsa ~/.ssh/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_rsa]
144
- end
139
+ %w[~/.ssh/id_ed25519 ~/.ssh/id_rsa ~/.ssh/id_dsa ~/.ssh/id_ecdsa
140
+ ~/.ssh2/id_ed25519 ~/.ssh2/id_rsa ~/.ssh2/id_dsa ~/.ssh2/id_ecdsa]
145
141
  end
146
142
 
147
143
  # Returns an array of paths to the key files that should be used when