]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(ocpp20): implement proper M04.FR.06 guard via isChargingStationCertificateHash
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 15 Mar 2026 20:16:10 +0000 (21:16 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 15 Mar 2026 20:16:10 +0000 (21:16 +0100)
commit47ced3bb98adf9723227ab83beaa720440b131a2
treebde15f9ce5ea7690eb012cc6d1a09015b7a11e1b
parent4266b93a48795234d27f2a980cc3cde0b80977ed
fix(ocpp20): implement proper M04.FR.06 guard via isChargingStationCertificateHash

The previous M04.FR.06 guard was ineffective: it called
getInstalledCertificates() which scans root cert directories and
maps types via mapInstallTypeToGetType(), which has no case for
ChargingStationCertificate (stored via CertificateSigned, not
InstallCertificate). The V2GCertificateChain filter never matched.

Add isChargingStationCertificateHash() to OCPP20CertificateManager
that directly scans the ChargingStationCertificate directory and
compares certificate hashes. Use it in handleRequestDeleteCertificate
for a reliable M04.FR.06 guard.
src/charging-station/ocpp/2.0/OCPP20CertificateManager.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-DeleteCertificate.test.ts
tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts