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

Fixing empty string in EvseSecurity config #708

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

Pietfried
Copy link
Contributor

@Pietfried Pietfried commented Jun 5, 2024

Describe your changes

Checking if private key password is empty and passing std::nullopt to EvseSecurity ctor in this case.

This change is required, because even if the config parameter private_key_password is not configured, the constructor will pass an empty string instead of std::nullopt. This will cause private keys to be encrypted every time.

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

… EvseSecurity ctor in this case

Signed-off-by: pietfried <[email protected]>
@Pietfried Pietfried requested a review from AssemblyJohn as a code owner June 5, 2024 11:20
@SebaLukas
Copy link
Contributor

@Pietfried clang-format failed

@james-ctc
Copy link
Contributor

Note there are other places in the codebase where nullopt is converted to an empty string for passwords:
e.g.
EVP_PKEY_ptr evp_pkey(PEM_read_bio_PrivateKey(bio.get(), nullptr, nullptr, (void*)password.value_or("").c_str()));

Care is needed to ensure that existing keys that have been created with "" can still be used.

@Pietfried Pietfried merged commit 6d67d7e into main Jun 18, 2024
6 checks passed
@Pietfried Pietfried deleted the bugfix/empty-private-key-pw branch June 18, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants