summaryrefslogtreecommitdiff
path: root/rpmio/rpmpgp.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-11-01 10:52:13 +0200
committerPanu Matilainen <pmatilai@redhat.com>2011-11-01 11:03:49 +0200
commitdfc89e85dd2b75cbadf6931415e4217503fe7e19 (patch)
treeea2813dce8c85d5913d15052ef558b6ae4960986 /rpmio/rpmpgp.c
parent2ba01d4b8138ffae88d13dbd431d95b36751db2d (diff)
downloadlibrpm-tizen-dfc89e85dd2b75cbadf6931415e4217503fe7e19.tar.gz
librpm-tizen-dfc89e85dd2b75cbadf6931415e4217503fe7e19.tar.bz2
librpm-tizen-dfc89e85dd2b75cbadf6931415e4217503fe7e19.zip
Eliminate buggy pgpPrtComment()
- Removes another source of stupid bugs: for rpm's purposes we're not interested in PGP comment tag contents, and the implementation here was unsafe as it assumes there always is a terminating \0 somewhere in the packet which might not be true for a malformed packet.
Diffstat (limited to 'rpmio/rpmpgp.c')
-rw-r--r--rpmio/rpmpgp.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 496a0ef48..2bd94483f 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -960,32 +960,6 @@ static int pgpPrtUserID(pgpTag tag, const uint8_t *h, size_t hlen,
return 0;
}
-static int pgpPrtComment(pgpTag tag, const uint8_t *h, size_t hlen)
-{
- size_t i = hlen;
-
- pgpPrtVal("", pgpTagTbl, tag);
- if (_print)
- fprintf(stderr, " ");
- while (i > 0) {
- size_t j;
- if (*h >= ' ' && *h <= 'z') {
- if (_print)
- fprintf(stderr, "%s", (const char *)h);
- j = strlen((const char*)h);
- while (h[j] == '\0')
- j++;
- } else {
- pgpPrtHex("", h, i);
- j = i;
- }
- i -= j;
- h += j;
- }
- pgpPrtNL();
- return 0;
-}
-
static int getFingerprint(const uint8_t *h, size_t hlen, pgpKeyID_t keyid)
{
int rc = -1; /* assume failure */
@@ -1092,9 +1066,6 @@ static int pgpPrtPkt(const uint8_t *pkt, size_t pleft,
break;
case PGPTAG_COMMENT:
case PGPTAG_COMMENT_OLD:
- rc = pgpPrtComment(p.tag, p.body, p.blen);
- break;
-
case PGPTAG_PUBLIC_SUBKEY:
case PGPTAG_SECRET_KEY:
case PGPTAG_SECRET_SUBKEY: