Skip to content

Commit

Permalink
fix: rename config variables
Browse files Browse the repository at this point in the history
  • Loading branch information
shingoxx222 committed Nov 15, 2024
1 parent eb89ebe commit bcf645f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions config/v201/component_config/standardized/InternalCtrlr.json
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@
"default": "60",
"type": "integer"
},
"AllowCSMSRootCertInstallWhenSecurityProfile1": {
"variable_name": "AllowCSMSRootCertInstallWhenSecurityProfile1",
"AllowCSMSRootCertInstallWithUnsecureConnection": {
"variable_name": "AllowCSMSRootCertInstallWithUnsecureConnection",
"characteristics": {
"supportsMonitoring": true,
"dataType": "boolean"
Expand All @@ -787,8 +787,8 @@
"default": true,
"type": "boolean"
},
"AllowMFRootCertInstallWhenSecurityProfile1": {
"variable_name": "AllowMFRootCertInstallWhenSecurityProfile1",
"AllowMFRootCertInstallWithUnsecureConnection": {
"variable_name": "AllowMFRootCertInstallWithUnsecureConnection",
"characteristics": {
"supportsMonitoring": true,
"dataType": "boolean"
Expand Down
4 changes: 2 additions & 2 deletions include/ocpp/v201/ctrlr_component_variables.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ extern const ComponentVariable& MaxCertificateChainSize;
extern const ComponentVariable& UpdateCertificateSymlinks;
extern const RequiredComponentVariable& OrganizationName;
extern const RequiredComponentVariable& SecurityProfile;
extern const ComponentVariable& AllowCSMSRootCertInstallWhenSecurityProfile1;
extern const ComponentVariable& AllowMFRootCertInstallWhenSecurityProfile1;
extern const ComponentVariable& AllowCSMSRootCertInstallWithUnsecureConnection;
extern const ComponentVariable& AllowMFRootCertInstallWithUnsecureConnection;
extern const ComponentVariable& ACPhaseSwitchingSupported;
extern const ComponentVariable& SmartChargingCtrlrAvailable;
extern const ComponentVariable& SmartChargingCtrlrEnabled;
Expand Down
8 changes: 4 additions & 4 deletions lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3597,12 +3597,12 @@ bool ChargePoint::should_allow_certificate_install(InstallCertificateUseEnum cer
switch (cert_type) {
case InstallCertificateUseEnum::CSMSRootCertificate:
return this->device_model
->get_optional_value<bool>(ControllerComponentVariables::AllowCSMSRootCertInstallWhenSecurityProfile1)
->get_optional_value<bool>(ControllerComponentVariables::AllowCSMSRootCertInstallWithUnsecureConnection)
.value_or(true);

case InstallCertificateUseEnum::ManufacturerRootCertificate:
return this->device_model
->get_optional_value<bool>(ControllerComponentVariables::AllowMFRootCertInstallWhenSecurityProfile1)
->get_optional_value<bool>(ControllerComponentVariables::AllowMFRootCertInstallWithUnsecureConnection)
.value_or(true);
default:
return true;
Expand All @@ -3618,8 +3618,8 @@ void ChargePoint::handle_install_certificate_req(Call<InstallCertificateRequest>
if (!should_allow_certificate_install(msg.certificateType)) {
response.status = InstallCertificateStatusEnum::Rejected;
response.statusInfo = StatusInfo();
response.statusInfo->reasonCode = "LowSecurityProfile";
response.statusInfo->additionalInfo = "CertificateInstallationNotAllowedWhenSecurityProfile1";
response.statusInfo->reasonCode = "UnsecureConnection";
response.statusInfo->additionalInfo = "CertificateInstallationNotAllowedWithUnsecureConnection";
} else {
const auto result = this->evse_security->install_ca_certificate(
msg.certificate.get(), ocpp::evse_security_conversions::from_ocpp_v201(msg.certificateType));
Expand Down
8 changes: 4 additions & 4 deletions lib/ocpp/v201/ctrlr_component_variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,18 @@ const ComponentVariable& ResumeTransactionsOnBoot = {
"ResumeTransactionsOnBoot",
}),
};
const ComponentVariable& AllowCSMSRootCertInstallWhenSecurityProfile1 = {
const ComponentVariable& AllowCSMSRootCertInstallWithUnsecureConnection = {
ControllerComponents::InternalCtrlr,
std::nullopt,
std::optional<Variable>({
"AllowCSMSRootCertInstallWhenSecurityProfile1",
"AllowCSMSRootCertInstallWithUnsecureConnection",
}),
};
const ComponentVariable& AllowMFRootCertInstallWhenSecurityProfile1 = {
const ComponentVariable& AllowMFRootCertInstallWithUnsecureConnection = {
ControllerComponents::InternalCtrlr,
std::nullopt,
std::optional<Variable>({
"AllowMFRootCertInstallWhenSecurityProfile1",
"AllowMFRootCertInstallWithUnsecureConnection",
}),
};
const ComponentVariable& AlignedDataCtrlrEnabled = {
Expand Down

0 comments on commit bcf645f

Please sign in to comment.