@@ -13,9 +13,7 @@ use openssl_sys::{
1313} ;
1414
1515use rustls:: client:: Resumption ;
16- use rustls:: crypto:: aws_lc_rs as provider;
17- use rustls:: crypto:: aws_lc_rs:: Ticketer ;
18- use rustls:: crypto:: SupportedKxGroup ;
16+ use rustls:: crypto:: { aws_lc_rs as provider, SupportedKxGroup } ;
1917use rustls:: pki_types:: { CertificateDer , ServerName } ;
2018use rustls:: server:: { Accepted , Acceptor , ProducesTickets } ;
2119use rustls:: {
@@ -103,7 +101,7 @@ pub struct SslCipher {
103101 pub standard_name : & ' static CStr ,
104102 pub version : & ' static CStr ,
105103 pub description : & ' static CStr ,
106- pub rustls : CipherSuite ,
104+ rustls : & ' static rustls :: SupportedCipherSuite ,
107105}
108106
109107impl SslCipher {
@@ -135,7 +133,7 @@ impl SslCipher {
135133 }
136134
137135 pub fn protocol_id ( & self ) -> u16 {
138- u16:: from ( self . rustls )
136+ u16:: from ( self . rustls . suite ( ) )
139137 }
140138
141139 pub fn openssl_id ( & self ) -> u32 {
@@ -144,102 +142,102 @@ impl SslCipher {
144142}
145143
146144static TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 : SslCipher = SslCipher {
145+ rustls : & provider:: cipher_suite:: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
147146 auth : constants:: NID_AUTH_ECDSA ,
148147 kx : constants:: NID_KX_ECDHE ,
149148 bits : 128 ,
150149 openssl_name : c"ECDHE-ECDSA-AES128-GCM-SHA256" ,
151150 standard_name : c"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" ,
152151 version : c"TLSv1.2" ,
153152 description : c"ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD\n " ,
154- rustls : CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 ,
155153} ;
156154
157155static TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 : SslCipher = SslCipher {
156+ rustls : & provider:: cipher_suite:: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
158157 auth : constants:: NID_AUTH_ECDSA ,
159158 kx : constants:: NID_KX_ECDHE ,
160159 bits : 256 ,
161160 openssl_name : c"ECDHE-ECDSA-AES256-GCM-SHA384" ,
162161 standard_name : c"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" ,
163162 version : c"TLSv1.2" ,
164163 description : c"ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD\n " ,
165- rustls : CipherSuite :: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ,
166164} ;
167165
168166static TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 : SslCipher = SslCipher {
167+ rustls : & provider:: cipher_suite:: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ,
169168 auth : constants:: NID_AUTH_ECDSA ,
170169 kx : constants:: NID_KX_ECDHE ,
171170 bits : 256 ,
172171 openssl_name : c"ECDHE-ECDSA-CHACHA20-POLY1305" ,
173172 standard_name : c"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" ,
174- rustls : CipherSuite :: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 ,
175173 version : c"TLSv1.2" ,
176174 description : c"ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD\n " ,
177175} ;
178176
179177static TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 : SslCipher = SslCipher {
178+ rustls : & provider:: cipher_suite:: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ,
180179 auth : constants:: NID_AUTH_RSA ,
181180 kx : constants:: NID_KX_ECDHE ,
182181 bits : 128 ,
183182 openssl_name : c"ECDHE-RSA-AES128-GCM-SHA256" ,
184183 standard_name : c"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" ,
185184 version : c"TLSv1.2" ,
186185 description : c"ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(128) Mac=AEAD\n " ,
187- rustls : CipherSuite :: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 ,
188186} ;
189187
190188static TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 : SslCipher = SslCipher {
189+ rustls : & provider:: cipher_suite:: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,
191190 auth : constants:: NID_AUTH_RSA ,
192191 kx : constants:: NID_KX_ECDHE ,
193192 bits : 256 ,
194193 openssl_name : c"ECDHE-RSA-AES256-GCM-SHA384" ,
195194 standard_name : c"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" ,
196195 version : c"TLSv1.2" ,
197196 description : c"ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD\n " ,
198- rustls : CipherSuite :: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ,
199197} ;
200198
201199static TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 : SslCipher = SslCipher {
200+ rustls : & provider:: cipher_suite:: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 ,
202201 auth : constants:: NID_AUTH_RSA ,
203202 kx : constants:: NID_KX_ECDHE ,
204203 bits : 256 ,
205204 openssl_name : c"ECDHE-RSA-CHACHA20-POLY1305" ,
206205 standard_name : c"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" ,
207206 version : c"TLSv1.2" ,
208207 description : c"ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD\n " ,
209- rustls : CipherSuite :: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 ,
210208} ;
211209
212210static TLS13_AES_128_GCM_SHA256 : SslCipher = SslCipher {
211+ rustls : & provider:: cipher_suite:: TLS13_AES_128_GCM_SHA256 ,
213212 auth : constants:: NID_AUTH_ANY ,
214213 kx : constants:: NID_KX_ANY ,
215214 bits : 128 ,
216215 openssl_name : c"TLS_AES_128_GCM_SHA256" ,
217216 standard_name : c"TLS_AES_128_GCM_SHA256" ,
218217 version : c"TLSv1.3" ,
219218 description : c"TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD\n " ,
220- rustls : CipherSuite :: TLS13_AES_128_GCM_SHA256 ,
221219} ;
222220
223221static TLS13_AES_256_GCM_SHA384 : SslCipher = SslCipher {
222+ rustls : & provider:: cipher_suite:: TLS13_AES_256_GCM_SHA384 ,
224223 auth : constants:: NID_AUTH_ANY ,
225224 kx : constants:: NID_KX_ANY ,
226225 bits : 256 ,
227226 openssl_name : c"TLS_AES_256_GCM_SHA384" ,
228227 standard_name : c"TLS_AES_256_GCM_SHA384" ,
229228 version : c"TLSv1.3" ,
230229 description : c"TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD\n " ,
231- rustls : CipherSuite :: TLS13_AES_256_GCM_SHA384 ,
232230} ;
233231
234232static TLS13_CHACHA20_POLY1305_SHA256 : SslCipher = SslCipher {
233+ rustls : & provider:: cipher_suite:: TLS13_CHACHA20_POLY1305_SHA256 ,
235234 auth : constants:: NID_AUTH_ANY ,
236235 kx : constants:: NID_KX_ANY ,
237236 bits : 256 ,
238237 openssl_name : c"TLS_CHACHA20_POLY1305_SHA256" ,
239238 standard_name : c"TLS_CHACHA20_POLY1305_SHA256" ,
240239 version : c"TLSv1.3" ,
241240 description : c"TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any Au=any Enc=CHACHA20/POLY1305(256) Mac=AEAD\n " ,
242- rustls : CipherSuite :: TLS13_CHACHA20_POLY1305_SHA256 ,
243241} ;
244242
245243#[ allow( dead_code) ]
@@ -624,7 +622,7 @@ impl SslContext {
624622 // a ticketer. Doing so is wasteful for a client, and incompatible with miri
625623 // (due to calls to a foreign function, `RAND_bytes`).
626624 let ticketer = match !method. server_versions . is_empty ( ) && cfg ! ( not( miri) ) {
627- true => Ticketer :: new ( ) . ok ( ) ,
625+ true => provider :: Ticketer :: new ( ) . ok ( ) ,
628626 false => None ,
629627 } ;
630628 Self {
0 commit comments