Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-27 08:28:45 +02:00
parent 9e9a227332
commit dd96cc4bf3
3 changed files with 28 additions and 30 deletions

View File

@@ -174,17 +174,16 @@ fn gen_certificate(req: GenCertificateReq) -> anyhow::Result<(Option<Vec<u8>>, V
cert_builder.set_not_after(&not_after)?;
// Specify CRL URL
if let Some(issuer) = req.issuer {
if let Some(crl) = &issuer.crl {
let crl_url = format!(
"{}/pki/{}",
AppConfig::get().unsecure_origin(),
crl.file_name().unwrap().to_string_lossy()
);
if let Some(issuer) = req.issuer
&& let Some(crl) = &issuer.crl
{
let crl_url = format!(
"{}/pki/{}",
AppConfig::get().unsecure_origin(),
crl.file_name().unwrap().to_string_lossy()
);
cert_builder
.append_extension(CRLDistributionPointExt { url: crl_url }.as_extension()?)?;
}
cert_builder.append_extension(CRLDistributionPointExt { url: crl_url }.as_extension()?)?;
}
// If cert is a CA or not
@@ -424,12 +423,12 @@ fn refresh_crl(d: &CertData, new_cert: Option<&X509>) -> anyhow::Result<()> {
}
// Add old entries
if let Some(old_crl) = old_crl {
if let Some(entries) = old_crl.get_revoked() {
for entry in entries {
if X509_CRL_add0_revoked(crl, X509_REVOKED_dup(entry.as_ptr())) == 0 {
return Err(PKIError::GenCRLError("X509_CRL_add0_revoked").into());
}
if let Some(old_crl) = old_crl
&& let Some(entries) = old_crl.get_revoked()
{
for entry in entries {
if X509_CRL_add0_revoked(crl, X509_REVOKED_dup(entry.as_ptr())) == 0 {
return Err(PKIError::GenCRLError("X509_CRL_add0_revoked").into());
}
}
}