Repository navigation
Conversation
|
Hey, seems like a lot is in here. Would you mind sharing the prompting and LLM used? JOSSL doesn't even have full 3.0 (Ruby API) compatibility yet and given the minimal BC requirements bump this might take a bit to (review and) merge. We also need to check what to do with BC-FIPS regarding these, which might be a blocker. We would very likely not be shipping this in a patch release. |
|
Hello, thanks for the very quick review. This was assisted by GPT-6-Astra, with several conversations to refine the implementation, so I don't have one single prompt to report here. The guiding principle was to maintain backwards compatibility, follow the established example of ECDSA with a similar implementation and style, and cover all the new functionality with tests. We don't really need to bump BC requirements, however: with BC 1.80, ML-DSA keys and certificates work, only mTLS would fail the handshake when the client or server tries to negotiate ML-DSA. This part does require 1.82. For BC-FIPS, I found that this is going to be released soon, it's already early access: |
|
Thanks, yes once the new BC-FIPS is out this should get unblocked. Code looks good, from what I can tell. I want to prompt a deep (security/feature parity) review and maybe close compatibility; didn't want to use the same stack as for development (am on low token budget for running multiple ones 😅). We'll keep returning to this one, appreciate moving ML-DSA support forward. |
06884af to
7177710
Compare
Expose ML-DSA-44, ML-DSA-65, and ML-DSA-87 through the existing PKey API, including pure signatures and X.509 operations. Use BC key specs to accept standard seed encodings on BC 1.80 and emit standard expanded PKCS#8 across supported BC versions. Report the exact parameter-set key type so BCJSSE can select a credential. Select the existing TLS provider path for default SSL contexts with ML-DSA credentials. Let Net::HTTP present the identity without Java-specific application code or an SSL method override. Keep cipher queries and their cache consistent with the selected provider. Preserve classical defaults, callback timing, and explicit provider and protocol policies. Add independent OpenSSL fixtures, regression tests, and TLS acceptance coverage on Java 11 with BCJSSE 1.82 and Java 25 with current BC. Run acceptance through a separate task with the required startup properties. Document BC 1.80 key support, BCJSSE 1.82 TLS support, and explicit signature-scheme policy. Test all three ML-DSA server identities with a default SSL context. Add an optional native OpenSSL task to check JRuby key exports and signatures independently for all three parameter sets.
7177710 to
75955e1
Compare
|
Given the developments this week, could we revisit the balance between compatibility with older Bouncy Castle versions and making ML-DSA available to JRuby applications? Amazon, Anthropic, Apple, Cloudflare, Google, Microsoft, OpenAI and Oracle have issued a joint statement supporting accelerated migration to NIST-standardized post-quantum algorithms. The NSA has also urged an immediate transition for US national security systems. This PR would let JRuby applications start working with ML-DSA keys, certificates and mutual TLS through the existing Ruby API. Could we agree on the remaining steps to get it into 0.20.0, including the independent security and compatibility review? On compatibility, perhaps we could keep existing functionality working with older BC versions and enable ML-DSA when the necessary provider capabilities are available, with a clear error otherwise. As discussed above, key operations need BC 1.80+, and the ML-DSA TLS path needs BCJSSE 1.82+. If supporting older BC versions makes the implementation or review significantly more difficult, I think a higher minimum version in 0.20.0, with a documented migration path, would be a reasonable tradeoff. |
This change lets JRuby applications use ML-DSA through the existing OpenSSL API. It supports ML-DSA-44, ML-DSA-65, and ML-DSA-87.
Applications can generate and import keys, sign and verify messages, and use ML-DSA with certificates, certificate requests, and revocation lists. Net::HTTP clients can present an ML-DSA identity without Java-specific application code.
The implementation uses Bouncy Castle and existing PKey and TLS helpers. Key operations require BC 1.80 or later. TLS requires BCJSSE 1.82 or later, with ML-DSA signature schemes enabled.
Tests cover independent OpenSSL fixtures, invalid inputs, mixed certificate chains, and real TLS GET and POST requests. Negative TLS tests check certificate trust, hostname, expiry, and client identity.
Inspired by Filippo's post-quantum cryptographic guidance: https://words.filippo.io/right-answers/