summaryrefslogtreecommitdiffstats
path: root/pgp.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-08-10 18:18:26 -0700
committerKevin McCarthy <kevin@8t8.us>2017-08-10 18:18:26 -0700
commit050125068504624fa7e70972df8f8e35122349eb (patch)
tree429a6bc269b8b7000afa1f58aa553342a31649dd /pgp.c
parent2a7358593861d9c721a2866ef8edb3fac6389a70 (diff)
Fix attachment check_traditional and extract_keys operations. (see #3728)
Add helpers and iterate over the actx->idx instead of the BODY structure.
Diffstat (limited to 'pgp.c')
-rw-r--r--pgp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pgp.c b/pgp.c
index 653905f0..5c98e81c 100644
--- a/pgp.c
+++ b/pgp.c
@@ -615,7 +615,7 @@ out:
return rc;
}
-static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only)
+static int pgp_check_traditional_one_body (FILE *fp, BODY *b)
{
char tempfile[_POSIX_PATH_MAX];
char buf[HUGE_STRING];
@@ -628,9 +628,6 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only)
if (b->type != TYPETEXT)
return 0;
- if (tagged_only && !b->tagged)
- return 0;
-
mutt_mktemp (tempfile, sizeof (tempfile));
if (mutt_decode_save_attachment (fp, b, tempfile, 0, 0) != 0)
{
@@ -675,21 +672,24 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only)
return 1;
}
-int pgp_check_traditional (FILE *fp, BODY *b, int tagged_only)
+int pgp_check_traditional (FILE *fp, BODY *b, int just_one)
{
int rv = 0;
int r;
for (; b; b = b->next)
{
- if (is_multipart (b))
- rv = pgp_check_traditional (fp, b->parts, tagged_only) || rv;
+ if (!just_one && is_multipart (b))
+ rv = pgp_check_traditional (fp, b->parts, 0) || rv;
else if (b->type == TYPETEXT)
{
if ((r = mutt_is_application_pgp (b)))
rv = rv || r;
else
- rv = pgp_check_traditional_one_body (fp, b, tagged_only) || rv;
+ rv = pgp_check_traditional_one_body (fp, b) || rv;
}
+
+ if (just_one)
+ break;
}
return rv;