Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 681013

Summary: contrary to the man page, rpm keeps adding signatures to rpm packages when attempting to sign them.
Product: Red Hat Enterprise Linux 6 Reporter: RedHatBugMonkey
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: mvadkert
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpm-4.8.0-14.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 14:19:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description RedHatBugMonkey 2011-02-28 19:20:58 UTC
Description of problem:

contrary to the man page, rpm keeps adding signatures to rpm packages when attempting to sign them.

Version-Release number of selected component (if applicable):

rpm-4.8.0-12.el6.x86_64

How reproducible:

100% of the time

Steps to Reproduce:
1.  create a 4096 bit rsa signing key with gpg
2.  find a test RPM package
3.  rpm --resign the package 3 times.
4.  rpm -K the package
  
Actual results:

find 3 insertions of the GPG key into the package.

Expected results:

find 1 insertion of the GPG into the package as the man page states.

Additional info:

From the man page:

"rpm --addsign|--resign PACKAGE_FILE ...

       Both  of  the  --addsign  and --resign options generate and insert new signatures for each package PACKAGE_FILE given, replacing any existing signatures. There are two options for historical reasons,
       there is no difference in behavior currently."

A simple demo:

root@hostname:~/rpmbug >rpm -K somedumbrpm-1.0-1.0.noarch.rpm
somedumbrpm-1.0-1.0.noarch.rpm: sha1 md5 OK
root@hostname:~/rpmbug >rpm -vv --resign somedumbrpm-1.0-1.0.noarch.rpm
Enter pass phrase: 
Pass phrase is good.
somedumbrpm-1.0-1.0.noarch.rpm:
D: Expected size:        21684 = lead(96)+sigs(180)+pad(4)+data(21404)
D:   Actual size:        21684
D: GPG sig size: 543
D: Got 543 bytes of GPG sig
D: GPG sig size: 543
D: Got 543 bytes of GPG sig
D: Signature: size(1296)+pad(0)
root@hostname:~/rpmbug >rpm -K somedumbrpm-1.0-1.0.noarch.rpm
somedumbrpm-1.0-1.0.noarch.rpm: RSA sha1 ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#deadf00d) 
root@hostname:~/rpmbug >rpm -vv --resign somedumbrpm-1.0-1.0.noarch.rpm
Enter pass phrase: 
Pass phrase is good.
somedumbrpm-1.0-1.0.noarch.rpm:
D: Expected size:        22796 = lead(96)+sigs(1296)+pad(0)+data(21404)
D:   Actual size:        22796
D: GPG sig size: 543
D: Got 543 bytes of GPG sig
D: GPG sig size: 543
D: Got 543 bytes of GPG sig
D: Signature: size(1856)+pad(0)
root@hostname:~/rpmbug >rpm -K somedumbrpm-1.0-1.0.noarch.rpm
somedumbrpm-1.0-1.0.noarch.rpm: RSA sha1 ((MD5) PGP) ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#deadf00d (MD5) PGP#deadf00d) 
root@hostname:~/rpmbug >rpm -vv --resign somedumbrpm-1.0-1.0.noarch.rpm
Enter pass phrase: 
Pass phrase is good.
somedumbrpm-1.0-1.0.noarch.rpm:
D: Expected size:        23356 = lead(96)+sigs(1856)+pad(0)+data(21404)
D:   Actual size:        23356
D: GPG sig size: 543
D: Got 543 bytes of GPG sig
D: GPG sig size: 543
D: Got 543 bytes of GPG sig
D: Signature: size(2416)+pad(0)
root@hostname:~/rpmbug >rpm -K somedumbrpm-1.0-1.0.noarch.rpm
somedumbrpm-1.0-1.0.noarch.rpm: RSA sha1 ((MD5) PGP) ((MD5) PGP) ((MD5) PGP) md5 NOT OK (MISSING KEYS: (MD5) PGP#deadf00d (MD5) PGP#deadf00d (MD5) PGP#deadf00d)

Comment 2 Panu Matilainen 2011-03-01 07:21:19 UTC
This is fixed as an intended side-effect of fixing bug 608608 so ACK, and no new code needed.

Comment 7 errata-xmlrpc 2011-05-19 14:19:54 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0739.html