tttls1.3 0.2.9 → 0.2.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +32 -0
  3. data/.rubocop.yml +9 -2
  4. data/Gemfile +1 -1
  5. data/README.md +5 -1
  6. data/Rakefile +66 -7
  7. data/example/helper.rb +6 -8
  8. data/example/https_client.rb +1 -1
  9. data/example/https_client_using_0rtt.rb +3 -3
  10. data/example/https_client_using_hrr.rb +1 -1
  11. data/example/https_client_using_hrr_and_ticket.rb +2 -2
  12. data/example/https_client_using_status_request.rb +31 -0
  13. data/example/https_client_using_ticket.rb +2 -2
  14. data/example/https_server.rb +6 -5
  15. data/interop/client_spec.rb +8 -8
  16. data/interop/helper.rb +10 -2
  17. data/interop/server_spec.rb +14 -10
  18. data/lib/tttls1.3.rb +1 -0
  19. data/lib/tttls1.3/client.rb +97 -12
  20. data/lib/tttls1.3/connection.rb +45 -12
  21. data/lib/tttls1.3/cryptograph.rb +1 -1
  22. data/lib/tttls1.3/cryptograph/aead.rb +20 -7
  23. data/lib/tttls1.3/message.rb +1 -1
  24. data/lib/tttls1.3/message/alert.rb +2 -2
  25. data/lib/tttls1.3/message/extension/status_request.rb +73 -17
  26. data/lib/tttls1.3/message/extensions.rb +35 -12
  27. data/lib/tttls1.3/server.rb +40 -13
  28. data/lib/tttls1.3/utils.rb +15 -0
  29. data/lib/tttls1.3/version.rb +1 -1
  30. data/spec/extensions_spec.rb +16 -0
  31. data/spec/fixtures/rsa_rsa.crt +15 -15
  32. data/spec/fixtures/rsa_rsa.key +25 -25
  33. data/spec/fixtures/rsa_rsa_ocsp.crt +18 -0
  34. data/spec/fixtures/rsa_rsa_ocsp.key +27 -0
  35. data/spec/server_hello_spec.rb +1 -1
  36. data/spec/spec_helper.rb +35 -1
  37. data/spec/status_request_spec.rb +77 -10
  38. data/tttls1.3.gemspec +1 -1
  39. metadata +14 -10
  40. data/.travis.yml +0 -18
  41. data/interop/Dockerfile +0 -28
@@ -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pqhOqsEk2avacWuCYEEE/SWmJ/mvLokbfECSUpy
13
+ ZqfXJPLNAoGBAPtd+m2YVmLJmjO2skv+zGG5KhHNF2cY6xLQWuHW/yChNjSzpLYm
14
+ YygyOd4hBH39ieQkBRs0QOX9S5Dzv6ERU1cr0CVDJeb9TQ9UTxXc01paJ+aoZNr5
15
+ uHoGO16xBR4tmidc4HmbHDFSwmRAFhkooHM9MVACUFABIdWqwEwSZa/HAoGBAN6s
16
+ WhPrsDyRAfKFV9bwD1P5aMPu6pjWOFO3bRIisPRtVzilamCkKvXCh1SyYHaNRjjG
17
+ fQYEZeCZTxHi7GxZltRG5DRsmm8rDz6E4OrTQMHfQNDiuw78uZZ9+YYwaIM3nt1i
18
+ /lN2hs79zj/HPf5qX9rw+CarOL0bdW97a/Monx4bAoGAeMqXXfT3hi9E15bypQxD
19
+ IK6/JaC9n0BdLkRLd/09ymtNxhORkipuOdGw9yo8o2Kj0arxfTol+Z83oedP7dGK
20
+ j/gw5McYvqB4WGZ2PpZIRkHOrMu883FPEexOuVktkWvuiP3brPQ5nwYa/dvCAsMA
21
+ H4CHYuBJwbhZjvinwaaRkN8CgYA9sQh/zmOUVCRy+Yh9jyLgBBCHgDDUyTzvzLjW
22
+ NnBKN+TbV9DiF3mjfxKZX5YkIj3bSvqmaR+Em1Txwqn31tZX15AwCgq7U/W0P4JE
23
+ 7ORbEixV8wsaOuB8FkjEabL677T+5wdJPmRZAq5asyu0yenmsa4+oF9m3S2rBknB
24
+ I3b6EwKBgQD1+0+xdGomMeKHg8jWuDytdlWmNXmbiV0g2yOm533jG67vGDPfgd0H
25
+ PNC62d7r5EhIVJwQZmW/GdOfZ7tI91XN+GjNyslr9t299hoMeRMT+Db2U+mQvKuS
26
+ Oz+MHhO8YnOz9GFbQShqiCFj4zTU/0Ga/BY8Y52lURftt/QIXo+7Vg==
27
+ -----END RSA PRIVATE KEY-----
@@ -187,7 +187,7 @@ RSpec.describe ServerHello do
187
187
  let(:message) do
188
188
  sh = ServerHello.deserialize(TESTBINARY_SERVER_HELLO)
189
189
  extensions = sh.instance_variable_get(:@extensions)
190
- extensions[ExtensionType::SUPPORTED_VERSIONS] = nil
190
+ extensions.delete(ExtensionType::SUPPORTED_VERSIONS)
191
191
  sh.instance_variable_set(:@extensions, extensions)
192
192
  sh
193
193
  end
@@ -4,6 +4,7 @@
4
4
  RSpec.configure(&:disable_monkey_patching!)
5
5
 
6
6
  # rubocop: disable Style/MixinUsage
7
+ require 'date'
7
8
  require 'tttls1.3'
8
9
  include TTTLS13
9
10
  include TTTLS13::Error
@@ -41,10 +42,43 @@ TESTBINARY_SERVER_NAME = <
41
42
  00 0d 00 00 0a 67 69 74 68 75 62 2e 63 6f 6d
42
43
  BIN
43
44
 
44
- TESTBINARY_STATUS_REQUEST = <<BIN.split.map(&:hex).map(&:chr).join
45
+ TESTBINARY_OCSP_STATUS_REQUEST = <<BIN.split.map(&:hex).map(&:chr).join
45
46
  01 00 00 00 00
46
47
  BIN
47
48
 
49
+ TESTBINARY_OCSP_RESPONSE = <<BIN.split.map(&:hex).map(&:chr).join
50
+ 01 00 01 d0 30 82 01 cc 0a 01 00 a0 82 01 c5 30
51
+ 82 01 c1 06 09 2b 06 01 05 05 07 30 01 01 04 82
52
+ 01 b2 30 82 01 ae 30 81 97 a1 16 30 14 31 12 30
53
+ 10 06 03 55 04 03 0c 09 74 65 73 74 2d 6f 63 73
54
+ 70 18 0f 32 30 31 39 31 31 32 38 32 30 34 32 32
55
+ 38 5a 30 6c 30 6a 30 42 30 09 06 05 2b 0e 03 02
56
+ 1a 05 00 04 14 71 02 ca 0e ca 3e be d8 31 e6 37
57
+ 40 80 9e 37 f6 da 9f a5 27 04 14 ac c2 63 89 fe
58
+ 4d c6 08 1f 1f 4d 77 9e 12 7a bf 32 b6 d6 12 02
59
+ 09 00 cf 1a 4c 8a cc cc 78 33 80 00 18 0f 32 30
60
+ 31 39 31 31 32 38 32 30 34 32 32 38 5a a0 11 18
61
+ 0f 32 30 32 39 31 31 32 38 32 30 34 32 32 38 5a
62
+ 30 0d 06 09 2a 86 48 86 f7 0d 01 01 05 05 00 03
63
+ 82 01 01 00 42 90 e2 2f f0 25 3b cf 11 75 56 83
64
+ c2 dc 10 d1 e8 d3 74 67 9e df db 0e 03 36 9f 64
65
+ 48 61 8b 50 ca 2c dd fc 82 5b 52 d5 9b 06 64 86
66
+ 70 08 c2 0b ca c9 50 b8 42 42 19 80 8f 6e f0 42
67
+ 92 ac 67 4f 74 fa 2a d2 f4 2f 82 15 11 71 4b bd
68
+ 54 d0 21 fb 0a 91 d3 ba 67 5e cb 7d b2 e6 a2 da
69
+ 30 3d b3 92 3d a9 4e 2c f6 4a 0b 22 96 b2 1d 06
70
+ c3 0a c7 41 5f 9e 22 c0 e0 3f 52 cc ff be dd 52
71
+ 80 3f 68 36 ce c0 02 df ae ab 96 a9 be d8 51 b2
72
+ bd ec f9 e7 98 5e 8a 77 69 b6 f1 60 19 49 f0 58
73
+ 26 70 2f 7b 19 cc d0 13 9e 9c ed 8a 5c 87 34 4c
74
+ fd bd 0f 41 3f 5c d8 1e 26 ce bb dd 17 a7 a4 37
75
+ 8f d8 19 39 5b c9 17 18 ca c3 7a eb 5d e7 ba a1
76
+ 12 23 d6 cb 22 0e e1 bf 9e 40 9b e3 5c b5 6b e3
77
+ aa 6e 93 56 4f da da a1 c6 79 13 9d 5c d6 87 2b
78
+ f7 6a 0f fc 2c 03 b2 41 c4 90 b8 3d 50 1c 8a 9b
79
+ 11 1b 41 83
80
+ BIN
81
+
48
82
  TESTBINARY_SUPPORTED_GROUPS = <<BIN.split.map(&:hex).map(&:chr).join
49
83
  00 06 00 17 00 18 00 19
50
84
  BIN
@@ -4,10 +4,10 @@
4
4
  require_relative 'spec_helper'
5
5
  using Refinements
6
6
 
7
- RSpec.describe StatusRequest do
8
- context 'default status_request' do
7
+ RSpec.describe OCSPStatusRequest do
8
+ context 'default OCSPStatusRequest' do
9
9
  let(:extension) do
10
- StatusRequest.new
10
+ OCSPStatusRequest.new
11
11
  end
12
12
 
13
13
  it 'should be generated' do
@@ -21,9 +21,9 @@ RSpec.describe StatusRequest do
21
21
  end
22
22
  end
23
23
 
24
- context 'valid status_request' do
24
+ context 'valid OCSPStatusRequest' do
25
25
  let(:extension) do
26
- StatusRequest.new(responder_id_list: [], request_extensions: '')
26
+ OCSPStatusRequest.new(responder_id_list: [], request_extensions: [])
27
27
  end
28
28
 
29
29
  it 'should be generated' do
@@ -37,9 +37,9 @@ RSpec.describe StatusRequest do
37
37
  end
38
38
  end
39
39
 
40
- context 'valid status_request, 0 length request ' do
40
+ context 'valid OCSPStatusRequest, 0 length request ' do
41
41
  let(:extension) do
42
- StatusRequest.new(responder_id_list: nil, request_extensions: nil)
42
+ OCSPStatusRequest.new(responder_id_list: nil, request_extensions: nil)
43
43
  end
44
44
 
45
45
  it 'should be generated' do
@@ -53,9 +53,9 @@ RSpec.describe StatusRequest do
53
53
  end
54
54
  end
55
55
 
56
- context 'valid status_request binary' do
56
+ context 'valid OCSPStatusRequest binary' do
57
57
  let(:extension) do
58
- StatusRequest.deserialize(TESTBINARY_STATUS_REQUEST)
58
+ OCSPStatusRequest.deserialize(TESTBINARY_OCSP_STATUS_REQUEST)
59
59
  end
60
60
 
61
61
  it 'should generate valid object' do
@@ -67,7 +67,74 @@ RSpec.describe StatusRequest do
67
67
  it 'should generate serializable object' do
68
68
  expect(extension.serialize)
69
69
  .to eq ExtensionType::STATUS_REQUEST \
70
- + TESTBINARY_STATUS_REQUEST.prefix_uint16_length
70
+ + TESTBINARY_OCSP_STATUS_REQUEST.prefix_uint16_length
71
+ end
72
+ end
73
+ end
74
+
75
+ RSpec.describe OCSPResponse do
76
+ context 'valid OCSPResponse whose status is good' do
77
+ let(:basic_resp) do
78
+ server_crt = OpenSSL::X509::Certificate.new(
79
+ File.read(__dir__ + '/fixtures/rsa_rsa.crt')
80
+ )
81
+ ca_crt = OpenSSL::X509::Certificate.new(
82
+ File.read(__dir__ + '/fixtures/rsa_ca.crt')
83
+ )
84
+ ocsp_crt = OpenSSL::X509::Certificate.new(
85
+ File.read(__dir__ + '/fixtures/rsa_rsa_ocsp.crt')
86
+ )
87
+ ocsp_key = OpenSSL::PKey.read(
88
+ File.read(__dir__ + '/fixtures/rsa_rsa_ocsp.key')
89
+ )
90
+
91
+ br = OpenSSL::OCSP::BasicResponse.new
92
+ cid = OpenSSL::OCSP::CertificateId.new(server_crt, ca_crt)
93
+ br.add_status(
94
+ cid,
95
+ OpenSSL::OCSP::V_CERTSTATUS_GOOD,
96
+ 0,
97
+ nil,
98
+ Time.now,
99
+ DateTime.now.next_day(1).to_time,
100
+ []
101
+ )
102
+ br.sign(ocsp_crt, ocsp_key)
103
+ br
104
+ end
105
+
106
+ let(:ocsp_response) do
107
+ OpenSSL::OCSP::Response.create(
108
+ OpenSSL::OCSP::RESPONSE_STATUS_SUCCESSFUL,
109
+ basic_resp
110
+ )
111
+ end
112
+
113
+ let(:extension) do
114
+ OCSPResponse.new(ocsp_response)
115
+ end
116
+
117
+ it 'should be generated' do
118
+ expect(extension.extension_type).to eq ExtensionType::STATUS_REQUEST
119
+ expect(extension.ocsp_response).to eq ocsp_response
120
+ end
121
+
122
+ it 'should be serialized' do
123
+ binary = CertificateStatusType::OCSP \
124
+ + ocsp_response.to_der.prefix_uint24_length
125
+
126
+ expect(extension.serialize).to eq ExtensionType::STATUS_REQUEST \
127
+ + binary.prefix_uint16_length
128
+ end
129
+ end
130
+
131
+ context 'valid OCSPResponse binary' do
132
+ let(:extension) do
133
+ OCSPResponse.deserialize(TESTBINARY_OCSP_RESPONSE)
134
+ end
135
+
136
+ it 'should generate valid object' do
137
+ expect(extension.extension_type).to eq ExtensionType::STATUS_REQUEST
71
138
  end
72
139
  end
73
140
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.version = TTTLS13::VERSION
10
10
  spec.authors = ['thekuwayama']
11
11
  spec.email = ['thekuwayama@gmail.com']
12
- spec.summary = 'TLS 1.3 implementation in Ruby'
12
+ spec.summary = 'TLS 1.3 implementation in Ruby (Tiny Trial TLS1.3 aka tttls1.3)'
13
13
  spec.description = spec.summary
14
14
  spec.homepage = 'https://github.com/thekuwayama/tttls1.3'
15
15
  spec.license = 'MIT'
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.2.9
4
+ version: 0.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekuwayama
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,17 +52,17 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: TLS 1.3 implementation in Ruby
55
+ description: TLS 1.3 implementation in Ruby (Tiny Trial TLS1.3 aka tttls1.3)
56
56
  email:
57
57
  - thekuwayama@gmail.com
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - ".github/workflows/ci.yml"
62
63
  - ".gitignore"
63
64
  - ".rspec"
64
65
  - ".rubocop.yml"
65
- - ".travis.yml"
66
66
  - Gemfile
67
67
  - LICENSE.txt
68
68
  - README.md
@@ -73,9 +73,9 @@ files:
73
73
  - example/https_client_using_0rtt.rb
74
74
  - example/https_client_using_hrr.rb
75
75
  - example/https_client_using_hrr_and_ticket.rb
76
+ - example/https_client_using_status_request.rb
76
77
  - example/https_client_using_ticket.rb
77
78
  - example/https_server.rb
78
- - interop/Dockerfile
79
79
  - interop/client_spec.rb
80
80
  - interop/helper.rb
81
81
  - interop/server_spec.rb
@@ -145,6 +145,8 @@ files:
145
145
  - spec/fixtures/rsa_ca.key
146
146
  - spec/fixtures/rsa_rsa.crt
147
147
  - spec/fixtures/rsa_rsa.key
148
+ - spec/fixtures/rsa_rsa_ocsp.crt
149
+ - spec/fixtures/rsa_rsa_ocsp.key
148
150
  - spec/fixtures/rsa_rsassaPss.crt
149
151
  - spec/fixtures/rsa_rsassaPss.key
150
152
  - spec/fixtures/rsa_secp256r1.crt
@@ -177,7 +179,7 @@ homepage: https://github.com/thekuwayama/tttls1.3
177
179
  licenses:
178
180
  - MIT
179
181
  metadata: {}
180
- post_install_message:
182
+ post_install_message:
181
183
  rdoc_options: []
182
184
  require_paths:
183
185
  - lib
@@ -192,10 +194,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
194
  - !ruby/object:Gem::Version
193
195
  version: '0'
194
196
  requirements: []
195
- rubygems_version: 3.0.3
196
- signing_key:
197
+ rubygems_version: 3.1.2
198
+ signing_key:
197
199
  specification_version: 4
198
- summary: TLS 1.3 implementation in Ruby
200
+ summary: TLS 1.3 implementation in Ruby (Tiny Trial TLS1.3 aka tttls1.3)
199
201
  test_files:
200
202
  - spec/aead_spec.rb
201
203
  - spec/alert_spec.rb
@@ -218,6 +220,8 @@ test_files:
218
220
  - spec/fixtures/rsa_ca.key
219
221
  - spec/fixtures/rsa_rsa.crt
220
222
  - spec/fixtures/rsa_rsa.key
223
+ - spec/fixtures/rsa_rsa_ocsp.crt
224
+ - spec/fixtures/rsa_rsa_ocsp.key
221
225
  - spec/fixtures/rsa_rsassaPss.crt
222
226
  - spec/fixtures/rsa_rsassaPss.key
223
227
  - spec/fixtures/rsa_secp256r1.crt
@@ -1,18 +0,0 @@
1
- sudo: false
2
-
3
- language: ruby
4
-
5
- rvm:
6
- - 2.6.3
7
- - 2.6.4
8
- - 2.7.0-preview1
9
-
10
- matrix:
11
- allow_failures:
12
- - rvm: ruby-2.7.0-preview1
13
-
14
- before_install:
15
- - gem install bundler -v 2.0.1
16
- - bundle install
17
-
18
- script: bundle exec rake
@@ -1,28 +0,0 @@
1
- FROM ubuntu:18.04
2
-
3
- ARG version="1.1.1c"
4
-
5
- RUN apt-get update && apt-get install -y --no-install-recommends \
6
- autoconf \
7
- bison \
8
- build-essential \
9
- ca-certificates \
10
- curl \
11
- gzip \
12
- libreadline-dev \
13
- patch \
14
- pkg-config \
15
- sed \
16
- zlib1g-dev
17
-
18
- RUN mkdir -p /build/openssl
19
- RUN curl -s https://www.openssl.org/source/openssl-${version}.tar.gz | tar -C /build/openssl -xzf - && \
20
- cd /build/openssl/openssl-${version} && \
21
- ./Configure \
22
- --prefix=/opt/openssl/openssl-${version} \
23
- enable-crypto-mdebug enable-crypto-mdebug-backtrace \
24
- linux-x86_64 && \
25
- make && make install_sw
26
-
27
- ENV LD_LIBRARY_PATH /opt/openssl/openssl-${version}/lib
28
- ENV PATH /opt/openssl/openssl-${version}/bin:$PATH