@@ -237,58 +237,42 @@ pub fn amazon() {
237237 Some ( & all_crls) ,
238238 ] {
239239 let builder = PathBuilder :: new (
240+ & intermediates,
241+ crls. map ( |c| revocation_options_for_test ( c) ) ,
240242 & ExtendedKeyUsage :: SERVER_AUTH ,
241243 ALL_VERIFICATION_ALGS ,
242244 & anchors,
243- )
244- . with_intermediate_certs ( & intermediates) ;
245-
246- let builder = match crls {
247- Some ( crls) => builder. with_revocation ( revocation_options_for_test ( crls) ) ,
248- None => builder,
249- } ;
245+ ) ;
250246
251247 assert ! ( builder. build( & cert, time) . is_ok( ) ) ;
252248
253249 let builder = PathBuilder :: new (
250+ & intermediates_legacy,
251+ crls. map ( |c| revocation_options_for_test ( c) ) ,
254252 & ExtendedKeyUsage :: SERVER_AUTH ,
255253 ALL_VERIFICATION_ALGS ,
256254 & legacy_anchors,
257- )
258- . with_intermediate_certs ( & intermediates_legacy) ;
259-
260- let builder = match crls {
261- Some ( crls) => builder. with_revocation ( revocation_options_for_test ( crls) ) ,
262- None => builder,
263- } ;
255+ ) ;
264256
265257 assert ! ( builder. build( & cert, time) . is_ok( ) ) ;
266258
267259 let builder = PathBuilder :: new (
260+ & intermediates_legacy,
261+ crls. map ( |c| revocation_options_for_test ( c) ) ,
268262 & ExtendedKeyUsage :: SERVER_AUTH ,
269263 ALL_VERIFICATION_ALGS ,
270264 & all_anchors,
271- )
272- . with_intermediate_certs ( & intermediates_legacy) ;
273-
274- let builder = match crls {
275- Some ( crls) => builder. with_revocation ( revocation_options_for_test ( crls) ) ,
276- None => builder,
277- } ;
265+ ) ;
278266
279267 assert ! ( builder. build( & cert, time) . is_ok( ) ) ;
280268
281269 let builder = PathBuilder :: new (
270+ & intermediates_legacy,
271+ crls. map ( |c| revocation_options_for_test ( c) ) ,
282272 & ExtendedKeyUsage :: SERVER_AUTH ,
283273 ALL_VERIFICATION_ALGS ,
284274 & all_anchors,
285- )
286- . with_intermediate_certs ( & intermediates_legacy) ;
287-
288- let builder = match crls {
289- Some ( crls) => builder. with_revocation ( revocation_options_for_test ( crls) ) ,
290- None => builder,
291- } ;
275+ ) ;
292276
293277 // verify should find shortest path
294278 let path = builder. build ( & cert, time) . unwrap ( ) ;
@@ -302,28 +286,24 @@ pub fn amazon() {
302286
303287 for & crls in & [ None , Some ( & roots_crls) ] {
304288 let builder = PathBuilder :: new (
289+ & intermediates,
290+ crls. map ( |c| revocation_options_for_test ( c) ) ,
305291 & ExtendedKeyUsage :: SERVER_AUTH ,
306292 ALL_VERIFICATION_ALGS ,
307293 & anchors,
308- )
309- . with_intermediate_certs ( & intermediates) ;
310-
311- let builder = match crls {
312- Some ( crls) => builder. with_revocation ( revocation_options_for_test ( crls) ) ,
313- None => builder,
314- } ;
294+ ) ;
315295
316296 assert ! ( builder. build( & cert, time) . is_ok( ) ) ;
317297 }
318298
319299 for & crls in & [ & intermediates_crls, & all_crls] {
320300 let builder = PathBuilder :: new (
301+ & intermediates,
302+ Some ( revocation_options_for_test ( crls) ) ,
321303 & ExtendedKeyUsage :: SERVER_AUTH ,
322304 ALL_VERIFICATION_ALGS ,
323305 & anchors,
324- )
325- . with_intermediate_certs ( & intermediates)
326- . with_revocation ( revocation_options_for_test ( crls) ) ;
306+ ) ;
327307
328308 assert ! (
329309 builder
@@ -335,11 +315,12 @@ pub fn amazon() {
335315
336316 for & ( cert, _dns_name) in expired_certs {
337317 let builder = PathBuilder :: new (
318+ & intermediates,
319+ None ,
338320 & ExtendedKeyUsage :: SERVER_AUTH ,
339321 ALL_VERIFICATION_ALGS ,
340322 & anchors,
341- )
342- . with_intermediate_certs ( & intermediates) ;
323+ ) ;
343324
344325 let cert = CertificateDer :: from ( cert) ;
345326 let cert = EndEntityCert :: try_from ( & cert) . unwrap ( ) ;
0 commit comments