Skip to content

Commit

Permalink
Support for tpm CSR request
Browse files Browse the repository at this point in the history
Signed-off-by: AssemblyJohn <[email protected]>
  • Loading branch information
AssemblyJohn committed Dec 22, 2023
1 parent 637b04c commit 37ab80e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion include/evse_security/evse_security.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ class EvseSecurity {
/// @param country
/// @param organization
/// @param common
/// @param use_tpm If the TPM should be used for the CSR request
/// @return the PEM formatted certificate signing request
std::string generate_certificate_signing_request(LeafCertificateType certificate_type, const std::string& country,
const std::string& organization, const std::string& common);
const std::string& organization, const std::string& common, bool use_tpm);

/// @brief Searches the filesystem on the specified directories for the given \p certificate_type and retrieves the
/// most recent certificate that is already valid and the respective key. If no certificate is present or no key is
Expand Down
6 changes: 2 additions & 4 deletions lib/evse_security/evse_security.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ bool EvseSecurity::is_ca_certificate_installed(CaCertificateType certificate_typ
std::string EvseSecurity::generate_certificate_signing_request(LeafCertificateType certificate_type,
const std::string& country,
const std::string& organization,
const std::string& common) {
const std::string& common,
bool use_tpm) {
fs::path key_path;

const auto file_name = std::string("SECC_LEAF_") + filesystem_utils::get_random_file_name(KEY_EXTENSION.string());
Expand All @@ -574,9 +575,6 @@ std::string EvseSecurity::generate_certificate_signing_request(LeafCertificateTy
std::string csr;
CertificateSigningRequestInfo info;

// TODO(ioan): get this from the parameter when the interface will support it
bool use_tpm = false;

info.n_version = 0;
info.commonName = common;
info.country = country;
Expand Down

0 comments on commit 37ab80e

Please sign in to comment.