Skip to content

Conversation

@pmatilai
Copy link
Member

Add some test-cases for OpenPGP v6 keys, address a couple of issues spotted with them:

  • rpmkeys --delete can't delete v6 keys
  • fix rpm v6 signing with algorithms not supported by rpm v4 signatures

To be able to test this stuff at all we need to go real bleeding edge and pull in stuff from Fedora rawhide.
More fancy details in the commit messages.

pmatilai added 4 commits May 15, 2025 12:35
For OpenPGP v6 we need sequoia-sq >= 1.3 and rpm-sequoia >= 1.8 in the
bare minimum, the latter is only available from rawhide so we need to
pull it from there. This also requires a newer crypto-policies package
than is available on any released version to permit ed25519 and x25519,
otherwise we'll get funky "denied by policy" errors when signing.
Talk about bleeding edge!
Created using Sequoia SQ 1.3.1 with:

    sq key generate
	--own-key \
	--userid v6-ed25519-testkey
	--name "rpm.org ed25519 v6 testkey"
	--email "[email protected]"
	--profile rfc9580
	--expiration=never
	--cannot-authenticate
	--cannot-encrypt
	--without-password
The length of identifiers is none of our business, they either match
something or they don't. This check causes a wholly unnecessary failure
with v6 keys, removing it protects us from similar breakages when the
underlying standard evolves.

Update the tests to match the new behavior.
Adding an rpm v6 signature fails with a message such as
"error: Unsupported OpenPGP pubkey algorithm 27" if the algorithm
isn't supported by rpm v4 signatures.

The issue here seems simple enough: makeSigTag() assumes there'll always
be a legacy tag to map to, but that's not the case with new algorithms
such as those added in RFC-9580. Only, this tiny thing causes a bit of an
avalance: we need to move the tag decision logic to putSignature(), but to
do that we also need to move the check for identical signatures there,
and to do that we need to pay more attention to putSignature() retuns.
And then we can finally make the decisions we need, where we need them:

When adding an rpm v4 signature, suppress the error from an "unknown"
algorithm if we already added an rpm v6 signature for it in the same run.

Add tests to the extent we can, rpm-sequoia 1.8 doesn't fully handle
OpenPGP v6 it seems:
rpm-software-management/rpm-sequoia#87

Fixes: rpm-software-management#3752
@pmatilai pmatilai requested a review from a team as a code owner May 16, 2025 09:28
@pmatilai pmatilai requested review from ffesti and removed request for a team May 16, 2025 09:28
@pmatilai
Copy link
Member Author

I'll note that we need tests for v6 packages too, but I consider that part of #3739 whereas this PR is primarily about addressing #3752 which is a blocker for other testing efforts.

@ffesti
Copy link
Contributor

ffesti commented May 19, 2025

LGTM. Took a while to see how this sigtd->tag = pgpDigParamsAlgo() trick work for multiple signatures. But ofc we don't use different tags for that at all and compare the actual signatures instead of tags.

@ffesti ffesti merged commit ad114b0 into rpm-software-management:master May 19, 2025
1 check passed
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.

2 participants