Skip to content

Commit

Permalink
Updated interface for security library
Browse files Browse the repository at this point in the history
Signed-off-by: AssemblyJohn <[email protected]>
  • Loading branch information
AssemblyJohn committed Dec 4, 2024
1 parent 6c9fffc commit 20669e3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ libcurl:
# of libocpp and would otherwise be overwritten by the version used there
libevse-security:
git: https://github.com/EVerest/libevse-security.git
git_tag: v0.9.1
git_tag: v0.9.2
cmake_condition: "EVEREST_DEPENDENCY_ENABLED_LIBEVSE_SECURITY"

# OCPP
libocpp:
git: https://github.com/EVerest/libocpp.git
git_tag: 9836ac4766e99a79555adb15c3001c8704f8b7a7
git_tag: 469629c615e369f4bb77b3b2f861e0d56b550d15
cmake_condition: "EVEREST_DEPENDENCY_ENABLED_LIBOCPP"
# Josev
Josev:
Expand Down
10 changes: 10 additions & 0 deletions interfaces/evse_security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ cmds:
result:
description: The path of the CA bundle file
type: string
get_verify_location:
description: Command to get the file path of the CA root directory that can be used for verification. Will also invoke c_rehash for that directory
arguments:
certificate_type:
description: Specifies that CA certificate type
type: string
$ref: /evse_security#/CaCertificateType
result:
description: The path of the CA certificates directory
type: string
get_leaf_expiry_days_count:
description: >-
Command to get the days count until the given leaf certificate expires.
Expand Down
4 changes: 4 additions & 0 deletions lib/staging/ocpp/evse_security_ocpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ std::string EvseSecurity::get_verify_file(const ocpp::CaCertificateType& certifi
return this->r_security.call_get_verify_file(conversions::from_ocpp(certificate_type));
}

std::string EvseSecurity::get_verify_location(const ocpp::CaCertificateType& certificate_type) {
return this->r_security.call_get_verify_location(conversions::from_ocpp(certificate_type));
}

int EvseSecurity::get_leaf_expiry_days_count(const ocpp::CertificateSigningUseEnum& certificate_type) {
return this->r_security.call_get_leaf_expiry_days_count(conversions::from_ocpp(certificate_type));
}
Expand Down
1 change: 1 addition & 0 deletions lib/staging/ocpp/evse_security_ocpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class EvseSecurity : public ocpp::EvseSecurity {
bool include_ocsp) override;
bool update_certificate_links(const ocpp::CertificateSigningUseEnum& certificate_type) override;
std::string get_verify_file(const ocpp::CaCertificateType& certificate_type) override;
std::string get_verify_location(const ocpp::CaCertificateType& certificate_type) override;
int get_leaf_expiry_days_count(const ocpp::CertificateSigningUseEnum& certificate_type) override;
};

Expand Down
4 changes: 4 additions & 0 deletions modules/EvseSecurity/main/evse_securityImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ std::string evse_securityImpl::handle_get_verify_file(types::evse_security::CaCe
return this->evse_security->get_verify_file(conversions::from_everest(certificate_type));
}

std::string evse_securityImpl::handle_get_verify_location(types::evse_security::CaCertificateType& certificate_type) {
return this->evse_security->handle_get_verify_location(conversions::from_everest(certificate_type));
}

int evse_securityImpl::handle_get_leaf_expiry_days_count(types::evse_security::LeafCertificateType& certificate_type) {
return this->evse_security->get_leaf_expiry_days_count(conversions::from_everest(certificate_type));
}
Expand Down
1 change: 1 addition & 0 deletions modules/EvseSecurity/main/evse_securityImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class evse_securityImpl : public evse_securityImplBase {
handle_get_all_valid_certificates_info(types::evse_security::LeafCertificateType& certificate_type,
types::evse_security::EncodingFormat& encoding, bool& include_ocsp) override;
virtual std::string handle_get_verify_file(types::evse_security::CaCertificateType& certificate_type) override;
virtual std::string handle_get_verify_location(types::evse_security::CaCertificateType& certificate_type) override;
virtual int handle_get_leaf_expiry_days_count(types::evse_security::LeafCertificateType& certificate_type) override;
virtual bool handle_verify_file_signature(std::string& file_path, std::string& signing_certificate,
std::string& signature) override;
Expand Down

0 comments on commit 20669e3

Please sign in to comment.