Skip to content

Commit

Permalink
Fix Lint
Browse files Browse the repository at this point in the history
Signed-off-by: Menno de Graaf <[email protected]>
  • Loading branch information
Menno de Graaf authored and AssemblyJohn committed Mar 15, 2024
1 parent 6b0aaca commit 06db569
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions include/evse_security/evse_security.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include <everest/timer.hpp>

#include <evse_security/crypto/evse_crypto.hpp>
#include <evse_security/evse_types.hpp>
#include <evse_security/utils/evse_filesystem_types.hpp>
#include <evse_security/crypto/evse_crypto.hpp>

#include <map>
#include <mutex>
Expand Down Expand Up @@ -87,10 +87,10 @@ class EvseSecurity {
/// @brief Verifies the given \p certificate_chain for the given \p certificate_type against the respective CA
/// certificates for the leaf.
/// @param certificate_chain PEM formatted certificate or certificate chain
/// @param certificate_type type of the leaf certificate
/// @param certificate_type type of the root certificate for which the chain is verified
/// @return result of the operation
CertificateValidationError verify_certificate(const std::string& certificate_chain,
const CaCertificateType certificate_type);
const CaCertificateType certificate_type);

/// @brief Verifies the given \p certificate_chain for the given \p certificate_type against the respective CA
/// certificates for the leaf and if valid installs the certificate on the filesystem. Before installing on the
Expand Down Expand Up @@ -123,7 +123,7 @@ class EvseSecurity {
/// @param certificate_type type of the leaf certificate
/// @return contains OCSP request data
OCSPRequestDataList get_ocsp_request_data(const std::string& certificate_chain,
const CaCertificateType certificate_type);
const CaCertificateType certificate_type);

/// @brief Updates the OCSP cache for the given \p certificate_hash_data with the given \p ocsp_response
/// @param certificate_hash_data identifies the certificate for which the \p ocsp_response is specified
Expand Down Expand Up @@ -198,7 +198,7 @@ class EvseSecurity {
private:
// Internal versions of the functions do not lock the mutex
CertificateValidationError verify_certificate_internal(const std::string& certificate_chain,
CaCertificateType certificate_type);
CaCertificateType certificate_type);
GetKeyPairResult get_key_pair_internal(LeafCertificateType certificate_type, EncodingFormat encoding);

/// @brief Determines if the total filesize of certificates is > than the max_filesystem_usage bytes
Expand Down
6 changes: 3 additions & 3 deletions lib/evse_security/evse_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ OCSPRequestDataList EvseSecurity::get_ocsp_request_data() {
}

OCSPRequestDataList EvseSecurity::get_ocsp_request_data(const std::string& certificate_chain,
const CaCertificateType certificate_type) {
const CaCertificateType certificate_type) {
std::lock_guard<std::mutex> guard(EvseSecurity::security_mutex);

OCSPRequestDataList response;
Expand Down Expand Up @@ -1101,14 +1101,14 @@ bool EvseSecurity::verify_file_signature(const fs::path& path, const std::string
}

CertificateValidationError EvseSecurity::verify_certificate(const std::string& certificate_chain,
CaCertificateType certificate_type) {
CaCertificateType certificate_type) {
std::lock_guard<std::mutex> guard(EvseSecurity::security_mutex);

return verify_certificate_internal(certificate_chain, certificate_type);
}

CertificateValidationError EvseSecurity::verify_certificate_internal(const std::string& certificate_chain,
CaCertificateType certificate_type) {
CaCertificateType certificate_type) {
try {
X509CertificateBundle certificate(certificate_chain, EncodingFormat::PEM);
std::vector<X509Wrapper> _certificate_chain = certificate.split();
Expand Down

0 comments on commit 06db569

Please sign in to comment.