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 829621 - rpm database corruption after gpg keys import
Summary: rpm database corruption after gpg keys import
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm
Version: 6.2
Hardware: Unspecified
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: Patrik Kis
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-07 06:23 UTC by GV
Modified: 2013-02-21 10:51 UTC (History)
2 users (show)

Fixed In Version: rpm-4.8.0-29.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 10:51:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
.gnupg directory (16.46 KB, application/x-bzip2)
2012-07-02 17:12 UTC, GV
no flags Details
.rpmmacros (31 bytes, application/octet-stream)
2012-07-02 17:12 UTC, GV
no flags Details
key1.txt (3.02 KB, text/plain)
2012-07-02 17:13 UTC, GV
no flags Details
key2.txt (5.92 KB, text/plain)
2012-07-02 17:13 UTC, GV
no flags Details
autocorr-de-3.2.1-19.6.el6_0.5.noarch.rpm (133.05 KB, application/x-rpm)
2012-07-02 17:14 UTC, GV
no flags Details
autocorr-en-3.2.1-19.6.el6_0.5.noarch.rpm (150.69 KB, application/x-rpm)
2012-07-02 17:14 UTC, GV
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0461 0 normal SHIPPED_LIVE rpm bug fix and enhancement update 2013-02-20 21:07:23 UTC

Description GV 2012-06-07 06:23:01 UTC
# rm -rf .gnupg
# gpg --gen-key 
...
# gpg -k
/root/.gnupg/pubring.gpg
------------------------
pub   1024R/16A3CBC5 2012-06-07
uid                  RPM Test <rpm@test>
sub   1024R/C351AA24 2012-06-07

# gpg --export -a 16A3CBC5 > key1.txt
# rpm --import key1.txt
# wget http://ftp-stud.hs-esslingen.de/Mirrors/centos/6.2/os/x86_64/Packages/autocorr-en-3.2.1-19.6.el6_0.5.noarch.rpm
....
# wget http://ftp-stud.hs-esslingen.de/Mirrors/centos/6.2/os/x86_64/Packages/autocorr-de-3.2.1-19.6.el6_0.5.noarch.rpm
...
# echo "%_gpg_name RPM Test <rpm@test>" > .rpmmacros
# rpmsign --resign autocorr-*
Enter pass phrase: 
Pass phrase is good.
autocorr-de-3.2.1-19.6.el6_0.5.noarch.rpm:
autocorr-en-3.2.1-19.6.el6_0.5.noarch.rpm:
# rpm -ivh autocorr-*
Preparing...                ########################################### [100%]
   1:autocorr-en            ########################################### [ 50%]
   2:autocorr-de            ########################################### [100%]
# rpm -qa | grep ^gpg-p
gpg-pubkey-16a3cbc5-4fd045f8
gpg-pubkey-c105b9de-4e0fd3a3
gpg-pubkey-e684206e-3df4643e
gpg-pubkey-0608b895-4bd22942
# gpg --gen-key 
...
# gpg -K
/root/.gnupg/secring.gpg
------------------------
sec   1024R/16A3CBC5 2012-06-07
uid                  RPM Test <rpm@test>
ssb   1024R/C351AA24 2012-06-07

sec   4096R/D10DBDA5 2012-06-07
uid                  RPM Test <rpm@test>
ssb   4096R/60E5C974 2012-06-07

# gpg --export -a "RPM Test" > key2.txt
# rpm -ev gpg-pubkey-16a3cbc5-4fd045f8
# rpm --import key2.txt
# rpm -qa | grep ^gpg-p
error: rpmdbNextIterator: skipping h#     337 Header V4 RSA/SHA1 Signature, key ID 16a3cbc5: BAD
gpg-pubkey-c105b9de-4e0fd3a3
gpg-pubkey-e684206e-3df4643e
error: rpmdbNextIterator: skipping h#     336 Header V4 RSA/SHA1 Signature, key ID 16a3cbc5: BAD
gpg-pubkey-d10dbda5-4fd04703
gpg-pubkey-0608b895-4bd22942
# rpm -q autocorr-en
error: rpmdbNextIterator: skipping h#     336 Header V4 RSA/SHA1 Signature, key ID 16a3cbc5: BAD
package autocorr-en is not installed
# rpm -q autocorr-de
error: rpmdbNextIterator: skipping h#     337 Header V4 RSA/SHA1 Signature, key ID 16a3cbc5: BAD
package autocorr-de is not installed

Comment 2 Panu Matilainen 2012-07-02 10:59:22 UTC
Please attach the (public) test keys and re-signed autocorr* packages them for reproduction purposes.

Comment 3 GV 2012-07-02 17:11:36 UTC
Sorry, I do not have those keys anymore. Anyway, I generated a new set of keys and everything was uploaded.

The problem I see with the corruption is because the second file (key2.txt) has 2 keys inside instead of one. rpm in Fedora 17 report an error when I'm trying to import the keys from second file.

Comment 4 GV 2012-07-02 17:12:22 UTC
Created attachment 595777 [details]
.gnupg directory

Comment 5 GV 2012-07-02 17:12:48 UTC
Created attachment 595778 [details]
.rpmmacros

Comment 6 GV 2012-07-02 17:13:16 UTC
Created attachment 595779 [details]
key1.txt

Comment 7 GV 2012-07-02 17:13:37 UTC
Created attachment 595780 [details]
key2.txt

Comment 8 GV 2012-07-02 17:14:09 UTC
Created attachment 595781 [details]
autocorr-de-3.2.1-19.6.el6_0.5.noarch.rpm

Comment 9 GV 2012-07-02 17:14:48 UTC
Created attachment 595782 [details]
autocorr-en-3.2.1-19.6.el6_0.5.noarch.rpm

Comment 10 Panu Matilainen 2012-07-03 07:57:08 UTC
h(In reply to comment #3)
> The problem I see with the corruption is because the second file (key2.txt)
> has 2 keys inside instead of one. rpm in Fedora 17 report an error when I'm
> trying to import the keys from second file.

Ah, that one... I suspected that much but wanted to be sure you hadn't discovered some other similar case. But yes, it needs fixing, thanks for filing the bug.

Comment 12 RHEL Program Management 2012-07-10 08:10:20 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 13 RHEL Program Management 2012-07-11 01:52:13 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 14 RHEL Program Management 2012-08-14 21:59:57 UTC
This request was evaluated by Red Hat Product Management for
inclusion in a Red Hat Enterprise Linux release.  Product
Management has requested further review of this request by
Red Hat Engineering, for potential inclusion in a Red Hat
Enterprise Linux release for currently deployed products.
This request is not yet committed for inclusion in a release.

Comment 20 errata-xmlrpc 2013-02-21 10:51:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0461.html


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