13
13
//! any parts of the system outside of these tests. See the `#![cfg(...)]`
14
14
//! immediately below to see which platforms run these tests.
15
15
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" ) ) ) ]
22
17
23
18
use super :: TestCase ;
24
19
use crate :: tests:: { assert_cert_error_eq, verification_time} ;
@@ -116,47 +111,47 @@ fn test_verification_without_mock_root() {
116
111
// Verifies that our test trust anchor(s) are not trusted when `Verifier::new()`
117
112
// is used.
118
113
mock_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 {
120
115
reference_id: EXAMPLE_COM ,
121
116
chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD , ROOT1_INT1 ] ,
122
117
stapled_ocsp: None ,
123
118
verification_time: verification_time( ) ,
124
119
expected_result: Ok ( ( ) ) ,
125
120
other_error: no_error!( ) ,
126
121
} ,
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 {
128
123
reference_id: LOCALHOST_IPV4 ,
129
124
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
130
125
stapled_ocsp: None ,
131
126
verification_time: verification_time( ) ,
132
127
expected_result: Ok ( ( ) ) ,
133
128
other_error: no_error!( ) ,
134
129
} ,
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 {
136
131
reference_id: LOCALHOST_IPV6 ,
137
132
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
138
133
stapled_ocsp: None ,
139
134
verification_time: verification_time( ) ,
140
135
expected_result: Ok ( ( ) ) ,
141
136
other_error: no_error!( ) ,
142
137
} ,
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 {
144
139
reference_id: EXAMPLE_COM ,
145
140
chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD , ROOT1_INT1 ] ,
146
141
stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_example.com-good.ocsp" ) ) ,
147
142
verification_time: verification_time( ) ,
148
143
expected_result: Ok ( ( ) ) ,
149
144
other_error: no_error!( ) ,
150
145
} ,
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 {
152
147
reference_id: LOCALHOST_IPV4 ,
153
148
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
154
149
stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_127.0.0.1-good.ocsp" ) ) ,
155
150
verification_time: verification_time( ) ,
156
151
expected_result: Ok ( ( ) ) ,
157
152
other_error: no_error!( ) ,
158
153
} ,
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 {
160
155
reference_id: LOCALHOST_IPV6 ,
161
156
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
162
157
stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_1-good.ocsp" ) ) ,
@@ -197,23 +192,23 @@ mock_root_test_cases! {
197
192
// (AIA is an extension that allows downloading of missing data,
198
193
// like missing certificates, during validation; see
199
194
// 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 {
201
196
reference_id: EXAMPLE_COM ,
202
197
chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD ] ,
203
198
stapled_ocsp: None ,
204
199
verification_time: verification_time( ) ,
205
200
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: UnknownIssuer ) ) ,
206
201
other_error: no_error!( ) ,
207
202
} ,
208
- ee_only_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
203
+ ee_only_ipv4 [ any( windows, unix ) ] => TestCase {
209
204
reference_id: LOCALHOST_IPV4 ,
210
205
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD ] ,
211
206
stapled_ocsp: None ,
212
207
verification_time: verification_time( ) ,
213
208
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: UnknownIssuer ) ) ,
214
209
other_error: no_error!( ) ,
215
210
} ,
216
- ee_only_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
211
+ ee_only_ipv6 [ any( windows, unix ) ] => TestCase {
217
212
reference_id: LOCALHOST_IPV6 ,
218
213
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD ] ,
219
214
stapled_ocsp: None ,
@@ -222,31 +217,31 @@ mock_root_test_cases! {
222
217
other_error: no_error!( ) ,
223
218
} ,
224
219
// 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 {
226
221
reference_id: "example.org" ,
227
222
chain: & [ ROOT1_INT1_EXAMPLE_COM_GOOD , ROOT1_INT1 ] ,
228
223
stapled_ocsp: None ,
229
224
verification_time: verification_time( ) ,
230
225
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
231
226
other_error: no_error!( ) ,
232
227
} ,
233
- domain_mismatch_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
228
+ domain_mismatch_ipv4 [ any( windows, unix ) ] => TestCase {
234
229
reference_id: "198.168.0.1" ,
235
230
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
236
231
stapled_ocsp: None ,
237
232
verification_time: verification_time( ) ,
238
233
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
239
234
other_error: no_error!( ) ,
240
235
} ,
241
- domain_mismatch_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
236
+ domain_mismatch_ipv6 [ any( windows, unix ) ] => TestCase {
242
237
reference_id: "::ffff:c6a8:1" ,
243
238
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
244
239
stapled_ocsp: None ,
245
240
verification_time: verification_time( ) ,
246
241
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
247
242
other_error: no_error!( ) ,
248
243
} ,
249
- wrong_eku_dns [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
244
+ wrong_eku_dns [ any( windows, unix ) ] => TestCase {
250
245
reference_id: EXAMPLE_COM ,
251
246
chain: & [ include_bytes!( "root1-int1-ee_example.com-wrong_eku.crt" ) , ROOT1_INT1 ] ,
252
247
stapled_ocsp: None ,
@@ -255,7 +250,7 @@ mock_root_test_cases! {
255
250
CertificateError :: Other ( Arc :: from( EkuError ) ) ) ) ,
256
251
other_error: Some ( EkuError ) ,
257
252
} ,
258
- wrong_eku_ipv4 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
253
+ wrong_eku_ipv4 [ any( windows, unix ) ] => TestCase {
259
254
reference_id: LOCALHOST_IPV4 ,
260
255
chain: & [ include_bytes!( "root1-int1-ee_127.0.0.1-wrong_eku.crt" ) , ROOT1_INT1 ] ,
261
256
stapled_ocsp: None ,
@@ -264,7 +259,7 @@ mock_root_test_cases! {
264
259
CertificateError :: Other ( Arc :: from( EkuError ) ) ) ) ,
265
260
other_error: Some ( EkuError ) ,
266
261
} ,
267
- wrong_eku_ipv6 [ any( windows, target_os = "android" , target_os = "macos" , target_os = "linux" ) ] => TestCase {
262
+ wrong_eku_ipv6 [ any( windows, unix ) ] => TestCase {
268
263
reference_id: LOCALHOST_IPV6 ,
269
264
chain: & [ include_bytes!( "root1-int1-ee_1-wrong_eku.crt" ) , ROOT1_INT1 ] ,
270
265
stapled_ocsp: None ,
0 commit comments