Skip to content

Commit

Permalink
Updated sec module interfaces/implementation
Browse files Browse the repository at this point in the history
Signed-off-by: AssemblyJohn <[email protected]>
  • Loading branch information
AssemblyJohn committed Oct 22, 2024
1 parent 78e9c17 commit adbf31a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/staging/evse_security/conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,11 @@ types::evse_security::OCSPRequestDataList to_everest(evse_security::OCSPRequestD
types::evse_security::CertificateInfo to_everest(evse_security::CertificateInfo other) {
types::evse_security::CertificateInfo lhs;
lhs.key = other.key;
lhs.certificate_root = other.certificate_root;
lhs.certificate = other.certificate;
lhs.certificate_single = other.certificate_single;
lhs.password = other.password;
lhs.certificate_count = other.certificate_count;
lhs.certificate_count = other.certificate_count;
return lhs;
}

Expand Down
19 changes: 19 additions & 0 deletions modules/EvseSecurity/main/evse_securityImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,25 @@ evse_securityImpl::handle_get_leaf_certificate_info(types::evse_security::LeafCe
return response;
}

types::evse_security::GetCertificateFullInfoResult
evse_securityImpl::handle_get_all_valid_certificates_info(types::evse_security::LeafCertificateType& certificate_type,
types::evse_security::EncodingFormat& encoding, bool& include_ocsp) {
types::evse_security::GetCertificateFullInfoResult response;

const auto full_leaf_info = this->evse_security->get_all_valid_certificates_info(
conversions::from_everest(certificate_type), conversions::from_everest(encoding), include_ocsp);

response.status = conversions::to_everest(full_leaf_info.status);

if (full_leaf_info.status == evse_security::GetCertificateInfoStatus::Accepted) {
for(const auto& info : full_leaf_info.info) {
response.info.push_back(conversions::to_everest(info));
}
}

return response;
}

std::string evse_securityImpl::handle_get_verify_file(types::evse_security::CaCertificateType& certificate_type) {
return this->evse_security->get_verify_file(conversions::from_everest(certificate_type));
}
Expand Down
1 change: 1 addition & 0 deletions types/evse_security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ types:
type: object
required:
- status
- info
properties:
status:
description: The status of the requested command
Expand Down

0 comments on commit adbf31a

Please sign in to comment.