Skip to content

Commit

Permalink
wip: show quadratic time in absence of path build limit
Browse files Browse the repository at this point in the history
  • Loading branch information
cpu committed Sep 15, 2023
1 parent 0ce4235 commit 3584ed4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/verify_cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ fn check_signed_chain_name_constraints(

pub struct Budget {
signatures: usize,
#[allow(dead_code)]
build_chain_calls: usize,
name_constraint_comparisons: usize,
}
Expand All @@ -199,10 +200,13 @@ impl Budget {

#[inline]
fn consume_build_chain_call(&mut self) -> Result<(), Error> {
/*
self.build_chain_calls = self
.build_chain_calls
.checked_sub(1)
.ok_or(Error::MaximumPathBuildCallsExceeded)?;
*/
Ok(())
}

Expand Down Expand Up @@ -565,7 +569,7 @@ mod tests {
#[cfg(feature = "alloc")]
fn test_too_many_path_calls() {
assert!(matches!(
dbg!(build_degenerate_chain(10, TrustAnchor::InChain, None)),
dbg!(build_degenerate_chain(20, TrustAnchor::InChain, None)),
ControlFlow::Break(Error::MaximumPathBuildCallsExceeded)
));
}
Expand Down

0 comments on commit 3584ed4

Please sign in to comment.