Skip to content

Commit

Permalink
Tweak style in distribution point handling
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jul 26, 2023
1 parent cd964da commit 92a91ac
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,18 @@ impl<'a> CrlDistributionPoint<'a> {
// a DistributionPoint MUST NOT consist of only the reasons field; either distributionPoint or
// cRLIssuer MUST be present.
match (result.distribution_point, result.crl_issuer) {
(None, None) => return Err(Error::MalformedExtensions),
_ => {}
(None, None) => Err(Error::MalformedExtensions),
_ => Ok(result),
}

Ok(result)
})
}

/// Return the distribution point names (if any).
#[allow(dead_code)] // TODO(@cpu): remove this once used in CRL validation.
pub(crate) fn names(&self) -> Result<Option<DistributionPointName<'a>>, Error> {
Ok(match self.distribution_point {
None => None,
Some(der) => Some(DistributionPointName::from_der(der)?),
})
self.distribution_point
.map(DistributionPointName::from_der)
.transpose()
}
}

Expand Down

0 comments on commit 92a91ac

Please sign in to comment.