File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,18 @@ def traverse_chain(cert: x509.Certificate) -> CRLValidationResult | None:
373373 return CRLValidationResult .REVOKED
374374
375375 is_being_visited .add (chain [0 ].subject )
376- return traverse_chain (chain [0 ])
376+ error_result = False
377+ revoked_result = False
378+ for cert in subject_certificates [chain [0 ].subject ]:
379+ result = traverse_chain (cert )
380+ if result == CRLValidationResult .UNREVOKED :
381+ return result
382+ error_result |= result == CRLValidationResult .ERROR
383+ revoked_result |= result == CRLValidationResult .REVOKED
384+
385+ if error_result or not revoked_result :
386+ return CRLValidationResult .ERROR
387+ return CRLValidationResult .REVOKED
377388
378389 def _is_certificate_trusted_by_os (self , cert : x509 .Certificate ) -> bool :
379390 if trusted_cert := self ._trusted_ca .get (cert .subject ):
Original file line number Diff line number Diff line change @@ -636,25 +636,17 @@ def test_cross_signed_certificate_chain(cert_gen, session_manager):
636636 ]
637637 assert not validator .validate_certificate_chains (chains )
638638
639-
640- def test_cross_signed_certificate_chain_revoked_CA (cert_gen , session_manager ):
641- chain = cert_gen .create_cross_signed_chain ()
639+ # mingled A and B paths passed in one chain - A has no connection to CA, B has
642640 chains = [
643641 [
644642 chain .leafA ,
645643 chain .AsignB ,
646644 chain .leafB ,
647- chain .BsignA ,
645+ # chain.BsignA,
648646 chain .rootB ,
649- chain .rootA ,
647+ # chain.rootA,
650648 ]
651649 ]
652- validator = CRLValidator (
653- session_manager ,
654- cert_revocation_check_mode = CertRevocationCheckMode .ENABLED ,
655- allow_certificates_without_crl_url = True ,
656- trusted_certificates = [cert_gen .ca_certificate ],
657- )
658650 assert validator .validate_certificate_chains (chains )
659651
660652
You can’t perform that action at this time.
0 commit comments