Skip to content

Commit

Permalink
Fixing empty string in EvseSecurity config (#708)
Browse files Browse the repository at this point in the history
* Checking if private key password is empty and passing std::nullopt to EvseSecurity ctor in this case
---------

Signed-off-by: pietfried <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]>
Co-authored-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
Pietfried and hikinggrass authored Jun 18, 2024
1 parent b11e1e3 commit 6d67d7e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/EvseSecurity/main/evse_securityImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ void evse_securityImpl::init() {
certs_path / this->mod->config.csms_leaf_key_directory,
certs_path / this->mod->config.secc_leaf_cert_directory,
certs_path / this->mod->config.secc_leaf_key_directory};
this->evse_security =
std::make_unique<evse_security::EvseSecurity>(file_paths, this->mod->config.private_key_password);

std::optional<std::string> private_key_password = std::nullopt;
if (!this->mod->config.private_key_password.empty()) {
private_key_password = this->mod->config.private_key_password;
}

this->evse_security = std::make_unique<evse_security::EvseSecurity>(file_paths, private_key_password);
}

void evse_securityImpl::ready() {
Expand Down

0 comments on commit 6d67d7e

Please sign in to comment.