Skip to content

Commit

Permalink
Fixed a missing return statement
Browse files Browse the repository at this point in the history
Signed-off-by: AssemblyJohn <[email protected]>
  • Loading branch information
AssemblyJohn committed May 15, 2024
1 parent 34ced9f commit 5ab512a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/evse_security/evse_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,15 @@ GetCertificateInfoResult EvseSecurity::get_leaf_certificate_info_internal(LeafCe
<< " single leaf not found at path: " << cert_dir;
}

if (leaf_single == nullptr && leaf_fullchain == nullptr) {
// None were found
EVLOG_error << "Could not find any leaf certificate for:"
<< conversions::leaf_certificate_type_to_string(certificate_type);

result.status = GetCertificateInfoStatus::NotFound;
return result;
}

// Include OCSP data if possible
if (include_ocsp && (leaf_fullchain != nullptr || leaf_single != nullptr)) {
X509CertificateBundle root_bundle(root_dir, EncodingFormat::PEM); // Required for hierarchy
Expand Down Expand Up @@ -1244,6 +1253,9 @@ GetCertificateInfoResult EvseSecurity::get_leaf_certificate_info_internal(LeafCe
result.status = GetCertificateInfoStatus::NotFound;
return result;
}

result.status = GetCertificateInfoStatus::NotFound;
return result;
}

bool EvseSecurity::update_certificate_links(LeafCertificateType certificate_type) {
Expand Down

0 comments on commit 5ab512a

Please sign in to comment.