net-ssh-backports 6.3.4.backports → 6.3.6.backports
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
- data/.gitignore +1 -0
- data/lib/net/ssh/authentication/key_manager.rb +28 -26
- data/lib/net/ssh/authentication/session.rb +13 -14
- data/lib/net/ssh/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11f75b7708864ad48d35c19370dce6e2865aa0be10cc2ad8c46f88c8bd2e677e
|
4
|
+
data.tar.gz: 75b03f76290c2267085309e76cc3c30ae7892f447a564dafbe17771b958693c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb7591b3a6db6c47ee242cba5b13d2b9a3285c88b0199c6eb487c50e026957e1c212d810a36b5aefa72a49901e73b0721f21a17f03908496d6274673a9131c34
|
7
|
+
data.tar.gz: 4b562a83eda3bf0894f292f72362210397715a7a368bfeca63e7696dc0b1b5430948629e4a8da77b1e132195b03d2515a29bf90ff67454cc71b668fc02255f91
|
data/.gitignore
CHANGED
@@ -249,35 +249,37 @@ module Net
|
|
249
249
|
# Load prepared identities. Private key decryption errors ignored if ignore_decryption_errors
|
250
250
|
def load_identities(identities, ask_passphrase, ignore_decryption_errors)
|
251
251
|
identities.map do |identity|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
252
|
+
begin
|
253
|
+
case identity[:load_from]
|
254
|
+
when :pubkey_file
|
255
|
+
key = KeyFactory.load_public_key(identity[:pubkey_file])
|
256
|
+
{ public_key: key, from: :file, file: identity[:privkey_file] }
|
257
|
+
when :privkey_file
|
258
|
+
private_key = KeyFactory.load_private_key(
|
259
|
+
identity[:privkey_file], options[:passphrase], ask_passphrase, options[:password_prompt]
|
260
|
+
)
|
261
|
+
key = private_key.send(:public_key)
|
262
|
+
{ public_key: key, from: :file, file: identity[:privkey_file], key: private_key }
|
263
|
+
when :data
|
264
|
+
private_key = KeyFactory.load_data_private_key(
|
265
|
+
identity[:data], options[:passphrase], ask_passphrase, "<key in memory>", options[:password_prompt]
|
266
|
+
)
|
267
|
+
key = private_key.send(:public_key)
|
268
|
+
{ public_key: key, from: :key_data, data: identity[:data], key: private_key }
|
269
|
+
else
|
270
|
+
identity
|
271
|
+
end
|
272
|
+
rescue OpenSSL::PKey::RSAError, OpenSSL::PKey::DSAError, OpenSSL::PKey::ECError, OpenSSL::PKey::PKeyError, ArgumentError => e
|
273
|
+
if ignore_decryption_errors
|
274
|
+
identity
|
275
|
+
else
|
276
|
+
process_identity_loading_error(identity, e)
|
277
|
+
nil
|
278
|
+
end
|
279
|
+
rescue Exception => e
|
275
280
|
process_identity_loading_error(identity, e)
|
276
281
|
nil
|
277
282
|
end
|
278
|
-
rescue Exception => e
|
279
|
-
process_identity_loading_error(identity, e)
|
280
|
-
nil
|
281
283
|
end.compact
|
282
284
|
end
|
283
285
|
|
@@ -55,26 +55,26 @@ module Net
|
|
55
55
|
# service request. Returns true if an authentication method succeeds in
|
56
56
|
# authenticating the user, and false otherwise.
|
57
57
|
def authenticate(next_service, username, password=nil)
|
58
|
-
|
59
|
-
debug { "beginning authentication of `#{username}'" }
|
58
|
+
debug { "beginning authentication of `#{username}'" }
|
60
59
|
|
61
|
-
|
62
|
-
|
60
|
+
transport.send_message(transport.service_request("ssh-userauth"))
|
61
|
+
expect_message(SERVICE_ACCEPT)
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
key_manager = KeyManager.new(logger, options)
|
64
|
+
keys.each { |key| key_manager.add(key) } unless keys.empty?
|
65
|
+
keycerts.each { |keycert| key_manager.add_keycert(keycert) } unless keycerts.empty?
|
66
|
+
key_data.each { |key2| key_manager.add_key_data(key2) } unless key_data.empty?
|
67
|
+
default_keys.each { |key| key_manager.add(key) } unless options.key?(:keys) || options.key?(:key_data)
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
attempted = []
|
70
|
+
@auth_methods.each do |name|
|
71
|
+
begin
|
73
72
|
next unless @allowed_auth_methods.include?(name)
|
74
73
|
|
75
74
|
attempted << name
|
76
75
|
|
77
76
|
debug { "trying #{name}" }
|
77
|
+
|
78
78
|
begin
|
79
79
|
auth_class = Methods.const_get(name.split(/\W+/).map { |p| p.capitalize }.join)
|
80
80
|
method = auth_class.new(self, key_manager: key_manager, password_prompt: options[:password_prompt])
|
@@ -84,8 +84,7 @@ module Net
|
|
84
84
|
end
|
85
85
|
|
86
86
|
return true if method.authenticate(next_service, username, password)
|
87
|
-
rescue Net::SSH::Authentication::DisallowedMethod
|
88
|
-
raise e
|
87
|
+
rescue Net::SSH::Authentication::DisallowedMethod
|
89
88
|
end
|
90
89
|
end
|
91
90
|
|
data/lib/net/ssh/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh-backports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.3.
|
4
|
+
version: 6.3.6.backports
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-01-
|
13
|
+
date: 2024-01-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bcrypt_pbkdf
|