From: Kevin McCarthy Date: Mon, 2 Jul 2018 03:13:11 +0000 (-0700) Subject: Void passphrase on s/mime decryption error X-Git-Tag: 2019-10-25~671^2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e38bbf8ec81c5b5960d7e299b7c15dcb96a23c63;p=neomutt Void passphrase on s/mime decryption error Model this after pgp's pgp_decrypt_part(), which checks if fpout is empty. --- diff --git a/ncrypt/smime.c b/ncrypt/smime.c index cb4b57126..815742cc7 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -2118,6 +2118,17 @@ static struct Body *smime_handle_entity(struct Body *m, struct State *s, FILE *o 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_class_void_passphrase(); + } + rewind(smimeout); + } + if (out_file) fpout = out_file; else