Bug 65417 - rpmVerifySignature() never returns RPMSIG_NOTTRUSTED for GPG signatures
rpmVerifySignature() never returns RPMSIG_NOTTRUSTED for GPG signatures
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-05-23 12:57 EDT by Ben Harris
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-05-23 12:57:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
This is the patch I've applied locally to make RPM do what I want. (1.33 KB, patch)
2002-05-23 14:45 EDT, Ben Harris
no flags Details | Diff

  None (edit)
Description Ben Harris 2002-05-23 12:57:47 EDT
Description of Problem:
Looking at the RPM sources, in lib/signature.c, verifyGPGSignature() seems to be
able to return RPMSIG_OK, RPMSIG_BAD, and RPMSIG_NOKEY, but not
RPMSIG_NOTTRUSTED.  This is unfortunate, especially since verifyPGPSignature()
can return RPMSIG_NOTTRUSTED.  This is similarly manifest in the fact that
rpm --checksig makes no adverse comment at all when checking a signature made
by an untrusted GPG key, where its source (lib/rpmchecksig.c) implies that an
untrusted PGP key would have caused verification to fail.

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

How Reproducible:

Steps to Reproduce:
1. Look at lib/signature.c, and note that verifyGPGSignature() can't return

Actual Results:
No occurrence of RPMSIG_NOTTRUSTED in verifyGPGSignature()

Expected Results:
Some route by which verifyGPGSignature() can return RPMSIG_NOTTRUSTED.

Additional Information:
Comment 1 Jeff Johnson 2002-05-23 13:15:20 EDT
rpm has no concept of trusted, depends
entirely on the gpg/pgp helpers for
its trust model.

Add -vv, and you will see exactly
what the helper considers to be adequate
feedback for "trusted".
Comment 2 Ben Harris 2002-05-23 13:30:52 EDT
rpm -Kvv says:
D: Expected size:     34323199 = lead(96)+sigs(241)+pad(7)+data(34322855)
D:   Actual size:     34323199
MD5 sum OK: 1e0d919c17218fc066e25ee25db552f0
gpg: Signature made Thu 23 May 2002 13:23:22 BST using DSA key ID E4D7035D
gpg: Good signature from "Ben Harris (PWF Linux package signing) <bjh21@cam.ac.uk>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
gpg: Fingerprint: 1146 14EB 8E76 FE40 1001  0D41 7C8C 7D09 E4D7 035D

i.e. GPG returns a big warning, which rpmlib ignores.

With PGP, on the other hand, it looks like rpmlib has code to spot that kind of
warning and return RPMSIG_NOTTRUSTED:

            else if (!strncmp("WARNING: The signing key is not trusted", buf, 39))
                res = RPMSIG_NOTTRUSTED;

If there really is a policy of ignoring trust problems, then
verifyPGPSignature() should be modified to comply with it.
Comment 3 Jeff Johnson 2002-05-23 13:39:38 EDT
No there isn't a "policy", the trust model is
opaque to rpm.

FYI, both gpg/pgp helpers have been eliminated
in rpm-4.1 in favor of direct DSA verification
from public keys retrieved from an rpm database.
Comment 4 Ben Harris 2002-05-23 14:45:20 EDT
Created attachment 58324 [details]
This is the patch I've applied locally to make RPM do what I want.

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