Skip to content

RPMTAG_OPENPGP returns legacy non-header signatures via "extension" code #4137

@dralley

Description

@dralley

Describe the bug

RPMTAG_OPENPGP is documented to return header-only signatures.

When used with the HEADERGET_EXT flag, the extension code for the handling of this tag returns legacy header + payload signatures in the mix.

The commit message suggests this was intentional (bea8f45), but it does not conform to the documented behavior of that tag. It makes usage challenging, because you cannot trust that these signatures can be verified against the header bytes range, and the behavior changes depending on whether RPMTAG_OPENPGP was actually present or not.

Querying multiple different tags should not be considered a problem when the usage of the return values is genuinely different.

To Reproduce
Steps to reproduce the behavior:

  1. Take a package which contains V4 (RSAHEADER/DSAHEADER) and V3 signatures (SIGPGP/SIGGPG)
  2. Call headerGet(RPMTAG_OPENPGP) with HEADERGET_EXT flags enabled
  3. Observe that >1 signatures are present

Expected behavior

Fetching from the RPMTAG_OPENPGP should return only header-only signatures as documented - disincluding legacy signatures. SIGPGP / SIGGPG signatures should be ignored.

Environment

  • OS / Distribution: F43
  • Version: rpm 6.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions