Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a missing return statement #72

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading