net-ssh 3.2.0.rc2 → 7.1.0
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 +5 -5
- checksums.yaml.gz.sig +2 -2
- data/.dockerignore +6 -0
- data/.github/config/rubocop_linter_action.yml +4 -0
- data/.github/workflows/ci-with-docker.yml +44 -0
- data/.github/workflows/ci.yml +87 -0
- data/.github/workflows/rubocop.yml +16 -0
- data/.gitignore +13 -0
- data/.rubocop.yml +22 -0
- data/.rubocop_todo.yml +1081 -0
- data/CHANGES.txt +228 -7
- data/Dockerfile +27 -0
- data/Dockerfile.openssl3 +17 -0
- data/Gemfile +13 -0
- data/Gemfile.noed25519 +12 -0
- data/ISSUE_TEMPLATE.md +30 -0
- data/Manifest +4 -5
- data/README.md +297 -0
- data/Rakefile +125 -74
- data/SECURITY.md +4 -0
- data/appveyor.yml +58 -0
- data/docker-compose.yml +23 -0
- data/lib/net/ssh/authentication/agent.rb +279 -18
- data/lib/net/ssh/authentication/certificate.rb +183 -0
- data/lib/net/ssh/authentication/constants.rb +17 -15
- data/lib/net/ssh/authentication/ed25519.rb +186 -0
- data/lib/net/ssh/authentication/ed25519_loader.rb +31 -0
- data/lib/net/ssh/authentication/key_manager.rb +86 -39
- data/lib/net/ssh/authentication/methods/abstract.rb +67 -48
- data/lib/net/ssh/authentication/methods/hostbased.rb +34 -37
- data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +13 -13
- data/lib/net/ssh/authentication/methods/none.rb +16 -19
- data/lib/net/ssh/authentication/methods/password.rb +27 -17
- data/lib/net/ssh/authentication/methods/publickey.rb +96 -55
- data/lib/net/ssh/authentication/pageant.rb +471 -367
- data/lib/net/ssh/authentication/pub_key_fingerprint.rb +43 -0
- data/lib/net/ssh/authentication/session.rb +131 -121
- data/lib/net/ssh/buffer.rb +399 -300
- data/lib/net/ssh/buffered_io.rb +154 -150
- data/lib/net/ssh/config.rb +308 -185
- data/lib/net/ssh/connection/channel.rb +635 -613
- data/lib/net/ssh/connection/constants.rb +29 -29
- data/lib/net/ssh/connection/event_loop.rb +123 -0
- data/lib/net/ssh/connection/keepalive.rb +55 -51
- data/lib/net/ssh/connection/session.rb +620 -551
- data/lib/net/ssh/connection/term.rb +125 -123
- data/lib/net/ssh/errors.rb +101 -99
- data/lib/net/ssh/key_factory.rb +197 -105
- data/lib/net/ssh/known_hosts.rb +214 -127
- data/lib/net/ssh/loggable.rb +50 -49
- data/lib/net/ssh/packet.rb +83 -79
- data/lib/net/ssh/prompt.rb +50 -81
- data/lib/net/ssh/proxy/command.rb +105 -90
- data/lib/net/ssh/proxy/errors.rb +12 -10
- data/lib/net/ssh/proxy/http.rb +82 -79
- data/lib/net/ssh/proxy/https.rb +50 -0
- data/lib/net/ssh/proxy/jump.rb +54 -0
- data/lib/net/ssh/proxy/socks4.rb +2 -6
- data/lib/net/ssh/proxy/socks5.rb +14 -17
- data/lib/net/ssh/service/forward.rb +370 -317
- data/lib/net/ssh/test/channel.rb +145 -136
- data/lib/net/ssh/test/extensions.rb +131 -110
- data/lib/net/ssh/test/kex.rb +34 -32
- data/lib/net/ssh/test/local_packet.rb +46 -44
- data/lib/net/ssh/test/packet.rb +89 -70
- data/lib/net/ssh/test/remote_packet.rb +32 -30
- data/lib/net/ssh/test/script.rb +156 -142
- data/lib/net/ssh/test/socket.rb +49 -48
- data/lib/net/ssh/test.rb +82 -77
- data/lib/net/ssh/transport/algorithms.rb +441 -360
- data/lib/net/ssh/transport/cipher_factory.rb +96 -98
- data/lib/net/ssh/transport/constants.rb +32 -24
- data/lib/net/ssh/transport/ctr.rb +42 -22
- data/lib/net/ssh/transport/hmac/abstract.rb +81 -63
- data/lib/net/ssh/transport/hmac/md5.rb +0 -2
- data/lib/net/ssh/transport/hmac/md5_96.rb +0 -2
- data/lib/net/ssh/transport/hmac/none.rb +0 -2
- data/lib/net/ssh/transport/hmac/ripemd160.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha1.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha1_96.rb +0 -2
- data/lib/net/ssh/transport/hmac/sha2_256.rb +7 -11
- data/lib/net/ssh/transport/hmac/sha2_256_96.rb +4 -8
- data/lib/net/ssh/transport/hmac/sha2_256_etm.rb +12 -0
- data/lib/net/ssh/transport/hmac/sha2_512.rb +6 -9
- data/lib/net/ssh/transport/hmac/sha2_512_96.rb +4 -8
- data/lib/net/ssh/transport/hmac/sha2_512_etm.rb +12 -0
- data/lib/net/ssh/transport/hmac.rb +14 -12
- data/lib/net/ssh/transport/identity_cipher.rb +54 -52
- data/lib/net/ssh/transport/kex/abstract.rb +130 -0
- data/lib/net/ssh/transport/kex/abstract5656.rb +72 -0
- data/lib/net/ssh/transport/kex/curve25519_sha256.rb +39 -0
- data/lib/net/ssh/transport/kex/curve25519_sha256_loader.rb +30 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +33 -40
- data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb +11 -0
- data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +119 -213
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +53 -61
- data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +5 -9
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +36 -90
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +18 -10
- data/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +18 -10
- data/lib/net/ssh/transport/kex.rb +15 -12
- data/lib/net/ssh/transport/key_expander.rb +24 -20
- data/lib/net/ssh/transport/openssl.rb +161 -124
- data/lib/net/ssh/transport/packet_stream.rb +225 -185
- data/lib/net/ssh/transport/server_version.rb +55 -56
- data/lib/net/ssh/transport/session.rb +306 -255
- data/lib/net/ssh/transport/state.rb +178 -176
- data/lib/net/ssh/verifiers/accept_new.rb +33 -0
- data/lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb +33 -0
- data/lib/net/ssh/verifiers/always.rb +58 -0
- data/lib/net/ssh/verifiers/never.rb +19 -0
- data/lib/net/ssh/version.rb +55 -53
- data/lib/net/ssh.rb +110 -47
- data/net-ssh-public_cert.pem +18 -18
- data/net-ssh.gemspec +36 -205
- data/support/ssh_tunnel_bug.rb +5 -5
- data.tar.gz.sig +0 -0
- metadata +153 -118
- metadata.gz.sig +0 -0
- data/.travis.yml +0 -18
- data/README.rdoc +0 -182
- data/lib/net/ssh/authentication/agent/java_pageant.rb +0 -85
- data/lib/net/ssh/authentication/agent/socket.rb +0 -178
- data/lib/net/ssh/ruby_compat.rb +0 -46
- data/lib/net/ssh/verifiers/lenient.rb +0 -30
- data/lib/net/ssh/verifiers/null.rb +0 -12
- data/lib/net/ssh/verifiers/secure.rb +0 -52
- data/lib/net/ssh/verifiers/strict.rb +0 -24
- data/setup.rb +0 -1585
- data/support/arcfour_check.rb +0 -20
- data/test/README.txt +0 -18
- data/test/authentication/methods/common.rb +0 -28
- data/test/authentication/methods/test_abstract.rb +0 -51
- data/test/authentication/methods/test_hostbased.rb +0 -114
- data/test/authentication/methods/test_keyboard_interactive.rb +0 -121
- data/test/authentication/methods/test_none.rb +0 -41
- data/test/authentication/methods/test_password.rb +0 -95
- data/test/authentication/methods/test_publickey.rb +0 -148
- data/test/authentication/test_agent.rb +0 -232
- data/test/authentication/test_key_manager.rb +0 -240
- data/test/authentication/test_session.rb +0 -107
- data/test/common.rb +0 -125
- data/test/configs/auth_off +0 -5
- data/test/configs/auth_on +0 -4
- data/test/configs/empty +0 -0
- data/test/configs/eqsign +0 -3
- data/test/configs/exact_match +0 -8
- data/test/configs/host_plus +0 -10
- data/test/configs/multihost +0 -4
- data/test/configs/negative_match +0 -6
- data/test/configs/nohost +0 -19
- data/test/configs/numeric_host +0 -4
- data/test/configs/proxy_remote_user +0 -2
- data/test/configs/send_env +0 -2
- data/test/configs/substitutes +0 -8
- data/test/configs/wild_cards +0 -14
- data/test/connection/test_channel.rb +0 -487
- data/test/connection/test_session.rb +0 -564
- data/test/integration/README.txt +0 -17
- data/test/integration/Vagrantfile +0 -12
- data/test/integration/common.rb +0 -63
- data/test/integration/playbook.yml +0 -56
- data/test/integration/test_forward.rb +0 -637
- data/test/integration/test_id_rsa_keys.rb +0 -96
- data/test/integration/test_proxy.rb +0 -93
- data/test/known_hosts/github +0 -1
- data/test/known_hosts/github_hash +0 -1
- data/test/manual/test_pageant.rb +0 -37
- data/test/start/test_connection.rb +0 -53
- data/test/start/test_options.rb +0 -57
- data/test/start/test_transport.rb +0 -28
- data/test/start/test_user_nil.rb +0 -27
- data/test/test_all.rb +0 -12
- data/test/test_buffer.rb +0 -433
- data/test/test_buffered_io.rb +0 -63
- data/test/test_config.rb +0 -268
- data/test/test_key_factory.rb +0 -191
- data/test/test_known_hosts.rb +0 -66
- data/test/transport/hmac/test_md5.rb +0 -41
- data/test/transport/hmac/test_md5_96.rb +0 -27
- data/test/transport/hmac/test_none.rb +0 -34
- data/test/transport/hmac/test_ripemd160.rb +0 -36
- data/test/transport/hmac/test_sha1.rb +0 -36
- data/test/transport/hmac/test_sha1_96.rb +0 -27
- data/test/transport/hmac/test_sha2_256.rb +0 -37
- data/test/transport/hmac/test_sha2_256_96.rb +0 -27
- data/test/transport/hmac/test_sha2_512.rb +0 -37
- data/test/transport/hmac/test_sha2_512_96.rb +0 -27
- data/test/transport/kex/test_diffie_hellman_group14_sha1.rb +0 -13
- data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +0 -150
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +0 -96
- data/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +0 -19
- data/test/transport/kex/test_ecdh_sha2_nistp256.rb +0 -161
- data/test/transport/kex/test_ecdh_sha2_nistp384.rb +0 -38
- data/test/transport/kex/test_ecdh_sha2_nistp521.rb +0 -38
- data/test/transport/test_algorithms.rb +0 -328
- data/test/transport/test_cipher_factory.rb +0 -443
- data/test/transport/test_hmac.rb +0 -34
- data/test/transport/test_identity_cipher.rb +0 -40
- data/test/transport/test_packet_stream.rb +0 -1762
- data/test/transport/test_server_version.rb +0 -74
- data/test/transport/test_session.rb +0 -331
- data/test/transport/test_state.rb +0 -181
- data/test/verifiers/test_secure.rb +0 -40
metadata
CHANGED
|
@@ -1,40 +1,68 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: net-ssh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 7.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jamis Buck
|
|
8
8
|
- Delano Mandelbaum
|
|
9
9
|
- Miklós Fazekas
|
|
10
10
|
autorequire:
|
|
11
|
-
bindir:
|
|
11
|
+
bindir: exe
|
|
12
12
|
cert_chain:
|
|
13
13
|
- |
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
MIIDQDCCAiigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpuZXRz
|
|
16
|
+
c2gvREM9c29sdXRpb3VzL0RDPWNvbTAeFw0yMzAxMjQwMzE3NTVaFw0yNDAxMjQw
|
|
17
|
+
MzE3NTVaMCUxIzAhBgNVBAMMGm5ldHNzaC9EQz1zb2x1dGlvdXMvREM9Y29tMIIB
|
|
18
|
+
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxieE22fR/qmdPKUHyYTyUx2g
|
|
19
|
+
wskLwrCkxay+Tvc97ZZUOwf85LDDDPqhQaTWLvRwnIOMgQE2nBPzwalVclK6a+pW
|
|
20
|
+
x/18KDeZY15vm3Qn5p42b0wi9hUxOqPm3J2hdCLCcgtENgdX21nVzejn39WVqFJO
|
|
21
|
+
lntgSDNW5+kCS8QaRsmIbzj17GKKkrsw39kiQw7FhWfJFeTjddzoZiWwc59KA/Bx
|
|
22
|
+
fBbmDnsMLAtAtauMOxORrbx3EOY7sHku/kSrMg3FXFay7jc6BkbbUij+MjJ/k82l
|
|
23
|
+
4o8o0YO4BAnya90xgEmgOG0LCCxRhuXQFnMDuDjK2XnUe0h4/6NCn94C+z9GsQID
|
|
24
|
+
AQABo3sweTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUBfKiwO2e
|
|
25
|
+
M4NEiRrVG793qEPLYyMwHwYDVR0RBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20w
|
|
26
|
+
HwYDVR0SBBgwFoEUbmV0c3NoQHNvbHV0aW91cy5jb20wDQYJKoZIhvcNAQELBQAD
|
|
27
|
+
ggEBAHyOSaOUji+EJFWZ46g+2EZ/kG7EFloFtIQUz8jDJIWGE+3NV5po1M0Z6EqH
|
|
28
|
+
XmG3BtMLfgOV9NwMQRqIdKnZDfKsqM/FOu+9IqrP+OieAde5OrXR2pzQls60Xft7
|
|
29
|
+
3qNVaQS99woQRqiUiDQQ7WagOYrZjuVANqTDNt4myzGSjS5sHcKlz3PRn0LJRMe5
|
|
30
|
+
ouuLwQ7BCXityv5RRXex2ibCOyY7pB5ris6xDnPe1WdlyCfUf1Fb+Yqxpy6a8QmH
|
|
31
|
+
v84waVXQ2i5M7pJaHVBF7DxxeW/q8W3VCnsq8vmmvULSThD18QqYGaFDJeN8sTR4
|
|
32
|
+
6tfjgZ6OvGSScvbCMHkCE9XjonE=
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date:
|
|
34
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
|
-
name:
|
|
37
|
+
name: bcrypt_pbkdf
|
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
- - "~>"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '1.0'
|
|
43
|
+
type: :development
|
|
44
|
+
prerelease: false
|
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
46
|
+
requirements:
|
|
47
|
+
- - "~>"
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '1.0'
|
|
50
|
+
- !ruby/object:Gem::Dependency
|
|
51
|
+
name: ed25519
|
|
52
|
+
requirement: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - "~>"
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '1.2'
|
|
57
|
+
type: :development
|
|
58
|
+
prerelease: false
|
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
60
|
+
requirements:
|
|
61
|
+
- - "~>"
|
|
62
|
+
- !ruby/object:Gem::Version
|
|
63
|
+
version: '1.2'
|
|
64
|
+
- !ruby/object:Gem::Dependency
|
|
65
|
+
name: x25519
|
|
38
66
|
requirement: !ruby/object:Gem::Requirement
|
|
39
67
|
requirements:
|
|
40
68
|
- - ">="
|
|
@@ -48,41 +76,114 @@ dependencies:
|
|
|
48
76
|
- !ruby/object:Gem::Version
|
|
49
77
|
version: '0'
|
|
50
78
|
- !ruby/object:Gem::Dependency
|
|
51
|
-
name:
|
|
79
|
+
name: bundler
|
|
52
80
|
requirement: !ruby/object:Gem::Requirement
|
|
53
81
|
requirements:
|
|
54
82
|
- - ">="
|
|
55
83
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: '
|
|
84
|
+
version: '1.17'
|
|
57
85
|
type: :development
|
|
58
86
|
prerelease: false
|
|
59
87
|
version_requirements: !ruby/object:Gem::Requirement
|
|
60
88
|
requirements:
|
|
61
89
|
- - ">="
|
|
62
90
|
- !ruby/object:Gem::Version
|
|
63
|
-
version: '
|
|
91
|
+
version: '1.17'
|
|
92
|
+
- !ruby/object:Gem::Dependency
|
|
93
|
+
name: minitest
|
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
|
95
|
+
requirements:
|
|
96
|
+
- - "~>"
|
|
97
|
+
- !ruby/object:Gem::Version
|
|
98
|
+
version: '5.10'
|
|
99
|
+
type: :development
|
|
100
|
+
prerelease: false
|
|
101
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
102
|
+
requirements:
|
|
103
|
+
- - "~>"
|
|
104
|
+
- !ruby/object:Gem::Version
|
|
105
|
+
version: '5.10'
|
|
106
|
+
- !ruby/object:Gem::Dependency
|
|
107
|
+
name: mocha
|
|
108
|
+
requirement: !ruby/object:Gem::Requirement
|
|
109
|
+
requirements:
|
|
110
|
+
- - "~>"
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
version: 1.11.2
|
|
113
|
+
type: :development
|
|
114
|
+
prerelease: false
|
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
116
|
+
requirements:
|
|
117
|
+
- - "~>"
|
|
118
|
+
- !ruby/object:Gem::Version
|
|
119
|
+
version: 1.11.2
|
|
120
|
+
- !ruby/object:Gem::Dependency
|
|
121
|
+
name: rake
|
|
122
|
+
requirement: !ruby/object:Gem::Requirement
|
|
123
|
+
requirements:
|
|
124
|
+
- - "~>"
|
|
125
|
+
- !ruby/object:Gem::Version
|
|
126
|
+
version: '12.0'
|
|
127
|
+
type: :development
|
|
128
|
+
prerelease: false
|
|
129
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
130
|
+
requirements:
|
|
131
|
+
- - "~>"
|
|
132
|
+
- !ruby/object:Gem::Version
|
|
133
|
+
version: '12.0'
|
|
134
|
+
- !ruby/object:Gem::Dependency
|
|
135
|
+
name: rubocop
|
|
136
|
+
requirement: !ruby/object:Gem::Requirement
|
|
137
|
+
requirements:
|
|
138
|
+
- - "~>"
|
|
139
|
+
- !ruby/object:Gem::Version
|
|
140
|
+
version: 1.28.0
|
|
141
|
+
type: :development
|
|
142
|
+
prerelease: false
|
|
143
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
144
|
+
requirements:
|
|
145
|
+
- - "~>"
|
|
146
|
+
- !ruby/object:Gem::Version
|
|
147
|
+
version: 1.28.0
|
|
64
148
|
description: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It
|
|
65
149
|
allows you to write programs that invoke and interact with processes on remote servers,
|
|
66
150
|
via SSH2.'
|
|
67
|
-
email:
|
|
151
|
+
email:
|
|
152
|
+
- net-ssh@solutious.com
|
|
68
153
|
executables: []
|
|
69
154
|
extensions: []
|
|
70
155
|
extra_rdoc_files:
|
|
71
156
|
- LICENSE.txt
|
|
72
|
-
- README.
|
|
157
|
+
- README.md
|
|
73
158
|
files:
|
|
74
|
-
- ".
|
|
159
|
+
- ".dockerignore"
|
|
160
|
+
- ".github/config/rubocop_linter_action.yml"
|
|
161
|
+
- ".github/workflows/ci-with-docker.yml"
|
|
162
|
+
- ".github/workflows/ci.yml"
|
|
163
|
+
- ".github/workflows/rubocop.yml"
|
|
164
|
+
- ".gitignore"
|
|
165
|
+
- ".rubocop.yml"
|
|
166
|
+
- ".rubocop_todo.yml"
|
|
75
167
|
- CHANGES.txt
|
|
168
|
+
- Dockerfile
|
|
169
|
+
- Dockerfile.openssl3
|
|
170
|
+
- Gemfile
|
|
171
|
+
- Gemfile.noed25519
|
|
172
|
+
- ISSUE_TEMPLATE.md
|
|
76
173
|
- LICENSE.txt
|
|
77
174
|
- Manifest
|
|
78
|
-
- README.
|
|
175
|
+
- README.md
|
|
79
176
|
- Rakefile
|
|
177
|
+
- SECURITY.md
|
|
80
178
|
- THANKS.txt
|
|
179
|
+
- appveyor.yml
|
|
180
|
+
- docker-compose.yml
|
|
81
181
|
- lib/net/ssh.rb
|
|
82
182
|
- lib/net/ssh/authentication/agent.rb
|
|
83
|
-
- lib/net/ssh/authentication/
|
|
84
|
-
- lib/net/ssh/authentication/agent/socket.rb
|
|
183
|
+
- lib/net/ssh/authentication/certificate.rb
|
|
85
184
|
- lib/net/ssh/authentication/constants.rb
|
|
185
|
+
- lib/net/ssh/authentication/ed25519.rb
|
|
186
|
+
- lib/net/ssh/authentication/ed25519_loader.rb
|
|
86
187
|
- lib/net/ssh/authentication/key_manager.rb
|
|
87
188
|
- lib/net/ssh/authentication/methods/abstract.rb
|
|
88
189
|
- lib/net/ssh/authentication/methods/hostbased.rb
|
|
@@ -91,12 +192,14 @@ files:
|
|
|
91
192
|
- lib/net/ssh/authentication/methods/password.rb
|
|
92
193
|
- lib/net/ssh/authentication/methods/publickey.rb
|
|
93
194
|
- lib/net/ssh/authentication/pageant.rb
|
|
195
|
+
- lib/net/ssh/authentication/pub_key_fingerprint.rb
|
|
94
196
|
- lib/net/ssh/authentication/session.rb
|
|
95
197
|
- lib/net/ssh/buffer.rb
|
|
96
198
|
- lib/net/ssh/buffered_io.rb
|
|
97
199
|
- lib/net/ssh/config.rb
|
|
98
200
|
- lib/net/ssh/connection/channel.rb
|
|
99
201
|
- lib/net/ssh/connection/constants.rb
|
|
202
|
+
- lib/net/ssh/connection/event_loop.rb
|
|
100
203
|
- lib/net/ssh/connection/keepalive.rb
|
|
101
204
|
- lib/net/ssh/connection/session.rb
|
|
102
205
|
- lib/net/ssh/connection/term.rb
|
|
@@ -109,9 +212,10 @@ files:
|
|
|
109
212
|
- lib/net/ssh/proxy/command.rb
|
|
110
213
|
- lib/net/ssh/proxy/errors.rb
|
|
111
214
|
- lib/net/ssh/proxy/http.rb
|
|
215
|
+
- lib/net/ssh/proxy/https.rb
|
|
216
|
+
- lib/net/ssh/proxy/jump.rb
|
|
112
217
|
- lib/net/ssh/proxy/socks4.rb
|
|
113
218
|
- lib/net/ssh/proxy/socks5.rb
|
|
114
|
-
- lib/net/ssh/ruby_compat.rb
|
|
115
219
|
- lib/net/ssh/service/forward.rb
|
|
116
220
|
- lib/net/ssh/test.rb
|
|
117
221
|
- lib/net/ssh/test/channel.rb
|
|
@@ -136,11 +240,18 @@ files:
|
|
|
136
240
|
- lib/net/ssh/transport/hmac/sha1_96.rb
|
|
137
241
|
- lib/net/ssh/transport/hmac/sha2_256.rb
|
|
138
242
|
- lib/net/ssh/transport/hmac/sha2_256_96.rb
|
|
243
|
+
- lib/net/ssh/transport/hmac/sha2_256_etm.rb
|
|
139
244
|
- lib/net/ssh/transport/hmac/sha2_512.rb
|
|
140
245
|
- lib/net/ssh/transport/hmac/sha2_512_96.rb
|
|
246
|
+
- lib/net/ssh/transport/hmac/sha2_512_etm.rb
|
|
141
247
|
- lib/net/ssh/transport/identity_cipher.rb
|
|
142
248
|
- lib/net/ssh/transport/kex.rb
|
|
249
|
+
- lib/net/ssh/transport/kex/abstract.rb
|
|
250
|
+
- lib/net/ssh/transport/kex/abstract5656.rb
|
|
251
|
+
- lib/net/ssh/transport/kex/curve25519_sha256.rb
|
|
252
|
+
- lib/net/ssh/transport/kex/curve25519_sha256_loader.rb
|
|
143
253
|
- lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb
|
|
254
|
+
- lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb
|
|
144
255
|
- lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
|
145
256
|
- lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
|
146
257
|
- lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb
|
|
@@ -153,94 +264,19 @@ files:
|
|
|
153
264
|
- lib/net/ssh/transport/server_version.rb
|
|
154
265
|
- lib/net/ssh/transport/session.rb
|
|
155
266
|
- lib/net/ssh/transport/state.rb
|
|
156
|
-
- lib/net/ssh/verifiers/
|
|
157
|
-
- lib/net/ssh/verifiers/
|
|
158
|
-
- lib/net/ssh/verifiers/
|
|
159
|
-
- lib/net/ssh/verifiers/
|
|
267
|
+
- lib/net/ssh/verifiers/accept_new.rb
|
|
268
|
+
- lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb
|
|
269
|
+
- lib/net/ssh/verifiers/always.rb
|
|
270
|
+
- lib/net/ssh/verifiers/never.rb
|
|
160
271
|
- lib/net/ssh/version.rb
|
|
161
272
|
- net-ssh-public_cert.pem
|
|
162
273
|
- net-ssh.gemspec
|
|
163
|
-
- setup.rb
|
|
164
|
-
- support/arcfour_check.rb
|
|
165
274
|
- support/ssh_tunnel_bug.rb
|
|
166
|
-
- test/README.txt
|
|
167
|
-
- test/authentication/methods/common.rb
|
|
168
|
-
- test/authentication/methods/test_abstract.rb
|
|
169
|
-
- test/authentication/methods/test_hostbased.rb
|
|
170
|
-
- test/authentication/methods/test_keyboard_interactive.rb
|
|
171
|
-
- test/authentication/methods/test_none.rb
|
|
172
|
-
- test/authentication/methods/test_password.rb
|
|
173
|
-
- test/authentication/methods/test_publickey.rb
|
|
174
|
-
- test/authentication/test_agent.rb
|
|
175
|
-
- test/authentication/test_key_manager.rb
|
|
176
|
-
- test/authentication/test_session.rb
|
|
177
|
-
- test/common.rb
|
|
178
|
-
- test/configs/auth_off
|
|
179
|
-
- test/configs/auth_on
|
|
180
|
-
- test/configs/empty
|
|
181
|
-
- test/configs/eqsign
|
|
182
|
-
- test/configs/exact_match
|
|
183
|
-
- test/configs/host_plus
|
|
184
|
-
- test/configs/multihost
|
|
185
|
-
- test/configs/negative_match
|
|
186
|
-
- test/configs/nohost
|
|
187
|
-
- test/configs/numeric_host
|
|
188
|
-
- test/configs/proxy_remote_user
|
|
189
|
-
- test/configs/send_env
|
|
190
|
-
- test/configs/substitutes
|
|
191
|
-
- test/configs/wild_cards
|
|
192
|
-
- test/connection/test_channel.rb
|
|
193
|
-
- test/connection/test_session.rb
|
|
194
|
-
- test/integration/README.txt
|
|
195
|
-
- test/integration/Vagrantfile
|
|
196
|
-
- test/integration/common.rb
|
|
197
|
-
- test/integration/playbook.yml
|
|
198
|
-
- test/integration/test_forward.rb
|
|
199
|
-
- test/integration/test_id_rsa_keys.rb
|
|
200
|
-
- test/integration/test_proxy.rb
|
|
201
|
-
- test/known_hosts/github
|
|
202
|
-
- test/known_hosts/github_hash
|
|
203
|
-
- test/manual/test_pageant.rb
|
|
204
|
-
- test/start/test_connection.rb
|
|
205
|
-
- test/start/test_options.rb
|
|
206
|
-
- test/start/test_transport.rb
|
|
207
|
-
- test/start/test_user_nil.rb
|
|
208
|
-
- test/test_all.rb
|
|
209
|
-
- test/test_buffer.rb
|
|
210
|
-
- test/test_buffered_io.rb
|
|
211
|
-
- test/test_config.rb
|
|
212
|
-
- test/test_key_factory.rb
|
|
213
|
-
- test/test_known_hosts.rb
|
|
214
|
-
- test/transport/hmac/test_md5.rb
|
|
215
|
-
- test/transport/hmac/test_md5_96.rb
|
|
216
|
-
- test/transport/hmac/test_none.rb
|
|
217
|
-
- test/transport/hmac/test_ripemd160.rb
|
|
218
|
-
- test/transport/hmac/test_sha1.rb
|
|
219
|
-
- test/transport/hmac/test_sha1_96.rb
|
|
220
|
-
- test/transport/hmac/test_sha2_256.rb
|
|
221
|
-
- test/transport/hmac/test_sha2_256_96.rb
|
|
222
|
-
- test/transport/hmac/test_sha2_512.rb
|
|
223
|
-
- test/transport/hmac/test_sha2_512_96.rb
|
|
224
|
-
- test/transport/kex/test_diffie_hellman_group14_sha1.rb
|
|
225
|
-
- test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
|
226
|
-
- test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
|
227
|
-
- test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb
|
|
228
|
-
- test/transport/kex/test_ecdh_sha2_nistp256.rb
|
|
229
|
-
- test/transport/kex/test_ecdh_sha2_nistp384.rb
|
|
230
|
-
- test/transport/kex/test_ecdh_sha2_nistp521.rb
|
|
231
|
-
- test/transport/test_algorithms.rb
|
|
232
|
-
- test/transport/test_cipher_factory.rb
|
|
233
|
-
- test/transport/test_hmac.rb
|
|
234
|
-
- test/transport/test_identity_cipher.rb
|
|
235
|
-
- test/transport/test_packet_stream.rb
|
|
236
|
-
- test/transport/test_server_version.rb
|
|
237
|
-
- test/transport/test_session.rb
|
|
238
|
-
- test/transport/test_state.rb
|
|
239
|
-
- test/verifiers/test_secure.rb
|
|
240
275
|
homepage: https://github.com/net-ssh/net-ssh
|
|
241
276
|
licenses:
|
|
242
277
|
- MIT
|
|
243
|
-
metadata:
|
|
278
|
+
metadata:
|
|
279
|
+
changelog_uri: https://github.com/net-ssh/net-ssh/blob/master/CHANGES.txt
|
|
244
280
|
post_install_message:
|
|
245
281
|
rdoc_options: []
|
|
246
282
|
require_paths:
|
|
@@ -249,15 +285,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
249
285
|
requirements:
|
|
250
286
|
- - ">="
|
|
251
287
|
- !ruby/object:Gem::Version
|
|
252
|
-
version: '2.
|
|
288
|
+
version: '2.6'
|
|
253
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
290
|
requirements:
|
|
255
|
-
- - "
|
|
291
|
+
- - ">="
|
|
256
292
|
- !ruby/object:Gem::Version
|
|
257
|
-
version:
|
|
293
|
+
version: '0'
|
|
258
294
|
requirements: []
|
|
259
|
-
|
|
260
|
-
rubygems_version: 2.4.3
|
|
295
|
+
rubygems_version: 3.3.3
|
|
261
296
|
signing_key:
|
|
262
297
|
specification_version: 4
|
|
263
298
|
summary: 'Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'
|
metadata.gz.sig
CHANGED
|
Binary file
|
data/.travis.yml
DELETED
data/README.rdoc
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
= Net::SSH 3.x
|
|
2
|
-
|
|
3
|
-
<em><b>Please note: this project is in maintenance mode. It is not under active development but pull requests are very much welcome. Just be sure to include tests! -- delano</b></em>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Docs: http://net-ssh.github.com/net-ssh
|
|
7
|
-
* Issues: https://github.com/net-ssh/net-ssh/issues
|
|
8
|
-
* Codes: https://github.com/net-ssh/net-ssh
|
|
9
|
-
* Email: net-ssh@solutious.com
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<em>As of v2.6.4, all gem releases are signed. See INSTALL.</em>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
== DESCRIPTION:
|
|
16
|
-
|
|
17
|
-
Net::SSH is a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.
|
|
18
|
-
|
|
19
|
-
== FEATURES:
|
|
20
|
-
|
|
21
|
-
* Execute processes on remote servers and capture their output
|
|
22
|
-
* Run multiple processes in parallel over a single SSH connection
|
|
23
|
-
* Support for SSH subsystems
|
|
24
|
-
* Forward local and remote ports via an SSH connection
|
|
25
|
-
|
|
26
|
-
== SYNOPSIS:
|
|
27
|
-
|
|
28
|
-
In a nutshell:
|
|
29
|
-
|
|
30
|
-
require 'net/ssh'
|
|
31
|
-
|
|
32
|
-
Net::SSH.start('host', 'user', :password => "password") do |ssh|
|
|
33
|
-
# capture all stderr and stdout output from a remote process
|
|
34
|
-
output = ssh.exec!("hostname")
|
|
35
|
-
puts output
|
|
36
|
-
|
|
37
|
-
# capture only stdout matching a particular pattern
|
|
38
|
-
stdout = ""
|
|
39
|
-
ssh.exec!("ls -l /home/jamis") do |channel, stream, data|
|
|
40
|
-
stdout << data if stream == :stdout
|
|
41
|
-
end
|
|
42
|
-
puts stdout
|
|
43
|
-
|
|
44
|
-
# run multiple processes in parallel to completion
|
|
45
|
-
ssh.exec "sed ..."
|
|
46
|
-
ssh.exec "awk ..."
|
|
47
|
-
ssh.exec "rm -rf ..."
|
|
48
|
-
ssh.loop
|
|
49
|
-
|
|
50
|
-
# open a new channel and configure a minimal set of callbacks, then run
|
|
51
|
-
# the event loop until the channel finishes (closes)
|
|
52
|
-
channel = ssh.open_channel do |ch|
|
|
53
|
-
ch.exec "/usr/local/bin/ruby /path/to/file.rb" do |ch, success|
|
|
54
|
-
raise "could not execute command" unless success
|
|
55
|
-
|
|
56
|
-
# "on_data" is called when the process writes something to stdout
|
|
57
|
-
ch.on_data do |c, data|
|
|
58
|
-
$stdout.print data
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# "on_extended_data" is called when the process writes something to stderr
|
|
62
|
-
ch.on_extended_data do |c, type, data|
|
|
63
|
-
$stderr.print data
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
ch.on_close { puts "done!" }
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
channel.wait
|
|
71
|
-
|
|
72
|
-
# forward connections on local port 1234 to port 80 of www.capify.org
|
|
73
|
-
ssh.forward.local(1234, "www.capify.org", 80)
|
|
74
|
-
ssh.loop { true }
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
See Net::SSH for more documentation, and links to further information.
|
|
78
|
-
|
|
79
|
-
== REQUIREMENTS:
|
|
80
|
-
|
|
81
|
-
The only requirement you might be missing is the OpenSSL bindings for Ruby. 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:
|
|
82
|
-
|
|
83
|
-
ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
|
|
84
|
-
|
|
85
|
-
If that spits out something like "OpenSSL 0.9.8g 19 Oct 2007", then you're set. If you get an error, then you'll need to see about rebuilding ruby with OpenSSL support, or (if your platform supports it) installing the OpenSSL bindings separately.
|
|
86
|
-
|
|
87
|
-
Additionally: if you are going to be having Net::SSH prompt you for things like passwords or certificate passphrases, you'll want to have either the Highline (recommended) or Termios (unix systems only) gem installed, so that the passwords don't echo in clear text.
|
|
88
|
-
|
|
89
|
-
Lastly, if you want to run the tests or use any of the Rake tasks, you'll need:
|
|
90
|
-
|
|
91
|
-
* Echoe (for the Rakefile)
|
|
92
|
-
* Mocha (for the tests)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
== INSTALL:
|
|
96
|
-
|
|
97
|
-
* gem install net-ssh (might need sudo privileges)
|
|
98
|
-
|
|
99
|
-
NOTE: If you are running on jruby you need to install jruby-pageant manually (gemspec doesn't allow for platform specific dependencies).
|
|
100
|
-
|
|
101
|
-
However, in order to be sure the code you're installing hasn't been tampered with, it's recommended that you verify the signature[http://docs.rubygems.org/read/chapter/21]. To do this, you need to add my public key as a trusted certificate (you only need to do this once):
|
|
102
|
-
|
|
103
|
-
# Add the public key as a trusted certificate
|
|
104
|
-
# (You only need to do this once)
|
|
105
|
-
$ curl -O https://raw.githubusercontent.com/net-ssh/net-ssh/master/net-ssh-public_cert.pem
|
|
106
|
-
$ gem cert --add net-ssh-public_cert.pem
|
|
107
|
-
|
|
108
|
-
Then, when install the gem, do so with high security:
|
|
109
|
-
|
|
110
|
-
$ gem install net-ssh -P HighSecurity
|
|
111
|
-
|
|
112
|
-
If you don't add the public key, you'll see an error like "Couldn't verify data signature". If you're still having trouble let me know and I'll give you a hand.
|
|
113
|
-
|
|
114
|
-
== RUBY 1.x SUPPORT
|
|
115
|
-
|
|
116
|
-
* Ruby 1.8.x is supported up until the net-ssh 2.5.1 release.
|
|
117
|
-
* Ruby 1.9.x is supported up until the net-ssh 2.9.x release.
|
|
118
|
-
* Current net-ssh releases require Ruby 2.0 or later.
|
|
119
|
-
|
|
120
|
-
== RUNNING TESTS
|
|
121
|
-
|
|
122
|
-
Run the test suite from the net-ssh directory with the following command:
|
|
123
|
-
|
|
124
|
-
bash -c 'unset HOME && ruby -Ilib -Itest -rrubygems test/test_all.rb'
|
|
125
|
-
|
|
126
|
-
Run a single test file like this:
|
|
127
|
-
|
|
128
|
-
ruby -Ilib -Itest -rrubygems test/transport/test_server_version.rb
|
|
129
|
-
|
|
130
|
-
To run integration tests see test/integration/README.txt
|
|
131
|
-
|
|
132
|
-
=== BUILDING GEM
|
|
133
|
-
|
|
134
|
-
Since building the gem requires the private key if you want to build a .gem locally please use the NET_SSH_NOKEY=1 envirnoment variable:
|
|
135
|
-
|
|
136
|
-
rake build NET_SSH_NOKEY=1
|
|
137
|
-
|
|
138
|
-
=== PORT FORWARDING TESTS
|
|
139
|
-
|
|
140
|
-
ruby -Ilib -Itest -rrubygems test/manual/test_forward.rb
|
|
141
|
-
|
|
142
|
-
test_forward.rb must be run separately from the test suite because
|
|
143
|
-
it requires authorizing your public SSH keys on you localhost.
|
|
144
|
-
|
|
145
|
-
If you already have keys you can do this:
|
|
146
|
-
|
|
147
|
-
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
|
|
148
|
-
|
|
149
|
-
If you don't have keys see:
|
|
150
|
-
|
|
151
|
-
http://kimmo.suominen.com/docs/ssh/#ssh-keygen
|
|
152
|
-
|
|
153
|
-
You should now be able to login to your localhost with out
|
|
154
|
-
bring prompted for a password:
|
|
155
|
-
|
|
156
|
-
ssh localhost
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
== LICENSE:
|
|
160
|
-
|
|
161
|
-
(The MIT License)
|
|
162
|
-
|
|
163
|
-
Copyright (c) 2008 Jamis Buck
|
|
164
|
-
|
|
165
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
166
|
-
a copy of this software and associated documentation files (the
|
|
167
|
-
'Software'), to deal in the Software without restriction, including
|
|
168
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
169
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
170
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
171
|
-
the following conditions:
|
|
172
|
-
|
|
173
|
-
The above copyright notice and this permission notice shall be
|
|
174
|
-
included in all copies or substantial portions of the Software.
|
|
175
|
-
|
|
176
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
177
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
178
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
179
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
180
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
181
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
182
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
require 'jruby_pageant'
|
|
2
|
-
|
|
3
|
-
module Net; module SSH; module Authentication
|
|
4
|
-
|
|
5
|
-
# This class implements an agent for JRuby + Pageant.
|
|
6
|
-
#
|
|
7
|
-
# Written by Artūras Šlajus <arturas.slajus@gmail.com>
|
|
8
|
-
class Agent
|
|
9
|
-
include Loggable
|
|
10
|
-
include JRubyPageant
|
|
11
|
-
|
|
12
|
-
# A simple module for extending keys, to allow blobs and comments to be
|
|
13
|
-
# specified for them.
|
|
14
|
-
module Key
|
|
15
|
-
# :blob is used by OpenSSL::PKey::RSA#to_blob
|
|
16
|
-
attr_accessor :java_blob
|
|
17
|
-
attr_accessor :comment
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Instantiates a new agent object, connects to a running SSH agent,
|
|
21
|
-
# negotiates the agent protocol version, and returns the agent object.
|
|
22
|
-
def self.connect(logger=nil, agent_socket_factory)
|
|
23
|
-
agent = new(logger)
|
|
24
|
-
agent.connect!
|
|
25
|
-
agent
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# Creates a new Agent object, using the optional logger instance to
|
|
29
|
-
# report status.
|
|
30
|
-
def initialize(logger=nil)
|
|
31
|
-
self.logger = logger
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Connect to the agent process using the socket factory and socket name
|
|
35
|
-
# given by the attribute writers. If the agent on the other end of the
|
|
36
|
-
# socket reports that it is an SSH2-compatible agent, this will fail
|
|
37
|
-
# (it only supports the ssh-agent distributed by OpenSSH).
|
|
38
|
-
def connect!
|
|
39
|
-
debug { "connecting to Pageant ssh-agent (via java connector)" }
|
|
40
|
-
@agent_proxy = JRubyPageant.create
|
|
41
|
-
unless @agent_proxy.is_running
|
|
42
|
-
raise AgentNotAvailable, "Pageant is not running!"
|
|
43
|
-
end
|
|
44
|
-
debug { "connection to Pageant ssh-agent (via java connector) succeeded" }
|
|
45
|
-
rescue AgentProxyException => e
|
|
46
|
-
error { "could not connect to Pageant ssh-agent (via java connector)" }
|
|
47
|
-
raise AgentNotAvailable, e.message, e.backtrace
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
# Return an array of all identities (public keys) known to the agent.
|
|
51
|
-
# Each key returned is augmented with a +comment+ property which is set
|
|
52
|
-
# to the comment returned by the agent for that key.
|
|
53
|
-
def identities
|
|
54
|
-
debug { "getting identities from Pageant" }
|
|
55
|
-
@agent_proxy.get_identities.map do |identity|
|
|
56
|
-
blob = identity.get_blob
|
|
57
|
-
key = Buffer.new(String.from_java_bytes(blob)).read_key
|
|
58
|
-
key.extend(Key)
|
|
59
|
-
key.java_blob = blob
|
|
60
|
-
key.comment = String.from_java_bytes(identity.get_comment)
|
|
61
|
-
key
|
|
62
|
-
end
|
|
63
|
-
rescue AgentProxyException => e
|
|
64
|
-
raise AgentError, "Cannot get identities: #{e.message}", e.backtrace
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
# Simulate agent close. This agent reference is no longer able to
|
|
68
|
-
# query the agent.
|
|
69
|
-
def close
|
|
70
|
-
@agent_proxy = nil
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
# Using the agent and the given public key, sign the given data. The
|
|
74
|
-
# signature is returned in SSH2 format.
|
|
75
|
-
def sign(key, data)
|
|
76
|
-
signed = @agent_proxy.sign(key.java_blob, data.to_java_bytes)
|
|
77
|
-
String.from_java_bytes(signed)
|
|
78
|
-
rescue AgentProxyException => e
|
|
79
|
-
raise AgentError,
|
|
80
|
-
"agent could not sign data with requested identity: #{e.message}",
|
|
81
|
-
e.backtrace
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
end; end; end
|