tttls1.3 0.1.2 → 0.1.3
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/lib/tttls1.3/client.rb +16 -0
- data/lib/tttls1.3/connection.rb +2 -2
- data/lib/tttls1.3/cryptograph/aead.rb +2 -2
- data/lib/tttls1.3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1951707edb6c1281f07975d9632817a783a0e9f69e9e40da6b1fe45487955c2a
|
4
|
+
data.tar.gz: 1c4aa360d27a89a9f81dfa6ae3f744115da70189c641618f8d6b9dd0e4519da9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ee2640200f2384732e9c24c2cdd02aad995b6da04f94a3dcc70cae19ef501f9b90e26cddad399822e9514e2aae1cecf4252d513741234e428f9b94fe8f1de3
|
7
|
+
data.tar.gz: e5de7b6c20bad449cec2a0fb041db8e4d03a12d6932fcef9ee3b579f9b0e35da80e19604b5b328d292a2cb6393de1f3fe515e4289233b09f6cbff916f6d43735
|
data/lib/tttls1.3/client.rb
CHANGED
@@ -133,6 +133,8 @@ module TTTLS13
|
|
133
133
|
loop do
|
134
134
|
case @state
|
135
135
|
when ClientState::START
|
136
|
+
logger.debug('ClientState::START')
|
137
|
+
|
136
138
|
send_client_hello
|
137
139
|
if use_early_data?
|
138
140
|
@early_data_write_cipher \
|
@@ -144,6 +146,8 @@ module TTTLS13
|
|
144
146
|
|
145
147
|
@state = ClientState::WAIT_SH
|
146
148
|
when ClientState::WAIT_SH
|
149
|
+
logger.debug('ClientState::WAIT_SH')
|
150
|
+
|
147
151
|
sh = recv_server_hello
|
148
152
|
terminate(:illegal_parameter) unless valid_sh_legacy_version?
|
149
153
|
terminate(:illegal_parameter) unless valid_sh_legacy_session_id_echo?
|
@@ -201,6 +205,8 @@ module TTTLS13
|
|
201
205
|
@key_schedule.server_handshake_write_iv)
|
202
206
|
@state = ClientState::WAIT_EE
|
203
207
|
when ClientState::WAIT_EE
|
208
|
+
logger.debug('ClientState::WAIT_EE')
|
209
|
+
|
204
210
|
ee = recv_encrypted_extensions
|
205
211
|
terminate(:illegal_parameter) if ee.any_forbidden_extensions?
|
206
212
|
terminate(:unsupported_extension) \
|
@@ -215,6 +221,8 @@ module TTTLS13
|
|
215
221
|
@state = ClientState::WAIT_CERT_CR
|
216
222
|
@state = ClientState::WAIT_FINISHED unless @psk.nil?
|
217
223
|
when ClientState::WAIT_CERT_CR
|
224
|
+
logger.debug('ClientState::WAIT_EE')
|
225
|
+
|
218
226
|
message = recv_message
|
219
227
|
if message.msg_type == Message::HandshakeType::CERTIFICATE
|
220
228
|
@transcript[CT] = ct = message
|
@@ -235,6 +243,8 @@ module TTTLS13
|
|
235
243
|
terminate(:unexpected_message)
|
236
244
|
end
|
237
245
|
when ClientState::WAIT_CERT
|
246
|
+
logger.debug('ClientState::WAIT_EE')
|
247
|
+
|
238
248
|
ct = recv_certificate
|
239
249
|
terminate(:unsupported_extension) \
|
240
250
|
unless ct.certificate_list.map(&:extensions)
|
@@ -246,10 +256,14 @@ module TTTLS13
|
|
246
256
|
|
247
257
|
@state = ClientState::WAIT_CV
|
248
258
|
when ClientState::WAIT_CV
|
259
|
+
logger.debug('ClientState::WAIT_EE')
|
260
|
+
|
249
261
|
recv_certificate_verify
|
250
262
|
terminate(:decrypt_error) unless verify_certificate_verify
|
251
263
|
@state = ClientState::WAIT_FINISHED
|
252
264
|
when ClientState::WAIT_FINISHED
|
265
|
+
logger.debug('ClientState::WAIT_EE')
|
266
|
+
|
253
267
|
recv_finished
|
254
268
|
terminate(:decrypt_error) unless verify_finished
|
255
269
|
send_ccs # compatibility mode
|
@@ -264,6 +278,8 @@ module TTTLS13
|
|
264
278
|
@key_schedule.server_application_write_iv)
|
265
279
|
@state = ClientState::CONNECTED
|
266
280
|
when ClientState::CONNECTED
|
281
|
+
logger.debug('ClientState::WAIT_EE')
|
282
|
+
|
267
283
|
break
|
268
284
|
end
|
269
285
|
end
|
data/lib/tttls1.3/connection.rb
CHANGED
@@ -144,7 +144,7 @@ module TTTLS13
|
|
144
144
|
|
145
145
|
# @param record [TTTLS13::Message::Record]
|
146
146
|
def send_record(record)
|
147
|
-
logger.debug(record.inspect)
|
147
|
+
logger.debug('send ' + record.inspect)
|
148
148
|
@socket.write(record.serialize(@send_record_size))
|
149
149
|
end
|
150
150
|
|
@@ -205,7 +205,7 @@ module TTTLS13
|
|
205
205
|
terminate(:unexpected_message)
|
206
206
|
end
|
207
207
|
|
208
|
-
logger.debug(record.inspect)
|
208
|
+
logger.debug('receive ' + record.inspect)
|
209
209
|
record
|
210
210
|
end
|
211
211
|
|
data/lib/tttls1.3/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tttls1.3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thekuwayama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|