-
Notifications
You must be signed in to change notification settings - Fork 76
verifier: Fix TSA cert chain construction #1482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,9 +128,18 @@ def _verify_signed_timestamp( | |
| for certificate_authority in cert_authorities: | ||
| certificates = certificate_authority.certificates(allow_expired=True) | ||
|
|
||
| builder = VerifierBuilder() | ||
| # We expect at least a signing cert and a root cert but there may be intermediates | ||
| if len(certificates) < 2: | ||
| _logger.debug("Unable to verify Timestamp: cert chain is incomplete") | ||
| continue | ||
|
|
||
| builder = ( | ||
| VerifierBuilder() | ||
| .tsa_certificate(certificates.pop(0)) | ||
| .add_root_certificate(certificates.pop()) | ||
| ) | ||
| for certificate in certificates: | ||
| builder.add_root_certificate(certificate) | ||
| builder = builder.add_intermediate_certificate(certificate) | ||
|
Comment on lines
+141
to
+142
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Flagging, nonblocking: we could add these with In practice that's probably a marginal performance benefit, however. |
||
|
|
||
| verifier = builder.build() | ||
| try: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.