1
1
#![ deny(
2
2
clippy:: all,
3
- clippy:: pedantic,
3
+ // TODO: clippy::pedantic,
4
4
clippy:: alloc_instead_of_core,
5
5
clippy:: std_instead_of_alloc,
6
6
clippy:: std_instead_of_core
@@ -22,11 +22,11 @@ pub struct Provider;
22
22
23
23
pub fn provider ( ) -> CryptoProvider {
24
24
CryptoProvider {
25
- cipher_suites : ALL_CIPHER_SUITES . to_vec ( ) ,
26
- kx_groups : kx:: ALL_KX_GROUPS . to_vec ( ) ,
25
+ cipher_suites : ALL_CIPHER_SUITES . to_vec ( ) ,
26
+ kx_groups : kx:: ALL_KX_GROUPS . to_vec ( ) ,
27
27
signature_verification_algorithms : verify:: ALGORITHMS ,
28
- secure_random : & Provider ,
29
- key_provider : & Provider ,
28
+ secure_random : & Provider ,
29
+ key_provider : & Provider ,
30
30
}
31
31
}
32
32
@@ -69,46 +69,46 @@ const TLS12_RSA_SCHEMES: [SignatureScheme; 6] = [
69
69
#[ cfg( feature = "tls12" ) ]
70
70
pub const TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 : SupportedCipherSuite =
71
71
SupportedCipherSuite :: Tls12 ( & rustls:: Tls12CipherSuite {
72
- common : CipherSuiteCommon {
73
- suite : CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
74
- hash_provider : hash:: SHA256 ,
72
+ common : CipherSuiteCommon {
73
+ suite : CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
74
+ hash_provider : hash:: SHA256 ,
75
75
confidentiality_limit : u64:: MAX ,
76
- integrity_limit : 1 << 36 ,
76
+ integrity_limit : 1 << 36 ,
77
77
} ,
78
- kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
79
- sign : & TLS12_ECDSA_SCHEMES ,
80
- aead_alg : & aead:: gcm:: Tls12Aes128Gcm ,
78
+ kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
79
+ sign : & TLS12_ECDSA_SCHEMES ,
80
+ aead_alg : & aead:: gcm:: Tls12Aes128Gcm ,
81
81
prf_provider : & rustls:: crypto:: tls12:: PrfUsingHmac ( hmac:: SHA256 ) ,
82
82
} ) ;
83
83
84
84
#[ cfg( feature = "tls12" ) ]
85
85
pub const TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 : SupportedCipherSuite =
86
86
SupportedCipherSuite :: Tls12 ( & rustls:: Tls12CipherSuite {
87
- common : CipherSuiteCommon {
88
- suite : CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
89
- hash_provider : hash:: SHA384 ,
87
+ common : CipherSuiteCommon {
88
+ suite : CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
89
+ hash_provider : hash:: SHA384 ,
90
90
confidentiality_limit : u64:: MAX ,
91
- integrity_limit : 1 << 36 ,
91
+ integrity_limit : 1 << 36 ,
92
92
} ,
93
- kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
94
- sign : & TLS12_ECDSA_SCHEMES ,
93
+ kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
94
+ sign : & TLS12_ECDSA_SCHEMES ,
95
95
prf_provider : & rustls:: crypto:: tls12:: PrfUsingHmac ( hmac:: SHA384 ) ,
96
- aead_alg : & aead:: gcm:: Tls12Aes256Gcm ,
96
+ aead_alg : & aead:: gcm:: Tls12Aes256Gcm ,
97
97
} ) ;
98
98
99
99
#[ cfg( feature = "tls12" ) ]
100
100
pub const TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 : SupportedCipherSuite =
101
101
SupportedCipherSuite :: Tls12 ( & rustls:: Tls12CipherSuite {
102
- common : CipherSuiteCommon {
103
- suite : CipherSuite :: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ,
104
- hash_provider : hash:: SHA256 ,
102
+ common : CipherSuiteCommon {
103
+ suite : CipherSuite :: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ,
104
+ hash_provider : hash:: SHA256 ,
105
105
confidentiality_limit : u64:: MAX ,
106
- integrity_limit : 1 << 36 ,
106
+ integrity_limit : 1 << 36 ,
107
107
} ,
108
108
prf_provider : & rustls:: crypto:: tls12:: PrfUsingHmac ( hmac:: SHA256 ) ,
109
- kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
110
- sign : & TLS12_ECDSA_SCHEMES ,
111
- aead_alg : & aead:: chacha20:: Chacha20Poly1305 ,
109
+ kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
110
+ sign : & TLS12_ECDSA_SCHEMES ,
111
+ aead_alg : & aead:: chacha20:: Chacha20Poly1305 ,
112
112
} ) ;
113
113
114
114
#[ cfg( feature = "tls12" ) ]
@@ -121,46 +121,46 @@ const TLS_ECDHE_ECDSA_SUITES: &[SupportedCipherSuite] = &[
121
121
#[ cfg( feature = "tls12" ) ]
122
122
pub const TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 : SupportedCipherSuite =
123
123
SupportedCipherSuite :: Tls12 ( & rustls:: Tls12CipherSuite {
124
- common : CipherSuiteCommon {
125
- suite : CipherSuite :: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ,
126
- hash_provider : hash:: SHA256 ,
124
+ common : CipherSuiteCommon {
125
+ suite : CipherSuite :: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ,
126
+ hash_provider : hash:: SHA256 ,
127
127
confidentiality_limit : u64:: MAX ,
128
- integrity_limit : 1 << 36 ,
128
+ integrity_limit : 1 << 36 ,
129
129
} ,
130
- kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
131
- sign : & TLS12_RSA_SCHEMES ,
132
- aead_alg : & aead:: gcm:: Tls12Aes128Gcm ,
130
+ kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
131
+ sign : & TLS12_RSA_SCHEMES ,
132
+ aead_alg : & aead:: gcm:: Tls12Aes128Gcm ,
133
133
prf_provider : & rustls:: crypto:: tls12:: PrfUsingHmac ( hmac:: SHA256 ) ,
134
134
} ) ;
135
135
136
136
#[ cfg( feature = "tls12" ) ]
137
137
pub const TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 : SupportedCipherSuite =
138
138
SupportedCipherSuite :: Tls12 ( & rustls:: Tls12CipherSuite {
139
- common : CipherSuiteCommon {
140
- suite : CipherSuite :: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,
141
- hash_provider : hash:: SHA384 ,
139
+ common : CipherSuiteCommon {
140
+ suite : CipherSuite :: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,
141
+ hash_provider : hash:: SHA384 ,
142
142
confidentiality_limit : u64:: MAX ,
143
- integrity_limit : 1 << 36 ,
143
+ integrity_limit : 1 << 36 ,
144
144
} ,
145
- kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
146
- sign : & TLS12_RSA_SCHEMES ,
145
+ kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
146
+ sign : & TLS12_RSA_SCHEMES ,
147
147
prf_provider : & rustls:: crypto:: tls12:: PrfUsingHmac ( hmac:: SHA384 ) ,
148
- aead_alg : & aead:: gcm:: Tls12Aes256Gcm ,
148
+ aead_alg : & aead:: gcm:: Tls12Aes256Gcm ,
149
149
} ) ;
150
150
151
151
#[ cfg( feature = "tls12" ) ]
152
152
pub const TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 : SupportedCipherSuite =
153
153
SupportedCipherSuite :: Tls12 ( & rustls:: Tls12CipherSuite {
154
- common : CipherSuiteCommon {
155
- suite : CipherSuite :: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 ,
156
- hash_provider : hash:: SHA256 ,
154
+ common : CipherSuiteCommon {
155
+ suite : CipherSuite :: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 ,
156
+ hash_provider : hash:: SHA256 ,
157
157
confidentiality_limit : u64:: MAX ,
158
- integrity_limit : 1 << 36 ,
158
+ integrity_limit : 1 << 36 ,
159
159
} ,
160
- kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
161
- sign : & TLS12_RSA_SCHEMES ,
160
+ kx : rustls:: crypto:: KeyExchangeAlgorithm :: ECDHE ,
161
+ sign : & TLS12_RSA_SCHEMES ,
162
162
prf_provider : & rustls:: crypto:: tls12:: PrfUsingHmac ( hmac:: SHA256 ) ,
163
- aead_alg : & aead:: chacha20:: Chacha20Poly1305 ,
163
+ aead_alg : & aead:: chacha20:: Chacha20Poly1305 ,
164
164
} ) ;
165
165
166
166
#[ cfg( feature = "tls12" ) ]
@@ -182,44 +182,44 @@ const TLS12_SUITES: &[SupportedCipherSuite] = &[];
182
182
183
183
pub const TLS13_AES_128_GCM_SHA256 : SupportedCipherSuite =
184
184
SupportedCipherSuite :: Tls13 ( & Tls13CipherSuite {
185
- common : CipherSuiteCommon {
186
- suite : CipherSuite :: TLS13_AES_128_GCM_SHA256 ,
187
- hash_provider : hash:: SHA256 ,
185
+ common : CipherSuiteCommon {
186
+ suite : CipherSuite :: TLS13_AES_128_GCM_SHA256 ,
187
+ hash_provider : hash:: SHA256 ,
188
188
confidentiality_limit : u64:: MAX ,
189
- integrity_limit : 1 << 36 ,
189
+ integrity_limit : 1 << 36 ,
190
190
} ,
191
191
hkdf_provider : & rustls:: crypto:: tls13:: HkdfUsingHmac ( hmac:: SHA256 ) ,
192
- aead_alg : & aead:: gcm:: Tls13Aes128Gcm ,
193
- quic : None ,
192
+ aead_alg : & aead:: gcm:: Tls13Aes128Gcm ,
193
+ quic : None ,
194
194
} ) ;
195
195
196
196
pub const TLS13_AES_256_GCM_SHA384 : SupportedCipherSuite =
197
197
SupportedCipherSuite :: Tls13 ( & Tls13CipherSuite {
198
- common : CipherSuiteCommon {
199
- suite : CipherSuite :: TLS13_AES_256_GCM_SHA384 ,
200
- hash_provider : hash:: SHA384 ,
198
+ common : CipherSuiteCommon {
199
+ suite : CipherSuite :: TLS13_AES_256_GCM_SHA384 ,
200
+ hash_provider : hash:: SHA384 ,
201
201
confidentiality_limit : u64:: MAX ,
202
- integrity_limit : 1 << 36 ,
202
+ integrity_limit : 1 << 36 ,
203
203
} ,
204
204
hkdf_provider : & rustls:: crypto:: tls13:: HkdfUsingHmac ( hmac:: SHA384 ) ,
205
- aead_alg : & aead:: gcm:: Tls13Aes256Gcm ,
206
- quic : None ,
205
+ aead_alg : & aead:: gcm:: Tls13Aes256Gcm ,
206
+ quic : None ,
207
207
} ) ;
208
208
209
209
const TLS13_AES_SUITES : & [ SupportedCipherSuite ] =
210
210
& [ TLS13_AES_128_GCM_SHA256 , TLS13_AES_256_GCM_SHA384 ] ;
211
211
212
212
pub const TLS13_CHACHA20_POLY1305_SHA256 : SupportedCipherSuite =
213
213
SupportedCipherSuite :: Tls13 ( & Tls13CipherSuite {
214
- common : CipherSuiteCommon {
215
- suite : CipherSuite :: TLS13_CHACHA20_POLY1305_SHA256 ,
216
- hash_provider : hash:: SHA256 ,
214
+ common : CipherSuiteCommon {
215
+ suite : CipherSuite :: TLS13_CHACHA20_POLY1305_SHA256 ,
216
+ hash_provider : hash:: SHA256 ,
217
217
confidentiality_limit : u64:: MAX ,
218
- integrity_limit : 1 << 36 ,
218
+ integrity_limit : 1 << 36 ,
219
219
} ,
220
220
hkdf_provider : & rustls:: crypto:: tls13:: HkdfUsingHmac ( hmac:: SHA256 ) ,
221
- aead_alg : & aead:: chacha20:: Chacha20Poly1305 ,
222
- quic : None ,
221
+ aead_alg : & aead:: chacha20:: Chacha20Poly1305 ,
222
+ quic : None ,
223
223
} ) ;
224
224
225
225
const TLS13_SUITES : & [ SupportedCipherSuite ] = misc:: const_concat_slices!(
0 commit comments