hrr_rb_ssh 0.1.9 → 0.2.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 +4 -4
- data/.travis.yml +12 -2
- data/README.md +11 -9
- data/demo/echo_server.rb +50 -42
- data/demo/server.rb +81 -62
- data/demo/subsystem_echo_server.rb +54 -47
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm/ecdsa_sha2_nistp521 → algorithm/publickey/ecdsa_sha2}/ecdsa_signature_blob.rb +3 -3
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm/ecdsa_sha2_nistp256 → algorithm/publickey/ecdsa_sha2}/public_key_blob.rb +5 -6
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm/ecdsa_sha2_nistp256 → algorithm/publickey/ecdsa_sha2}/signature.rb +5 -5
- data/lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2.rb +85 -0
- data/lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2_nistp256.rb +19 -0
- data/lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2_nistp384.rb +19 -0
- data/lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2_nistp521.rb +19 -0
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm → algorithm/publickey}/ssh_dss/public_key_blob.rb +3 -3
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm → algorithm/publickey}/ssh_dss/signature.rb +4 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_dss.rb +90 -0
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm → algorithm/publickey}/ssh_rsa/public_key_blob.rb +3 -4
- data/lib/hrr_rb_ssh/{transport/server_host_key_algorithm → algorithm/publickey}/ssh_rsa/signature.rb +4 -4
- data/lib/hrr_rb_ssh/algorithm/publickey/ssh_rsa.rb +67 -0
- data/lib/hrr_rb_ssh/algorithm/publickey.rb +32 -0
- data/lib/hrr_rb_ssh/algorithm.rb +9 -0
- data/lib/hrr_rb_ssh/authentication/method/none/context.rb +1 -1
- data/lib/hrr_rb_ssh/authentication/method/none.rb +1 -1
- data/lib/hrr_rb_ssh/authentication/method/password/context.rb +1 -1
- data/lib/hrr_rb_ssh/authentication/method/password.rb +1 -1
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256.rb +2 -65
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384.rb +2 -65
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521.rb +2 -65
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/functionable.rb +54 -0
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/signature_blob.rb +31 -0
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss.rb +2 -73
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa.rb +2 -55
- data/lib/hrr_rb_ssh/authentication/method/publickey.rb +3 -3
- data/lib/hrr_rb_ssh/authentication.rb +15 -15
- data/lib/hrr_rb_ssh/codable.rb +1 -1
- data/lib/hrr_rb_ssh/compat/openssh/public_key.rb +3 -40
- data/lib/hrr_rb_ssh/compat/ruby/array.rb +14 -0
- data/lib/hrr_rb_ssh/compat/ruby/openssl/bn.rb +20 -0
- data/lib/hrr_rb_ssh/compat/ruby/openssl.rb +4 -0
- data/lib/hrr_rb_ssh/compat/ruby/queue.rb +38 -0
- data/lib/hrr_rb_ssh/compat/ruby.rb +6 -0
- data/lib/hrr_rb_ssh/compat.rb +1 -63
- data/lib/hrr_rb_ssh/connection/channel/channel_type/direct_tcpip.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/forwarded_tcpip.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain/chain_context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/proc_chain.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env/context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/env.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/exec/context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/exec.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/pty_req/context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/pty_req.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/shell/context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/shell.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/subsystem/context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/subsystem.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/window_change/context.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session/request_type/window_change.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel/channel_type/session.rb +1 -1
- data/lib/hrr_rb_ssh/connection/channel.rb +22 -22
- data/lib/hrr_rb_ssh/connection/global_request_handler.rb +1 -1
- data/lib/hrr_rb_ssh/connection/request_handler/reference_env_request_handler.rb +1 -1
- data/lib/hrr_rb_ssh/connection/request_handler/reference_exec_request_handler.rb +3 -56
- data/lib/hrr_rb_ssh/connection/request_handler/reference_pty_req_request_handler.rb +50 -13
- data/lib/hrr_rb_ssh/connection/request_handler/reference_shell_request_handler.rb +3 -56
- data/lib/hrr_rb_ssh/connection/request_handler/reference_window_change_request_handler.rb +1 -1
- data/lib/hrr_rb_ssh/connection/request_handler.rb +1 -1
- data/lib/hrr_rb_ssh/connection.rb +40 -40
- data/lib/hrr_rb_ssh/data_type.rb +0 -3
- data/lib/hrr_rb_ssh/error/closed_authentication.rb +9 -0
- data/lib/hrr_rb_ssh/{closed_transport_error.rb → error/closed_connection.rb} +3 -1
- data/lib/hrr_rb_ssh/{closed_authentication_error.rb → error/closed_transport.rb} +3 -1
- data/lib/hrr_rb_ssh/error.rb +11 -0
- data/lib/hrr_rb_ssh/{closed_connection_error.rb → mode.rb} +3 -1
- data/lib/hrr_rb_ssh/server.rb +23 -0
- data/lib/hrr_rb_ssh/transport/compression_algorithm/functionable.rb +1 -1
- data/lib/hrr_rb_ssh/transport/compression_algorithm/unfunctionable.rb +1 -1
- data/lib/hrr_rb_ssh/transport/encryption_algorithm/functionable.rb +3 -3
- data/lib/hrr_rb_ssh/transport/encryption_algorithm/unfunctionable.rb +1 -1
- data/lib/hrr_rb_ssh/transport/kex_algorithm/diffie_hellman.rb +8 -48
- data/lib/hrr_rb_ssh/transport/kex_algorithm/diffie_hellman_group_exchange.rb +11 -51
- data/lib/hrr_rb_ssh/transport/kex_algorithm/elliptic_curve_diffie_hellman.rb +8 -48
- data/lib/hrr_rb_ssh/transport/kex_algorithm/iv_computable.rb +57 -0
- data/lib/hrr_rb_ssh/transport/mac_algorithm/functionable.rb +2 -2
- data/lib/hrr_rb_ssh/transport/mac_algorithm/unfunctionable.rb +1 -1
- data/lib/hrr_rb_ssh/transport/receiver.rb +1 -1
- data/lib/hrr_rb_ssh/transport/sender.rb +1 -1
- data/lib/hrr_rb_ssh/transport/sequence_number.rb +1 -1
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb +2 -56
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384.rb +2 -56
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp521.rb +2 -56
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/functionable.rb +29 -0
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_dss.rb +2 -50
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_rsa.rb +2 -31
- data/lib/hrr_rb_ssh/transport.rb +83 -81
- data/lib/hrr_rb_ssh/version.rb +1 -1
- data/lib/hrr_rb_ssh.rb +4 -0
- metadata +32 -37
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/ecdsa_signature_blob.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/public_key_blob.rb +0 -28
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/signature.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/signature_blob.rb +0 -33
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/ecdsa_signature_blob.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/public_key_blob.rb +0 -28
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/signature.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/signature_blob.rb +0 -33
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521/ecdsa_signature_blob.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521/public_key_blob.rb +0 -28
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521/signature.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521/signature_blob.rb +0 -33
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss/public_key_blob.rb +0 -30
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss/signature.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss/signature_blob.rb +0 -33
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa/public_key_blob.rb +0 -28
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa/signature.rb +0 -27
- data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa/signature_blob.rb +0 -33
- data/lib/hrr_rb_ssh/transport/mode.rb +0 -11
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256/ecdsa_signature_blob.rb +0 -23
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384/ecdsa_signature_blob.rb +0 -23
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384/public_key_blob.rb +0 -25
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384/signature.rb +0 -23
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp521/public_key_blob.rb +0 -25
- data/lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp521/signature.rb +0 -23
data/lib/hrr_rb_ssh/transport.rb
CHANGED
|
@@ -6,9 +6,8 @@ require 'hrr_rb_ssh/version'
|
|
|
6
6
|
require 'hrr_rb_ssh/logger'
|
|
7
7
|
require 'hrr_rb_ssh/data_type'
|
|
8
8
|
require 'hrr_rb_ssh/message'
|
|
9
|
-
require 'hrr_rb_ssh/
|
|
9
|
+
require 'hrr_rb_ssh/error/closed_transport'
|
|
10
10
|
require 'hrr_rb_ssh/transport/constant'
|
|
11
|
-
require 'hrr_rb_ssh/transport/mode'
|
|
12
11
|
require 'hrr_rb_ssh/transport/direction'
|
|
13
12
|
require 'hrr_rb_ssh/transport/sequence_number'
|
|
14
13
|
require 'hrr_rb_ssh/transport/sender'
|
|
@@ -55,24 +54,24 @@ module HrrRbSsh
|
|
|
55
54
|
@mode = mode
|
|
56
55
|
@options = options
|
|
57
56
|
|
|
58
|
-
@logger =
|
|
57
|
+
@logger = Logger.new self.class.name
|
|
59
58
|
|
|
60
59
|
@closed = nil
|
|
61
60
|
@disconnected = nil
|
|
62
61
|
|
|
63
62
|
@in_kex = false
|
|
64
63
|
|
|
65
|
-
@sender =
|
|
66
|
-
@receiver =
|
|
64
|
+
@sender = Sender.new
|
|
65
|
+
@receiver = Receiver.new
|
|
67
66
|
|
|
68
67
|
@sender_monitor = Monitor.new
|
|
69
68
|
@receiver_monitor = Monitor.new
|
|
70
69
|
|
|
71
|
-
@local_version = "SSH-2.0-HrrRbSsh-#{
|
|
70
|
+
@local_version = "SSH-2.0-HrrRbSsh-#{VERSION}".force_encoding(Encoding::ASCII_8BIT)
|
|
72
71
|
@remote_version = "".force_encoding(Encoding::ASCII_8BIT)
|
|
73
72
|
|
|
74
|
-
@incoming_sequence_number =
|
|
75
|
-
@outgoing_sequence_number =
|
|
73
|
+
@incoming_sequence_number = SequenceNumber.new
|
|
74
|
+
@outgoing_sequence_number = SequenceNumber.new
|
|
76
75
|
|
|
77
76
|
@acceptable_services = Array.new
|
|
78
77
|
|
|
@@ -93,40 +92,40 @@ module HrrRbSsh
|
|
|
93
92
|
rescue Errno::EPIPE => e
|
|
94
93
|
@logger.warn { "IO is Broken PIPE" }
|
|
95
94
|
close
|
|
96
|
-
raise
|
|
95
|
+
raise Error::ClosedTransport
|
|
97
96
|
rescue => e
|
|
98
97
|
@logger.error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
|
|
99
98
|
close
|
|
100
|
-
raise
|
|
99
|
+
raise Error::ClosedTransport
|
|
101
100
|
end
|
|
102
101
|
end
|
|
103
102
|
end
|
|
104
103
|
|
|
105
104
|
def receive
|
|
106
|
-
raise
|
|
105
|
+
raise Error::ClosedTransport if @closed
|
|
107
106
|
@receiver_monitor.synchronize do
|
|
108
107
|
begin
|
|
109
108
|
payload = @receiver.receive self
|
|
110
109
|
case payload[0,1].unpack("C")[0]
|
|
111
|
-
when
|
|
112
|
-
message =
|
|
110
|
+
when Message::SSH_MSG_DISCONNECT::VALUE
|
|
111
|
+
message = Message::SSH_MSG_DISCONNECT.decode payload
|
|
113
112
|
@logger.debug { "received disconnect message: #{message.inspect}" }
|
|
114
113
|
@disconnected = true
|
|
115
114
|
close
|
|
116
|
-
raise
|
|
117
|
-
when
|
|
118
|
-
message =
|
|
115
|
+
raise Error::ClosedTransport
|
|
116
|
+
when Message::SSH_MSG_IGNORE::VALUE
|
|
117
|
+
message = Message::SSH_MSG_IGNORE.decode payload
|
|
119
118
|
@logger.debug { "received ignore message: #{message.inspect}" }
|
|
120
119
|
receive
|
|
121
|
-
when
|
|
122
|
-
message =
|
|
120
|
+
when Message::SSH_MSG_UNIMPLEMENTED::VALUE
|
|
121
|
+
message = Message::SSH_MSG_UNIMPLEMENTED.decode payload
|
|
123
122
|
@logger.debug { "received unimplemented message: #{message.inspect}" }
|
|
124
123
|
receive
|
|
125
|
-
when
|
|
126
|
-
message =
|
|
124
|
+
when Message::SSH_MSG_DEBUG::VALUE
|
|
125
|
+
message = Message::SSH_MSG_DEBUG.decode payload
|
|
127
126
|
@logger.debug { "received debug message: #{message.inspect}" }
|
|
128
127
|
receive
|
|
129
|
-
when
|
|
128
|
+
when Message::SSH_MSG_KEXINIT::VALUE
|
|
130
129
|
@logger.debug { "received kexinit message" }
|
|
131
130
|
if @in_kex
|
|
132
131
|
payload
|
|
@@ -137,23 +136,23 @@ module HrrRbSsh
|
|
|
137
136
|
else
|
|
138
137
|
payload
|
|
139
138
|
end
|
|
140
|
-
rescue
|
|
141
|
-
raise
|
|
139
|
+
rescue Error::ClosedTransport
|
|
140
|
+
raise Error::ClosedTransport
|
|
142
141
|
rescue EOFError => e
|
|
143
142
|
close
|
|
144
|
-
raise
|
|
143
|
+
raise Error::ClosedTransport
|
|
145
144
|
rescue IOError => e
|
|
146
145
|
@logger.warn { "IO is closed" }
|
|
147
146
|
close
|
|
148
|
-
raise
|
|
147
|
+
raise Error::ClosedTransport
|
|
149
148
|
rescue Errno::ECONNRESET => e
|
|
150
149
|
@logger.warn { "IO is RESET" }
|
|
151
150
|
close
|
|
152
|
-
raise
|
|
151
|
+
raise Error::ClosedTransport
|
|
153
152
|
rescue => e
|
|
154
153
|
@logger.error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
|
|
155
154
|
close
|
|
156
|
-
raise
|
|
155
|
+
raise Error::ClosedTransport
|
|
157
156
|
end
|
|
158
157
|
end
|
|
159
158
|
end
|
|
@@ -166,7 +165,7 @@ module HrrRbSsh
|
|
|
166
165
|
exchange_key
|
|
167
166
|
|
|
168
167
|
case @mode
|
|
169
|
-
when
|
|
168
|
+
when Mode::SERVER
|
|
170
169
|
verify_service_request
|
|
171
170
|
end
|
|
172
171
|
|
|
@@ -250,19 +249,19 @@ module HrrRbSsh
|
|
|
250
249
|
end
|
|
251
250
|
|
|
252
251
|
def update_supported_algorithms
|
|
253
|
-
@supported_kex_algorithms =
|
|
254
|
-
@supported_server_host_key_algorithms =
|
|
255
|
-
@supported_encryption_algorithms =
|
|
256
|
-
@supported_mac_algorithms =
|
|
257
|
-
@supported_compression_algorithms =
|
|
252
|
+
@supported_kex_algorithms = KexAlgorithm.list_supported
|
|
253
|
+
@supported_server_host_key_algorithms = ServerHostKeyAlgorithm.list_supported
|
|
254
|
+
@supported_encryption_algorithms = EncryptionAlgorithm.list_supported
|
|
255
|
+
@supported_mac_algorithms = MacAlgorithm.list_supported
|
|
256
|
+
@supported_compression_algorithms = CompressionAlgorithm.list_supported
|
|
258
257
|
end
|
|
259
258
|
|
|
260
259
|
def update_preferred_algorithms
|
|
261
|
-
@preferred_kex_algorithms = @options['transport_preferred_kex_algorithms'] ||
|
|
262
|
-
@preferred_server_host_key_algorithms = @options['transport_preferred_server_host_key_algorithms'] ||
|
|
263
|
-
@preferred_encryption_algorithms = @options['transport_preferred_encryption_algorithms'] ||
|
|
264
|
-
@preferred_mac_algorithms = @options['transport_preferred_mac_algorithms'] ||
|
|
265
|
-
@preferred_compression_algorithms = @options['transport_preferred_compression_algorithms'] ||
|
|
260
|
+
@preferred_kex_algorithms = @options['transport_preferred_kex_algorithms'] || KexAlgorithm.list_preferred
|
|
261
|
+
@preferred_server_host_key_algorithms = @options['transport_preferred_server_host_key_algorithms'] || ServerHostKeyAlgorithm.list_preferred
|
|
262
|
+
@preferred_encryption_algorithms = @options['transport_preferred_encryption_algorithms'] || EncryptionAlgorithm.list_preferred
|
|
263
|
+
@preferred_mac_algorithms = @options['transport_preferred_mac_algorithms'] || MacAlgorithm.list_preferred
|
|
264
|
+
@preferred_compression_algorithms = @options['transport_preferred_compression_algorithms'] || CompressionAlgorithm.list_preferred
|
|
266
265
|
|
|
267
266
|
check_if_preferred_algorithms_are_supported
|
|
268
267
|
end
|
|
@@ -295,13 +294,13 @@ module HrrRbSsh
|
|
|
295
294
|
end
|
|
296
295
|
|
|
297
296
|
def initialize_algorithms
|
|
298
|
-
@incoming_encryption_algorithm =
|
|
299
|
-
@incoming_mac_algorithm =
|
|
300
|
-
@incoming_compression_algorithm =
|
|
297
|
+
@incoming_encryption_algorithm = EncryptionAlgorithm['none'].new
|
|
298
|
+
@incoming_mac_algorithm = MacAlgorithm['none'].new
|
|
299
|
+
@incoming_compression_algorithm = CompressionAlgorithm['none'].new
|
|
301
300
|
|
|
302
|
-
@outgoing_encryption_algorithm =
|
|
303
|
-
@outgoing_mac_algorithm =
|
|
304
|
-
@outgoing_compression_algorithm =
|
|
301
|
+
@outgoing_encryption_algorithm = EncryptionAlgorithm['none'].new
|
|
302
|
+
@outgoing_mac_algorithm = MacAlgorithm['none'].new
|
|
303
|
+
@outgoing_compression_algorithm = CompressionAlgorithm['none'].new
|
|
305
304
|
end
|
|
306
305
|
|
|
307
306
|
def send_version
|
|
@@ -309,15 +308,18 @@ module HrrRbSsh
|
|
|
309
308
|
end
|
|
310
309
|
|
|
311
310
|
def receive_version
|
|
312
|
-
|
|
311
|
+
str_io = StringIO.new
|
|
313
312
|
loop do
|
|
314
|
-
|
|
315
|
-
if
|
|
316
|
-
if
|
|
317
|
-
@remote_version =
|
|
313
|
+
str_io.write @io.read(1)
|
|
314
|
+
if str_io.string[-2..-1] == "#{CR}#{LF}"
|
|
315
|
+
if str_io.string[0..3] == "SSH-"
|
|
316
|
+
@remote_version = str_io.string[0..-3]
|
|
317
|
+
@logger.info { "received remote version string: #{@remote_version}" }
|
|
318
318
|
break
|
|
319
319
|
else
|
|
320
|
-
|
|
320
|
+
@logger.info { "received message before remote version string: #{str_io.string}" }
|
|
321
|
+
str_io.rewind
|
|
322
|
+
str_io.truncate(0)
|
|
321
323
|
end
|
|
322
324
|
end
|
|
323
325
|
end
|
|
@@ -325,10 +327,10 @@ module HrrRbSsh
|
|
|
325
327
|
|
|
326
328
|
def update_version_strings
|
|
327
329
|
case @mode
|
|
328
|
-
when
|
|
330
|
+
when Mode::SERVER
|
|
329
331
|
@v_c = @remote_version
|
|
330
332
|
@v_s = @local_version
|
|
331
|
-
when
|
|
333
|
+
when Mode::CLIENT
|
|
332
334
|
@v_c = @local_version
|
|
333
335
|
@v_s = @remote_version
|
|
334
336
|
end
|
|
@@ -336,18 +338,18 @@ module HrrRbSsh
|
|
|
336
338
|
|
|
337
339
|
def send_disconnect
|
|
338
340
|
message = {
|
|
339
|
-
:'message number' =>
|
|
340
|
-
:'reason code' =>
|
|
341
|
+
:'message number' => Message::SSH_MSG_DISCONNECT::VALUE,
|
|
342
|
+
:'reason code' => Message::SSH_MSG_DISCONNECT::ReasonCode::SSH_DISCONNECT_BY_APPLICATION,
|
|
341
343
|
:'description' => "disconnected by user",
|
|
342
344
|
:'language tag' => ""
|
|
343
345
|
}
|
|
344
|
-
payload =
|
|
346
|
+
payload = Message::SSH_MSG_DISCONNECT.encode message
|
|
345
347
|
send payload
|
|
346
348
|
end
|
|
347
349
|
|
|
348
350
|
def send_kexinit
|
|
349
351
|
message = {
|
|
350
|
-
:'message number' =>
|
|
352
|
+
:'message number' => Message::SSH_MSG_KEXINIT::VALUE,
|
|
351
353
|
:'cookie (random byte)' => lambda { rand(0x01_00) },
|
|
352
354
|
:'kex_algorithms' => @local_kex_algorithms,
|
|
353
355
|
:'server_host_key_algorithms' => @local_server_host_key_algorithms,
|
|
@@ -362,53 +364,53 @@ module HrrRbSsh
|
|
|
362
364
|
:'first_kex_packet_follows' => false,
|
|
363
365
|
:'0 (reserved for future extension)' => 0,
|
|
364
366
|
}
|
|
365
|
-
payload =
|
|
367
|
+
payload = Message::SSH_MSG_KEXINIT.encode message
|
|
366
368
|
send payload
|
|
367
369
|
|
|
368
370
|
case @mode
|
|
369
|
-
when
|
|
371
|
+
when Mode::SERVER
|
|
370
372
|
@i_s = payload
|
|
371
|
-
when
|
|
373
|
+
when Mode::CLIENT
|
|
372
374
|
@i_c = payload
|
|
373
375
|
end
|
|
374
376
|
end
|
|
375
377
|
|
|
376
378
|
def receive_kexinit payload
|
|
377
379
|
case @mode
|
|
378
|
-
when
|
|
380
|
+
when Mode::SERVER
|
|
379
381
|
@i_c = payload
|
|
380
|
-
when
|
|
382
|
+
when Mode::CLIENT
|
|
381
383
|
@i_s = payload
|
|
382
384
|
end
|
|
383
|
-
message =
|
|
385
|
+
message = Message::SSH_MSG_KEXINIT.decode payload
|
|
384
386
|
update_remote_algorithms message
|
|
385
387
|
end
|
|
386
388
|
|
|
387
389
|
def send_newkeys
|
|
388
390
|
message = {
|
|
389
|
-
:'message number' =>
|
|
391
|
+
:'message number' => Message::SSH_MSG_NEWKEYS::VALUE,
|
|
390
392
|
}
|
|
391
|
-
payload =
|
|
393
|
+
payload = Message::SSH_MSG_NEWKEYS.encode message
|
|
392
394
|
send payload
|
|
393
395
|
end
|
|
394
396
|
|
|
395
397
|
def receive_newkeys payload
|
|
396
|
-
message =
|
|
398
|
+
message = Message::SSH_MSG_NEWKEYS.decode payload
|
|
397
399
|
end
|
|
398
400
|
|
|
399
401
|
def receive_service_request
|
|
400
402
|
payload = @receiver.receive self
|
|
401
|
-
message =
|
|
403
|
+
message = Message::SSH_MSG_SERVICE_REQUEST.decode payload
|
|
402
404
|
|
|
403
405
|
message
|
|
404
406
|
end
|
|
405
407
|
|
|
406
408
|
def send_service_accept service_name
|
|
407
409
|
message = {
|
|
408
|
-
:'message number' =>
|
|
410
|
+
:'message number' => Message::SSH_MSG_SERVICE_ACCEPT::VALUE,
|
|
409
411
|
:'service name' => service_name,
|
|
410
412
|
}
|
|
411
|
-
payload =
|
|
413
|
+
payload = Message::SSH_MSG_SERVICE_ACCEPT.encode message
|
|
412
414
|
send payload
|
|
413
415
|
end
|
|
414
416
|
|
|
@@ -425,17 +427,17 @@ module HrrRbSsh
|
|
|
425
427
|
|
|
426
428
|
def update_kex_and_server_host_key_algorithms
|
|
427
429
|
case @mode
|
|
428
|
-
when
|
|
430
|
+
when Mode::SERVER
|
|
429
431
|
kex_algorithm_name = @remote_kex_algorithms.find{ |a| @local_kex_algorithms.include? a } or raise
|
|
430
432
|
server_host_key_algorithm_name = @remote_server_host_key_algorithms.find{ |a| @local_server_host_key_algorithms.include? a } or raise
|
|
431
|
-
when
|
|
433
|
+
when Mode::CLIENT
|
|
432
434
|
kex_algorithm_name = @local_kex_algorithms.find{ |a| @remote_kex_algorithms.include? a } or raise
|
|
433
435
|
server_host_key_algorithm_name = @local_server_host_key_algorithms.find{ |a| @remote_server_host_key_algorithms.include? a } or raise
|
|
434
436
|
end
|
|
435
437
|
|
|
436
438
|
server_secret_host_key = @options.fetch('transport_server_secret_host_keys', {}).fetch(server_host_key_algorithm_name, nil)
|
|
437
|
-
@kex_algorithm =
|
|
438
|
-
@server_host_key_algorithm =
|
|
439
|
+
@kex_algorithm = KexAlgorithm[kex_algorithm_name].new
|
|
440
|
+
@server_host_key_algorithm = ServerHostKeyAlgorithm[server_host_key_algorithm_name].new server_secret_host_key
|
|
439
441
|
end
|
|
440
442
|
|
|
441
443
|
def update_encryption_mac_compression_algorithms
|
|
@@ -447,7 +449,7 @@ module HrrRbSsh
|
|
|
447
449
|
|
|
448
450
|
def update_encryption_algorithm
|
|
449
451
|
case @mode
|
|
450
|
-
when
|
|
452
|
+
when Mode::SERVER
|
|
451
453
|
encryption_algorithm_c_to_s_name = @remote_encryption_algorithms_client_to_server.find{ |a| @local_encryption_algorithms_client_to_server.include? a } or raise
|
|
452
454
|
encryption_algorithm_s_to_c_name = @remote_encryption_algorithms_server_to_client.find{ |a| @local_encryption_algorithms_server_to_client.include? a } or raise
|
|
453
455
|
incoming_encryption_algorithm_name = encryption_algorithm_c_to_s_name
|
|
@@ -457,13 +459,13 @@ module HrrRbSsh
|
|
|
457
459
|
incoming_crpt_key = @kex_algorithm.key_c_to_s self, incoming_encryption_algorithm_name
|
|
458
460
|
outgoing_crpt_key = @kex_algorithm.key_s_to_c self, outgoing_encryption_algorithm_name
|
|
459
461
|
end
|
|
460
|
-
@incoming_encryption_algorithm =
|
|
461
|
-
@outgoing_encryption_algorithm =
|
|
462
|
+
@incoming_encryption_algorithm = EncryptionAlgorithm[incoming_encryption_algorithm_name].new Direction::INCOMING, incoming_crpt_iv, incoming_crpt_key
|
|
463
|
+
@outgoing_encryption_algorithm = EncryptionAlgorithm[outgoing_encryption_algorithm_name].new Direction::OUTGOING, outgoing_crpt_iv, outgoing_crpt_key
|
|
462
464
|
end
|
|
463
465
|
|
|
464
466
|
def update_mac_algorithm
|
|
465
467
|
case @mode
|
|
466
|
-
when
|
|
468
|
+
when Mode::SERVER
|
|
467
469
|
mac_algorithm_c_to_s_name = @remote_mac_algorithms_client_to_server.find{ |a| @local_mac_algorithms_client_to_server.include? a } or raise
|
|
468
470
|
mac_algorithm_s_to_c_name = @remote_mac_algorithms_server_to_client.find{ |a| @local_mac_algorithms_server_to_client.include? a } or raise
|
|
469
471
|
incoming_mac_algorithm_name = mac_algorithm_c_to_s_name
|
|
@@ -471,13 +473,13 @@ module HrrRbSsh
|
|
|
471
473
|
incoming_mac_key = @kex_algorithm.mac_c_to_s self, incoming_mac_algorithm_name
|
|
472
474
|
outgoing_mac_key = @kex_algorithm.mac_s_to_c self, outgoing_mac_algorithm_name
|
|
473
475
|
end
|
|
474
|
-
@incoming_mac_algorithm =
|
|
475
|
-
@outgoing_mac_algorithm =
|
|
476
|
+
@incoming_mac_algorithm = MacAlgorithm[incoming_mac_algorithm_name].new incoming_mac_key
|
|
477
|
+
@outgoing_mac_algorithm = MacAlgorithm[outgoing_mac_algorithm_name].new outgoing_mac_key
|
|
476
478
|
end
|
|
477
479
|
|
|
478
480
|
def update_compression_algorithm
|
|
479
481
|
case @mode
|
|
480
|
-
when
|
|
482
|
+
when Mode::SERVER
|
|
481
483
|
compression_algorithm_c_to_s_name = @remote_compression_algorithms_client_to_server.find{ |a| @local_compression_algorithms_client_to_server.include? a } or raise
|
|
482
484
|
compression_algorithm_s_to_c_name = @remote_compression_algorithms_server_to_client.find{ |a| @local_compression_algorithms_server_to_client.include? a } or raise
|
|
483
485
|
incoming_compression_algorithm_name = compression_algorithm_c_to_s_name
|
|
@@ -485,8 +487,8 @@ module HrrRbSsh
|
|
|
485
487
|
end
|
|
486
488
|
@incoming_compression_algorithm.close
|
|
487
489
|
@outgoing_compression_algorithm.close
|
|
488
|
-
@incoming_compression_algorithm =
|
|
489
|
-
@outgoing_compression_algorithm =
|
|
490
|
+
@incoming_compression_algorithm = CompressionAlgorithm[incoming_compression_algorithm_name].new Direction::INCOMING
|
|
491
|
+
@outgoing_compression_algorithm = CompressionAlgorithm[outgoing_compression_algorithm_name].new Direction::OUTGOING
|
|
490
492
|
end
|
|
491
493
|
end
|
|
492
494
|
end
|
data/lib/hrr_rb_ssh/version.rb
CHANGED
data/lib/hrr_rb_ssh.rb
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
require "hrr_rb_ssh/version"
|
|
5
5
|
require "hrr_rb_ssh/compat"
|
|
6
6
|
require "hrr_rb_ssh/logger"
|
|
7
|
+
require "hrr_rb_ssh/mode"
|
|
8
|
+
require "hrr_rb_ssh/algorithm"
|
|
9
|
+
require "hrr_rb_ssh/error"
|
|
7
10
|
require "hrr_rb_ssh/transport"
|
|
8
11
|
require "hrr_rb_ssh/authentication"
|
|
9
12
|
require "hrr_rb_ssh/connection"
|
|
13
|
+
require "hrr_rb_ssh/server"
|
|
10
14
|
|
|
11
15
|
module HrrRbSsh
|
|
12
16
|
# Your code goes here...
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hrr_rb_ssh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hirura
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-05-
|
|
11
|
+
date: 2018-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -86,6 +86,21 @@ files:
|
|
|
86
86
|
- demo/subsystem_echo_server.rb
|
|
87
87
|
- hrr_rb_ssh.gemspec
|
|
88
88
|
- lib/hrr_rb_ssh.rb
|
|
89
|
+
- lib/hrr_rb_ssh/algorithm.rb
|
|
90
|
+
- lib/hrr_rb_ssh/algorithm/publickey.rb
|
|
91
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2.rb
|
|
92
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2/ecdsa_signature_blob.rb
|
|
93
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2/public_key_blob.rb
|
|
94
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2/signature.rb
|
|
95
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2_nistp256.rb
|
|
96
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2_nistp384.rb
|
|
97
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ecdsa_sha2_nistp521.rb
|
|
98
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ssh_dss.rb
|
|
99
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ssh_dss/public_key_blob.rb
|
|
100
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ssh_dss/signature.rb
|
|
101
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ssh_rsa.rb
|
|
102
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ssh_rsa/public_key_blob.rb
|
|
103
|
+
- lib/hrr_rb_ssh/algorithm/publickey/ssh_rsa/signature.rb
|
|
89
104
|
- lib/hrr_rb_ssh/authentication.rb
|
|
90
105
|
- lib/hrr_rb_ssh/authentication/authenticator.rb
|
|
91
106
|
- lib/hrr_rb_ssh/authentication/method.rb
|
|
@@ -96,37 +111,23 @@ files:
|
|
|
96
111
|
- lib/hrr_rb_ssh/authentication/method/publickey.rb
|
|
97
112
|
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm.rb
|
|
98
113
|
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256.rb
|
|
99
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/ecdsa_signature_blob.rb
|
|
100
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/public_key_blob.rb
|
|
101
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/signature.rb
|
|
102
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/signature_blob.rb
|
|
103
114
|
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384.rb
|
|
104
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/ecdsa_signature_blob.rb
|
|
105
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/public_key_blob.rb
|
|
106
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/signature.rb
|
|
107
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp384/signature_blob.rb
|
|
108
115
|
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521.rb
|
|
109
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/
|
|
110
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/
|
|
111
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521/signature.rb
|
|
112
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp521/signature_blob.rb
|
|
116
|
+
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/functionable.rb
|
|
117
|
+
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/signature_blob.rb
|
|
113
118
|
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss.rb
|
|
114
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss/public_key_blob.rb
|
|
115
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss/signature.rb
|
|
116
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_dss/signature_blob.rb
|
|
117
119
|
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa.rb
|
|
118
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa/public_key_blob.rb
|
|
119
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa/signature.rb
|
|
120
|
-
- lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ssh_rsa/signature_blob.rb
|
|
121
120
|
- lib/hrr_rb_ssh/authentication/method/publickey/context.rb
|
|
122
|
-
- lib/hrr_rb_ssh/closed_authentication_error.rb
|
|
123
|
-
- lib/hrr_rb_ssh/closed_connection_error.rb
|
|
124
|
-
- lib/hrr_rb_ssh/closed_transport_error.rb
|
|
125
121
|
- lib/hrr_rb_ssh/codable.rb
|
|
126
122
|
- lib/hrr_rb_ssh/compat.rb
|
|
127
123
|
- lib/hrr_rb_ssh/compat/openssh.rb
|
|
128
124
|
- lib/hrr_rb_ssh/compat/openssh/authorized_keys.rb
|
|
129
125
|
- lib/hrr_rb_ssh/compat/openssh/public_key.rb
|
|
126
|
+
- lib/hrr_rb_ssh/compat/ruby.rb
|
|
127
|
+
- lib/hrr_rb_ssh/compat/ruby/array.rb
|
|
128
|
+
- lib/hrr_rb_ssh/compat/ruby/openssl.rb
|
|
129
|
+
- lib/hrr_rb_ssh/compat/ruby/openssl/bn.rb
|
|
130
|
+
- lib/hrr_rb_ssh/compat/ruby/queue.rb
|
|
130
131
|
- lib/hrr_rb_ssh/connection.rb
|
|
131
132
|
- lib/hrr_rb_ssh/connection/channel.rb
|
|
132
133
|
- lib/hrr_rb_ssh/connection/channel/channel_type.rb
|
|
@@ -156,6 +157,10 @@ files:
|
|
|
156
157
|
- lib/hrr_rb_ssh/connection/request_handler/reference_shell_request_handler.rb
|
|
157
158
|
- lib/hrr_rb_ssh/connection/request_handler/reference_window_change_request_handler.rb
|
|
158
159
|
- lib/hrr_rb_ssh/data_type.rb
|
|
160
|
+
- lib/hrr_rb_ssh/error.rb
|
|
161
|
+
- lib/hrr_rb_ssh/error/closed_authentication.rb
|
|
162
|
+
- lib/hrr_rb_ssh/error/closed_connection.rb
|
|
163
|
+
- lib/hrr_rb_ssh/error/closed_transport.rb
|
|
159
164
|
- lib/hrr_rb_ssh/logger.rb
|
|
160
165
|
- lib/hrr_rb_ssh/message.rb
|
|
161
166
|
- lib/hrr_rb_ssh/message/001_ssh_msg_disconnect.rb
|
|
@@ -193,7 +198,9 @@ files:
|
|
|
193
198
|
- lib/hrr_rb_ssh/message/098_ssh_msg_channel_request.rb
|
|
194
199
|
- lib/hrr_rb_ssh/message/099_ssh_msg_channel_success.rb
|
|
195
200
|
- lib/hrr_rb_ssh/message/100_ssh_msg_channel_failure.rb
|
|
201
|
+
- lib/hrr_rb_ssh/mode.rb
|
|
196
202
|
- lib/hrr_rb_ssh/openssl_secure_random.rb
|
|
203
|
+
- lib/hrr_rb_ssh/server.rb
|
|
197
204
|
- lib/hrr_rb_ssh/subclass_with_preference_listable.rb
|
|
198
205
|
- lib/hrr_rb_ssh/transport.rb
|
|
199
206
|
- lib/hrr_rb_ssh/transport/compression_algorithm.rb
|
|
@@ -236,6 +243,7 @@ files:
|
|
|
236
243
|
- lib/hrr_rb_ssh/transport/kex_algorithm/elliptic_curve_diffie_hellman_sha2_nistp256.rb
|
|
237
244
|
- lib/hrr_rb_ssh/transport/kex_algorithm/elliptic_curve_diffie_hellman_sha2_nistp384.rb
|
|
238
245
|
- lib/hrr_rb_ssh/transport/kex_algorithm/elliptic_curve_diffie_hellman_sha2_nistp521.rb
|
|
246
|
+
- lib/hrr_rb_ssh/transport/kex_algorithm/iv_computable.rb
|
|
239
247
|
- lib/hrr_rb_ssh/transport/mac_algorithm.rb
|
|
240
248
|
- lib/hrr_rb_ssh/transport/mac_algorithm/functionable.rb
|
|
241
249
|
- lib/hrr_rb_ssh/transport/mac_algorithm/hmac_md5.rb
|
|
@@ -246,29 +254,16 @@ files:
|
|
|
246
254
|
- lib/hrr_rb_ssh/transport/mac_algorithm/hmac_sha2_512.rb
|
|
247
255
|
- lib/hrr_rb_ssh/transport/mac_algorithm/none.rb
|
|
248
256
|
- lib/hrr_rb_ssh/transport/mac_algorithm/unfunctionable.rb
|
|
249
|
-
- lib/hrr_rb_ssh/transport/mode.rb
|
|
250
257
|
- lib/hrr_rb_ssh/transport/receiver.rb
|
|
251
258
|
- lib/hrr_rb_ssh/transport/sender.rb
|
|
252
259
|
- lib/hrr_rb_ssh/transport/sequence_number.rb
|
|
253
260
|
- lib/hrr_rb_ssh/transport/server_host_key_algorithm.rb
|
|
254
261
|
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256.rb
|
|
255
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256/ecdsa_signature_blob.rb
|
|
256
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256/public_key_blob.rb
|
|
257
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp256/signature.rb
|
|
258
262
|
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384.rb
|
|
259
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384/ecdsa_signature_blob.rb
|
|
260
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384/public_key_blob.rb
|
|
261
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp384/signature.rb
|
|
262
263
|
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp521.rb
|
|
263
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/
|
|
264
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp521/public_key_blob.rb
|
|
265
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ecdsa_sha2_nistp521/signature.rb
|
|
264
|
+
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/functionable.rb
|
|
266
265
|
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_dss.rb
|
|
267
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_dss/public_key_blob.rb
|
|
268
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_dss/signature.rb
|
|
269
266
|
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_rsa.rb
|
|
270
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_rsa/public_key_blob.rb
|
|
271
|
-
- lib/hrr_rb_ssh/transport/server_host_key_algorithm/ssh_rsa/signature.rb
|
|
272
267
|
- lib/hrr_rb_ssh/version.rb
|
|
273
268
|
homepage: https://github.com/hirura/hrr_rb_ssh
|
|
274
269
|
licenses:
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
# vim: et ts=2 sw=2
|
|
3
|
-
|
|
4
|
-
require 'hrr_rb_ssh/data_type'
|
|
5
|
-
require 'hrr_rb_ssh/codable'
|
|
6
|
-
|
|
7
|
-
module HrrRbSsh
|
|
8
|
-
class Authentication
|
|
9
|
-
class Method
|
|
10
|
-
class Publickey
|
|
11
|
-
class Algorithm
|
|
12
|
-
class EcdsaSha2Nistp256
|
|
13
|
-
module EcdsaSignatureBlob
|
|
14
|
-
class << self
|
|
15
|
-
include Codable
|
|
16
|
-
end
|
|
17
|
-
DEFINITION = [
|
|
18
|
-
[DataType::Mpint, :'r'],
|
|
19
|
-
[DataType::Mpint, :'s'],
|
|
20
|
-
]
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/public_key_blob.rb
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
# vim: et ts=2 sw=2
|
|
3
|
-
|
|
4
|
-
require 'hrr_rb_ssh/data_type'
|
|
5
|
-
require 'hrr_rb_ssh/codable'
|
|
6
|
-
|
|
7
|
-
module HrrRbSsh
|
|
8
|
-
class Authentication
|
|
9
|
-
class Method
|
|
10
|
-
class Publickey
|
|
11
|
-
class Algorithm
|
|
12
|
-
class EcdsaSha2Nistp256
|
|
13
|
-
module PublicKeyBlob
|
|
14
|
-
class << self
|
|
15
|
-
include Codable
|
|
16
|
-
end
|
|
17
|
-
DEFINITION = [
|
|
18
|
-
[DataType::String, :'public key algorithm name'],
|
|
19
|
-
[DataType::String, :'[identifier]'],
|
|
20
|
-
[DataType::String, :'Q'],
|
|
21
|
-
]
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
data/lib/hrr_rb_ssh/authentication/method/publickey/algorithm/ecdsa_sha2_nistp256/signature.rb
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
# vim: et ts=2 sw=2
|
|
3
|
-
|
|
4
|
-
require 'hrr_rb_ssh/data_type'
|
|
5
|
-
require 'hrr_rb_ssh/codable'
|
|
6
|
-
|
|
7
|
-
module HrrRbSsh
|
|
8
|
-
class Authentication
|
|
9
|
-
class Method
|
|
10
|
-
class Publickey
|
|
11
|
-
class Algorithm
|
|
12
|
-
class EcdsaSha2Nistp256
|
|
13
|
-
module Signature
|
|
14
|
-
class << self
|
|
15
|
-
include Codable
|
|
16
|
-
end
|
|
17
|
-
DEFINITION = [
|
|
18
|
-
[DataType::String, :'public key algorithm name'],
|
|
19
|
-
[DataType::String, :'signature blob'],
|
|
20
|
-
]
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|