-
Notifications
You must be signed in to change notification settings - Fork 57
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
Refactored pki_handler to evse_security #157
Conversation
Pietfried
commented
Aug 31, 2023
- removed pki handler impl and header from libocpp and replaced by evse_security.hpp, which can be provided externally from libocpp consumer.
- Refactored all parts where pki_handler was used with usage of evse_security
- added dependency to libevse-security and used this for implementation of evse_security interface. This internal evse_security_impl is used if no external implementation is given in the ChargePoint constructor
/// \param certificate_type specifies the CA certificate type | ||
/// \return result of the operation | ||
virtual InstallCertificateResult install_ca_certificate(const std::string& certificate, | ||
const CaCertificateType& certificate_type) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering this in our call earlier today too. Why are we passing enum class arguments by const reference? Seems like by value would be simpler and more code efficient as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just a matter of habbit, they could also be passed by value. In general, there are a couple of things we could target for a larger styling refactor of libocpp, which is already on our list :)
563697c
to
e8983aa
Compare
e8983aa
to
6a6c582
Compare
lib/ocpp/v201/charge_point.cpp
Outdated
this->device_model->get_optional_value<bool>(ControllerComponentVariables::AdditionalRootCertificateCheck) | ||
.value_or(false)); | ||
this->database_handler = std::make_shared<DatabaseHandler>(core_database_path, sql_init_path); | ||
this->evse_security = evse_security; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line. evse_security is already initialized in ChargingStationBase. If you set evse_security to nullptr, a new instance is created in ChargingStationBase and overwritten with this line.
4b7d0b8
to
643dfe2
Compare
643dfe2
to
5c2c133
Compare
…_security.hpp, which can be provided externally from libocpp consumer. Refactored all parts where pki_handler was used with usage of evse_security Signed-off-by: pietfried <[email protected]>
… of evse_security interface. This internal evse_security_impl is used of no external implementation is given in the ChargePoint constructor Signed-off-by: pietfried <[email protected]>
Signed-off-by: Ioan Bogdann <[email protected]> Signed-off-by: pietfried <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: pietfried <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]> Signed-off-by: pietfried <[email protected]>
Signed-off-by: Kai-Uwe Hermann <[email protected]> Signed-off-by: pietfried <[email protected]>
48a9fc1
to
2530619
Compare