summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2017-02-08 09:51:09 +0200
committerPanu Matilainen <pmatilai@redhat.com>2017-02-16 11:54:14 +0200
commita4d94ddd515ccfcc6fca824b41874b9d329f6dd3 (patch)
tree7eed4a04d6472c58b25de68bcd9eb54cc70a83e6
parent6ff6406ca61729185b1ef7f6f2042f506c0ec4a5 (diff)
downloadrpm-a4d94ddd515ccfcc6fca824b41874b9d329f6dd3.tar.gz
Handle OpenPGP reserved tag correctly
RFC-4880 states tag value 0 is reserved and that packet tag MUST NOT have this value, so we should error out and not just chug on. (cherry picked from commit 0821d69b0c999450c443fbd4f47bc84146437816)
-rw-r--r--rpmio/rpmpgp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index b72247672..895c36b2e 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -852,12 +852,14 @@ static int pgpPrtPkt(struct pgpPkt *p, pgpDigParams _digp)
case PGPTAG_USER_ID:
rc = pgpPrtUserID(p->tag, p->body, p->blen, _digp);
break;
+ case PGPTAG_RESERVED:
+ rc = -1;
+ break;
case PGPTAG_COMMENT:
case PGPTAG_COMMENT_OLD:
case PGPTAG_PUBLIC_SUBKEY:
case PGPTAG_SECRET_KEY:
case PGPTAG_SECRET_SUBKEY:
- case PGPTAG_RESERVED:
case PGPTAG_PUBLIC_SESSION_KEY:
case PGPTAG_SYMMETRIC_SESSION_KEY:
case PGPTAG_COMPRESSED_DATA: