Repository navigation
fix: check provider support in KeyPackageIn::validate - #2206
Merged
kkohbrok merged 3 commits intoOct 5, 2026
Merged
Conversation
KeyPackageIn::validate verified the leaf node and key package signatures with the signature scheme of the key package's ciphersuite, without first asking the crypto provider whether it supports that ciphersuite. When it does not, signature verification fails for the wrong reason and the caller gets InvalidLeafNodeSignature for a key package whose signature is valid. With the libcrux provider, which only handles Ed25519, that is every P-256 key package. Group creation, StagedWelcome and the external commit builder got a supports() check and an UnsupportedCiphersuite error in openmls#2109. validate is another public entry point that takes a ciphersuite from the wire and did not. This adds the check as the first step, with a matching KeyPackageVerifyError::UnsupportedCiphersuite variant, and a test with the RestrictedProvider that fails without it. Two smaller things in the same area: AddProposalIn::validate now compares the key package's ciphersuite with the group's before running the full key package validation instead of after, and a test pins down that a GREASE value in a KeyPackage's own ciphersuite field fails to deserialize.
mtrossbach
force-pushed
the
keypackage-validate-supports
branch
from
September 2, 2026 11:39
ba409d6 to
26c9566
Compare
kkohbrok
approved these changes
Sep 2, 2026
kkohbrok
left a comment
Member
There was a problem hiding this comment.
Thanks for your continued contributions! This generally looks good to merge.
kkohbrok
enabled auto-merge (squash)
October 5, 2026 06:45
MicroDroid
pushed a commit
to MicroDroid/openmls
that referenced
this pull request
Nov 17, 2026
KeyPackageIn::validate verified the leaf node and key package signatures with the signature scheme of the key package's ciphersuite, without first asking the crypto provider whether it supports that ciphersuite. When it does not, signature verification fails for the wrong reason and the caller gets InvalidLeafNodeSignature for a key package whose signature is valid. With the libcrux provider, which only handles Ed25519, that is every P-256 key package. Group creation, StagedWelcome and the external commit builder got a supports() check and an UnsupportedCiphersuite error in openmls#2109. validate is another public entry point that takes a ciphersuite from the wire and did not. This adds the check as the first step, with a matching KeyPackageVerifyError::UnsupportedCiphersuite variant, and a test with the RestrictedProvider that fails without it. Two smaller things in the same area: AddProposalIn::validate now compares the key package's ciphersuite with the group's before running the full key package validation instead of after, and a test pins down that a GREASE value in a KeyPackage's own ciphersuite field fails to deserialize. Co-authored-by: Konrad Kohbrok <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
KeyPackageIn::validatedoesn't check whether the crypto provider supports the key package's ciphersuite before it verifies the signatures. If the provider doesn't support it, signature verification fails and the caller getsInvalidLeafNodeSignature, even though the signature is valid. I ran into this with the libcrux provider, which only does Ed25519: validating a P-256 key package returnsInvalidLeafNodeSignature. For something like a delivery service that validates key packages on its own this is misleading, because it looks like a bad signature and not like an unsupported ciphersuite.#2109 added a
supports()check andUnsupportedCiphersuiteerrors to group creation,StagedWelcomeand the external commit builder.KeyPackageIn::validateis another public entry point that takes a ciphersuite from the wire, and it didn't get the check. This PR adds it as the first step ofvalidate, plus aKeyPackageVerifyError::UnsupportedCiphersuite(Ciphersuite)variant. The test uses theRestrictedProviderfromtest-utilsand fails without the change.Two smaller things in the same area:
AddProposalIn::validatedid the full key package validation (both signature checks) before comparing the key package's ciphersuite with the group's. Now the comparison comes first. The test corrupts the key package signature and checks that the ciphersuite mismatch is reported, not the signature.Ciphersuitetable, but there was no test for it.Context: I've been looking into how crypto providers could bring their own ciphersuites (#1915) and what that would touch in the code base, and I'll probably have something to propose on that at some point. This came up while going through the ciphersuite checks. It's independent of that though.