pmatilai · GitHub

Initially requested in #189 and one possible implementation drafted in #1050, but lacking direction and motivation at the time. The topic rose again as in the context of Post Quantum signatures in #3363 - something rpm would rather not know anything about. #1050 added labels to each signature but this is apparently a goofy idea (I think I stole it from Debian at the time), and back then rpm v3 header+payload signatures complicated the backwards compatibility store quite a bit, which is where I ran out of steam in the face of lack of general interest. The discussion in #3363 provided us with a nice clear path ahead now, with multiple benefits, so much so that it'd be stupid not to do this now:

  • support for multiple signatures has generic benefits and use-cases
  • puts a further layer of insulation between rpm and crypto, something we have been actively driving for a couple of years now
  • adds provisions for PQC without us getting directly involved in it
  • fixes up a long-standing terminology mixup with tag names
  • lines up nicely with the rpm v6 theme and timing
  • most of it is already implemented

What the implementation will do:

  • add a string array RPMTAG_OPENPGP tag and RPMSIGTAG_OPENPGP alias
  • RPMTAG_OPENPGP may contain one or more independent OpenPGP signatures base64-encoded (the header doesn't support binary arrays)
  • the RPMTAG_OPENPGP signatures are always header-only, and we'll call them RPM v6 signatures
  • extend :pgpsig format to handle new format
  • add the new tag to rpm -qi Signature: output
  • rpmsign --addsign appends a new signature to the RPMTAG_OPENPGP tag
  • rpmsign --delsign deletes all signatures from the package
  • rpmsign --resign deletes all signatures before adding a new one
  • verification will:
    • ignore unknown algorithms
    • require all known (and enabled) signatures to pass for a positive verification
  • backwards compatibility is handled as follows:
    • when signing v4 packages and --rpmv6 is specified, the first added RSA/DSA/EcDSA signature is additionally stored in binary format to RPMTAG_RSAHEADER/RPMTAG_DSAHEADER as appropriate
    • v6 packages get only RPMTAG_OPENPGP signatures, unless --rpmv4 switch (added by the PR) is used - this allows rpm v4 to verify such packages, in which case it behaves the same as signing v4 packages

Allowing to replace or delete a specific signature would be out of the initial scope but can be done later. Additional controls for verification policies can/will be added later.

Edit: add default verification policy

Read the original on github.com ↗