summaryrefslogtreecommitdiffstats
path: root/hdrline.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-03-22 20:04:46 -0700
committerKevin McCarthy <kevin@8t8.us>2018-03-22 20:04:46 -0700
commit47e6c5aac5200582600cc0823191bb3bc7799daf (patch)
tree2811b206fc3025655c5cc5349ad93e02ddf71220 /hdrline.c
parent66063c4531b93cd955784f8085c42d8c99304139 (diff)
Fix comparison of flags with multiple bits set.
PGPENCRYPT, PGPKEY, SMIMEENCRYPT, and SMIMEOPAQUE are all combination flags, with multiple bits set. In a few places these flags were bitwise-and'ed incorrectly: expecting a non-zero result to indicate all the bits in the flag were set. Change those to explicitly compare the result against the original flag.
Diffstat (limited to 'hdrline.c')
-rw-r--r--hdrline.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hdrline.c b/hdrline.c
index ba118bf5..ea76e836 100644
--- a/hdrline.c
+++ b/hdrline.c
@@ -688,7 +688,8 @@ hdr_format_str (char *dest,
ch = 'P';
else if (WithCrypto && hdr->security & SIGN)
ch = 's';
- else if ((WithCrypto & APPLICATION_PGP) && hdr->security & PGPKEY)
+ else if ((WithCrypto & APPLICATION_PGP) &&
+ ((hdr->security & PGPKEY) == PGPKEY))
ch = 'K';
snprintf (buf2, sizeof (buf2),