#[non_exhaustive]pub enum Error {
NoPathFound,
DepthExceeded,
BudgetExceeded,
MalformedIntermediate,
}Expand description
Errors returned by path building.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoPathFound
No valid path from the target certificate to any trust anchor was found.
DepthExceeded
A topologically valid path exists but requires more intermediates than
the configured maximum (see PathBuilderConfig::max_depth, default
DEFAULT_MAX_DEPTH).
BudgetExceeded
The internal DFS node-visit budget was exhausted in a single round.
This guards against adversarial certificate pools that would otherwise
cause exponential search time. Each iterative-deepening round and the
depth probe start with a fresh budget of DFS_BUDGET node visits.
MalformedIntermediate
Reserved for future diagnostic use. Path building no longer
surfaces this variant: a candidate whose BasicConstraints extension
is present but cannot be DER-decoded is silently skipped, just like
candidates with cA = FALSE or no BasicConstraints extension at
all. This skip-not-fail behaviour is required so that a single
malformed certificate in a CMS SignedData.certificates bag (or any
other unsolicited-cert pool) cannot poison verification of an
otherwise-valid chain.
The variant is retained because Error is #[non_exhaustive] and
a future diagnostic mode may want to surface decode failures
explicitly. Build_path itself returns Error::NoPathFound when no
chain can be built — including when the only available intermediates
have a malformed BasicConstraints extension.
Trait Implementations§
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()