tttls1.3 0.3.4 → 0.3.5

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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +4 -2
  3. data/.rubocop.yml +16 -11
  4. data/.ruby-version +1 -1
  5. data/Gemfile +3 -3
  6. data/README.md +4 -4
  7. data/Rakefile +3 -3
  8. data/example/helper.rb +1 -1
  9. data/example/https_client_using_0rtt.rb +1 -1
  10. data/example/https_client_using_ech.rb +1 -1
  11. data/example/https_client_using_hrr_and_ech.rb +1 -1
  12. data/example/https_client_using_hrr_and_ticket.rb +1 -1
  13. data/example/https_client_using_status_request.rb +1 -1
  14. data/example/https_client_using_ticket.rb +1 -1
  15. data/example/https_client_using_ticket_and_ech.rb +3 -3
  16. data/example/https_server.rb +1 -1
  17. data/interop/client_spec.rb +57 -31
  18. data/interop/server_spec.rb +74 -46
  19. data/interop/spec_helper.rb +2 -2
  20. data/lib/tttls1.3/cipher_suites.rb +21 -16
  21. data/lib/tttls1.3/client.rb +86 -73
  22. data/lib/tttls1.3/connection.rb +6 -15
  23. data/lib/tttls1.3/cryptograph/aead.rb +26 -16
  24. data/lib/tttls1.3/ech.rb +11 -15
  25. data/lib/tttls1.3/endpoint.rb +4 -25
  26. data/lib/tttls1.3/key_schedule.rb +1 -1
  27. data/lib/tttls1.3/logging.rb +1 -1
  28. data/lib/tttls1.3/message/alert.rb +3 -4
  29. data/lib/tttls1.3/message/certificate.rb +4 -7
  30. data/lib/tttls1.3/message/certificate_verify.rb +3 -5
  31. data/lib/tttls1.3/message/client_hello.rb +9 -15
  32. data/lib/tttls1.3/message/compressed_certificate.rb +3 -9
  33. data/lib/tttls1.3/message/encrypted_extensions.rb +1 -2
  34. data/lib/tttls1.3/message/extension/alpn.rb +1 -6
  35. data/lib/tttls1.3/message/extension/compress_certificate.rb +1 -2
  36. data/lib/tttls1.3/message/extension/cookie.rb +1 -2
  37. data/lib/tttls1.3/message/extension/early_data_indication.rb +1 -2
  38. data/lib/tttls1.3/message/extension/ech.rb +9 -16
  39. data/lib/tttls1.3/message/extension/ech_outer_extensions.rb +1 -2
  40. data/lib/tttls1.3/message/extension/key_share.rb +17 -43
  41. data/lib/tttls1.3/message/extension/pre_shared_key.rb +8 -17
  42. data/lib/tttls1.3/message/extension/psk_key_exchange_modes.rb +1 -2
  43. data/lib/tttls1.3/message/extension/record_size_limit.rb +1 -2
  44. data/lib/tttls1.3/message/extension/server_name.rb +1 -2
  45. data/lib/tttls1.3/message/extension/signature_algorithms.rb +1 -2
  46. data/lib/tttls1.3/message/extension/status_request.rb +4 -12
  47. data/lib/tttls1.3/message/extension/supported_groups.rb +1 -4
  48. data/lib/tttls1.3/message/extension/supported_versions.rb +2 -8
  49. data/lib/tttls1.3/message/extension/unknown_extension.rb +2 -3
  50. data/lib/tttls1.3/message/extensions.rb +1 -7
  51. data/lib/tttls1.3/message/finished.rb +1 -2
  52. data/lib/tttls1.3/message/new_session_ticket.rb +6 -12
  53. data/lib/tttls1.3/message/record.rb +10 -23
  54. data/lib/tttls1.3/message/server_hello.rb +10 -21
  55. data/lib/tttls1.3/named_group.rb +12 -6
  56. data/lib/tttls1.3/server.rb +39 -34
  57. data/lib/tttls1.3/shared_secret.rb +118 -0
  58. data/lib/tttls1.3/utils.rb +0 -15
  59. data/lib/tttls1.3/version.rb +1 -1
  60. data/lib/tttls1.3.rb +1 -1
  61. data/spec/certificate_verify_spec.rb +1 -1
  62. data/spec/client_hello_spec.rb +4 -4
  63. data/spec/client_spec.rb +13 -13
  64. data/spec/endpoint_spec.rb +11 -11
  65. data/spec/key_schedule_spec.rb +4 -4
  66. data/spec/new_session_ticket_spec.rb +4 -4
  67. data/spec/pre_shared_key_spec.rb +8 -8
  68. data/spec/record_spec.rb +1 -1
  69. data/spec/server_hello_spec.rb +5 -5
  70. data/spec/server_spec.rb +8 -8
  71. data/tttls1.3.gemspec +2 -2
  72. metadata +7 -10
  73. data/example/https_client_using_grease_psk.rb +0 -58
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0913f70f0bdbfd6740f41ce7902f55660ea1bd99533a8f765f9d98a1bd56a58c'
4
- data.tar.gz: 611a063ae74498d19636ebf3ee3741b76164856341bb38ec9966a999579bdfb1
3
+ metadata.gz: f96bc3fd01ddafecaaa2871ffb65b8126f98d4ae3f7e227ec60d4d3b84fb20f4
4
+ data.tar.gz: d4f76a3799d201a2ad830182e00dab1becbdb3927ecf9a9b4afef77276de4b0c
5
5
  SHA512:
6
- metadata.gz: 88f39003d30f4642c67a61169923fe248bc572b4a1c638eb36803dc4278aa91a499919784cd060fa35c522bcb935745d1b4542abb1963514aba1f86f1ea789fd
7
- data.tar.gz: cd2ae8cd383cd9737a732d53c8ca27cbacdcd3c4a5b6bee62f5f43faba4fd8eb8067b0621df18d8b77db679823c3aa26947508fe5827939bf6741e6f417a1d80
6
+ metadata.gz: 4ae20c65462966ad685029f1f419e8fe141ccdd7fba9a61a04a7f1f238fd1e62ee88ac06e8f80bd6d5ea907b1571914acd23561d53350238adcc30eacac84885
7
+ data.tar.gz: 8e11fb873969e1b3a37a582d7e7b6db06bfe2c55aaa0c5f2035b3b9ca0c79fd1a35d8f4bb064ad0b3f2708f545624925f1f4c95aa9fee8ed8635b64c8f64d730
@@ -14,11 +14,13 @@ jobs:
14
14
  strategy:
15
15
  matrix:
16
16
  ruby-version: ['3.1', '3.2', '3.3']
17
+ env:
18
+ SPEC_VERBOSE: true
17
19
  steps:
18
- - uses: actions/checkout@v3
20
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19
21
  - uses: docker://thekuwayama/openssl:latest
20
22
  - name: Set up Ruby
21
- uses: ruby/setup-ruby@v1
23
+ uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
22
24
  with:
23
25
  ruby-version: ${{ matrix.ruby-version }}
24
26
  - name: Install dependencies
data/.rubocop.yml CHANGED
@@ -1,11 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7
3
-
4
- Gemspec/RequiredRubyVersion:
5
- Enabled: false
6
-
7
- Semicolon:
8
- AllowAsExpressionSeparator: true
2
+ TargetRubyVersion: 3.1
9
3
 
10
4
  Style/ConditionalAssignment:
11
5
  Enabled: false
@@ -16,25 +10,36 @@ Style/Documentation:
16
10
  Style/NumericLiterals:
17
11
  Enabled: false
18
12
 
13
+ Style/Semicolon:
14
+ Enabled: false
15
+
16
+ Style/StringConcatenation:
17
+ Enabled: false
18
+
19
19
  Metrics/AbcSize:
20
20
  Max: 30
21
21
 
22
+ Metrics/CyclomaticComplexity:
23
+ Max: 15
24
+
22
25
  Metrics/MethodLength:
23
26
  Max: 30
24
27
 
28
+ Metrics/PerceivedComplexity:
29
+ Max: 15
30
+
25
31
  Naming/MethodParameterName:
26
32
  MinNameLength: 1
27
33
 
34
+ Naming/VariableNumber:
35
+ Enabled: false
36
+
28
37
  Metrics/BlockLength:
29
38
  Exclude:
30
39
  - 'Rakefile'
31
40
  - 'spec/*.rb'
32
41
  - 'interop/*.rb'
33
42
 
34
- Layout/LineLength:
35
- Exclude:
36
- - 'tttls1.3.gemspec'
37
-
38
43
  # https://github.com/rubocop/rubocop/issues/10258
39
44
  Layout/BlockAlignment:
40
45
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.4.3
data/Gemfile CHANGED
@@ -6,15 +6,15 @@ gem 'ech_config', '~> 0.0.3'
6
6
  gem 'hpke'
7
7
  gem 'logger'
8
8
  gem 'openssl'
9
- gem 'rake'
10
9
 
11
10
  group :development do
12
11
  gem 'base64'
13
12
  gem 'byebug'
14
13
  gem 'http_parser.rb'
14
+ gem 'rake'
15
15
  gem 'resolv', '~> 0.4.0'
16
- gem 'rspec', '3.9.0'
17
- gem 'rubocop', '0.78.0'
16
+ gem 'rspec'
17
+ gem 'rubocop', '1.62.0'
18
18
  gem 'webrick'
19
19
  end
20
20
 
data/README.md CHANGED
@@ -24,7 +24,7 @@ tttls1.3 provides client API with the following features:
24
24
  * Resumed 0-RTT Handshake (with PSK from NST)
25
25
  * [ECH](https://datatracker.ietf.org/doc/draft-ietf-tls-esni/)
26
26
 
27
- **NOT supports** certificate with OID RSASSA-PSS, X25519, X448, FFDHE, AES-CCM, Client Authentication, Post-Handshake Authentication, KeyUpdate and external PSKs.
27
+ **NOT supports** certificate with OID RSASSA-PSS, FFDHE, Client Authentication, Post-Handshake Authentication, KeyUpdate and external PSKs.
28
28
 
29
29
  ### Server
30
30
 
@@ -33,7 +33,7 @@ tttls1.3 provides server API with the following features:
33
33
  * Simple 1-RTT Handshake
34
34
  * HelloRetryRequest
35
35
 
36
- **NOT supports** certificate with OID RSASSA-PSS, X25519, X448, FFDHE, AES-CCM, Client Authentication, Post-Handshake Authentication, KeyUpdate, external PSKs and Resumed 0-RTT Handshake.
36
+ **NOT supports** certificate with OID RSASSA-PSS, FFDHE, Client Authentication, Post-Handshake Authentication, KeyUpdate, external PSKs and Resumed 0-RTT Handshake.
37
37
 
38
38
 
39
39
  ## Getting started
@@ -90,7 +90,7 @@ tttls1.3 client is configurable using keyword arguments.
90
90
  | `:cipher_suites` | Array of TTTLS13::CipherSuite constant | `TLS_AES_256_GCM_SHA384`, `TLS_CHACHA20_POLY1305_SHA256`, `TLS_AES_128_GCM_SHA256` | List of cipher suites offered in ClientHello. |
91
91
  | `:signature_algorithms` | Array of TTTLS13::SignatureScheme constant | `ECDSA_SECP256R1_SHA256`, `ECDSA_SECP384R1_SHA384`, `ECDSA_SECP521R1_SHA512`, `RSA_PSS_RSAE_SHA256`, `RSA_PSS_RSAE_SHA384`, `RSA_PSS_RSAE_SHA512`, `RSA_PKCS1_SHA256`, `RSA_PKCS1_SHA384`, `RSA_PKCS1_SHA512` | List of signature algorithms offered in ClientHello extensions. |
92
92
  | `:signature_algorithms_cert` | Array of TTTLS13::SignatureScheme constant | nil | List of certificate signature algorithms offered in ClientHello extensions. You can set this to signal the difference between the signature algorithm and `:signature_algorithms`. |
93
- | `:supported_groups` | Array of TTTLS13::NamedGroup constant | `SECP256R1`, `SECP384R1`, `SECP521R1` | List of named groups offered in ClientHello extensions. |
93
+ | `:supported_groups` | Array of TTTLS13::NamedGroup constant | `X25519`, `SECP256R1`, `SECP384R1`, `SECP521R1` | List of named groups offered in ClientHello extensions. |
94
94
  | `:key_share_groups` | Array of TTTLS13::NamedGroup constant | nil | List of named groups offered in KeyShareClientHello. In default, KeyShareClientHello has only a KeyShareEntry of most preferred named group in `:supported_groups`. You can set this to send KeyShareClientHello that has multiple KeyShareEntry. |
95
95
  | `:alpn` | Array of String | nil | List of application protocols offered in ClientHello extensions. If not needed to be present, set nil. |
96
96
  | `:process_new_session_ticket` | Proc | nil | Proc that processes received NewSessionTicket. Its 3 arguments are TTTLS13::Message::NewSessionTicket, resumption main secret and cipher suite. If not needed to process NewSessionTicket, set nil. |
@@ -122,7 +122,7 @@ tttls1.3 server is configurable using keyword arguments.
122
122
  | `:key_file` | String | nil | Path to the private key file. This is a required setting. |
123
123
  | `:cipher_suites` | Array of TTTLS13::CipherSuite constant | `TLS_AES_256_GCM_SHA384`, `TLS_CHACHA20_POLY1305_SHA256`, `TLS_AES_128_GCM_SHA256` | List of supported cipher suites. |
124
124
  | `:signature_algorithms` | Array of TTTLS13::SignatureScheme constant | `ECDSA_SECP256R1_SHA256`, `ECDSA_SECP384R1_SHA384`, `ECDSA_SECP521R1_SHA512`, `RSA_PSS_RSAE_SHA256`, `RSA_PSS_RSAE_SHA384`, `RSA_PSS_RSAE_SHA512`, `RSA_PKCS1_SHA256`, `RSA_PKCS1_SHA384`, `RSA_PKCS1_SHA512` | List of supported signature algorithms. |
125
- | `:supported_groups` | Array of TTTLS13::NamedGroup constant | `SECP256R1`, `SECP384R1`, `SECP521R1` | List of supported named groups. |
125
+ | `:supported_groups` | Array of TTTLS13::NamedGroup constant | `X25519`, `SECP256R1`, `SECP384R1`, `SECP521R1` | List of supported named groups. |
126
126
  | `:alpn` | Array of String | nil | List of supported application protocols. If not needed to check this extension, set nil. |
127
127
  | `:process_ocsp_response` | Proc | nil | Proc that gets OpenSSL::OCSP::Response. If not needed to staple OCSP::Response, set nil. |
128
128
  | `:compress_certificate_algorithms` | Array of TTTLS13::Message::Extension::CertificateCompressionAlgorithm constant | `ZLIB` | The compression algorithms are supported for compressing the Certificate message. |
data/Rakefile CHANGED
@@ -61,7 +61,7 @@ file CA_CRT => [TMP_DIR, CA_KEY] do
61
61
  )
62
62
  )
63
63
 
64
- digest = OpenSSL::Digest::SHA256.new
64
+ digest = OpenSSL::Digest.new('SHA256')
65
65
  ca_crt.sign(ca_key, digest)
66
66
  File.write(CA_CRT, ca_crt.to_pem)
67
67
  end
@@ -112,7 +112,7 @@ file INTER_CRT => [TMP_DIR, INTER_KEY] do
112
112
  )
113
113
  )
114
114
 
115
- digest = OpenSSL::Digest::SHA256.new
115
+ digest = OpenSSL::Digest.new('SHA256')
116
116
  inter_crt.sign(ca_key, digest)
117
117
  File.write(INTER_CRT, inter_crt.to_pem)
118
118
  end
@@ -169,7 +169,7 @@ file SERVER_CRT => [TMP_DIR, INTER_CRT, SERVER_KEY] do
169
169
  )
170
170
  )
171
171
 
172
- digest = OpenSSL::Digest::SHA256.new
172
+ digest = OpenSSL::Digest.new('SHA256')
173
173
  server_crt.sign(inter_key, digest)
174
174
  File.write(SERVER_CRT, server_crt.to_pem)
175
175
  end
data/example/helper.rb CHANGED
@@ -80,7 +80,7 @@ def transcript_htmlize(transcript)
80
80
  TTTLS13::CCT => 'Certificate',
81
81
  TTTLS13::CCV => 'CertificateVerify',
82
82
  TTTLS13::CF => 'Finished'
83
- }.map { |k, v| [k, '<details><summary>' + v + '</summary>%s</details>'] }.to_h
83
+ }.transform_values { |v| '<details><summary>' + v + '</summary>%s</details>' }
84
84
  transcript.map do |k, v|
85
85
  format(m[k], TTTLS13::Convert.obj2html(v.first))
86
86
  end.join('<br>')
@@ -25,7 +25,7 @@ end
25
25
  settings_1st = {
26
26
  ca_file: File.exist?(ca_file) ? ca_file : nil,
27
27
  alpn: ['http/1.1'],
28
- process_new_session_ticket: process_new_session_ticket,
28
+ process_new_session_ticket:,
29
29
  sslkeylogfile: '/tmp/sslkeylogfile.log'
30
30
  }
31
31
 
@@ -16,7 +16,7 @@ socket = TCPSocket.new(uri.host, uri.port)
16
16
  settings = {
17
17
  ca_file: File.exist?(ca_file) ? ca_file : nil,
18
18
  alpn: ['http/1.1'],
19
- ech_config: ech_config,
19
+ ech_config:,
20
20
  ech_hpke_cipher_suites:
21
21
  TTTLS13::STANDARD_CLIENT_ECH_HPKE_SYMMETRIC_CIPHER_SUITES,
22
22
  sslkeylogfile: '/tmp/sslkeylogfile.log'
@@ -17,7 +17,7 @@ settings = {
17
17
  ca_file: File.exist?(ca_file) ? ca_file : nil,
18
18
  key_share_groups: [], # empty KeyShareClientHello.client_shares
19
19
  alpn: ['http/1.1'],
20
- ech_config: ech_config,
20
+ ech_config:,
21
21
  ech_hpke_cipher_suites:
22
22
  TTTLS13::STANDARD_CLIENT_ECH_HPKE_SYMMETRIC_CIPHER_SUITES,
23
23
  sslkeylogfile: '/tmp/sslkeylogfile.log'
@@ -26,7 +26,7 @@ end
26
26
  settings_1st = {
27
27
  ca_file: File.exist?(ca_file) ? ca_file : nil,
28
28
  alpn: ['http/1.1'],
29
- process_new_session_ticket: process_new_session_ticket,
29
+ process_new_session_ticket:,
30
30
  sslkeylogfile: '/tmp/sslkeylogfile.log'
31
31
  }
32
32
 
@@ -19,7 +19,7 @@ settings = {
19
19
  ca_file: File.exist?(ca_file) ? ca_file : nil,
20
20
  alpn: ['http/1.1'],
21
21
  check_certificate_status: true,
22
- process_certificate_status: process_certificate_status,
22
+ process_certificate_status:,
23
23
  sslkeylogfile: '/tmp/sslkeylogfile.log'
24
24
  }
25
25
  client = TTTLS13::Client.new(socket, uri.host, **settings)
@@ -25,7 +25,7 @@ end
25
25
  settings_1st = {
26
26
  ca_file: File.exist?(ca_file) ? ca_file : nil,
27
27
  alpn: ['http/1.1'],
28
- process_new_session_ticket: process_new_session_ticket,
28
+ process_new_session_ticket:,
29
29
  sslkeylogfile: '/tmp/sslkeylogfile.log'
30
30
  }
31
31
 
@@ -15,7 +15,7 @@ ech_config = if ARGV.length > 1
15
15
  settings_2nd = {
16
16
  ca_file: File.exist?(ca_file) ? ca_file : nil,
17
17
  alpn: ['http/1.1'],
18
- ech_config: ech_config,
18
+ ech_config:,
19
19
  ech_hpke_cipher_suites:
20
20
  TTTLS13::STANDARD_CLIENT_ECH_HPKE_SYMMETRIC_CIPHER_SUITES,
21
21
  sslkeylogfile: '/tmp/sslkeylogfile.log'
@@ -33,10 +33,10 @@ end
33
33
  settings_1st = {
34
34
  ca_file: File.exist?(ca_file) ? ca_file : nil,
35
35
  alpn: ['http/1.1'],
36
- ech_config: ech_config,
36
+ ech_config:,
37
37
  ech_hpke_cipher_suites:
38
38
  TTTLS13::STANDARD_CLIENT_ECH_HPKE_SYMMETRIC_CIPHER_SUITES,
39
- process_new_session_ticket: process_new_session_ticket,
39
+ process_new_session_ticket:,
40
40
  sslkeylogfile: '/tmp/sslkeylogfile.log'
41
41
  }
42
42
 
@@ -17,7 +17,7 @@ settings = {
17
17
  }
18
18
 
19
19
  q = Queue.new
20
- logger = Logger.new(STDERR, Logger::WARN)
20
+ logger = Logger.new($stderr, Logger::WARN)
21
21
  # rubocop: disable Metrics/BlockLength
22
22
  Etc.nprocessors.times do
23
23
  Thread.start do
@@ -12,127 +12,154 @@ RSpec.describe Client do
12
12
  # crt [String] server crt file path
13
13
  # key [String] server key file path
14
14
  # settings [Hash] TTTLS13::Server settings
15
- # rubocop: disable Layout/LineLength
16
15
  testcases = [
17
16
  [
18
17
  true,
19
18
  '-ciphersuites TLS_AES_256_GCM_SHA384',
20
19
  'rsa_rsa.crt',
21
20
  'rsa_rsa.key',
22
- cipher_suites: [CipherSuite::TLS_AES_256_GCM_SHA384]
21
+ { cipher_suites: [CipherSuite::TLS_AES_256_GCM_SHA384] }
23
22
  ],
24
23
  [
25
24
  true,
26
25
  '-ciphersuites TLS_CHACHA20_POLY1305_SHA256',
27
26
  'rsa_rsa.crt',
28
27
  'rsa_rsa.key',
29
- cipher_suites: [CipherSuite::TLS_CHACHA20_POLY1305_SHA256]
28
+ { cipher_suites: [CipherSuite::TLS_CHACHA20_POLY1305_SHA256] }
30
29
  ],
31
30
  [
32
31
  true,
33
32
  '-ciphersuites TLS_AES_128_GCM_SHA256',
34
33
  'rsa_rsa.crt',
35
34
  'rsa_rsa.key',
36
- cipher_suites: [CipherSuite::TLS_AES_128_GCM_SHA256]
35
+ { cipher_suites: [CipherSuite::TLS_AES_128_GCM_SHA256] }
36
+ ],
37
+ [
38
+ true,
39
+ '-ciphersuites TLS_AES_128_CCM_SHA256',
40
+ 'rsa_rsa.crt',
41
+ 'rsa_rsa.key',
42
+ { cipher_suites: [CipherSuite::TLS_AES_128_CCM_SHA256] }
43
+ ],
44
+ [
45
+ true,
46
+ "-ciphersuites TLS_AES_128_CCM_8_SHA256 -cipher 'DEFAULT:@SECLEVEL=0'",
47
+ 'rsa_rsa.crt',
48
+ 'rsa_rsa.key',
49
+ { cipher_suites: [CipherSuite::TLS_AES_128_CCM_8_SHA256] }
37
50
  ],
38
51
  [
39
52
  false,
40
53
  '-ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256',
41
54
  'rsa_rsa.crt',
42
55
  'rsa_rsa.key',
43
- cipher_suites: [CipherSuite::TLS_AES_128_GCM_SHA256]
56
+ { cipher_suites: [CipherSuite::TLS_AES_128_GCM_SHA256] }
57
+ ],
58
+ [
59
+ true,
60
+ '-groups X25519',
61
+ 'rsa_rsa.crt',
62
+ 'rsa_rsa.key',
63
+ { supported_groups: [NamedGroup::X25519] }
64
+ ],
65
+ [
66
+ true,
67
+ '-groups X448',
68
+ 'rsa_rsa.crt',
69
+ 'rsa_rsa.key',
70
+ { supported_groups: [NamedGroup::X448] }
44
71
  ],
45
72
  [
46
73
  true,
47
74
  '-groups P-256',
48
75
  'rsa_rsa.crt',
49
76
  'rsa_rsa.key',
50
- supported_groups: [NamedGroup::SECP256R1]
77
+ { supported_groups: [NamedGroup::SECP256R1] }
51
78
  ],
52
79
  [
53
80
  true,
54
81
  '-groups P-384',
55
82
  'rsa_rsa.crt',
56
83
  'rsa_rsa.key',
57
- supported_groups: [NamedGroup::SECP384R1]
84
+ { supported_groups: [NamedGroup::SECP384R1] }
58
85
  ],
59
86
  [
60
87
  true,
61
88
  '-groups P-521',
62
89
  'rsa_rsa.crt',
63
90
  'rsa_rsa.key',
64
- supported_groups: [NamedGroup::SECP521R1]
91
+ { supported_groups: [NamedGroup::SECP521R1] }
65
92
  ],
66
93
  [
67
94
  false,
68
- '-groups P-256:P-384',
95
+ '-groups P-256:P-384:P-521:X448',
69
96
  'rsa_rsa.crt',
70
97
  'rsa_rsa.key',
71
- supported_groups: [NamedGroup::SECP521R1]
98
+ { supported_groups: [NamedGroup::X25519] }
72
99
  ],
73
100
  [
74
101
  true,
75
102
  '-sigalgs RSA-PSS+SHA256',
76
103
  'rsa_rsa.crt',
77
104
  'rsa_rsa.key',
78
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
79
- signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA256]
105
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
106
+ signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA256] }
80
107
  ],
81
108
  [
82
109
  true,
83
110
  '-sigalgs RSA-PSS+SHA384',
84
111
  'rsa_rsa.crt',
85
112
  'rsa_rsa.key',
86
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
87
- signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA384]
113
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
114
+ signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA384] }
88
115
  ],
89
116
  [
90
117
  true,
91
118
  '-sigalgs RSA-PSS+SHA512',
92
119
  'rsa_rsa.crt',
93
120
  'rsa_rsa.key',
94
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
95
- signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA512]
121
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
122
+ signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA512] }
96
123
  ],
97
124
  [
98
125
  true,
99
126
  '-sigalgs ECDSA+SHA256',
100
127
  'rsa_secp256r1.crt',
101
128
  'rsa_secp256r1.key',
102
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
103
- signature_algorithms: [SignatureScheme::ECDSA_SECP256R1_SHA256]
129
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
130
+ signature_algorithms: [SignatureScheme::ECDSA_SECP256R1_SHA256] }
104
131
  ],
105
132
  [
106
133
  true,
107
134
  '-sigalgs ECDSA+SHA384',
108
135
  'rsa_secp384r1.crt',
109
136
  'rsa_secp384r1.key',
110
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
111
- signature_algorithms: [SignatureScheme::ECDSA_SECP384R1_SHA384]
137
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
138
+ signature_algorithms: [SignatureScheme::ECDSA_SECP384R1_SHA384] }
112
139
  ],
113
140
  [
114
141
  true,
115
142
  '-sigalgs ECDSA+SHA512',
116
143
  'rsa_secp521r1.crt',
117
144
  'rsa_secp521r1.key',
118
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
119
- signature_algorithms: [SignatureScheme::ECDSA_SECP521R1_SHA512]
145
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
146
+ signature_algorithms: [SignatureScheme::ECDSA_SECP521R1_SHA512] }
120
147
  ],
121
148
  [
122
149
  true,
123
150
  '-sigalgs RSA-PSS+SHA256',
124
151
  'rsa_rsassaPss.crt',
125
152
  'rsa_rsassaPss.key',
126
- signature_algorithms_cert: [SignatureScheme::RSA_PSS_RSAE_SHA256],
127
- signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA256]
153
+ { signature_algorithms_cert: [SignatureScheme::RSA_PSS_RSAE_SHA256],
154
+ signature_algorithms: [SignatureScheme::RSA_PSS_RSAE_SHA256] }
128
155
  ],
129
156
  [
130
157
  false,
131
158
  '-sigalgs ECDSA+SHA256:ECDSA+SHA384:RSA-PSS+SHA256:RSA-PSS+SHA384:RSA-PSS+SHA512:RSA+SHA256',
132
159
  'rsa_secp521r1.crt',
133
160
  'rsa_secp521r1.key',
134
- signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
135
- signature_algorithms: [SignatureScheme::ECDSA_SECP521R1_SHA512]
161
+ { signature_algorithms_cert: [SignatureScheme::RSA_PKCS1_SHA256],
162
+ signature_algorithms: [SignatureScheme::ECDSA_SECP521R1_SHA512] }
136
163
  ],
137
164
  [
138
165
  true,
@@ -146,24 +173,23 @@ RSpec.describe Client do
146
173
  '',
147
174
  'rsa_rsa.crt',
148
175
  'rsa_rsa.key',
149
- key_share_groups: []
176
+ { key_share_groups: [] }
150
177
  ],
151
178
  [
152
179
  true,
153
180
  '-alpn http/1.0',
154
181
  'rsa_rsa.crt',
155
182
  'rsa_rsa.key',
156
- alpn: ['http/1.0']
183
+ { alpn: ['http/1.0'] }
157
184
  ],
158
185
  [
159
186
  true,
160
187
  '',
161
188
  'rsa_rsa.crt',
162
189
  'rsa_rsa.key',
163
- compatibility_mode: false
190
+ { compatibility_mode: false }
164
191
  ]
165
192
  ]
166
- # rubocop: enable Layout/LineLength
167
193
  testcases.each do |normal, opt, crt, key, settings|
168
194
  context 'client interop' do
169
195
  before do
@@ -181,7 +207,7 @@ RSpec.describe Client do
181
207
  + 'thekuwayama/openssl ' + cmd)
182
208
  Process.detach(pid)
183
209
 
184
- wait_to_listen('127.0.0.1', PORT)
210
+ wait_to_listen('127.0.0.1', PORT, ENV['SPEC_VERBOSE'])
185
211
  end
186
212
 
187
213
  let(:client) do