1313//! any parts of the system outside of these tests. See the `#![cfg(...)]`
1414//! immediately below to see which platforms run these tests.
1515
16- #![ cfg( any(
17- windows,
18- target_os = "android" ,
19- target_os = "macos" ,
20- target_os = "linux"
21- ) ) ]
16+ #![ cfg( all( any( windows, unix, target_os = "android" ) , not( target_os = "ios" ) ) ) ]
2217
2318use super :: TestCase ;
2419use crate :: tests:: { assert_cert_error_eq, verification_time} ;
@@ -116,47 +111,47 @@ fn test_verification_without_mock_root() {
116111// Verifies that our test trust anchor(s) are not trusted when `Verifier::new()`
117112// is used.
118113mock_root_test_cases ! {
119- valid_no_stapling_dns [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
114+ valid_no_stapling_dns [ any( windows, unix ) ] => TestCase {
120115 reference_id: EXAMPLE_COM ,
121116 chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD , ROOT1_INT1 ] ,
122117 stapled_ocsp: None ,
123118 verification_time: verification_time( ) ,
124119 expected_result: Ok ( ( ) ) ,
125120 other_error: no_error!( ) ,
126121 } ,
127- valid_no_stapling_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
122+ valid_no_stapling_ipv4 [ any( windows, unix ) ] => TestCase {
128123 reference_id: LOCALHOST_IPV4 ,
129124 chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
130125 stapled_ocsp: None ,
131126 verification_time: verification_time( ) ,
132127 expected_result: Ok ( ( ) ) ,
133128 other_error: no_error!( ) ,
134129 } ,
135- valid_no_stapling_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
130+ valid_no_stapling_ipv6 [ any( windows, unix ) ] => TestCase {
136131 reference_id: LOCALHOST_IPV6 ,
137132 chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
138133 stapled_ocsp: None ,
139134 verification_time: verification_time( ) ,
140135 expected_result: Ok ( ( ) ) ,
141136 other_error: no_error!( ) ,
142137 } ,
143- valid_stapled_good_dns [ any( windows, target_os = "android" , target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
138+ valid_stapled_good_dns [ any( windows, unix ) ] => TestCase {
144139 reference_id: EXAMPLE_COM ,
145140 chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD , ROOT1_INT1 ] ,
146141 stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_example.com-good.ocsp" ) ) ,
147142 verification_time: verification_time( ) ,
148143 expected_result: Ok ( ( ) ) ,
149144 other_error: no_error!( ) ,
150145 } ,
151- valid_stapled_good_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
146+ valid_stapled_good_ipv4 [ any( windows, unix ) ] => TestCase {
152147 reference_id: LOCALHOST_IPV4 ,
153148 chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
154149 stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_127.0.0.1-good.ocsp" ) ) ,
155150 verification_time: verification_time( ) ,
156151 expected_result: Ok ( ( ) ) ,
157152 other_error: no_error!( ) ,
158153 } ,
159- valid_stapled_good_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
154+ valid_stapled_good_ipv6 [ any( windows, unix ) ] => TestCase {
160155 reference_id: LOCALHOST_IPV6 ,
161156 chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
162157 stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_1-good.ocsp" ) ) ,
@@ -197,23 +192,23 @@ mock_root_test_cases! {
197192 // (AIA is an extension that allows downloading of missing data,
198193 // like missing certificates, during validation; see
199194 // https://datatracker.ietf.org/doc/html/rfc5280#section-5.2.7).
200- ee_only_dns [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
195+ ee_only_dns [ any( windows, unix ) ] => TestCase {
201196 reference_id: EXAMPLE_COM ,
202197 chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD ] ,
203198 stapled_ocsp: None ,
204199 verification_time: verification_time( ) ,
205200 expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: UnknownIssuer ) ) ,
206201 other_error: no_error!( ) ,
207202 } ,
208- ee_only_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
203+ ee_only_ipv4 [ any( windows, unix ) ] => TestCase {
209204 reference_id: LOCALHOST_IPV4 ,
210205 chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD ] ,
211206 stapled_ocsp: None ,
212207 verification_time: verification_time( ) ,
213208 expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: UnknownIssuer ) ) ,
214209 other_error: no_error!( ) ,
215210 } ,
216- ee_only_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
211+ ee_only_ipv6 [ any( windows, unix ) ] => TestCase {
217212 reference_id: LOCALHOST_IPV6 ,
218213 chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD ] ,
219214 stapled_ocsp: None ,
@@ -222,31 +217,31 @@ mock_root_test_cases! {
222217 other_error: no_error!( ) ,
223218 } ,
224219 // Validation fails when the certificate isn't valid for the reference ID.
225- domain_mismatch_dns [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
220+ domain_mismatch_dns [ any( windows, unix ) ] => TestCase {
226221 reference_id: "example.org" ,
227222 chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD , ROOT1_INT1 ] ,
228223 stapled_ocsp: None ,
229224 verification_time: verification_time( ) ,
230225 expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
231226 other_error: no_error!( ) ,
232227 } ,
233- domain_mismatch_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
228+ domain_mismatch_ipv4 [ any( windows, unix ) ] => TestCase {
234229 reference_id: "198.168.0.1" ,
235230 chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
236231 stapled_ocsp: None ,
237232 verification_time: verification_time( ) ,
238233 expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
239234 other_error: no_error!( ) ,
240235 } ,
241- domain_mismatch_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
236+ domain_mismatch_ipv6 [ any( windows, unix ) ] => TestCase {
242237 reference_id: "::ffff:c6a8:1" ,
243238 chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
244239 stapled_ocsp: None ,
245240 verification_time: verification_time( ) ,
246241 expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
247242 other_error: no_error!( ) ,
248243 } ,
249- wrong_eku_dns [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
244+ wrong_eku_dns [ any( windows, unix ) ] => TestCase {
250245 reference_id: EXAMPLE_COM ,
251246 chain: & [ include_bytes!( "root1-int1-ee_example.com-wrong_eku.crt" ) , ROOT1_INT1 ] ,
252247 stapled_ocsp: None ,
@@ -255,7 +250,7 @@ mock_root_test_cases! {
255250 CertificateError :: Other ( Arc :: from( EkuError ) ) ) ) ,
256251 other_error: Some ( EkuError ) ,
257252 } ,
258- wrong_eku_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
253+ wrong_eku_ipv4 [ any( windows, unix ) ] => TestCase {
259254 reference_id: LOCALHOST_IPV4 ,
260255 chain: & [ include_bytes!( "root1-int1-ee_127.0.0.1-wrong_eku.crt" ) , ROOT1_INT1 ] ,
261256 stapled_ocsp: None ,
@@ -264,7 +259,7 @@ mock_root_test_cases! {
264259 CertificateError :: Other ( Arc :: from( EkuError ) ) ) ) ,
265260 other_error: Some ( EkuError ) ,
266261 } ,
267- wrong_eku_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
262+ wrong_eku_ipv6 [ any( windows, unix ) ] => TestCase {
268263 reference_id: LOCALHOST_IPV6 ,
269264 chain: & [ include_bytes!( "root1-int1-ee_1-wrong_eku.crt" ) , ROOT1_INT1 ] ,
270265 stapled_ocsp: None ,
0 commit comments