if (WithCrypto)
{
/* update crypto information for this message */
+ cur->security &= ~(GOODSIGN|BADSIGN);
cur->security |= crypt_query (cur->content);
/* Remove color cache for this message, in case there
*/
if (rc == -1 || rv) maybe_goodsig = 0;
- state_putc ('\n', s);
state_attach_puts (_("[-- End of PGP output --]\n\n"), s);
}
}
mutt_error _("Could not decrypt PGP message");
pgp_void_passphrase ();
- safe_fclose (&tmpfp);
- mutt_unlink (tmpfname);
- safe_fclose (&pgpout);
- mutt_unlink (outfile);
- return;
+ goto out;
}
/*
* Now, copy cleartext to the screen. NOTE - we expect that PGP
else
state_attach_puts (_("[-- END PGP SIGNED MESSAGE --]\n"), s);
}
-
- if (tmpfp)
- {
- safe_fclose (&tmpfp);
- mutt_unlink (tmpfname);
- }
- if (pgpout)
- {
- safe_fclose (&pgpout);
- mutt_unlink (outfile);
- }
}
else
{
}
}
+out:
m->goodsig = (maybe_goodsig && have_any_sigs);
+ if (tmpfp)
+ {
+ safe_fclose (&tmpfp);
+ mutt_unlink (tmpfname);
+ }
+ if (pgpout)
+ {
+ safe_fclose (&pgpout);
+ mutt_unlink (outfile);
+ }
+
if (needpass == -1)
{
state_attach_puts (_("[-- Error: could not find beginning of PGP message! --]\n\n"), s);
char pgperrfile[_POSIX_PATH_MAX];
char pgptmpfile[_POSIX_PATH_MAX];
pid_t thepid;
+ int rv;
mutt_mktemp (pgperrfile);
if ((pgperr = safe_fopen (pgperrfile, "w+")) == NULL)
}
fclose (pgpout);
- mutt_wait_filter (thepid);
+ rv = mutt_wait_filter (thepid);
mutt_unlink(pgptmpfile);
if (s->flags & M_DISPLAY)
{
fflush (pgperr);
rewind (pgperr);
- if (pgp_copy_checksig (pgperr, s->fpout) == 0 && p)
+ if (pgp_copy_checksig (pgperr, s->fpout) == 0 && !rv && p)
p->goodsig = 1;
+ else
+ p->goodsig = 0;
state_attach_puts (_("[-- End of PGP output --]\n\n"), s);
}
fclose (pgperr);