Add Composite ML-DSA support for HTTPS#63280
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Composite ML-DSA (Machine Learning Digital Signature Algorithm) to HTTPS in Kestrel. This follows up on previous work to enable post-quantum cryptographic support in the ASP.NET Core web server.
- Adds support for all 18 Composite ML-DSA algorithm variants for certificate loading and test generation
- Refactors existing test infrastructure to use shared dictionaries for algorithm definitions
- Includes comprehensive tests (disabled due to certificate generation limitations)
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| KestrelConfigurationLoaderTests.cs | Refactors algorithm handling and adds Composite ML-DSA test support with shared dictionaries |
| CertificateConfigLoader.cs | Adds OID constants and certificate loading logic for all 18 Composite ML-DSA variants |
| private static readonly Dictionary<string, MLDsaAlgorithm> _mlDsaAlgorithms = ((IEnumerable<MLDsaAlgorithm>)[ | ||
| MLDsaAlgorithm.MLDsa44, | ||
| MLDsaAlgorithm.MLDsa65, | ||
| MLDsaAlgorithm.MLDsa87, | ||
| ]).ToDictionary(a => a.Name); |
There was a problem hiding this comment.
This refactor allows us to add more algorithms to test without having to repeat the algorithm name in 3 different places.
| const string SlhDsaShake_256sOid = "2.16.840.1.101.3.4.3.30"; | ||
| const string SlhDsaShake_256fOid = "2.16.840.1.101.3.4.3.31"; | ||
|
|
||
| const string MLDsa44WithRSA2048PssPreHashSha256Oid = "2.16.840.1.114027.80.9.0"; |
There was a problem hiding this comment.
These seem wrong? Ref https://datatracker.ietf.org/doc/draft-ietf-lamps-pq-composite-sigs/
<CompSig>is equal to 2.16.840.1.114027.80.9.1
id-MLDSA44-RSA2048-PSS-SHA256|<CompSig>.0
That would equal 2.16.840.1.114027.80.9.1.0
There was a problem hiding this comment.
Wow, good catch. We should probably fix https://github.com/dotnet/runtime/blob/f514fa50f3385d28fad10d3e1ef5b75a8dfa84f5/src/libraries/Common/src/System/Security/Cryptography/Oids.cs#L138-L155 then (that's where I copied these from).
There was a problem hiding this comment.
Follow-up to #62866 with support for Composite ML-DSA.
Tests are included, but disabled because certificate generation for composite ML-DSA is not currently implemented.
Fixes #62030