Skip to content

feat: Adds ML-DSA post-quantum signature algorithm support - #8527

Closed
siddhibhor-56 wants to merge 1 commit into
cert-manager:masterfrom
siddhibhor-56:PQC-poc
Closed

siddhibhor-56 wants to merge 1 commit into
cert-manager:masterfrom
siddhibhor-56:PQC-poc

Conversation

@siddhibhor-56

Copy link
Copy Markdown
Contributor

Pull Request Motivation

This PR adds ML-DSA-65 (Module-Lattice-Based Digital Signature Algorithm, security level 3) support to cert-manager as a proof of concept. It introduces MLDSA65 as a new PrivateKeyAlgorithm and PureMLDSA65 as a new SignatureAlgorithm, enabling cert-manager to generate ML-DSA-65 key pairs, create and parse CSRs, and sign certificates using this post-quantum scheme.
Since Go's standard crypto/x509 library does not yet support ML-DSA, this implementation uses cloudflare/circl and manually constructs the ASN.1 structures for CSRs and certificates using the FIPS 204 OID (2.16.840.1.101.3.4.3.18).
This PR covers SelfSigned and CA issuers only

Kind

feature

@cert-manager-prow

Copy link
Copy Markdown
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@cert-manager-prow cert-manager-prow Bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing labels Feb 19, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jakexks for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 19, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

Hi @siddhibhor-56. Thanks for your PR.

I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@siddhibhor-56 siddhibhor-56 changed the title [wip]:AddS ML-DSA-65 post-quantum signature algorithm support [WIP]:AddS ML-DSA-65 post-quantum signature algorithm support Feb 19, 2026
@cert-manager-prow cert-manager-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 19, 2026
@siddhibhor-56
siddhibhor-56 force-pushed the PQC-poc branch 2 times, most recently from 1e5c03c to 8ed4a07 Compare February 19, 2026 10:26
@cert-manager-prow cert-manager-prow Bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. and removed dco-signoff: no Indicates that at least one commit in this pull request is missing the DCO sign-off message. labels Feb 19, 2026
@siddhibhor-56

Copy link
Copy Markdown
Contributor Author

/kind feature

@cert-manager-prow cert-manager-prow Bot added kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Feb 19, 2026
@cert-manager-bot

Copy link
Copy Markdown
Contributor

Issues go stale after 6 months of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues remain open for an additional 3 months of inactivity and then close.
If this issue is safe to close now please do so with /close.
/lifecycle stale

@cert-manager-prow cert-manager-prow Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 26, 2026
@swghosh

swghosh commented Aug 26, 2026

Copy link
Copy Markdown

/remove-lifecycle stale

This is being tracked through #8929

@cert-manager-prow cert-manager-prow Bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 26, 2026
@cert-manager-prow cert-manager-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 23, 2026
@siddhibhor-56 siddhibhor-56 changed the title [WIP]:AddS ML-DSA-65 post-quantum signature algorithm support feat:Adds ML-DSA-65 post-quantum signature algorithm support Sep 23, 2026
@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2026
@siddhibhor-56 siddhibhor-56 changed the title feat:Adds ML-DSA-65 post-quantum signature algorithm support feat: Adds ML-DSA post-quantum signature algorithm support Sep 23, 2026
@cert-manager-prow cert-manager-prow Bot added area/acme Indicates a PR directly modifies the ACME Issuer code size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 23, 2026
FelixPhipps pushed a commit to FelixPhipps/FelixPhippsCertMgr that referenced this pull request Oct 7, 2026
Address review feedback on cert-manager#9436:

- Move the go directive to 1.27 in every go.mod instead of using a
  go1.27 build tag; drop the stub, internal/mldsa and min-Go CI jobs
- Build on cert-manager#8527, which now uses the standard library, and list what it
  still needs (MLDSA with size, ML-DSA-87, restored checks.go mismatch
  checks, feature gate, webhook validation, tests)
- Note maintainer agreement on the default parameter set (44) and
  openness to using the size field
- Describe the preparatory PR (go.mod bump plus safety checks) and the
  GODEBUG and lint impact of Go 1.27

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Felix Phipps <[email protected]>
@FelixPhipps

Copy link
Copy Markdown
Member

Hi @siddhibhor-56, thanks for this PR, and for moving it from circl to the standard library.

Some context on where things are now: master builds with Go 1.27 and #9440 has moved the go directive to 1.27, and there's a design for ML-DSA support in #9436. @SgtCoDFish has said on #8929 that we'd like to get this PR merged rather than start again, and I'd like to help you with that. The aim is to ship ML-DSA as an alpha feature, behind a feature gate, in v1.22.

I've compared the PR with the design. This is what it still needs:

API

  • algorithm: MLDSA with size: 44|65|87 (44 when size is unset), instead of separate MLDSA44/MLDSA65 algorithm values.
  • ML-DSA-87.
  • No ML-DSA signature algorithm values, so PureMLDSA44/PureMLDSA65 would be dropped. Each ML-DSA key can only produce one kind of signature, so there's nothing for users to choose (discussion). Instead, the webhook should reject any signatureAlgorithm set with algorithm: MLDSA. That needs an explicit check, because keyAlgToAllowedSigAlgs currently accepts any signature algorithm for a key algorithm it has no entry for.
  • An MLDSAPrivateKeys feature gate on the controller and the webhook, off by default. With the gate off, the webhook rejects new ML-DSA Certificates and CertificateRequests with ML-DSA CSRs, and the SelfSigned and CA issuers won't sign ML-DSA certificates.

Correctness

  • PublicKeysEqual now returns true for an unrecognised key type, and the error check after it in SecretPublicKeysDiffer (checks.go) is commented out. Together, these mean a key type cert-manager doesn't recognise would be treated as matching the certificate. The PR already adds a *mldsa.PublicKey case, so I think both can go back to how they were on master.
  • PrivateKeyMatchesSpec should compare the key's parameter set with size (or 44 if it's unset), so that a change from 65 to 87 triggers re-issuance.

Housekeeping

  • Rebase on master. Bump the go directive to 1.27 #9440 has already made the go.mod changes, so those can be dropped.
  • Revert the unrelated changes: some existing comments removed from SignCertificate, signatureAlgorithmFromPublicKey and DecodeX509CertificateRequestBytes, the trailing newline removed from parse.go, and the new "special handling for ML-DSA CSRs" comment in certificatetemplate.go, since CheckSignature works without any special handling.
  • Update the PR description, which still mentions circl and only ML-DSA-65, and add a release-note block.

Tests
These are the main missing piece. At least unit tests for key generation, encoding and parsing, CSRs, signing (an ML-DSA CA, a classical CA with an ML-DSA leaf, and the reverse), key matching, and webhook validation with the gate on and off. Integration and e2e tests can come in follow-up PRs.

Thanks again for the PR and I look forward to working with you!

cert-manager-prow Bot pushed a commit that referenced this pull request Oct 12, 2026
Add a design for supporting ML-DSA private keys and signatures in
cert-manager, using the Go 1.27 standard library (crypto/mldsa and the
ML-DSA support in crypto/x509).

The proposal covers:

- API: privateKey.algorithm "MLDSA" with size 44/65/87 (default 44),
  and MLDSA44/MLDSA65/MLDSA87 signature algorithms
- An alpha MLDSAPrivateKeys feature gate for the controller and webhook
- Keeping the go.mod directive at 1.26 and placing ML-DSA code behind
  a go1.27 build tag, so library consumers can stay on Go 1.26
- SelfSigned, CA and Kubernetes CSR signer support; other issuers
  receive the CSR unchanged and never fall back to a classical key
- Lifecycle, keystore, size limit, upgrade/downgrade and test plans
- Prototype measurements and answers to the questions raised in #8929

Supersedes the approach taken in #8527 (cloudflare/circl and
hand-built ASN.1) in favour of the standard library.

Ref: #8929

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Felix Phipps <[email protected]>
@FelixPhipps

Copy link
Copy Markdown
Member

Hi @siddhibhor-56, an update on my earlier comment.

The design (#9436) has now merged, and the rework it needed turned out to be large: the API changed to algorithm: MLDSA with size, the signature algorithm values went away, and it needed a feature gate, ML-DSA-87, the key-matching fixes and a lot of tests. Rather than push all of that onto your branch, I've opened #9469. Its first commit is your commit from this PR, rebased onto master with your authorship and sign-off kept, and the PR description credits you.

#9469 is in review now. Your review there would be very welcome, especially as you know this code well. Once #9469 merges, I think this PR can be closed as superseded, but I'll leave that to you and the maintainers.

Thanks again for getting this started, and for moving it from circl to the standard library!

@cert-manager-prow cert-manager-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2026
@cert-manager-prow

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@wallrj

wallrj commented Nov 3, 2026

Copy link
Copy Markdown
Member

Supplanted by #9469

@wallrj wallrj closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/acme Indicates a PR directly modifies the ACME Issuer code area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration area/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants