Bug 719154

Summary: rpmsign exits (mysteriously) with code 255 when using DSA key
Product: [Fedora] Fedora Reporter: BJ Dierkes <derks>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: anton, briemers, ffesti, jnovy, pmatilai
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:02:20 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 BJ Dierkes 2011-07-05 22:12:12 UTC
Description of problem:

When using a DSA GPG key to sign a package in F15, rpmsign exits with code 
255 with no other errors/warnings/output.  The resulting package is also not
signed at all.

$ cat /etc/redhat-release 
Fedora release 15 (Lovelock)


$ rpmsign --version
RPM version 4.9.0


$ gpg --version
gpg (GnuPG) 1.4.11


How reproducible:

Every time


Steps to Reproduce:
1. Create a test GPG key using DSA
2. Add proper macros to ~/.rpmmacros for the key
3. Attempt to sign an rpm package


Actual results:

The package is not signed, no errors are produced, and rpmsign exits with code 255.


Expected results:

The package should be signed.


Additional info:

The following is a full proof of concept.

### GENERATE A TEST KEY

$ gpg --gen-key
# Answers to prompts follow:
#
#   Key type (2) DSA and Elgamal
#   Key size 2048
#   Key is valid for '0' (key does not expire)
#   Real name: John Doe
#   Email address: jdoe
#   Comment: None
#

$ gpg --list-secret-keys
/home/wdierkes/.gnupg/secring.gpg
---------------------------------

sec   2048D/E28D1405 2011-07-05
uid                  John Doe <jdoe>
ssb   2048g/10563A7E 2011-07-05


### EXPORTING HERE FOR FUTURE TESTING WITH SAME KEY

$ gpg --armor --export-secret-key E28D1405

-----BEGIN PGP PRIVATE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HBg3ZBSOkjbNGf1Rx5CEwKmP/wTPuLWHsr78s3jTz1nNavl5Q
4uZnm4cCHxtiVWD/qrZKRluDNZzKxTjWkgM+f/PBgW8212GaRp8sFnxNXI6ir6Yo
uPxami0TN8GpHFk0WX2Fvqm/w5JJ558CUuVq9A2LIwuAyriQvKcyor18vHRlcnlS
w0IaSFSDpazJ84hhBBgRCAAJBQJOE4cbAhsMAAoJEOI8UCXijRQFtEkBAJJNTGkY
UAcxZR3r9u2ZzVhbIUd/uBHqF6We9y8qqMFfAQCzIB6xKiFqfVuMvLZl22vvE+dF
wfXOq4bPj1rUlfTX4A==
=vc09
-----END PGP PUBLIC KEY BLOCK-----



### ADDED GPG NAME TO RPM MACROS FILE

$ cat ~/.rpmmacros
%_signature gpg
%_gpg_name John Doe <jdoe> 


### VERIFY EXISTING SIG OF A TEST PACKAGE

$ rpm -qip fedora-release-15-1.noarch.rpm | grep Signature
Signature   : RSA/SHA256, Wed 11 May 2011 03:26:54 AM CDT, Key ID b4ebf579069c8460


### REMOVE EXISTING SIG

$ rpmsign --delsign fedora-release-15-1.noarch.rpm 
fedora-release-15-1.noarch.rpm:

$ rpm -qip fedora-release-15-1.noarch.rpm | grep Signature
Signature   : (none)


### ADD OUR SIG

$ rpm --addsign fedora-release-15-1.noarch.rpm 
Enter pass phrase: 
Pass phrase is good.
fedora-release-15-1.noarch.rpm:


### FAIL BOAT - BUT NO ERRORS

$ echo $?
255

$ rpm -qip fedora-release-15-1.noarch.rpm | grep Signature
Signature   : (none)

Comment 1 BJ Dierkes 2011-07-05 22:15:38 UTC
I forgot to note, I also verified successful signing using the same exact steps as above but by selecting 'RSA' when creating the GPG key instead of DSA... in which case the resulting test package *is* signed as expected, verified by looking at the Signature field of 'rpm -qip' of the test package.

Comment 2 Panu Matilainen 2011-07-12 12:35:57 UTC
Right, there's a missing error message or two somewhere, but the underlying problem is that NSS doesn't support "extended DSA" from FIPS 186-3. In more practical terms, it means that rpm doesn't support DSA with > 1024 key sizes, whereas GPG apparently defaults to 2048bits nowadays.

Here's the NSS bug: https://bugzilla.mozilla.org/show_bug.cgi?id=475578, doesn't seem to be a whole lot happening on it :-/

In the meanwhile, either limit the DSA key to 1024 bits or use RSA keys.

Comment 3 Panu Matilainen 2011-10-23 11:43:41 UTC
*** Bug 748116 has been marked as a duplicate of this bug. ***

Comment 4 Panu Matilainen 2011-10-23 11:44:20 UTC
Error message added upstream...

Comment 5 Fedora End Of Life 2012-08-07 20:02:24 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping