Bug 829621 - rpm database corruption after gpg keys import
rpm database corruption after gpg keys import
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm (Show other bugs)
6.2
Unspecified Linux
medium Severity high
: rc
: ---
Assigned To: Panu Matilainen
Patrik Kis
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-07 02:23 EDT by Gabriel VLASIU
Modified: 2013-02-21 05:51 EST (History)
2 users (show)

See Also:
Fixed In Version: rpm-4.8.0-29.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 05:51:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0461 normal SHIPPED_LIVE rpm bug fix and enhancement update 2013-02-20 16:07:23 EST

  None (edit)
Description Gabriel VLASIU 2012-06-07 02:23:01 EDT
# 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 06:59:22 EDT
Please attach the (public) test keys and re-signed autocorr* packages them for reproduction purposes.
Comment 3 Gabriel VLASIU 2012-07-02 13:11:36 EDT
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 Gabriel VLASIU 2012-07-02 13:12:22 EDT
Created attachment 595777 [details]
.gnupg directory
Comment 5 Gabriel VLASIU 2012-07-02 13:12:48 EDT
Created attachment 595778 [details]
.rpmmacros
Comment 6 Gabriel VLASIU 2012-07-02 13:13:16 EDT
Created attachment 595779 [details]
key1.txt
Comment 7 Gabriel VLASIU 2012-07-02 13:13:37 EDT
Created attachment 595780 [details]
key2.txt
Comment 8 Gabriel VLASIU 2012-07-02 13:14:09 EDT
Created attachment 595781 [details]
autocorr-de-3.2.1-19.6.el6_0.5.noarch.rpm
Comment 9 Gabriel VLASIU 2012-07-02 13:14:48 EDT
Created attachment 595782 [details]
autocorr-en-3.2.1-19.6.el6_0.5.noarch.rpm
Comment 10 Panu Matilainen 2012-07-03 03:57:08 EDT
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 Product and Program Management 2012-07-10 04:10:20 EDT
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 Product and Program Management 2012-07-10 21:52:13 EDT
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 Product and Program Management 2012-08-14 17:59:57 EDT
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 05:51:33 EST
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.