Skip to content

Allow ML-DSA account keys - #570

Merged
jsha merged 3 commits into
letsencrypt:mainfrom
alebastr:mldsa-account-keys
Nov 5, 2026
Merged

jsha merged 3 commits into
letsencrypt:mainfrom
alebastr:mldsa-account-keys

Conversation

@alebastr

@alebastr alebastr commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Based on #568; will rebase and mark as ready once it's merged.

Tested with one client. I haven't seen post-quantum algorithms support in other popular clients, hopefully this will motivate more people to work on it.

@aarongable
aarongable changed the base branch from main to go-jose-v4.1.8 November 3, 2026 23:06
@aarongable
aarongable changed the base branch from go-jose-v4.1.8 to main November 3, 2026 23:06
Comment thread wfe/jose.go
Comment on lines +54 to +56
return acme.MalformedProblem(fmt.Sprintf(
"JWS signature header algorithm %s does not match expected algorithm %s for JWK",
jwsAlgorithm, algorithm))

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.

This change LGTM. Noting for posterity that we check that the JWS's alg field is acceptable, and return BadSignatureAlgorithmProblem if it is not, when first parsing the JWS.

Comment thread wfe/jose.go
Comment on lines +59 to +61
return acme.MalformedProblem(fmt.Sprintf(
"JWK key header algorithm %s does not match expected algorithm %s for JWK",
key.Algorithm, algorithm))

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.

However, this removes the only place where Pebble currently returns BadPublicKeyProblem. I think I agree that this is not the right place to do it, but I don't think that removing it entirely is right, either.

We should have a list of acceptable JWK algorithms, and we should check against that list when we get a pubkey. This should probably happen in extractJWK, i.e. when we're first being presented with a JWK during new account creation or during account key rollover.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

BadPublicKeyProblem is returned above after checking the algorithmForKey. Which also matches the logic in boulder.

It might be too lax after the last commit, as algorithmForKey doesn't explicitly test all 3 possible ML-DSA parameter sets. However, I found that go-jose already rejects unsupported AKP algs before we even see the parsed jwk in pebble.

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.

Aha, you're right. RFC 8555 wants us to return BadPublicKey when the server "does not support or chooses to reject the public key jwk". I think it would be much cleaner to do that when we're actually parsing the key out of the POST, not when we're trying to check for key-to-algorithm correspondence. But I think it's reasonable to say that that's out of scope for this PR, and the status quo is fine for now.

(For what it's worth, matching Boulder's logic is explicitly not a goal for Pebble. We want Pebble to be spec-compliant, but lean towards having Pebble behave differently from Boulder any time there's room for variation. This helps ensure that ACME clients don't over-index on Boulder's specific implementation. For example, this PR is going to allow all three sizes of ML-DSA keys; Boulder is only going to allow ML-DSA-44.)

For any key of type AKP, "alg" must be present and must match the key
algorithm or parameter set. go-jose validates this when parsing JWK from
JSON and guarantees that the Algorithm value is correct.
@alebastr alebastr closed this Nov 4, 2026
@alebastr alebastr reopened this Nov 4, 2026
@alebastr
alebastr marked this pull request as ready for review November 4, 2026 03:25
@alebastr

alebastr commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

On a slightly related note, I see that .github/workflows/release.yml takes the toolchain minor version from go.mod. Would it be acceptable to replace it with go-version: stable to ensure that prebuilt release artifacts can use ml-dsa?

@jsha

jsha commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Would it be acceptable to replace it with go-version: stable to ensure that prebuilt release artifacts can use ml-dsa?

Yep!

@jsha
jsha merged commit 4c6061f into letsencrypt:main Nov 5, 2026
15 checks passed
@alebastr
alebastr deleted the mldsa-account-keys branch November 7, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants