Improve local certificate signing#2048
Conversation
…time. there is language in spec that stations may be RSA-only or ECDSA-only capable. the CSMS is expected to support both sides. currently, the default selection chooses issuer by CSR public key family: - RSA CSR -> RSA issuer - ECDSA CSR -> ECDSA issuer this may be too simple and naive. however, real production installations should use a known PKI provider anyways. CertificateSigningServiceLocal is just for fallback/testing.
we have two TC_074 test cases for the SignCertificate flow now: - RSA CSR -> expects RSA-signed certificate - ECDSA/P-256 CSR -> expects ECDSA-signed certificate
we dont have to retain RSA PKCS#1 support. the spec expresses "For signing by the certificate authority RSA-PSS, or ECDSA SHOULD be used."
Review Summary by QodoSupport simultaneous RSA and ECDSA certificate signing in local CSR service
WalkthroughsDescription• Refactor local CSR signing to support both RSA and ECDSA simultaneously • Replace single issuer configuration with separate RSA and ECDSA issuer configs • Implement issuer selection logic based on CSR public key family • Add comprehensive test coverage for both RSA and ECDSA certificate signing flows • Simplify signature algorithm resolution to use RSA-PSS and ECDSA only Diagramflowchart LR
A["Single Issuer Config"] -->|Refactor| B["Dual Issuer Config<br/>RSA + ECDSA"]
B --> C["CertificateIssuerMaterial<br/>Record"]
C --> D["Issuer Selection<br/>by CSR Key Type"]
D --> E["Sign Certificate<br/>with Selected Issuer"]
F["TC_074 RSA Test"] --> G["Enhanced Test Suite"]
H["TC_074 ECDSA Test"] --> G
File Changes1. src/main/java/de/rwth/idsg/steve/config/SteveProperties.java
|
Code Review by Qodo
1. triggerFuture.join() lacks timeout
|
| var params = new ExtendedTriggerMessageParams(); | ||
| params.setChargeBoxIdList(List.of(REGISTERED_CHARGE_BOX_ID)); | ||
| params.setTriggerMessage(ExtendedTriggerMessage.MessageTriggerEnumType.SIGN_CHARGE_POINT_CERTIFICATE); | ||
|
|
||
| var triggerFuture = supplyAsyncUnchecked(() -> operationsService.extendedTriggerMessage(params)); | ||
|
|
||
| chargePoint.expectRequest( | ||
| new ExtendedTriggerMessage() | ||
| .withRequestedMessage(ExtendedTriggerMessage.MessageTriggerEnumType.SIGN_CHARGE_POINT_CERTIFICATE), | ||
| new ExtendedTriggerMessageResponse() | ||
| .withStatus(ExtendedTriggerMessageResponse.TriggerMessageStatusEnumType.ACCEPTED) | ||
| ); | ||
|
|
||
| var triggerStatus = successResponse(triggerFuture.join()); | ||
| assertEquals(ExtendedTriggerMessageResponse.TriggerMessageStatusEnumType.ACCEPTED.value(), triggerStatus.value()); |
There was a problem hiding this comment.
1. triggerfuture.join() lacks timeout 📘 Rule violation ☼ Reliability
The new integration test waits on an async result using triggerFuture.join() without any bounded timeout, which can hang indefinitely and cause flaky/non-deterministic CI behavior.
Agent Prompt
## Issue description
The test uses `triggerFuture.join()` which has no timeout and can block forever if the async operation never completes.
## Issue Context
Compliance requires deterministic async waits with explicit timeout handling.
## Fix Focus Areas
- src/test/java/de/rwth/idsg/steve/certification/ocpp16/Ocpp16JsonCsmsCertification_TLS_IT.java[293-307]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
refactor local CSR signing to support both RSA and ECDSA at the same time. the CSMS is expected to support both:
currently, the default selection chooses issuer by CSR public key family: