else
mutt_error ( _("S/MIME certificate owner does not match sender."));
}
+ else if (cur->security & PARTSIGN)
+ mutt_message (_("Warning: Part of this message has not been signed."));
else if (cur->security & SIGN || cur->security & BADSIGN)
mutt_error ( _("S/MIME signature could NOT be verified."));
}
if (WithCrypto
&& (cur->security & APPLICATION_PGP) && (cmflags & M_CM_VERIFY))
- mutt_message ((cur->security & GOODSIGN) ?
- _("PGP signature successfully verified.") :
- _("PGP signature could NOT be verified."));
+ {
+ if (cur->security & GOODSIGN)
+ mutt_message (_("PGP signature successfully verified."));
+ else if (cur->security & PARTSIGN)
+ mutt_message (_("Warning: Part of this message has not been signed."));
+ else
+ mutt_message (_("PGP signature could NOT be verified."));
+ }
/* Invoke the builtin pager */
memset (&info, 0, sizeof (pager_t));
if (!WithCrypto)
return 0;
+
+ if (!m)
+ return 0;
if (m->type == TYPEAPPLICATION)
{
t |= mutt_is_multipart_encrypted(m);
t |= mutt_is_multipart_signed (m);
- if (t && m->goodsig) t |= GOODSIGN;
+ if (t && m->goodsig)
+ t |= GOODSIGN;
}
if (m->type == TYPEMULTIPART || m->type == TYPEMESSAGE)
{
BODY *p;
+ int u, v, w;
+
+ u = m->parts ? 0xffffffff : 0; /* Bits set in all parts */
+ w = 0; /* Bits set in any part */
for (p = m->parts; p; p = p->next)
- t |= crypt_query (p) & ~GOODSIGN;
+ {
+ v = crypt_query (p);
+ u &= v; w |= v;
+ }
+ t |= u | (w & ~GOODSIGN);
+
+ if ((w & GOODSIGN) && !(u & GOODSIGN))
+ t |= PARTSIGN;
}
return t;
mutt_unlink (tempfile);
b->goodsig = goodsig;
- b->badsig = goodsig; /* XXX - WHAT!?!?!? */
+ b->badsig = !goodsig;
/* Now display the signed body */
state_attach_puts (_("[-- The following data is signed --]\n\n"), s);
*/
unsigned int goodsig : 1; /* good cryptographic signature */
- unsigned int badsig : 1; /* bad cryptographic signature (needed to check encrypted s/mime-signatures */
+ unsigned int badsig : 1; /* bad cryptographic signature (needed to check encrypted s/mime-signatures) */
unsigned int collapsed : 1; /* used by recvattach */
typedef struct header
{
- unsigned int security : 7; /* bit 0-4: flags, bit 5,6: application.
+ unsigned int security : 9; /* bit 0-6: flags, bit 7,8: application.
see: crypt.h pgplib.h, smime.h */
unsigned int mime : 1; /* has a Mime-Version header? */
#ifndef MUTT_CRYPT_H
#define MUTT_CRYPT_H
-#include "mutt.h" /* Need this to declarer BODY, ADDTESS. STATE etc. */
+#include "mutt.h" /* Need this to declare BODY, ADDRESS. STATE etc. */
/* FIXME: They should be pointer to anonymous structures for better
information hiding. */
#define ENCRYPT (1 << 0)
#define SIGN (1 << 1)
#define GOODSIGN (1 << 2)
-#define BADSIGN (1 << 3) /* FIXME: value also used below for PGPKEY */
-#define SIGNOPAQUE (1 << 4)
+#define BADSIGN (1 << 3)
+#define PARTSIGN (1 << 4)
+#define SIGNOPAQUE (1 << 5)
+/* (1 << 6) is used by PGPKEY below. */
-#define APPLICATION_PGP (1 << 5)
-#define APPLICATION_SMIME (1 << 6)
+#define APPLICATION_PGP (1 << 7)
+#define APPLICATION_SMIME (1 << 8)
#define PGPENCRYPT (APPLICATION_PGP | ENCRYPT)
#define PGPSIGN (APPLICATION_PGP | SIGN)
#define PGPGOODSIGN (APPLICATION_PGP | GOODSIGN)
-#define PGPKEY (APPLICATION_PGP | (1 << 3))
+#define PGPKEY (APPLICATION_PGP | (1 << 6))
#define SMIMEENCRYPT (APPLICATION_SMIME | ENCRYPT)
#define SMIMESIGN (APPLICATION_SMIME | SIGN)
m->goodsig = 1;
FREE (&line);
}
- else {
+ else
+ {
m->goodsig = p->goodsig;
- m->badsig = p->badsig;
+ m->badsig = p->badsig;
}
fclose (smimeerr);