tttls1.3 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/example/helper.rb +21 -0
- data/example/https_client_using_0rtt.rb +1 -1
- data/example/https_server.rb +14 -1
- data/lib/tttls1.3/client.rb +205 -418
- data/lib/tttls1.3/connection.rb +21 -362
- data/lib/tttls1.3/ech.rb +410 -0
- data/lib/tttls1.3/endpoint.rb +276 -0
- data/lib/tttls1.3/message/certificate_verify.rb +1 -1
- data/lib/tttls1.3/message/extension/ech.rb +12 -10
- data/lib/tttls1.3/message/extension/signature_algorithms.rb +2 -2
- data/lib/tttls1.3/message/extension/supported_versions.rb +3 -3
- data/lib/tttls1.3/message/extension/unknown_extension.rb +2 -2
- data/lib/tttls1.3/server.rb +125 -63
- data/lib/tttls1.3/utils.rb +37 -0
- data/lib/tttls1.3/version.rb +1 -1
- data/lib/tttls1.3.rb +2 -1
- data/spec/client_spec.rb +21 -60
- data/spec/ech_spec.rb +39 -0
- data/spec/{connection_spec.rb → endpoint_spec.rb} +41 -49
- data/spec/server_spec.rb +12 -12
- metadata +7 -6
- data/lib/tttls1.3/hpke.rb +0 -91
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7245602faa9087e83b3e47484aa88dc368b153e98c76fd00e36ebb1a863af6ef
|
4
|
+
data.tar.gz: c7362f39fc26763f712cdf61a29b3796686c50034d2a6431788d8dbf7dd505c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33168ef27007f9e6d73197ed3e1bae9b58dadfdf3042e732ddc6a05913db0aad48fb653ea7b7222716d70ebe42739f2d9dddee0ec75ee45eb33daba4be6f0229
|
7
|
+
data.tar.gz: d05c73a49e0f5d568785c3b6af3d9bc3c286b35f1110c5f31860f8cf788a9f9e019112fd8647394672c279808e20c4f02d438a58c44f5bab9af1d5fb851ef41f
|
data/Gemfile
CHANGED
data/example/helper.rb
CHANGED
@@ -62,3 +62,24 @@ def recv_http_response(client)
|
|
62
62
|
parser << client.read until client.eof?
|
63
63
|
buf
|
64
64
|
end
|
65
|
+
|
66
|
+
def transcript_htmlize(transcript)
|
67
|
+
m = {
|
68
|
+
TTTLS13::CH1 => 'ClientHello',
|
69
|
+
TTTLS13::HRR => 'HelloRetryRequest',
|
70
|
+
TTTLS13::CH => 'ClientHello',
|
71
|
+
TTTLS13::SH => 'ServerHello',
|
72
|
+
TTTLS13::EE => 'EncryptedExtensions',
|
73
|
+
TTTLS13::CR => 'CertificateRequest',
|
74
|
+
TTTLS13::CT => 'Certificate',
|
75
|
+
TTTLS13::CV => 'CertificateVerify',
|
76
|
+
TTTLS13::SF => 'Finished',
|
77
|
+
TTTLS13::EOED => 'EndOfEarlyData',
|
78
|
+
TTTLS13::CCT => 'Certificate',
|
79
|
+
TTTLS13::CCV => 'CertificateVerify',
|
80
|
+
TTTLS13::CF => 'Finished'
|
81
|
+
}.map { |k, v| [k, '<details><summary>' + v + '</summary>%s</details>'] }.to_h
|
82
|
+
transcript.map do |k, v|
|
83
|
+
format(m[k], TTTLS13::Convert.obj2html(v.first))
|
84
|
+
end.join('<br>')
|
85
|
+
end
|
@@ -15,7 +15,7 @@ process_new_session_ticket = lambda do |nst, rms, cs|
|
|
15
15
|
return if Time.now.to_i - nst.timestamp > nst.ticket_lifetime
|
16
16
|
|
17
17
|
settings_2nd[:ticket] = nst.ticket
|
18
|
-
settings_2nd[:
|
18
|
+
settings_2nd[:resumption_secret] = rms
|
19
19
|
settings_2nd[:psk_cipher_suite] = cs
|
20
20
|
settings_2nd[:ticket_nonce] = nst.ticket_nonce
|
21
21
|
settings_2nd[:ticket_age_add] = nst.ticket_age_add
|
data/example/https_server.rb
CHANGED
@@ -30,7 +30,20 @@ Etc.nprocessors.times do
|
|
30
30
|
parser.on_message_complete = lambda do
|
31
31
|
if !parser.http_method.nil?
|
32
32
|
logger.info 'Receive Request'
|
33
|
-
|
33
|
+
html = <<HTML
|
34
|
+
<!DOCTYPE html>
|
35
|
+
<html>
|
36
|
+
<head>
|
37
|
+
<meta charset="UTF-8" />
|
38
|
+
<title>tttls1.3 test server</title>
|
39
|
+
</head>
|
40
|
+
<body>
|
41
|
+
%s
|
42
|
+
</body>
|
43
|
+
</html>
|
44
|
+
HTML
|
45
|
+
html = format(html, transcript_htmlize(server.transcript))
|
46
|
+
server.write(simple_http_response(html))
|
34
47
|
server.close
|
35
48
|
else
|
36
49
|
logger.warn 'Not Request'
|