tttls1.3 0.3.6 → 0.3.7
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/.ruby-version +1 -1
- data/lib/tttls1.3/version.rb +1 -1
- data/lib/tttls1.3.rb +1 -0
- data/tttls1.3.gemspec +5 -2
- metadata +3 -113
- data/.github/workflows/ci.yml +0 -39
- data/.gitignore +0 -17
- data/spec/aead_spec.rb +0 -95
- data/spec/alert_spec.rb +0 -54
- data/spec/alpn_spec.rb +0 -55
- data/spec/application_data_spec.rb +0 -26
- data/spec/certificate_spec.rb +0 -82
- data/spec/certificate_verify_spec.rb +0 -51
- data/spec/change_cipher_spec_spec.rb +0 -26
- data/spec/cipher_suites_spec.rb +0 -39
- data/spec/client_hello_spec.rb +0 -105
- data/spec/client_spec.rb +0 -274
- data/spec/compress_certificate_spec.rb +0 -54
- data/spec/cookie_spec.rb +0 -98
- data/spec/early_data_indication_spec.rb +0 -64
- data/spec/ech_outer_extensions_spec.rb +0 -42
- data/spec/ech_spec.rb +0 -122
- data/spec/encrypted_extensions_spec.rb +0 -94
- data/spec/end_of_early_data_spec.rb +0 -28
- data/spec/endpoint_spec.rb +0 -167
- data/spec/error_spec.rb +0 -18
- data/spec/extensions_spec.rb +0 -250
- data/spec/finished_spec.rb +0 -55
- data/spec/fixtures/rsa_ca.crt +0 -18
- data/spec/fixtures/rsa_ca.key +0 -27
- data/spec/fixtures/rsa_rsa.crt +0 -18
- data/spec/fixtures/rsa_rsa.key +0 -27
- data/spec/fixtures/rsa_rsa_ocsp.crt +0 -18
- data/spec/fixtures/rsa_rsa_ocsp.key +0 -27
- data/spec/fixtures/rsa_rsassaPss.crt +0 -20
- data/spec/fixtures/rsa_rsassaPss.key +0 -27
- data/spec/fixtures/rsa_secp256r1.crt +0 -14
- data/spec/fixtures/rsa_secp256r1.key +0 -5
- data/spec/fixtures/rsa_secp384r1.crt +0 -14
- data/spec/fixtures/rsa_secp384r1.key +0 -6
- data/spec/fixtures/rsa_secp521r1.crt +0 -15
- data/spec/fixtures/rsa_secp521r1.key +0 -7
- data/spec/key_schedule_spec.rb +0 -221
- data/spec/key_share_spec.rb +0 -199
- data/spec/new_session_ticket_spec.rb +0 -80
- data/spec/pre_shared_key_spec.rb +0 -167
- data/spec/psk_key_exchange_modes_spec.rb +0 -45
- data/spec/record_size_limit_spec.rb +0 -61
- data/spec/record_spec.rb +0 -105
- data/spec/server_hello_spec.rb +0 -200
- data/spec/server_name_spec.rb +0 -110
- data/spec/server_spec.rb +0 -232
- data/spec/signature_algorithms_cert_spec.rb +0 -77
- data/spec/signature_algorithms_spec.rb +0 -104
- data/spec/spec_helper.rb +0 -990
- data/spec/status_request_spec.rb +0 -140
- data/spec/supported_groups_spec.rb +0 -79
- data/spec/supported_versions_spec.rb +0 -136
- data/spec/transcript_spec.rb +0 -83
- data/spec/unknown_extension_spec.rb +0 -90
- data/spec/utils_spec.rb +0 -235
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# encoding: ascii-8bit
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require_relative 'spec_helper'
|
|
5
|
-
using Refinements
|
|
6
|
-
|
|
7
|
-
RSpec.describe SignatureAlgorithms do
|
|
8
|
-
context 'valid signature_algorithms' do
|
|
9
|
-
let(:supported_signature_algorithms) do
|
|
10
|
-
[
|
|
11
|
-
SignatureScheme::ECDSA_SECP256R1_SHA256,
|
|
12
|
-
SignatureScheme::RSA_PSS_RSAE_SHA256,
|
|
13
|
-
SignatureScheme::RSA_PKCS1_SHA256,
|
|
14
|
-
SignatureScheme::ECDSA_SECP384R1_SHA384,
|
|
15
|
-
SignatureScheme::RSA_PSS_RSAE_SHA384,
|
|
16
|
-
SignatureScheme::RSA_PKCS1_SHA384,
|
|
17
|
-
SignatureScheme::RSA_PSS_RSAE_SHA512,
|
|
18
|
-
SignatureScheme::RSA_PKCS1_SHA512
|
|
19
|
-
]
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
let(:extension) do
|
|
23
|
-
SignatureAlgorithms.new(supported_signature_algorithms)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'should be generated' do
|
|
27
|
-
expect(extension).to be_a(SignatureAlgorithms)
|
|
28
|
-
|
|
29
|
-
expect(extension.extension_type).to eq ExtensionType::SIGNATURE_ALGORITHMS
|
|
30
|
-
expect(extension.supported_signature_algorithms)
|
|
31
|
-
.to eq supported_signature_algorithms
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it 'should be serialized' do
|
|
35
|
-
expect(extension.serialize).to eq ExtensionType::SIGNATURE_ALGORITHMS \
|
|
36
|
-
+ 18.to_uint16 \
|
|
37
|
-
+ 16.to_uint16 \
|
|
38
|
-
+ supported_signature_algorithms.join
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
context 'invalid signature_algorithms, empty,' do
|
|
43
|
-
let(:extension) do
|
|
44
|
-
SignatureAlgorithms.new([])
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
it 'should not be generated' do
|
|
48
|
-
expect { extension }.to raise_error(ErrorAlerts)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
context 'invalid signature_algorithms, too long,' do
|
|
53
|
-
let(:extension) do
|
|
54
|
-
SignatureAlgorithms.new((0..2**15 - 2).to_a.map(&:to_uint16))
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it 'should not be generated' do
|
|
58
|
-
expect { extension }.to raise_error(ErrorAlerts)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
context 'valid signature_algorithms binary' do
|
|
63
|
-
let(:extension) do
|
|
64
|
-
SignatureAlgorithms.deserialize(TESTBINARY_SIGNATURE_ALGORITHMS)
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
let(:supported_signature_algorithms) do
|
|
68
|
-
[
|
|
69
|
-
SignatureScheme::ECDSA_SECP256R1_SHA256,
|
|
70
|
-
SignatureScheme::RSA_PSS_RSAE_SHA256,
|
|
71
|
-
SignatureScheme::RSA_PKCS1_SHA256,
|
|
72
|
-
SignatureScheme::ECDSA_SECP384R1_SHA384,
|
|
73
|
-
SignatureScheme::RSA_PSS_RSAE_SHA384,
|
|
74
|
-
SignatureScheme::RSA_PKCS1_SHA384,
|
|
75
|
-
SignatureScheme::RSA_PSS_RSAE_SHA512,
|
|
76
|
-
SignatureScheme::RSA_PKCS1_SHA512
|
|
77
|
-
]
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
it 'should generate valid object' do
|
|
81
|
-
expect(extension).to be_a(SignatureAlgorithms)
|
|
82
|
-
|
|
83
|
-
expect(extension.extension_type).to eq ExtensionType::SIGNATURE_ALGORITHMS
|
|
84
|
-
expect(extension.supported_signature_algorithms)
|
|
85
|
-
.to eq supported_signature_algorithms
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it 'should generate serializable object' do
|
|
89
|
-
expect(extension.serialize)
|
|
90
|
-
.to eq ExtensionType::SIGNATURE_ALGORITHMS \
|
|
91
|
-
+ TESTBINARY_SIGNATURE_ALGORITHMS.prefix_uint16_length
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
context 'invalid signature_algorithms binary, malformed binary,' do
|
|
96
|
-
let(:extension) do
|
|
97
|
-
SignatureAlgorithms.deserialize(TESTBINARY_SIGNATURE_ALGORITHMS[0...-1])
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
it 'should return nil' do
|
|
101
|
-
expect(extension).to be nil
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
end
|