Bug 2235323 - RFE: don't strip old signatures while exporting pub key
Summary: RFE: don't strip old signatures while exporting pub key
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: gnupg2
Version: 37
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-28 12:49 UTC by Pavel Raiskup
Modified: 2023-11-23 01:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Pavel Raiskup 2023-08-28 12:49:59 UTC
In Copr, we generate RPM signature key pairs when a new Copr project is
created.  With 5 years expiration.

If project lives longer than 4 years, we prolong the keypair with gpg
--edit-key with 'expire 5y' to get longer validity (ie 9 years in total).
The older RPMs stay unchanged (signed with old signature), the newly built
RPMs are signed with the new (prolonged) signature.

The thing is that after the `expire 5y` action, the pubkey we get with
`--export` doesn't contain all the necessary info to validate the old
signatures we historically did (before the `expire 5y` action).  It seems that
the old signature is stripped from `--export`ed pub key.

It would be nice to have a way to `--export` not-stripped pub key, containing
all the previous signatures.  Either by default, or with an option, so such a
pub-key can be used to validate both old and new RPMs.  I'm not a GPG expert,
nor an RPM expert, so I'm not sure how to design this properly.  Cooperating
with the RPM/RPM-SEQUOIA developers might be necessary to design this
properly; this is probably crucial feature to implement RPM signatures
properly long-term.

This is the original issue we filled to resolve recent signature checking
failures in Copr, lot of important info is there:
https://github.com/rpm-software-management/rpm-sequoia/issues/50

The way we (I believe) export the pub-key using obs-signd:
https://github.com/openSUSE/obs-sign/blob/c66608f79d4f48c97131840c6e5337c28e59a9d9/signd#L1027-L1029
https://github.com/openSUSE/obs-sign/blob/c66608f79d4f48c97131840c6e5337c28e59a9d9/sign.c#L1106-L1136
https://github.com/fedora-copr/copr/blob/1141e994356a319dd81ce46aa73b0e2d85aa6783/backend/copr_backend/sign.py#L67-L69

This is how we generate the keypair initially:
https://github.com/fedora-copr/copr/blob/1141e994356a319dd81ce46aa73b0e2d85aa6783/keygen/src/copr_keygen/logic.py#L151

This is how we prolong the signature keypair:
https://github.com/fedora-copr/copr/blob/1141e994356a319dd81ce46aa73b0e2d85aa6783/keygen/run/gpg-copr-prolong#L44-L45
https://github.com/fedora-copr/copr/blob/1141e994356a319dd81ce46aa73b0e2d85aa6783/keygen/run/gpg-copr#L19-L21
https://github.com/fedora-copr/copr/blob/1141e994356a319dd81ce46aa73b0e2d85aa6783/keygen/src/copr_keygen/gpg.py#L2-L7


Reproducible: Always

Comment 1 Jakub Jelen 2023-08-29 10:47:18 UTC
Filled upstream issue https://dev.gnupg.org/T6689

Comment 2 Aoife Moloney 2023-11-23 01:49:54 UTC
This message is a reminder that Fedora Linux 37 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '37'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 37 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.


Note You need to log in before you can comment on or make changes to this bug.