Skip to content

Add a signature validation budget during path construction#14960

Merged
alex merged 6 commits into
mainfrom
path-building-signature-budget
Jun 7, 2026
Merged

Add a signature validation budget during path construction#14960
alex merged 6 commits into
mainfrom
path-building-signature-budget

Conversation

@woodruffw
Copy link
Copy Markdown
Member

This extends our existing NC budget check to include a budget for signature validations. If a path construction exceeds the budget by performing more than the allowed number of signature validation steps, the entire construction fails.

For now, our budget is 128 signature validations. This is consistent with (higher than) Go and rustls-webpki, which both set a limit of 100. Like Go, we attempt to make the "best" use of our signature budget by ordering by likelihood, using AKI/SKI match as the strongest signal of fitness.

woodruffw added 6 commits June 6, 2026 19:41
This extends our existing NC budget check to include a budget
for signature validations. If a path construction exceeds the
budget by performing more than the allowed number of signature
validation steps, the entire construction fails.

For now, our budget is 128 signature validations. This is
consistent with (higher than) Go and rustls-webpki, which
both set a limit of 100. Like Go, we attempt to make the "best"
use of our signature budget by ordering by likelihood, using
AKI/SKI match as the strongest signal of fitness.
This reverts commit bcdb680.
Comment on lines +627 to +631
#[test]
fn test_clone() {
assert_eq!(NullOps::clone_public_key(&()), ());
assert_eq!(NullOps::clone_extra(&()), ());
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need NullOps for the coverage below, which means we need to "test" the empty trait impl bodies we add.

(We already do this for another test-only impl, PulicKeyErrorOps.)

@woodruffw woodruffw marked this pull request as ready for review June 7, 2026 01:15
@woodruffw woodruffw requested a review from alex June 7, 2026 01:16
.ok()
.unwrap();
let err = builder
.build_chain_inner(&working, u8::MAX, &ca_exts, name_chain, &mut budget)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This single line is the coverage-bearing one.

@alex alex merged commit 4a12cf4 into main Jun 7, 2026
64 checks passed
@alex alex deleted the path-building-signature-budget branch June 7, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants