net-ssh 2.7.0 → 7.3.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.
Files changed (199) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.dockerignore +6 -0
  4. data/.github/FUNDING.yml +1 -0
  5. data/.github/config/rubocop_linter_action.yml +4 -0
  6. data/.github/workflows/ci-with-docker.yml +44 -0
  7. data/.github/workflows/ci.yml +94 -0
  8. data/.github/workflows/rubocop.yml +16 -0
  9. data/.gitignore +15 -0
  10. data/.rubocop.yml +22 -0
  11. data/.rubocop_todo.yml +1081 -0
  12. data/CHANGES.txt +387 -0
  13. data/DEVELOPMENT.md +23 -0
  14. data/Dockerfile +29 -0
  15. data/Dockerfile.openssl3 +17 -0
  16. data/Gemfile +13 -0
  17. data/Gemfile.noed25519 +12 -0
  18. data/Gemfile.norbnacl +12 -0
  19. data/ISSUE_TEMPLATE.md +30 -0
  20. data/Manifest +4 -5
  21. data/README.md +303 -0
  22. data/Rakefile +174 -40
  23. data/SECURITY.md +4 -0
  24. data/THANKS.txt +25 -0
  25. data/appveyor.yml +58 -0
  26. data/docker-compose.yml +25 -0
  27. data/lib/net/ssh/authentication/agent.rb +279 -18
  28. data/lib/net/ssh/authentication/certificate.rb +183 -0
  29. data/lib/net/ssh/authentication/constants.rb +17 -15
  30. data/lib/net/ssh/authentication/ed25519.rb +184 -0
  31. data/lib/net/ssh/authentication/ed25519_loader.rb +31 -0
  32. data/lib/net/ssh/authentication/key_manager.rb +125 -54
  33. data/lib/net/ssh/authentication/methods/abstract.rb +67 -48
  34. data/lib/net/ssh/authentication/methods/hostbased.rb +34 -37
  35. data/lib/net/ssh/authentication/methods/keyboard_interactive.rb +19 -12
  36. data/lib/net/ssh/authentication/methods/none.rb +16 -19
  37. data/lib/net/ssh/authentication/methods/password.rb +56 -19
  38. data/lib/net/ssh/authentication/methods/publickey.rb +96 -55
  39. data/lib/net/ssh/authentication/pageant.rb +483 -246
  40. data/lib/net/ssh/authentication/pub_key_fingerprint.rb +43 -0
  41. data/lib/net/ssh/authentication/session.rb +138 -120
  42. data/lib/net/ssh/buffer.rb +399 -300
  43. data/lib/net/ssh/buffered_io.rb +154 -150
  44. data/lib/net/ssh/config.rb +361 -166
  45. data/lib/net/ssh/connection/channel.rb +640 -596
  46. data/lib/net/ssh/connection/constants.rb +29 -29
  47. data/lib/net/ssh/connection/event_loop.rb +123 -0
  48. data/lib/net/ssh/connection/keepalive.rb +59 -0
  49. data/lib/net/ssh/connection/session.rb +628 -548
  50. data/lib/net/ssh/connection/term.rb +125 -123
  51. data/lib/net/ssh/errors.rb +101 -95
  52. data/lib/net/ssh/key_factory.rb +198 -100
  53. data/lib/net/ssh/known_hosts.rb +221 -98
  54. data/lib/net/ssh/loggable.rb +50 -49
  55. data/lib/net/ssh/packet.rb +83 -79
  56. data/lib/net/ssh/prompt.rb +50 -81
  57. data/lib/net/ssh/proxy/command.rb +108 -60
  58. data/lib/net/ssh/proxy/errors.rb +12 -10
  59. data/lib/net/ssh/proxy/http.rb +82 -78
  60. data/lib/net/ssh/proxy/https.rb +50 -0
  61. data/lib/net/ssh/proxy/jump.rb +54 -0
  62. data/lib/net/ssh/proxy/socks4.rb +5 -8
  63. data/lib/net/ssh/proxy/socks5.rb +18 -20
  64. data/lib/net/ssh/service/forward.rb +383 -255
  65. data/lib/net/ssh/test/channel.rb +145 -136
  66. data/lib/net/ssh/test/extensions.rb +131 -110
  67. data/lib/net/ssh/test/kex.rb +34 -32
  68. data/lib/net/ssh/test/local_packet.rb +46 -44
  69. data/lib/net/ssh/test/packet.rb +89 -70
  70. data/lib/net/ssh/test/remote_packet.rb +32 -30
  71. data/lib/net/ssh/test/script.rb +156 -142
  72. data/lib/net/ssh/test/socket.rb +49 -48
  73. data/lib/net/ssh/test.rb +82 -77
  74. data/lib/net/ssh/transport/aes128_gcm.rb +40 -0
  75. data/lib/net/ssh/transport/aes256_gcm.rb +40 -0
  76. data/lib/net/ssh/transport/algorithms.rb +472 -348
  77. data/lib/net/ssh/transport/chacha20_poly1305_cipher.rb +117 -0
  78. data/lib/net/ssh/transport/chacha20_poly1305_cipher_loader.rb +17 -0
  79. data/lib/net/ssh/transport/cipher_factory.rb +124 -100
  80. data/lib/net/ssh/transport/constants.rb +32 -24
  81. data/lib/net/ssh/transport/ctr.rb +42 -22
  82. data/lib/net/ssh/transport/gcm_cipher.rb +207 -0
  83. data/lib/net/ssh/transport/hmac/abstract.rb +97 -63
  84. data/lib/net/ssh/transport/hmac/md5.rb +0 -2
  85. data/lib/net/ssh/transport/hmac/md5_96.rb +0 -2
  86. data/lib/net/ssh/transport/hmac/none.rb +0 -2
  87. data/lib/net/ssh/transport/hmac/ripemd160.rb +0 -2
  88. data/lib/net/ssh/transport/hmac/sha1.rb +0 -2
  89. data/lib/net/ssh/transport/hmac/sha1_96.rb +0 -2
  90. data/lib/net/ssh/transport/hmac/sha2_256.rb +7 -11
  91. data/lib/net/ssh/transport/hmac/sha2_256_96.rb +4 -8
  92. data/lib/net/ssh/transport/hmac/sha2_256_etm.rb +12 -0
  93. data/lib/net/ssh/transport/hmac/sha2_512.rb +6 -9
  94. data/lib/net/ssh/transport/hmac/sha2_512_96.rb +4 -8
  95. data/lib/net/ssh/transport/hmac/sha2_512_etm.rb +12 -0
  96. data/lib/net/ssh/transport/hmac.rb +14 -12
  97. data/lib/net/ssh/transport/identity_cipher.rb +54 -44
  98. data/lib/net/ssh/transport/kex/abstract.rb +130 -0
  99. data/lib/net/ssh/transport/kex/abstract5656.rb +72 -0
  100. data/lib/net/ssh/transport/kex/curve25519_sha256.rb +39 -0
  101. data/lib/net/ssh/transport/kex/curve25519_sha256_loader.rb +30 -0
  102. data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +33 -40
  103. data/lib/net/ssh/transport/kex/diffie_hellman_group14_sha256.rb +11 -0
  104. data/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +119 -213
  105. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +53 -61
  106. data/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +5 -9
  107. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +36 -90
  108. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +18 -10
  109. data/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +18 -10
  110. data/lib/net/ssh/transport/kex.rb +15 -12
  111. data/lib/net/ssh/transport/key_expander.rb +24 -20
  112. data/lib/net/ssh/transport/openssl.rb +161 -124
  113. data/lib/net/ssh/transport/openssl_cipher_extensions.rb +8 -0
  114. data/lib/net/ssh/transport/packet_stream.rb +246 -183
  115. data/lib/net/ssh/transport/server_version.rb +57 -51
  116. data/lib/net/ssh/transport/session.rb +307 -235
  117. data/lib/net/ssh/transport/state.rb +178 -176
  118. data/lib/net/ssh/verifiers/accept_new.rb +33 -0
  119. data/lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb +33 -0
  120. data/lib/net/ssh/verifiers/always.rb +58 -0
  121. data/lib/net/ssh/verifiers/never.rb +19 -0
  122. data/lib/net/ssh/version.rb +57 -51
  123. data/lib/net/ssh.rb +140 -40
  124. data/net-ssh-public_cert.pem +21 -0
  125. data/net-ssh.gemspec +39 -184
  126. data/support/ssh_tunnel_bug.rb +5 -5
  127. data.tar.gz.sig +0 -0
  128. metadata +205 -99
  129. metadata.gz.sig +0 -0
  130. data/README.rdoc +0 -219
  131. data/Rudyfile +0 -96
  132. data/gem-public_cert.pem +0 -20
  133. data/lib/net/ssh/authentication/agent/java_pageant.rb +0 -85
  134. data/lib/net/ssh/authentication/agent/socket.rb +0 -170
  135. data/lib/net/ssh/ruby_compat.rb +0 -51
  136. data/lib/net/ssh/verifiers/lenient.rb +0 -30
  137. data/lib/net/ssh/verifiers/null.rb +0 -12
  138. data/lib/net/ssh/verifiers/secure.rb +0 -54
  139. data/lib/net/ssh/verifiers/strict.rb +0 -24
  140. data/setup.rb +0 -1585
  141. data/support/arcfour_check.rb +0 -20
  142. data/test/README.txt +0 -47
  143. data/test/authentication/methods/common.rb +0 -28
  144. data/test/authentication/methods/test_abstract.rb +0 -51
  145. data/test/authentication/methods/test_hostbased.rb +0 -114
  146. data/test/authentication/methods/test_keyboard_interactive.rb +0 -100
  147. data/test/authentication/methods/test_none.rb +0 -41
  148. data/test/authentication/methods/test_password.rb +0 -52
  149. data/test/authentication/methods/test_publickey.rb +0 -148
  150. data/test/authentication/test_agent.rb +0 -205
  151. data/test/authentication/test_key_manager.rb +0 -218
  152. data/test/authentication/test_session.rb +0 -108
  153. data/test/common.rb +0 -108
  154. data/test/configs/eqsign +0 -3
  155. data/test/configs/exact_match +0 -8
  156. data/test/configs/host_plus +0 -10
  157. data/test/configs/multihost +0 -4
  158. data/test/configs/nohost +0 -19
  159. data/test/configs/numeric_host +0 -4
  160. data/test/configs/send_env +0 -2
  161. data/test/configs/substitutes +0 -8
  162. data/test/configs/wild_cards +0 -14
  163. data/test/connection/test_channel.rb +0 -467
  164. data/test/connection/test_session.rb +0 -526
  165. data/test/known_hosts/github +0 -1
  166. data/test/manual/test_forward.rb +0 -223
  167. data/test/start/test_options.rb +0 -36
  168. data/test/start/test_transport.rb +0 -28
  169. data/test/test_all.rb +0 -11
  170. data/test/test_buffer.rb +0 -433
  171. data/test/test_buffered_io.rb +0 -63
  172. data/test/test_config.rb +0 -151
  173. data/test/test_key_factory.rb +0 -173
  174. data/test/test_known_hosts.rb +0 -13
  175. data/test/transport/hmac/test_md5.rb +0 -41
  176. data/test/transport/hmac/test_md5_96.rb +0 -27
  177. data/test/transport/hmac/test_none.rb +0 -34
  178. data/test/transport/hmac/test_ripemd160.rb +0 -36
  179. data/test/transport/hmac/test_sha1.rb +0 -36
  180. data/test/transport/hmac/test_sha1_96.rb +0 -27
  181. data/test/transport/hmac/test_sha2_256.rb +0 -37
  182. data/test/transport/hmac/test_sha2_256_96.rb +0 -27
  183. data/test/transport/hmac/test_sha2_512.rb +0 -37
  184. data/test/transport/hmac/test_sha2_512_96.rb +0 -27
  185. data/test/transport/kex/test_diffie_hellman_group14_sha1.rb +0 -13
  186. data/test/transport/kex/test_diffie_hellman_group1_sha1.rb +0 -146
  187. data/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +0 -92
  188. data/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +0 -34
  189. data/test/transport/kex/test_ecdh_sha2_nistp256.rb +0 -161
  190. data/test/transport/kex/test_ecdh_sha2_nistp384.rb +0 -38
  191. data/test/transport/kex/test_ecdh_sha2_nistp521.rb +0 -38
  192. data/test/transport/test_algorithms.rb +0 -330
  193. data/test/transport/test_cipher_factory.rb +0 -443
  194. data/test/transport/test_hmac.rb +0 -34
  195. data/test/transport/test_identity_cipher.rb +0 -40
  196. data/test/transport/test_packet_stream.rb +0 -1755
  197. data/test/transport/test_server_version.rb +0 -78
  198. data/test/transport/test_session.rb +0 -319
  199. data/test/transport/test_state.rb +0 -181
data/CHANGES.txt CHANGED
@@ -1,3 +1,390 @@
1
+ === 7.3.0 rc0
2
+
3
+ * aes(128|256)gcm [#946]
4
+
5
+ === 7.2.2
6
+
7
+ * ruby 3.3.0: base64 fix
8
+
9
+ === 7.2.1 rc1
10
+
11
+ * feat: allow load of certkey from string [#926]
12
+ * fix: fix for Socket#recv returning nil on ruby 3.3.0 [#928]
13
+
14
+ === 7.2.0
15
+
16
+ * Add debugging information for algorithm of pubkey in use [#918]
17
+
18
+ === 7.2.0 rc1
19
+
20
+ * Allow IdentityAgent as option to Net::SSH.start [#912]
21
+
22
+ === 7.2.0 beta1
23
+
24
+ * Support `chacha20-poly1305@opnessh.com` cypher if `RbNaCl` gem is installed [#908]
25
+
26
+ === 7.1.0
27
+
28
+ * Accept pubkey_algorithms option when starting a new connection [#891]
29
+
30
+ === 7.1.0 beta1
31
+
32
+ * Don't use the deprecated set_XXX methods on RSA keys. [#875]
33
+ * Raise error when BCryptPbkdf fails [#876]
34
+
35
+ === 7.0.1
36
+
37
+ * Drop leftover debug statement [#866]
38
+
39
+ === 7.0.0
40
+
41
+ * BREAKING: Drop support for Ruby 2.5
42
+ * Fix decoding of ecdsa-sha2-nistp256 private keys [#657, #854]
43
+ * Fix missing require [#855]
44
+ * Support `~` in the path to the SSH agent's unix socket [#850]
45
+ * Add support for RSA client authentication with SHA-2 [a45f54]
46
+ * openssl: DSA: don't hardcode expected signature size, see ruby/openssl#483 [23a15c]
47
+ * Internal housekeeping (rubocop, codecov, remove travis, adding/improving tests)
48
+
49
+ === 6.3.0 beta1
50
+
51
+ * Support cert based host key auth, fix asterisk in known_hosts [#833]
52
+ * Support kex dh-group14-sha256 [#795]
53
+ * Fix StrictHostKeyChecking ssh config parameter translation [#765]
54
+
55
+ === 6.2.0 rc1
56
+
57
+ === 6.2.0 beta1
58
+
59
+ * rsa-sha2-512, rsa-sha2-256 host_key algs [#771]
60
+ * JRuby aes*-ctr suppport [#767]
61
+
62
+ === 6.1.0
63
+
64
+ * Adapt to ssh's default behaviors when no username is provided.
65
+ When Net::SSH.start user is nil and config has no entry
66
+ we default to Etc.getpwuid.name() instead of Etc.getlogin(). [#749]
67
+
68
+ === 6.1.0.rc1
69
+
70
+ * Make sha2-{256,512}-etm@openssh.com MAC default again [#761]
71
+ * Support algorithm subtraction syntax from ssh_config [#751]
72
+
73
+ === 6.0.2
74
+
75
+ * Fix corrupted hmac issue in etm hmac [#759]
76
+
77
+ === 6.0.1
78
+
79
+ * Make sha2-{256,512}-etm@openssh.com MAC opt-in as they seems to have issues [#757]
80
+
81
+ === 6.0.0
82
+
83
+ * Support empty lines and comments in known_hosts [donoghuc, #742]
84
+ * Add sha2-{256,512}-etm@openssh.com MAC algorithms [graaff, #714]
85
+
86
+ === 6.0.0 beta2
87
+
88
+ * Support :certkeys and CertificateFile configuration option [Anders Carling, #722]
89
+
90
+ === 6.0.0 beta1
91
+
92
+ * curve25519sha256 support [Florian Wininger ,#690]
93
+ * disabled insecure algs [Florian Wininger , #709]
94
+
95
+ === 5.2.0
96
+
97
+ === 5.2.0.rc3
98
+
99
+ * Fix check_host_ip read from config
100
+ * Support ssh-ed25519 in known hosts
101
+
102
+ === 5.2.0.rc2
103
+
104
+ * Read check_host_ip from ssh config files
105
+
106
+ === 5.2.0.rc1
107
+
108
+ * Interpret * and ? in know_hosts file [Romain Tartière, #660]
109
+ * New :check_host_ip so ip checking can be disabled in known hosts [Romain Tartière, #656]
110
+
111
+ === 5.1.0
112
+
113
+ === 5.1.0.rc1
114
+
115
+ * Support new OpenSSH private key format for rsa - bcrypt for rsa (ed25519 already supported) [#646]
116
+ * Support IdentityAgent is ssh config [Frank Groeneveld, #645]
117
+ * Improve Match processing in ssh config [Aleksandrs Ļedovskis, #642]
118
+ * Ignore signature verification when verify_host_key is never [Piotr Kliczewski, #641]
119
+ * Alg preference was changed to prefer stronger encryptions [Tray, #637]
120
+
121
+ === 5.0.2
122
+
123
+ * Fix ctr for jruby [#612]
124
+
125
+ === 5.0.1
126
+
127
+ * default_keys were not loaded even if no keys or key_data options specified [#607]
128
+
129
+ === 5.0.0
130
+
131
+ * Breaking change: ed25519 now requires ed25519 gem instead of RbNaCl gem [#563]
132
+ * Verify_host_key options rename (true, false, :very, :secure depreacted new equivalents are :never, :accept_new_or_local_tunnel :accept_new :always) [Jared Beck, #595]
133
+
134
+ === 5.0.0.rc2
135
+
136
+ * Add .dll extensions to dlopen on cygwin [#603]
137
+ * Fix host certificate validation [#601]
138
+
139
+ === 5.0.0.rc1
140
+
141
+ * Fix larger than 4GB file transfers [#599]
142
+ * Update HTTP proxy to version 1.1 [Connor Dunn, #597]
143
+
144
+ === 5.0.0.beta2
145
+
146
+ * Support for sha256 pubkey fingerprint [Tom Maher, #585]
147
+ * Don't try to load default_keys if key_data option is used [Josh Larson, #589]
148
+ * Added fingerprint_hash defaulting to SHA256 as fingerprint format, and MD5 can be used as an option [Miklós Fazekas, #591]
149
+
150
+ === 5.0.0.beta1
151
+
152
+ * Don't leave proxy command as zombie on timeout [DimitriosLisenko, #560]
153
+ * Use OpenSSL for aes*-ctr for up to 5x throughput improvement [Miklós Fazekas, Harald Sitter, #570]
154
+ * Optimize slice! usage in CTR for up to 2x throughput improvement [Harald Sitter, #569]
155
+ * Replace RbNaCl dependency with ed25519 gem [Tony Arcieri ,#563]
156
+ * Add initial Match support [Kasumi Hanazuki, #553]
157
+
158
+ === 4.2.0.rc2
159
+
160
+ * Fix double close bug on auth failure (or ruby 2.2 or earlier) [#538]
161
+
162
+ === 4.2.0.rc1
163
+
164
+ * Improved logging with proxy command [Dmitriy Ivliev, #530]
165
+ * Close transport on proxy error [adamruzicka, #526]
166
+ * Support multiple identity files [Kimura Masayuki, #528]
167
+ * Move `none` cipher to end of cipher list [Brian Cain, #525]
168
+ * Deprecate `:paranoid` in favor of `:verify_host_key` [Jared Beck, #524]
169
+ * Support Multile Include ssh config files [Kasumi Hanazuki, #516]
170
+ * Support Relative path in ssh confif files [Akinori MUSHA, #510]
171
+ * add direct-streamlocal@openssh.com support in Forward class [Harald Sitter, #502]
172
+
173
+ === 4.1.0
174
+ === 4.1.0.rc1
175
+
176
+ * ProxyJump support [Ryan McGeary, #500]
177
+ * Fix agent detection on Windows [Christian Koehler, #495]
178
+
179
+ === 4.1.0.beta1
180
+
181
+ * Fix nil error when libsodium is not there [chapmajs ,#488]
182
+ * SSH certificate support for client auth [David Bartley, #485]
183
+
184
+ === 4.0.1
185
+ === 4.0.1.rc2
186
+
187
+ * ENV["HOME"] might be empty so filter non expandable paths [Matt Casper, #351]
188
+
189
+ === 4.0.1.rc1
190
+
191
+ * support of rbnacl 4.0 and better error message [#479]
192
+ * support include in config files [Kimura Masayuki, #475]
193
+ * fixed issue with ruby 2.2 or older on windows [#472]
194
+
195
+ === 4.0.0
196
+ === 4.0.0.rc3
197
+
198
+ * parse `+` character in config files [Christoph Lupprich, #470, #314]
199
+
200
+ === 4.0.0.rc2
201
+
202
+ * Fixed OpenSSL 2.0/Ruby 2.4.0 warnings [Miklós Fazekas, #468]
203
+ * Added ssh-ed25519 to KnownHosts:SUPPORTED_TYPE [detatka-kuzlatka-otevrete, Miklós Fazekas, #459]
204
+ * Allow nil for :passhrase and passing in nil option is now a depreaction warning [Miklós Fazekas, #465]
205
+
206
+ === 4.0.0.rc1
207
+
208
+ * Allow :password to be nil for capistrano v2 compatibility [Will Bryant, #357]
209
+ * In next_packet if prefer consuming buffer before filling it again if we have enough data [Miklós Fazekas, #454]
210
+
211
+ === 4.0.0.beta4
212
+
213
+ * Added exitstatus method to exec's return [Miklós Fazekas, #452]
214
+ * Don't raise from exec if server closes transport just after channel close [Miklós Fazekas, #450]
215
+ * Removed java_pageant, as jruby should be using regular pagent impl [Miklós Fazekas, ]
216
+ * Use SSH_AUTH_SOCK if possible on windows (cygwin) [Miklós Fazekas, Martin Dürst, #365, #361]
217
+ * HTTPS proxy support [Marcus Ilgner, #432]
218
+ * Supports ruby 2.4.0.dev new exception type from OpenSSL::PKey.read
219
+
220
+ === 4.0.0.beta3
221
+
222
+ * Fix Net::SSH::Disconnect exceptions when channels are closed cleanly [Miklos Fazekas, #421, #422]
223
+
224
+ === 4.0.0.beta2
225
+
226
+ * Fix raiseUnlessLoaded undefined ERROR issue [Miklos Fazekas, #418]
227
+
228
+ === 4.0.0.beta1
229
+
230
+ * Fix pageant [elconas, #235]
231
+ * Relaxed rbnacl,rbnacl-selenium contstraints ang give better errors about them [Miklos Fazekas, #398]
232
+ * Fix UTF-8 encoding issues [Ethan J. Brown, #407]
233
+
234
+ === 4.0.0.alpha4
235
+
236
+ * Experimental event loop abstraction [Miklos Fazekas]
237
+ * RbNacl dependency is optional [Miklos Fazekas]
238
+ * agent_socket_factory option [Alon Goldboim]
239
+ * client sends KEXINIT, it doesn't have to wait for server [Miklos Fazekas]
240
+ * better error message when option is nil [Kane Morgan]
241
+ * prompting can be customized [Miklos Fazekas]
242
+
243
+ === 4.0.0.alpha3
244
+
245
+ * added max_select_wait_time [Eugene Kenny]
246
+
247
+ === 4.0.0.alpha2
248
+
249
+ * when transport closes we're cleaning up channels [Miklos Fazekas]
250
+
251
+ === 4.0.0.alpha1
252
+
253
+ * ed25519 key support [Miklos Fazekas]
254
+ * removed camellia [Miklos Fazekas]
255
+
256
+ === 3.1.0
257
+ === 3.1.0.rc1
258
+
259
+ * fix Secure#verify [Jean Boussier]
260
+ * use the smallest of don't spend longer time than keepalive if it's configured [Eugene Kenny]
261
+
262
+ === 3.1.0.beta3
263
+
264
+ * forward/on_open_failed should stop listning closed socket otherwise it locks #269 [Miklos Fazekas,Scott McGillivray]
265
+ * fix incorrect pattern handling in config files #310 [Miklos Fazekas]
266
+
267
+ === 3.1.0.beta2
268
+
269
+ * trying to execute something on a not yet opend channel throws nicer messag [Miklos Fazekas]
270
+ * calling close on a not opened channel marks the channel for close [Miklos Fazekas]
271
+ * read keepalive configuration from ssh config files [Miklos Fazekas]
272
+ * send client version on hadshake before waiting for server to reduce handshake time [Miklos Fazekas]
273
+ * allow custom Net::SSH::KnownHosts implementations [Jean Boussier]
274
+ * memoize known host so we only search it once per session [Jean Boussier, Miklos Fazekas]
275
+
276
+ === 3.0.2
277
+ === 3.0.2.rc1
278
+
279
+ * fixed rare WaitWritable error with proxy commands [Miklos Fazkas, Andre Meij]]
280
+ * if Net::SSH.start user is nil and config has no entry we default to Etc.getlogin
281
+ * Bugfix: CHANNEL_CLOSE was sent before draining ouput buffer #280 [Christopher F. Auston]
282
+
283
+ === 3.0.1
284
+ === 3.0.1.rc1
285
+
286
+ * Breaking change from 2.* series: exec! without block now returns empty string instread of nil if command has no output [https://github.com/net-ssh/net-ssh/pull/273]
287
+ * Support remote_user as %r in proxy commands [Dominic Scheirlinck]
288
+ * Raise Net::SSH::ConnectionTimeout from connection timeout [Carl Hoerberg]
289
+
290
+ === 3.0.0.rc1
291
+
292
+ * SemVer: Major version change because of dropping of ruby 1.9
293
+
294
+ === 2.10.1.rc2
295
+
296
+ * Win: Use fiddle on ruby 2.1 too [Charlie Savage]
297
+
298
+ === 2.10.1.rc1
299
+
300
+ * Added ruby 2.0 requirement to gemspec [Alex Schultz]
301
+
302
+ === 2.10.0
303
+
304
+ === 2.10.0-beta2
305
+
306
+ * Fix :passphrase option with :non_interactive [Jeremy Stanley]
307
+ * Use Socket.tcp with connect_timeout instead of Timeout::timeout [Carl Hörberg]
308
+ * Support for hostname hashes [Jef Mathiot]
309
+ * Ruby 1.9.3 is no longer supported but should moslty work expect for stuff like connect_timeout
310
+
311
+ === 2.10.0-beta1
312
+
313
+ * Fix could not parse PKey error. [Andrey Voronkov]
314
+ * Workaround for threading issue in MRI + singleton method declaration [Matt Brictson]
315
+ * Configuration change: we no longer append all supported algorithms, this is so you can exclude insecure algorithms. If you want to use the old behaviour specify append_all_supported_algorithms => true [voidus, mfazekas]
316
+ * New configuration option: :non_interactive => true in case you prefer an authmethod to fail rather than prompt. [mfazekas]
317
+ * Configuration change: password will now ask for password up to the :number_of_password_prompts times. If you want the
318
+ 2.9.1 behaviour of never asking password please set number_of_password_prompts to 0.
319
+
320
+ === 2.9.4-beta1
321
+
322
+ * Use sysread and syswrite on Windows instead of read_nonblock and write [marc-etienne]
323
+ * Windows/peagant: use fiddle on ruby 2.2+/windows [Charlie Savage]
324
+ * Check if ssh key is a file [kiela]
325
+
326
+ === 2.9.3
327
+
328
+ === 2.9.2-rc3
329
+
330
+ * Remove advertised algorithms that were not working (curve25519-sha256@libssh.org) [mfazekas]
331
+
332
+ === 2.9.2-rc2
333
+
334
+ * number_of_password_prompts is now accepted as ssh option, by setting it 0 net-ssh will not ask for password for password auth as with previous versions [mfazekas]
335
+
336
+ === 2.9.2-rc1
337
+
338
+ * Documentation fixes and refactoring to keepalive [detiber, mfazekas]
339
+
340
+ === 2.9.2-beta
341
+
342
+ * Remove advertised algorithms that were not working (ssh-rsa-cert-* *ed25519 acm*-gcm@openssh.com) [mfazekas]
343
+ * Unknown algorithms now ignored instead of failed [mfazekas]
344
+ * Configuration change: Asks for password with password auth (up to number_of_password_prompts) [mfazekas]
345
+ * Removed warnings [amatsuda]
346
+
347
+ === 2.9.1 / 13 May 2014
348
+
349
+ * Fix for unknown response from agent on Windows with 64-bit PuTTY [chrahunt]
350
+ * Support negative patterns in host lookup from the SSH config file [nirvdrum]
351
+
352
+
353
+ === 2.9.0 / 30 Apr 2014
354
+
355
+ * New ciphers [chr4]
356
+ * Added host keys: ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v00@openssh.com ssh-ed25519-cert-v01@openssh.com ssh-ed25519
357
+ * Added HMACs: hmac-sha2-512-etm@openssh.com hmac-sha2-256-etm@openssh.com umac-128-etm@openssh.com
358
+ * Added Kex: aes256-gcm@openssh.com aes128-gcm@openssh.com curve25519-sha256@libssh.org
359
+ * Added private key support for id_ed25519
360
+ * IdentiesOnly will not disable ssh_agent - fixes #148 and new fix for #137 [mfazekas]
361
+ * Ignore errors during ssh agent negotiation [simonswine, jasiek]
362
+ * Added an optional "options" argument to test socket open method [jefmathiot]
363
+ * Added gem signing (again) with new cert [delano]
364
+
365
+
366
+ === 2.8.1 / 19 Feb 2014
367
+
368
+ * Correct location of global known_hosts files [mfischer-zd]
369
+ * Fix for password authentication [blackpond, zachlipton, delano]
370
+
371
+
372
+ === 2.8.0 / 01 Feb 2014
373
+
374
+ * Handle ssh-rsa and ssh-dss certificate files [bobveznat]
375
+ * Correctly interpret /etc/ssh_config Authentication settings based on openssh /etc/ssh_config system defaults [therealjessesanford, liggitt]
376
+ * Fixed pageant support for Windows [jarredholman]
377
+ * Support %r in ProxyCommand configuration in ssh_config files as defined in OpenSSH [yugui]
378
+ * Don't use ssh-agent if :keys_only is true [SFEley]
379
+ * Fix the bug in keys with comments [bobtfish]
380
+ * Add a failing tests for options in pub keys [bobtfish]
381
+ * Assert that the return value from ssh block is returned [carlhoerberg]
382
+ * Don't close the connection it's already closed [carlhoerberg]
383
+ * Ensure the connection closes even on exception [carlhoerberg]
384
+ * Make the authentication error message more useful [deric]
385
+ * Fix "ConnectionError" typo in lib/net/ssh/proxy/socks5.rb [mirakui]
386
+ * Allow KeyManager to recover from incompatible agents [ecki, delano]
387
+ * Fix for "Authentication Method determination can pick up a class from the root namespace" [dave.sieh]
1
388
 
2
389
 
3
390
  === 2.7.0 / 11 Sep 2013
data/DEVELOPMENT.md ADDED
@@ -0,0 +1,23 @@
1
+ ### Development notes
2
+
3
+ ## Building/running ssh server in debug mode
4
+
5
+ clone the openssh server from `https://github.com/openssh/openssh-portable`
6
+
7
+ ```sh
8
+ brew install openssl
9
+ /usr/local/Cellar/openssl@3/3.1.0/bin/openssl
10
+
11
+ autoreconf
12
+ ./configure --with-ssl-dir=/usr/local/Cellar/openssl@3/3.1.0/ --with-audit=debug --enable-debug CPPFLAGS="-DDEBUG -DPACKET_DEBUG" CFLAGS="-g -O0"
13
+ make
14
+ ```
15
+
16
+ To run server in debug mode:
17
+ ```sh
18
+ echo '#' > /tmp/sshd_config
19
+ ssh-keygen -t rsa -f /tmp/ssh_host_rsa_key
20
+ # /Users/boga/Work/OSS/NetSSH/openssh-portable/sshd -p 2222 -D -d -d -d -e -f /tmp/sshd_config
21
+ /Users/boga/Work/OSS/NetSSH/openssh-portable/sshd -p 2222 -D -d -d -d -e -f /tmp/sshd_config -h /tmp/ssh_host_rsa_key
22
+
23
+ ```
data/Dockerfile ADDED
@@ -0,0 +1,29 @@
1
+ ARG RUBY_VERSION=3.1
2
+ FROM ruby:${RUBY_VERSION}
3
+
4
+ ARG BUNDLERV=
5
+
6
+ RUN apt update && apt install -y openssh-server sudo netcat-openbsd \
7
+ && useradd --create-home --shell '/bin/bash' --comment 'NetSSH' 'net_ssh_1' \
8
+ && useradd --create-home --shell '/bin/bash' --comment 'NetSSH' 'net_ssh_2' \
9
+ && echo net_ssh_1:foopwd | chpasswd \
10
+ && echo net_ssh_2:foo2pwd | chpasswd \
11
+ && mkdir -p /home/net_ssh_1/.ssh \
12
+ && mkdir -p /home/net_ssh_2/.ssh \
13
+ && echo "net_ssh_1 ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
14
+ && echo "net_ssh_2 ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
15
+ && ssh-keygen -f /etc/ssh/users_ca -N ''
16
+
17
+ ENV INSTALL_PATH="/netssh"
18
+
19
+ WORKDIR $INSTALL_PATH
20
+
21
+ COPY Gemfile net-ssh.gemspec $INSTALL_PATH/
22
+
23
+ COPY lib/net/ssh/version.rb $INSTALL_PATH/lib/net/ssh/version.rb
24
+
25
+ RUN gem install bundler ${BUNDLERV} && bundle install
26
+
27
+ COPY . $INSTALL_PATH/
28
+
29
+ CMD service ssh start && rake test && NET_SSH_NO_ED25519=1 rake test
@@ -0,0 +1,17 @@
1
+ FROM ubuntu:22.04
2
+
3
+ ENV INSTALL_PATH="/netssh"
4
+
5
+ RUN apt update && apt install -y openssl ruby ruby-dev git build-essential
6
+
7
+ WORKDIR $INSTALL_PATH
8
+
9
+ COPY Gemfile net-ssh.gemspec $INSTALL_PATH/
10
+
11
+ COPY lib/net/ssh/version.rb $INSTALL_PATH/lib/net/ssh/version.rb
12
+
13
+ RUN ls -l && gem install bundler && bundle install
14
+
15
+ COPY . $INSTALL_PATH/
16
+
17
+ CMD openssl version && ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' && rake test
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mygem.gemspec
4
+ gemspec
5
+
6
+ gem 'byebug', group: %i[development test] if !Gem.win_platform? && RUBY_ENGINE == "ruby"
7
+
8
+ if ENV["CI"]
9
+ gem 'codecov', require: false, group: :test
10
+ gem 'simplecov', require: false, group: :test
11
+ end
12
+
13
+ gem 'webrick', group: %i[development test] if RUBY_VERSION.split(".")[0].to_i >= 3
data/Gemfile.noed25519 ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ ENV['NET_SSH_NO_ED25519'] = 'true'
4
+ # Specify your gem's dependencies in mygem.gemspec
5
+ gemspec
6
+
7
+ if ENV["CI"] && !Gem.win_platform?
8
+ gem 'simplecov', require: false, group: :test
9
+ gem 'codecov', require: false, group: :test
10
+ end
11
+
12
+ gem 'webrick', group: %i[development test] if RUBY_VERSION.split(".")[0].to_i >= 3
data/Gemfile.norbnacl ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ ENV['NET_SSH_NO_RBNACL'] = 'true'
4
+ # Specify your gem's dependencies in mygem.gemspec
5
+ gemspec
6
+
7
+ if ENV["CI"] && !Gem.win_platform?
8
+ gem 'simplecov', require: false, group: :test
9
+ gem 'codecov', require: false, group: :test
10
+ end
11
+
12
+ gem 'webrick', group: %i[development test] if RUBY_VERSION.split(".")[0].to_i >= 3
data/ISSUE_TEMPLATE.md ADDED
@@ -0,0 +1,30 @@
1
+ ### Expected behavior
2
+
3
+ Tell us what should happen
4
+
5
+ ### Actual behavior
6
+
7
+ Tell us what happens instead.
8
+
9
+ ### System configuration
10
+
11
+ - net-ssh version
12
+ - Ruby version
13
+
14
+ ### Example App
15
+
16
+ Please provide an example script that reproduces the problem. This will save maintainers time so they can spend it fixing your issues instead of trying to build a reproduction case from sparse instructions.
17
+
18
+ You can use this as stating point:
19
+
20
+ ```ruby
21
+ gem 'net-ssh', '= 4.0.0.beta3'
22
+ require 'net/ssh'
23
+ puts Net::SSH::Version::CURRENT
24
+
25
+ @host = 'localhost'
26
+ @user = ENV['USER']
27
+ Net::SSH.start(@host, @user) do |ssh|
28
+ puts ssh.exec!('echo "hello"')
29
+ end
30
+ ```
data/Manifest CHANGED
@@ -33,7 +33,6 @@ lib/net/ssh/proxy/errors.rb
33
33
  lib/net/ssh/proxy/http.rb
34
34
  lib/net/ssh/proxy/socks4.rb
35
35
  lib/net/ssh/proxy/socks5.rb
36
- lib/net/ssh/ruby_compat.rb
37
36
  lib/net/ssh/service/forward.rb
38
37
  lib/net/ssh/test.rb
39
38
  lib/net/ssh/test/channel.rb
@@ -75,10 +74,10 @@ lib/net/ssh/transport/packet_stream.rb
75
74
  lib/net/ssh/transport/server_version.rb
76
75
  lib/net/ssh/transport/session.rb
77
76
  lib/net/ssh/transport/state.rb
78
- lib/net/ssh/verifiers/lenient.rb
79
- lib/net/ssh/verifiers/null.rb
80
- lib/net/ssh/verifiers/secure.rb
81
- lib/net/ssh/verifiers/strict.rb
77
+ lib/net/ssh/verifiers/accept_new.rb
78
+ lib/net/ssh/verifiers/accept_new_or_local_tunnel.rb
79
+ lib/net/ssh/verifiers/always.rb
80
+ lib/net/ssh/verifiers/never.rb
82
81
  lib/net/ssh/version.rb
83
82
  net-ssh.gemspec
84
83
  setup.rb