fix(revocation): validate bundle freshness policy inputs - #288
Open
altrudev wants to merge 2 commits into
Open
Conversation
Contributor
|
🔴 Contributor Check: HIGH
Automated check by AgenTrust Contributor Check. |
lywinged
approved these changes
Sep 4, 2026
lywinged
left a comment
Collaborator
There was a problem hiding this comment.
Approved on 8de5b5b over fc38496. Reproduced on main: check_bundle() with max_bundle_age_seconds=True and max_future_skew_seconds=False runs through to an outcome. On this head each of the three seconds inputs refuses True and False with a ValueError naming the argument, and integers proceed to the bundle-shape outcome as before; the PR's own test file has 8 of 10 cases failing against main and none here. sign.verify_record() already refuses a boolean now, and max_age_seconds stays with #239 as the body says. Suite 1,177 passed, 1 skipped; ruff, mypy and the dash check clean.
Tool-assisted: the runs and this write-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #286.
What
The public revocation-bundle consumer used
now,max_bundle_age_seconds, andmax_future_skew_secondsdirectly in freshness arithmetic without holding them to the documented integer-seconds boundary.In Python, booleans are integer subclasses, so
True/Falsewere acted on as1/0seconds. Becausesign.verify_record()delegates bundle freshness tocheck_bundle(), the same boundary also affects its bundle-specificmax_bundle_age_secondswhen a bundle is actually checked.This change adds one local
_check_seconds()boundary inrevocation.pyand applies it before bundle shape or freshness evaluation.Ownership boundary
PR #239 already owns top-level Trust Record freshness validation for
sign.verify_record(max_age_seconds=...)andsign.verify_record(max_future_skew_seconds=...). This PR does not modify that lane.Regression coverage
The focused tests refuse
TrueandFalsefor:revocation.check_bundle(now=...);revocation.check_bundle(max_bundle_age_seconds=...);revocation.check_bundle(max_future_skew_seconds=...);sign.verify_record(max_bundle_age_seconds=...)when a revocation bundle is checked.Integer controls show the calls proceed to the existing bundle-shape outcome instead of being rejected by the new boundary.
No floating-point/double cases are part of this claim.
Scope
No change to defaults, bundle schema, freshness arithmetic, signature verification, or the three revocation outcome states.
AI-assistance disclosure: ChatGPT assisted with source triage, adversarial-case design, duplicate/ownership review, implementation drafting, and diff review.
altrudevreviewed the bounded claim and remains responsible for the contribution.