- Add out-of-band reporting of signature status.
AUTOMAKE_OPTIONS = foreign
EXTRA_PROGRAMS = mutt_dotlock pgpring
+if NEEDS_PGPEWRAP
+bin_SCRIPTS = pgpewrap
+else
+bin_SCRIPTS =
+endif
+
bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@
mutt_SOURCES = addrbook.c alias.c attach.c browser.c buffy.c color.c \
commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
mutt_parse_mime_message (Context, cur);
-
#ifdef _PGPPATH
/* see if PGP is needed for this message. if so, we should exit curses */
if (cur->pgp)
-
-
-
-
mutt_mktemp (tempfile);
if ((fpout = safe_fopen (tempfile, "w")) == NULL)
{
return (0);
}
+#ifdef _PGPPATH
+ /* update PGP information for this message */
+ cur->pgp |= pgp_query (cur->content);
+#endif
+
if (builtin)
{
pager_t info;
-
+
+ if (cur->pgp & PGPGOODSIGN)
+ mutt_message _("PGP signature successfully verified.");
+
/* Invoke the builtin pager */
memset (&info, 0, sizeof (pager_t));
info.hdr = cur;
else
{
bits &= ~PGPSIGN;
- mutt_error _("An unkown PGP version was defined for signing.");
}
*redraw = REDRAW_FULL;
fi
if test $PGP != no || test $PGPK != no || test $GPG != no ; then
- PGPAUX_TARGET="pgpring pgpewrap"
+ PGPAUX_TARGET=pgpring
+ AM_CONDITIONAL(NEEDS_PGPEWRAP, true)
MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o"
OPS="$OPS \$(srcdir)/OPS.PGP"
fi
ch = ' ';
#ifdef _PGPPATH
- if (hdr->pgp & PGPENCRYPT)
+ if (hdr->pgp & PGPGOODSIGN)
+ ch = 'S';
+ else if (hdr->pgp & PGPENCRYPT)
ch = 'P';
else if (hdr->pgp & PGPSIGN)
- ch = 'S';
+ ch = 's';
else if (hdr->pgp & PGPKEY)
ch = 'K';
#endif
mutt_exit(1);
}
+#if 0
set_option (OPTWEED); /* turn weeding on by default */
+#endif
}
{ "msg_format", DT_SYN, R_NONE, UL "message_format", 0 },
{ "pager", DT_PATH, R_NONE, UL &Pager, UL "builtin" },
{ "pager_context", DT_NUM, R_NONE, UL &PagerContext, 0 },
- { "pager_format", DT_STR, R_PAGER, UL &PagerFmt, UL "-%S- %C/%m: %-20.20n %s" },
+ { "pager_format", DT_STR, R_PAGER, UL &PagerFmt, UL "-%Z- %C/%m: %-20.20n %s" },
{ "pager_index_lines",DT_NUM, R_PAGER, UL &PagerIndexLines, 0 },
{ "pager_stop", DT_BOOL, R_NONE, OPTPAGERSTOP, 0 },
{ "user_agent", DT_BOOL, R_NONE, OPTXMAILER, 1},
{ "visual", DT_PATH, R_NONE, UL &Visual, 0 },
{ "wait_key", DT_BOOL, R_NONE, OPTWAITKEY, 1 },
+ { "weed", DT_BOOL, R_NONE, OPTWEED, 1 },
{ "wrap_search", DT_BOOL, R_NONE, OPTWRAPSEARCH, 1 },
{ "write_inc", DT_NUM, R_NONE, UL &WriteInc, 10 },
{ "write_bcc", DT_BOOL, R_NONE, OPTWRITEBCC, 1},
unsigned int tagged : 1;
unsigned int deleted : 1; /* attachment marked for deletion */
unsigned int noconv : 1; /* don't do character set conversion */
+
+#ifdef _PGPPATH
+ unsigned int goodsig : 1; /* good PGP signature */
+#endif
+
} BODY;
typedef struct header
{
#ifdef _PGPPATH
- unsigned int pgp : 3;
+ unsigned int pgp : 4;
#endif
unsigned int mime : 1; /* has a Mime-Version header? */
/* Check for PGP/MIME messages. */
if (m->type == TYPEMULTIPART)
{
- if(mutt_is_multipart_signed(m))
+ if (mutt_is_multipart_signed(m))
t |= PGPSIGN;
else if (mutt_is_multipart_encrypted(m))
t |= PGPENCRYPT;
+
+ if ((mutt_is_multipart_signed (m) || mutt_is_multipart_encrypted (m))
+ && m->goodsig)
+ t |= PGPGOODSIGN;
}
- if(m->type == TYPEMULTIPART || m->type == TYPEMESSAGE)
+ if (m->type == TYPEMULTIPART || m->type == TYPEMESSAGE)
{
BODY *p;
- for(p = m->parts; p; p = p->next)
- t |= pgp_query(p);
+ for (p = m->parts; p; p = p->next)
+ t |= pgp_query(p) & ~PGPGOODSIGN;
}
-
+
return t;
}
char sigfile[_POSIX_PATH_MAX], pgperrfile[_POSIX_PATH_MAX];
FILE *fp, *pgpout, *pgperr;
pid_t thepid;
+ int rv = -1;
snprintf (sigfile, sizeof (sigfile), "%s.asc", tempfile);
mutt_copy_stream(pgperr, s->fpout);
fclose(pgperr);
- mutt_wait_filter (thepid);
+ rv = mutt_wait_filter (thepid);
}
state_puts (_("[-- End of PGP output --]\n\n"), s);
mutt_unlink (sigfile);
mutt_unlink (pgperrfile);
- return 0;
+ return rv;
}
/*
int protocol_major = TYPEOTHER;
char *protocol_minor = NULL;
+ BODY *b = a;
BODY **signatures = NULL;
int sigcnt = 0;
int i;
+ short goodsig = 1;
protocol = mutt_get_parameter ("protocol", a->parameter);
a = a->parts;
{
if (signatures[i]->type == TYPEAPPLICATION
&& !mutt_strcasecmp(signatures[i]->subtype, "pgp-signature"))
- pgp_verify_one (signatures[i], s, tempfile);
+ {
+ if (pgp_verify_one (signatures[i], s, tempfile) != 0)
+ goodsig = 0;
+ }
else
state_printf (s, _("[-- Warning: We can't verify %s/%s signatures. --]\n\n"),
TYPE(signatures[i]), signatures[i]->subtype);
}
mutt_unlink (tempfile);
+
+ b->goodsig = goodsig;
/* Now display the signed body */
state_puts (_("[-- The following data is signed --]\n\n"), s);
mutt_body_handler (tattach, s);
s->fpin = fpin;
+ /*
+ * if a multipart/signed is the _only_ sub-part of a
+ * multipart/encrypted, cache signature verification
+ * status.
+ *
+ */
+
+ if (mutt_is_multipart_signed (tattach) && !tattach->next)
+ a->goodsig = tattach->goodsig;
+
if (s->flags & M_DISPLAY)
state_puts (_("\n[-- End of PGP/MIME encrypted data --]\n"), s);
optional = 0;
break;
}
+ default:
+ {
+ *dest = '\0';
+ break;
+ }
}
-
+
if (optional)
- mutt_FormatString (dest, destlen, ifstring, mutt_attach_fmt, data, 0);
+ mutt_FormatString (dest, destlen, ifstring, _mutt_fmt_pgp_command, data, 0);
else if (flags & M_FORMAT_OPTIONAL)
- mutt_FormatString (dest, destlen, elsestring, mutt_attach_fmt, data, 0);
-
+ mutt_FormatString (dest, destlen, elsestring, _mutt_fmt_pgp_command, data, 0);
+
return (src);
}
att = mutt_new_body ();
att->filename = safe_strdup (tempf);
att->unlink = 1;
+ att->use_disp = 0;
att->type = TYPEAPPLICATION;
att->subtype = safe_strdup ("pgp-keys");
snprintf (buff, sizeof (buff), _("PGP Key %s."), tmp);
#ifdef _PGPPATH
-#define PGPENCRYPT 1
-#define PGPSIGN 2
-#define PGPKEY 4
+#define PGPENCRYPT (1 << 0)
+#define PGPSIGN (1 << 1)
+#define PGPKEY (1 << 2)
+#define PGPGOODSIGN (1 << 3)
#define KEYFLAG_CANSIGN (1 << 0)
#define KEYFLAG_CANENCRYPT (1 << 1)
#include <string.h>
#include <unistd.h>
#include <time.h>
-
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#endif
case '2': case '5':
{
- version = 'c' - '0';
+ version = c - '0';
break;
}
void
mutt_attach_display_loop (MUTTMENU *menu, int op, FILE *fp, ATTACHPTR **idx)
{
+#if 0
int old_optweed = option (OPTWEED);
-
set_option (OPTWEED);
+#endif
+
do
{
switch (op)
}
while (op != OP_NULL);
+#if 0
if (option (OPTWEED) != old_optweed)
toggle_option (OPTWEED);
+#endif
}