@@ -72,15 +72,15 @@ macro_rules! no_error {
72
72
const ROOT1 : & [ u8 ] = include_bytes ! ( "root1.crt" ) ;
73
73
const ROOT1_INT1 : & [ u8 ] = include_bytes ! ( "root1-int1.crt" ) ;
74
74
const ROOT1_INT1_EXAMPLE_COM_GOOD : & [ u8 ] = include_bytes ! ( "root1-int1-ee_example.com-good.crt" ) ;
75
- #[ cfg( any( windows, target_os = "macos" ) ) ]
75
+ #[ cfg( any( windows, target_os = "macos" , target_os = "linux" ) ) ]
76
76
const ROOT1_INT1_LOCALHOST_IPV4_GOOD : & [ u8 ] = include_bytes ! ( "root1-int1-ee_127.0.0.1-good.crt" ) ;
77
- #[ cfg( any( windows, target_os = "macos" ) ) ]
77
+ #[ cfg( any( windows, target_os = "macos" , target_os = "linux" ) ) ]
78
78
const ROOT1_INT1_LOCALHOST_IPV6_GOOD : & [ u8 ] = include_bytes ! ( "root1-int1-ee_1-good.crt" ) ;
79
79
80
80
const EXAMPLE_COM : & str = "example.com" ;
81
- #[ cfg( any( windows, target_os = "macos" ) ) ]
81
+ #[ cfg( any( windows, target_os = "macos" , target_os = "linux" ) ) ]
82
82
const LOCALHOST_IPV4 : & str = "127.0.0.1" ;
83
- #[ cfg( any( windows, target_os = "macos" ) ) ]
83
+ #[ cfg( any( windows, target_os = "macos" , target_os = "linux" ) ) ]
84
84
const LOCALHOST_IPV6 : & str = "::1" ;
85
85
86
86
#[ cfg( any( test, feature = "ffi-testing" ) ) ]
@@ -115,8 +115,8 @@ fn test_verification_without_mock_root() {
115
115
verification_without_mock_root ( )
116
116
}
117
117
118
- // Note: `WebPkiVerifier` (Linux) does not support IP address hosts, so these tests are disabled for Linux
119
- // Ref: https://docs.rs/rustls/0.20.6/src/rustls/verify.rs.html#322. Android does not currently support them either .
118
+ // Note: Android does not currently support IP address hosts, so these tests are disabled for
119
+ // Android.
120
120
// Verifies that our test trust anchor(s) are not trusted when `Verifier::new()`
121
121
// is used.
122
122
mock_root_test_cases ! {
@@ -127,14 +127,14 @@ mock_root_test_cases! {
127
127
expected_result: Ok ( ( ) ) ,
128
128
other_error: no_error!( ) ,
129
129
} ,
130
- valid_no_stapling_ipv4 [ any( windows, target_os = "macos" ) ] => TestCase {
130
+ valid_no_stapling_ipv4 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
131
131
reference_id: LOCALHOST_IPV4 ,
132
132
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
133
133
stapled_ocsp: None ,
134
134
expected_result: Ok ( ( ) ) ,
135
135
other_error: no_error!( ) ,
136
136
} ,
137
- valid_no_stapling_ipv6 [ any( windows, target_os = "macos" ) ] => TestCase {
137
+ valid_no_stapling_ipv6 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
138
138
reference_id: LOCALHOST_IPV6 ,
139
139
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
140
140
stapled_ocsp: None ,
@@ -148,14 +148,14 @@ mock_root_test_cases! {
148
148
expected_result: Ok ( ( ) ) ,
149
149
other_error: no_error!( ) ,
150
150
} ,
151
- valid_stapled_good_ipv4 [ any( windows, target_os = "macos" ) ] => TestCase {
151
+ valid_stapled_good_ipv4 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
152
152
reference_id: LOCALHOST_IPV4 ,
153
153
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
154
154
stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_127.0.0.1-good.ocsp" ) ) ,
155
155
expected_result: Ok ( ( ) ) ,
156
156
other_error: no_error!( ) ,
157
157
} ,
158
- valid_stapled_good_ipv6 [ any( windows, target_os = "macos" ) ] => TestCase {
158
+ valid_stapled_good_ipv6 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
159
159
reference_id: LOCALHOST_IPV6 ,
160
160
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
161
161
stapled_ocsp: Some ( include_bytes!( "root1-int1-ee_1-good.ocsp" ) ) ,
@@ -164,6 +164,8 @@ mock_root_test_cases! {
164
164
} ,
165
165
// Uses a separate certificate from the one used in the "good" case to deal
166
166
// with operating systems with validation data caches (e.g. Windows).
167
+ // Linux is not included, since the webpki verifier does not presently support OCSP revocation
168
+ // checking.
167
169
stapled_revoked_dns [ any( windows, target_os = "android" , target_os = "macos" ) ] => TestCase {
168
170
reference_id: EXAMPLE_COM ,
169
171
chain: & [ include_bytes!( "root1-int1-ee_example.com-revoked.crt" ) , ROOT1_INT1 ] ,
@@ -197,14 +199,14 @@ mock_root_test_cases! {
197
199
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: UnknownIssuer ) ) ,
198
200
other_error: no_error!( ) ,
199
201
} ,
200
- ee_only_ipv4 [ any( windows, target_os = "macos" ) ] => TestCase {
202
+ ee_only_ipv4 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
201
203
reference_id: LOCALHOST_IPV4 ,
202
204
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD ] ,
203
205
stapled_ocsp: None ,
204
206
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: UnknownIssuer ) ) ,
205
207
other_error: no_error!( ) ,
206
208
} ,
207
- ee_only_ipv6 [ any( windows, target_os = "macos" ) ] => TestCase {
209
+ ee_only_ipv6 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
208
210
reference_id: LOCALHOST_IPV6 ,
209
211
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD ] ,
210
212
stapled_ocsp: None ,
@@ -219,14 +221,14 @@ mock_root_test_cases! {
219
221
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
220
222
other_error: no_error!( ) ,
221
223
} ,
222
- domain_mismatch_ipv4 [ any( windows, target_os = "macos" ) ] => TestCase {
224
+ domain_mismatch_ipv4 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
223
225
reference_id: "198.168.0.1" ,
224
226
chain: & [ ROOT1_INT1_LOCALHOST_IPV4_GOOD , ROOT1_INT1 ] ,
225
227
stapled_ocsp: None ,
226
228
expected_result: Err ( TlsError :: InvalidCertificate ( CertificateError :: NotValidForName ) ) ,
227
229
other_error: no_error!( ) ,
228
230
} ,
229
- domain_mismatch_ipv6 [ any( windows, target_os = "macos" ) ] => TestCase {
231
+ domain_mismatch_ipv6 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
230
232
reference_id: "::ffff:c6a8:1" ,
231
233
chain: & [ ROOT1_INT1_LOCALHOST_IPV6_GOOD , ROOT1_INT1 ] ,
232
234
stapled_ocsp: None ,
@@ -241,15 +243,15 @@ mock_root_test_cases! {
241
243
CertificateError :: Other ( Arc :: from( EkuError ) ) ) ) ,
242
244
other_error: Some ( EkuError ) ,
243
245
} ,
244
- wrong_eku_ipv4 [ any( windows, target_os = "macos" ) ] => TestCase {
246
+ wrong_eku_ipv4 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
245
247
reference_id: LOCALHOST_IPV4 ,
246
248
chain: & [ include_bytes!( "root1-int1-ee_127.0.0.1-wrong_eku.crt" ) , ROOT1_INT1 ] ,
247
249
stapled_ocsp: None ,
248
250
expected_result: Err ( TlsError :: InvalidCertificate (
249
251
CertificateError :: Other ( Arc :: from( EkuError ) ) ) ) ,
250
252
other_error: Some ( EkuError ) ,
251
253
} ,
252
- wrong_eku_ipv6 [ any( windows, target_os = "macos" ) ] => TestCase {
254
+ wrong_eku_ipv6 [ any( windows, target_os = "macos" , target_os = "linux" ) ] => TestCase {
253
255
reference_id: LOCALHOST_IPV6 ,
254
256
chain: & [ include_bytes!( "root1-int1-ee_1-wrong_eku.crt" ) , ROOT1_INT1 ] ,
255
257
stapled_ocsp: None ,
0 commit comments