8000 Add test coverage for truststore loading with ML-DSA certificates by Tijl-B · Pull Request #55821 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Add test coverage for truststore loading with ML-DSA certificates - #55821

Open
Tijl-B wants to merge 1 commit into
keycloak:mainfrom
Tijl-B:truststore-ml-dsa-tests
Open

Tijl-B wants to merge 1 commit into
keycloak:mainfrom
Tijl-B:truststore-ml-dsa-tests

Conversation

@Tijl-B
@Tijl-B Tijl-B commented Dec 4, 2026
Copy link
Copy Markdown

Closes #50680

Decisions and assumptions:

  • The fixture truststores-ml-dsa/roots.pem holds three self-signed ML-DSA roots (44/65/87) generated with keytool -genkeypair -keyalg ML-DSA, valid for 100 years. It is outside truststores/ because TruststoreBuilderTest.testMergedTrustStoreFromDirectory scans that folder recursively.
  • No production change was needed, the existing code already handles ML-DSA certificates.
  • The tests do not perform a TLS handshake, so they do not depend on PQC TLS support in the JDK (see Verify LDAP federation compatibility on PQC-capable JDK #50789).
  • The tests also pass on a JDK without native ML-DSA (checked on Temurin 17.0.9) because DefaultCryptoProvider registers BouncyCastle, which supplies the ML-DSA signature verification. For that reason there is no JDK-specific guard.
  • No documentation change needed as the change is test-only.

I used an AI assistant (Claude) to help write these tests, and I reviewed the code and ran the tests myself.

Closes keycloak#50680

Signed-off-by: Tijl Bormans <tijl.bormans@bexio.com>
@Tijl-B
Tijl-B requested a review from a team as a code owner December 4, 2026 18:50
Copilot AI balanced review requested due to automatic review settings December 4, 2026 18:50
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the added ML-DSA truststore regression coverage.

No open issues 🎉

What changed in this PR

Adds regression coverage for ML-DSA certificates in Keycloak’s existing truststore handling, addressing #50680 without production changes or TLS handshakes.

Changes:

  • Adds self-signed ML-DSA-44/65/87 certificate fixtures.
  • Tests PEM loading and PKCS12 round-trip loading.
  • Tests trusted-root classification and SSL socket factory initialization.
File Description
services/​src/​test/​resources/​truststores-ml-dsa/​roots.pem Adds three ML-DSA root certificates outside existing recursive-scan fixtures.
services/​src/​test/​java/​org/​keycloak/​truststore/​TruststoreBuilderTest.java Covers ML-DSA truststore loading from PEM and PKCS12.
services/​src/​test/​java/​org/​keycloak/​truststore/​FileTruststoreProviderFactoryTest.java Covers root classification, socket factory creation, and accepted issuers.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test coverage for truststore loading with PQC certificates

2 participants

0