crussh 0.1.0-aarch64-linux

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 (82) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +371 -0
  5. data/lib/crussh/auth.rb +46 -0
  6. data/lib/crussh/channel/key_parser.rb +125 -0
  7. data/lib/crussh/channel.rb +381 -0
  8. data/lib/crussh/cipher/algorithm.rb +31 -0
  9. data/lib/crussh/cipher/chacha20poly1305.rb +98 -0
  10. data/lib/crussh/cipher.rb +25 -0
  11. data/lib/crussh/compression.rb +42 -0
  12. data/lib/crussh/crypto/3.4/poly1305.so +0 -0
  13. data/lib/crussh/crypto/4.0/poly1305.so +0 -0
  14. data/lib/crussh/gatekeeper.rb +50 -0
  15. data/lib/crussh/handler/line_buffer.rb +131 -0
  16. data/lib/crussh/handler.rb +128 -0
  17. data/lib/crussh/heartbeat.rb +68 -0
  18. data/lib/crussh/kex/algorithm.rb +86 -0
  19. data/lib/crussh/kex/curve25519.rb +30 -0
  20. data/lib/crussh/kex/exchange.rb +234 -0
  21. data/lib/crussh/kex.rb +42 -0
  22. data/lib/crussh/keys/key_pair.rb +61 -0
  23. data/lib/crussh/keys/public_key.rb +35 -0
  24. data/lib/crussh/keys.rb +70 -0
  25. data/lib/crussh/limits.rb +45 -0
  26. data/lib/crussh/logger.rb +95 -0
  27. data/lib/crussh/mac/algorithm.rb +23 -0
  28. data/lib/crussh/mac/crypto.rb +60 -0
  29. data/lib/crussh/mac/none.rb +9 -0
  30. data/lib/crussh/mac.rb +28 -0
  31. data/lib/crussh/negotiator.rb +41 -0
  32. data/lib/crussh/preferred.rb +16 -0
  33. data/lib/crussh/protocol/channel_close.rb +11 -0
  34. data/lib/crussh/protocol/channel_data.rb +12 -0
  35. data/lib/crussh/protocol/channel_eof.rb +11 -0
  36. data/lib/crussh/protocol/channel_extended_data.rb +13 -0
  37. data/lib/crussh/protocol/channel_failure.rb +11 -0
  38. data/lib/crussh/protocol/channel_open.rb +69 -0
  39. data/lib/crussh/protocol/channel_open_confirmation.rb +15 -0
  40. data/lib/crussh/protocol/channel_open_failure.rb +14 -0
  41. data/lib/crussh/protocol/channel_request.rb +146 -0
  42. data/lib/crussh/protocol/channel_success.rb +11 -0
  43. data/lib/crussh/protocol/channel_window_adjust.rb +12 -0
  44. data/lib/crussh/protocol/debug.rb +15 -0
  45. data/lib/crussh/protocol/disconnect.rb +39 -0
  46. data/lib/crussh/protocol/ext_info.rb +48 -0
  47. data/lib/crussh/protocol/global_request.rb +46 -0
  48. data/lib/crussh/protocol/ignore.rb +11 -0
  49. data/lib/crussh/protocol/kex_ecdh_init.rb +11 -0
  50. data/lib/crussh/protocol/kex_ecdh_reply.rb +13 -0
  51. data/lib/crussh/protocol/kex_init.rb +38 -0
  52. data/lib/crussh/protocol/new_keys.rb +9 -0
  53. data/lib/crussh/protocol/ping.rb +11 -0
  54. data/lib/crussh/protocol/pong.rb +11 -0
  55. data/lib/crussh/protocol/request_failure.rb +9 -0
  56. data/lib/crussh/protocol/request_success.rb +11 -0
  57. data/lib/crussh/protocol/service_accept.rb +11 -0
  58. data/lib/crussh/protocol/service_request.rb +11 -0
  59. data/lib/crussh/protocol/unimplemented.rb +11 -0
  60. data/lib/crussh/protocol/userauth_banner.rb +12 -0
  61. data/lib/crussh/protocol/userauth_failure.rb +12 -0
  62. data/lib/crussh/protocol/userauth_pk_ok.rb +12 -0
  63. data/lib/crussh/protocol/userauth_request.rb +52 -0
  64. data/lib/crussh/protocol/userauth_success.rb +9 -0
  65. data/lib/crussh/protocol.rb +135 -0
  66. data/lib/crussh/server/auth_handler.rb +18 -0
  67. data/lib/crussh/server/config.rb +157 -0
  68. data/lib/crussh/server/layers/connection.rb +363 -0
  69. data/lib/crussh/server/layers/transport.rb +49 -0
  70. data/lib/crussh/server/layers/userauth.rb +232 -0
  71. data/lib/crussh/server/request_rule.rb +76 -0
  72. data/lib/crussh/server/session.rb +192 -0
  73. data/lib/crussh/server.rb +214 -0
  74. data/lib/crussh/ssh_id.rb +44 -0
  75. data/lib/crussh/transport/packet_stream.rb +245 -0
  76. data/lib/crussh/transport/reader.rb +98 -0
  77. data/lib/crussh/transport/version_exchange.rb +26 -0
  78. data/lib/crussh/transport/writer.rb +72 -0
  79. data/lib/crussh/version.rb +5 -0
  80. data/lib/crussh.rb +61 -0
  81. data/sig/crussh.rbs +4 -0
  82. metadata +240 -0
data/lib/crussh.rb ADDED
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "zeitwerk"
4
+ require "securerandom"
5
+ require "async"
6
+ require "io/endpoint"
7
+ require "io/endpoint/host_endpoint"
8
+
9
+ loader = Zeitwerk::Loader.for_gem
10
+ loader.inflector.inflect("chacha20poly1305" => "ChaCha20Poly1305")
11
+ loader.ignore("#{__dir__}/crussh/crypto")
12
+ loader.setup
13
+
14
+ begin
15
+ RUBY_VERSION =~ /(\d+\.\d+)/
16
+ require "crussh/crypto/#{Regexp.last_match(1)}/poly1305"
17
+ rescue LoadError
18
+ require "crussh/crypto/poly1305"
19
+ end
20
+
21
+ module Crussh
22
+ Algorithms = Data.define(
23
+ :kex,
24
+ :host_key,
25
+ :cipher_client_to_server,
26
+ :cipher_server_to_client,
27
+ :mac_client_to_server,
28
+ :mac_server_to_client,
29
+ :compression_client_to_server,
30
+ :compression_server_to_client,
31
+ )
32
+
33
+ class Error < StandardError; end
34
+
35
+ class ConfigError < Error; end
36
+ class ProtocolError < Error; end
37
+
38
+ class PacketError < Error; end
39
+ class PacketTooLarge < PacketError; end
40
+ class PacketTooSmall < PacketError; end
41
+ class InvalidPadding < PacketError; end
42
+ class IncompletePacket < PacketError; end
43
+
44
+ class NegotiationError < ProtocolError; end
45
+
46
+ class KexError < ProtocolError; end
47
+
48
+ class ConnectionError < Error; end
49
+ class TimeoutError < ConnectionError; end
50
+ class ConnectionClosed < ConnectionError; end
51
+
52
+ class CryptoError < Error; end
53
+ class UnknownAlgorithm < CryptoError; end
54
+ class DecryptionError < CryptoError; end
55
+ class SignatureError < CryptoError; end
56
+ class KeyError < CryptoError; end
57
+
58
+ class ChannelError < Error; end
59
+ class ChannelClosed < ChannelError; end
60
+ class ChannelWindowExhausted < ChannelError; end
61
+ end
data/sig/crussh.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Crussh
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,240 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crussh
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: aarch64-linux
6
+ authors:
7
+ - MSILycanthropy
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-01-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '8.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '8.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: async
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ed25519
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '1.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '1.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: io-endpoint
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: io-stream
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0.1'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: ssh_data
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 2.0.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: x25519
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: 1.0.10
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.10
111
+ - !ruby/object:Gem::Dependency
112
+ name: zeitwerk
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '2'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '2'
125
+ description:
126
+ email:
127
+ - ethanmichaelk@gmail.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - CHANGELOG.md
133
+ - LICENSE.txt
134
+ - README.md
135
+ - lib/crussh.rb
136
+ - lib/crussh/auth.rb
137
+ - lib/crussh/channel.rb
138
+ - lib/crussh/channel/key_parser.rb
139
+ - lib/crussh/cipher.rb
140
+ - lib/crussh/cipher/algorithm.rb
141
+ - lib/crussh/cipher/chacha20poly1305.rb
142
+ - lib/crussh/compression.rb
143
+ - lib/crussh/crypto/3.4/poly1305.so
144
+ - lib/crussh/crypto/4.0/poly1305.so
145
+ - lib/crussh/gatekeeper.rb
146
+ - lib/crussh/handler.rb
147
+ - lib/crussh/handler/line_buffer.rb
148
+ - lib/crussh/heartbeat.rb
149
+ - lib/crussh/kex.rb
150
+ - lib/crussh/kex/algorithm.rb
151
+ - lib/crussh/kex/curve25519.rb
152
+ - lib/crussh/kex/exchange.rb
153
+ - lib/crussh/keys.rb
154
+ - lib/crussh/keys/key_pair.rb
155
+ - lib/crussh/keys/public_key.rb
156
+ - lib/crussh/limits.rb
157
+ - lib/crussh/logger.rb
158
+ - lib/crussh/mac.rb
159
+ - lib/crussh/mac/algorithm.rb
160
+ - lib/crussh/mac/crypto.rb
161
+ - lib/crussh/mac/none.rb
162
+ - lib/crussh/negotiator.rb
163
+ - lib/crussh/preferred.rb
164
+ - lib/crussh/protocol.rb
165
+ - lib/crussh/protocol/channel_close.rb
166
+ - lib/crussh/protocol/channel_data.rb
167
+ - lib/crussh/protocol/channel_eof.rb
168
+ - lib/crussh/protocol/channel_extended_data.rb
169
+ - lib/crussh/protocol/channel_failure.rb
170
+ - lib/crussh/protocol/channel_open.rb
171
+ - lib/crussh/protocol/channel_open_confirmation.rb
172
+ - lib/crussh/protocol/channel_open_failure.rb
173
+ - lib/crussh/protocol/channel_request.rb
174
+ - lib/crussh/protocol/channel_success.rb
175
+ - lib/crussh/protocol/channel_window_adjust.rb
176
+ - lib/crussh/protocol/debug.rb
177
+ - lib/crussh/protocol/disconnect.rb
178
+ - lib/crussh/protocol/ext_info.rb
179
+ - lib/crussh/protocol/global_request.rb
180
+ - lib/crussh/protocol/ignore.rb
181
+ - lib/crussh/protocol/kex_ecdh_init.rb
182
+ - lib/crussh/protocol/kex_ecdh_reply.rb
183
+ - lib/crussh/protocol/kex_init.rb
184
+ - lib/crussh/protocol/new_keys.rb
185
+ - lib/crussh/protocol/ping.rb
186
+ - lib/crussh/protocol/pong.rb
187
+ - lib/crussh/protocol/request_failure.rb
188
+ - lib/crussh/protocol/request_success.rb
189
+ - lib/crussh/protocol/service_accept.rb
190
+ - lib/crussh/protocol/service_request.rb
191
+ - lib/crussh/protocol/unimplemented.rb
192
+ - lib/crussh/protocol/userauth_banner.rb
193
+ - lib/crussh/protocol/userauth_failure.rb
194
+ - lib/crussh/protocol/userauth_pk_ok.rb
195
+ - lib/crussh/protocol/userauth_request.rb
196
+ - lib/crussh/protocol/userauth_success.rb
197
+ - lib/crussh/server.rb
198
+ - lib/crussh/server/auth_handler.rb
199
+ - lib/crussh/server/config.rb
200
+ - lib/crussh/server/layers/connection.rb
201
+ - lib/crussh/server/layers/transport.rb
202
+ - lib/crussh/server/layers/userauth.rb
203
+ - lib/crussh/server/request_rule.rb
204
+ - lib/crussh/server/session.rb
205
+ - lib/crussh/ssh_id.rb
206
+ - lib/crussh/transport/packet_stream.rb
207
+ - lib/crussh/transport/reader.rb
208
+ - lib/crussh/transport/version_exchange.rb
209
+ - lib/crussh/transport/writer.rb
210
+ - lib/crussh/version.rb
211
+ - sig/crussh.rbs
212
+ homepage: https://github.com/MSILycanthropy/crussh
213
+ licenses:
214
+ - MIT
215
+ metadata:
216
+ homepage_uri: https://github.com/MSILycanthropy/crussh
217
+ source_code_uri: https://github.com/MSILycanthropy/crussh
218
+ post_install_message:
219
+ rdoc_options: []
220
+ require_paths:
221
+ - lib
222
+ required_ruby_version: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - ">="
225
+ - !ruby/object:Gem::Version
226
+ version: '3.4'
227
+ - - "<"
228
+ - !ruby/object:Gem::Version
229
+ version: 4.1.dev
230
+ required_rubygems_version: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - ">="
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ requirements: []
236
+ rubygems_version: 3.5.23
237
+ signing_key:
238
+ specification_version: 4
239
+ summary: A lowish-level SSH server library for Ruby
240
+ test_files: []