Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
verify_cert: correct handling of fatal errors.
Previously the handling of fatal path building errors (e.g. those that should halt all further exploration of the path space) was mishandled such that we could hit the maximum signature budget and still pursue additional path building. This was demonstrated by the `test_too_many_path_calls` unit test which was hitting a `MaximumSignatureChecksExceeded` error, but yet proceeding until hitting a `MaximumPathBuildCallsExceeded` error. This commit centralizes the determination of whether an error is fatal or not to a new `Error.is_fatal` fn, allowing the logic to be used in the two places we need to evaluate an error for fatal status in `verify_cert.rs`. We now correctly terminate path building for fatal errors after evaluating a path to a trust anchor, instead of proceeding for further path building. The existing `test_too_many_path_calls` test is updated to use an artificially large signature check budget so that we can focus on testing the limit we care about for that test without needing to invest in more complicated test case generation. This avoids hitting a `MaximumSignatureChecksExceeded` error early in the test (which now terminates further path building), instead allowing execution to continue until the maximum path building call budget is expended (matching the previous behaviour and intent of the original test).
- Loading branch information