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

Adjust certificate hash data conversion #227

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/ocpp/common/evse_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ocpp::v201::CertificateHashDataChain to_ocpp_v201(ocpp::CertificateHashDataChain
ocpp::v201::CertificateHashDataChain lhs;
lhs.certificateType = to_ocpp_v201(other.certificateType);
lhs.certificateHashData = to_ocpp_v201(other.certificateHashData);
if (other.childCertificateHashData.has_value()) {
if (other.childCertificateHashData.has_value() && !other.childCertificateHashData.value().empty()) {
std::vector<ocpp::v201::CertificateHashDataType> v;
for (const auto& certificate_hash_data : other.childCertificateHashData.value()) {
v.push_back(to_ocpp_v201(certificate_hash_data));
Expand Down
2 changes: 1 addition & 1 deletion lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,7 @@ void ChargePoint::handle_get_installed_certificate_ids_req(Call<GetInstalledCert

// convert the common type back to the v201 type(s) for the response
std::vector<CertificateHashDataChain> certificate_hash_data_chain_v201;
for (const auto certificate_hash_data_chain_entry : certificate_hash_data_chains) {
for (const auto& certificate_hash_data_chain_entry : certificate_hash_data_chains) {
certificate_hash_data_chain_v201.push_back(
ocpp::evse_security_conversions::to_ocpp_v201(certificate_hash_data_chain_entry));
}
Expand Down