]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(ocpp20): remediate all OCPP 2.0.1 audit findings (#1726)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 15 Mar 2026 15:10:29 +0000 (16:10 +0100)
committerGitHub <noreply@github.com>
Sun, 15 Mar 2026 15:10:29 +0000 (16:10 +0100)
commit3a6e89f6347a4b7771dfd2323b43ff89a2711325
tree2a81b555c9d75fe3e72f1a9d25784a74dba77b49
parent063f748d9a943e6a518e1cbcf0ea8202326afa47
fix(ocpp20): remediate all OCPP 2.0.1 audit findings (#1726)

* fix(ocpp20): add consistent statusInfo to all rejection responses

* fix(ocpp20): cache validatePersistentMappings and fix MinSet/MaxSet atomicity

* feat(ocpp20): implement SetNetworkProfile Accepted path per B09.FR.01

* fix(ocpp20): prevent deletion of ChargingStationCertificate per M04.FR.06

* feat(ocpp20): implement GetLog lifecycle with LogStatusNotification per N01

* fix(ocpp20): implement NotifyCustomerInformation pagination and N09.FR.09 validation

* feat(ocpp20): add X.509 certificate validation per A02.FR.06 and M05

* feat(ocpp20): implement UpdateFirmware lifecycle with status notifications per L01/L02

* feat(ocpp20): generate real PKCS#10 CSR with node:crypto per A02.FR.02

* feat(ocpp20): add firmware signature check, transaction blocking, cancellation

* docs(ocpp20): document OCSP limitation + enforce MaxCertificateChainSize

* style(ocpp20): fix all lint errors and warnings

* [autofix.ci] apply automated fixes

* fix(ocpp20): address PR review findings — enum fix, per-station cache, cancellation status

* [autofix.ci] apply automated fixes

* docs(ocpp20): document simulator limitations for SetNetworkProfile and X.509 validation

* refactor(ocpp20): extract ASN.1 DER utilities to dedicated module

* fix(ocpp20): scope invalidVariables per-station in VariableManager singleton

* [autofix.ci] apply automated fixes

* test(ocpp20): improve test hygiene — extract flushMicrotasks, remove dead code, strengthen spy coverage

* [autofix.ci] apply automated fixes

* fix(ocpp20): replace silent hashId fallback with fail-fast guard in VariableManager

* fix(ocpp20): align B09.FR.02 reasonCode to errata 2025-09 InvalidNetworkConf

* style(ocpp20): normalize spec ref format in additionalInfo to parentheses style

* fix(ocpp20): use request hashAlgorithm in M04.FR.06 guard for algorithm-independent certificate matching

* [autofix.ci] apply automated fixes

* style(ocpp20): harmonize message content — sentence case, consistent punctuation, no em-dash

* fix(ocpp20): unify .catch() log level to logger.error for all fire-and-forget notifications

* fix(ocpp20): remove noisy per-call OCSP stub warning — limitation already documented in JSDoc

* refactor(ocpp20): rename invalidVariablesPerStation to invalidVariables for naming consistency

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
19 files changed:
src/charging-station/ocpp/2.0/Asn1DerUtils.ts [new file with mode: 0644]
src/charging-station/ocpp/2.0/OCPP20CertificateManager.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/2.0/OCPP20RequestService.ts
src/charging-station/ocpp/2.0/OCPP20VariableManager.ts
src/types/ocpp/2.0/Common.ts
tests/charging-station/ocpp/2.0/Asn1DerUtils.test.ts [new file with mode: 0644]
tests/charging-station/ocpp/2.0/OCPP20CertificateManager.test.ts
tests/charging-station/ocpp/2.0/OCPP20CertificateTestData.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-CertificateSigned.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-CustomerInformation.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-DeleteCertificate.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetLog.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-SetNetworkProfile.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-UpdateFirmware.test.ts
tests/charging-station/ocpp/2.0/OCPP20RequestService-SignCertificate.test.ts
tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts
tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts
tests/helpers/TestLifecycleHelpers.ts