From b8ad9ac9203ad1315cc808cf93c1e66dd43fbb03 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sun, 23 Oct 2011 14:23:12 +0300 Subject: Log an error on signing if we can't even parse the gpg-generated signature - The error message is not very helpful but if pgpPrtPkts() fails we dont have a whole lot clue in the caller why it failed, spitting out at least *some* error is better than silently failing (RhBug:748116, RhBug:719154) --- sign/rpmgensig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sign/rpmgensig.c b/sign/rpmgensig.c index cd61b7af4..a9a2552e6 100644 --- a/sign/rpmgensig.c +++ b/sign/rpmgensig.c @@ -121,8 +121,10 @@ static int putSignature(Header sigh, int ishdr, uint8_t *pkt, size_t pktlen) struct rpmtd_s sigtd; int rc = 1; /* assume failure */ - if (pgpPrtPkts(pkt, pktlen, dig, 0) != 0) + if (pgpPrtPkts(pkt, pktlen, dig, 0) != 0) { + rpmlog(RPMLOG_ERR, _("Unsupported PGP signature\n")); goto exit; + } if (rpmDigestLength(sigp->hash_algo) == 0) { rpmlog(RPMLOG_ERR, _("Unsupported PGP hash algorithm %d\n"), -- cgit v1.2.3