tttls1.3 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 990b3de64c01b392c33e66910d6419cce1ff276a9f957f3479c7aacac6909b00
4
- data.tar.gz: 82702fe41052a5fbd80722f267d0ffe089f56b696d064a0f4b9a4baf59b64b97
3
+ metadata.gz: 1951707edb6c1281f07975d9632817a783a0e9f69e9e40da6b1fe45487955c2a
4
+ data.tar.gz: 1c4aa360d27a89a9f81dfa6ae3f744115da70189c641618f8d6b9dd0e4519da9
5
5
  SHA512:
6
- metadata.gz: 3d61ad9524126642b8ef1505369f2b08543a4f4ddf1a8a8d1ae15a364e29cf648b68b57840053118bc98104fe28d217519770c034bb3caed1d7401c85611f392
7
- data.tar.gz: cd465dcfc8d671e10f1819ce7a49dc5b19b6310cf8855d2a09eec563947685bf2f8b860617399010a4b4c4cd34726410ed4a4b3c7a3c9332888e177feb0f0b9f
6
+ metadata.gz: b6ee2640200f2384732e9c24c2cdd02aad995b6da04f94a3dcc70cae19ef501f9b90e26cddad399822e9514e2aae1cecf4252d513741234e428f9b94fe8f1de3
7
+ data.tar.gz: e5de7b6c20bad449cec2a0fb041db8e4d03a12d6932fcef9ee3b579f9b0e35da80e19604b5b328d292a2cb6393de1f3fe515e4289233b09f6cbff916f6d43735
@@ -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
@@ -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
 
@@ -112,9 +112,9 @@ module TTTLS13
112
112
  #
113
113
  # @return [Integer]
114
114
  def scan_zeros(clear)
115
- i = 0
115
+ i = 1
116
116
  i += 1 while clear[-i] == "\x00"
117
- i
117
+ i - 1
118
118
  end
119
119
  end
120
120
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TTTLS13
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
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.2
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-03 00:00:00.000000000 Z
11
+ date: 2019-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler