Model this after pgp's pgp_decrypt_part(), which checks if fpout is
empty.
{
fflush (smimeout);
rewind (smimeout);
+
+ if (type & ENCRYPT)
+ {
+ /* void the passphrase, even if that wasn't the problem */
+ if (fgetc (smimeout) == EOF)
+ {
+ mutt_error _("Decryption failed");
+ smime_void_passphrase ();
+ }
+ rewind (smimeout);
+ }
if (outFile) fpout = outFile;
else
fflush (fpout);
rewind (fpout);
-
if ((p = mutt_read_mime_header (fpout, 0)) != NULL)
{
fstat (fileno (fpout), &info);
}
}
+
safe_fclose (&smimeout);
smimeout = NULL;
mutt_unlink (outfile);