Commit 85ef6f6a authored by Thomas Roessler's avatar Thomas Roessler

S/MIME support. From Oliver Ehli <elmy@acm.org> and Mike Schiraldi

<raldi@research.netsol.com>.
parent c6d96bc1
......@@ -15,7 +15,7 @@ bin_SCRIPTS = muttbug flea
BUILT_SOURCES = keymap_defs.h patchlist.c
bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@
bin_PROGRAMS = mutt @DOTLOCK_TARGET@ @PGPAUX_TARGET@ @SMIMEAUX_TARGET@
mutt_SOURCES = $(BUILT_SOURCES) \
addrbook.c alias.c attach.c base64.c browser.c buffy.c color.c \
commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
......@@ -56,20 +56,14 @@ INCLUDES=-I. -I$(top_srcdir) $(IMAP_INCLUDES) -Iintl
CPPFLAGS=@CPPFLAGS@ -I$(includedir)
non_us_sources = pgp.c pgpinvoke.c pgpkey.c pgplib.c sha1.c \
pgpmicalg.c gnupgparse.c sha1.h \
doc/language.txt doc/language50.txt OPS.PGP doc/PGP-Notes.txt \
OPS.MIX remailer.c remailer.h pgpewrap.c \
contrib/pgp2.rc contrib/pgp5.rc contrib/gpg.rc \
mutt_ssl.c mutt_ssl.h README.SSL mutt_ssl_nss.c \
pgppacket.c pgppacket.h
EXTRA_mutt_SOURCES = account.c md5c.c mutt_sasl.c mutt_socket.c mutt_ssl.c \
mutt_tunnel.c pop.c pop_auth.c pop_lib.c pgp.c pgpinvoke.c pgpkey.c \
mutt_tunnel.c pop.c pop_auth.c pop_lib.c crypt.c smime.c pgp.c pgpinvoke.c pgpkey.c \
pgplib.c sha1.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \
browser.h mbyte.h remailer.h url.h mutt_ssl_nss.c pgppacket.c
EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP TODO configure acconfig.h account.h \
EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \
configure acconfig.h account.h \
attach.h buffy.h charset.h copy.h dotlock.h functions.h gen_defs \
globals.h hash.h history.h init.h keymap.h \
mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
......@@ -77,8 +71,8 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP TODO configure acconfig.h account.h \
mx.h pager.h pgp.h pop.h protos.h reldate.h rfc1524.h rfc2047.h \
rfc2231.h rfc822.h sha1.h sort.h mime.types VERSION prepare \
_regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
mbyte.h lib.h extlib.c pgpewrap.c pgplib.h Muttrc.head Muttrc \
makedoc.c stamp-doc-rc README.SSL \
mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttrc.head Muttrc \
makedoc.c stamp-doc-rc README.SSL crypt.h \
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh
mutt_dotlock_SOURCES = mutt_dotlock.c
......@@ -105,6 +99,10 @@ flea: muttbug.sh
cp muttbug.sh flea
chmod +x flea
smime_keys: smime_keys.pl
cp smime_keys.pl smime_keys
chmod +x smime_keys
Makefile: $(BUILT_SOURCES)
keymap_defs.h: $(OPS) $(srcdir)/gen_defs
......@@ -156,27 +154,6 @@ changelog:
dist-hook:
-for file in $(BUILT_SOURCES) ; do rm -f $(distdir)/$$file ; done
us-distdir: distdir dist-hook
mv $(distdir) $(distdir)-us
find $(distdir)-us -type f -print | while read f ; do \
cp $$f `dirname $$f`/_`basename $$f`.$$$$ && \
rm $$f && mv `dirname $$f`/_`basename $$f`.$$$$ $$f ; \
done
us-dist: us-distdir
for file in $(distdir)-us/*.c $(distdir)-us/*.h ; do \
$(srcdir)/reap.pl HAVE_PGP < $$file | $(srcdir)/reap.pl MIXMASTER | $(srcdir)/reap.pl USE_SSL > $$file.n && rm $$file && mv $$file.n $$file ; \
done
for file in $(non_us_sources) ; do \
echo "/* This file is only available in the international mutt version */" \
> $(distdir)-us/$$file ; \
done
echo "This version of mutt may be exported from the US."> $(distdir)-us/EXPORTABLE
-chmod -R a+r $(distdir)-us
GZIP=$(GZIP) $(TAR) chozf $(distdir)-us.tar.gz $(distdir)-us
-rm -rf $(distdir)-us
mutt-dist:
(cd $(srcdir) && ./build-release )
......
OP_DECRYPT_SAVE "make decrypted copy and delete"
OP_DECRYPT_COPY "make decrypted copy"
OP_FORGET_PASSPHRASE "wipe passphrase(s) from memory"
OP_EXTRACT_KEYS "extract supported public keys"
OP_COMPOSE_ATTACH_KEY "attach a PGP public key"
OP_COMPOSE_PGP_MENU "show PGP options"
OP_EXTRACT_KEYS "extract PGP public keys"
OP_FORGET_PASSPHRASE "wipe PGP passphrase from memory"
OP_MAIL_KEY "mail a PGP public key"
OP_VERIFY_KEY "verify a PGP public key"
OP_VIEW_ID "view the key's user id"
OP_DECRYPT_SAVE "make decrypted copy and delete"
OP_DECRYPT_COPY "make decrypted copy"
OP_CHECK_TRADITIONAL "check for classic pgp"
OP_COMPOSE_SMIME_MENU "show S/MIME options"
......@@ -32,6 +32,10 @@
#include "pgp.h"
#endif
#ifdef HAVE_SMIME
#include "smime.h"
#endif
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -413,10 +417,11 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
int unlink_tempfile = 0;
is_message = mutt_is_message_type(a->type, a->subtype);
#ifdef HAVE_PGP
if (is_message && a->hdr && (a->hdr->pgp & PGPENCRYPT) && !pgp_valid_passphrase())
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase(a->hdr->security))
return (rc);
#endif /* HAVE_PGP */
#endif /* HAVE_PGP || HAVE_SMIME */
use_mailcap = (flag == M_MAILCAP ||
(flag == M_REGULAR && mutt_needs_mailcap (a)));
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
......
......@@ -45,6 +45,11 @@
#endif
#ifdef HAVE_SMIME
#include "smime.h"
#endif
#include <errno.h>
#include <unistd.h>
......@@ -76,18 +81,22 @@ int mutt_display_message (HEADER *cur)
mutt_parse_mime_message (Context, cur);
mutt_message_hook (Context, cur, M_MESSAGEHOOK);
#ifdef HAVE_PGP
#if defined (HAVE_PGP) || defined (HAVE_SMIME)
/* see if PGP is needed for this message. if so, we should exit curses */
if (cur->pgp)
if (cur->security)
{
if (cur->pgp & PGPENCRYPT)
if (cur->security & ENCRYPT)
{
if (!pgp_valid_passphrase ())
#ifdef HAVE_SMIME
if (cur->env->to && cur->security & APPLICATION_SMIME)
smime_getkeys (cur->env->to->mailbox);
#endif
if(!crypt_valid_passphrase(cur->security))
return 0;
cmflags |= M_CM_VERIFY;
}
else if (cur->pgp & PGPSIGN)
else if (cur->security & SIGN)
{
/* find out whether or not the verify signature */
if (query_quadoption (OPT_VERIFYSIG, _("Verify PGP signature?")) == M_YES)
......@@ -97,15 +106,25 @@ int mutt_display_message (HEADER *cur)
}
}
if ((cmflags & M_CM_VERIFY) || (cur->pgp & PGPENCRYPT))
if (cmflags & M_CM_VERIFY || cur->security & ENCRYPT)
{
if (cur->env->from)
pgp_invoke_getkeys (cur->env->from);
#ifdef HAVE_PGP
if (cur->security & APPLICATION_PGP)
{
if (cur->env->from)
pgp_invoke_getkeys (cur->env->from);
mutt_message _("Invoking PGP...");
}
mutt_message _("Invoking PGP...");
}
#endif
#ifdef HAVE_SMIME
if (cur->security & APPLICATION_SMIME)
mutt_message _("Invoking OpenSSL...");
#endif
}
#endif /* defined (HAVE_PGP) || defined (HAVE_SMIME) */
mutt_mktemp (tempfile);
if ((fpout = safe_fopen (tempfile, "w")) == NULL)
......@@ -153,18 +172,35 @@ int mutt_display_message (HEADER *cur)
if (fpfilterout != NULL && mutt_wait_filter (filterpid) != 0)
mutt_any_key_to_continue (NULL);
#ifdef HAVE_PGP
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
/* update PGP information for this message */
cur->pgp |= pgp_query (cur->content);
cur->security |= crypt_query (cur->content);
#endif
if (builtin)
{
pager_t info;
#ifdef HAVE_SMIME
char *smime_signer;
if (cur->security & APPLICATION_SMIME && (cmflags & M_CM_VERIFY))
{
if (cur->security & GOODSIGN)
{
if (!(smime_signer = smime_verify_sender(cur)))
mutt_message ( _("S/MIME signature successfully verified."));
else
mutt_error ( _("S/MIME certificate owner does not match sender."));
}
else if (cur->security & SIGN || cur->security & BADSIGN)
mutt_error ( _("S/MIME signature could NOT be verified."));
}
#endif
#ifdef HAVE_PGP
if (cmflags & M_CM_VERIFY)
mutt_message ((cur->pgp & PGPGOODSIGN) ?
if (cur->security & APPLICATION_PGP && (cmflags & M_CM_VERIFY))
mutt_message ((cur->security & GOODSIGN) ?
_("PGP signature successfully verified.") :
_("PGP signature could NOT be verified."));
#endif
......@@ -282,17 +318,16 @@ void pipe_msg (HEADER *h, FILE *fp, int decode, int print)
pipe_set_flags (decode, print, &cmflags, &chflags);
#ifdef HAVE_PGP
if (decode && (h->pgp & PGPENCRYPT))
{
if (!pgp_valid_passphrase())
return;
endwin();
}
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (decode && h->security & ENCRYPT)
{
if(!crypt_valid_passphrase(h->security))
return;
endwin ();
}
#endif
if (decode)
mutt_parse_mime_message (Context, h);
......@@ -313,17 +348,22 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
pid_t thepid;
FILE *fpout;
mutt_endwin (NULL);
/* mutt_endwin (NULL);
is this really needed here ?
it makes the screen flicker on pgp and s/mime messages,
before asking for a passphrase...
Oliver Ehli */
if (h)
{
mutt_message_hook (Context, h, M_MESSAGEHOOK);
#ifdef HAVE_PGP
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (decode)
{
mutt_parse_mime_message (Context, h);
if(h->pgp & PGPENCRYPT && !pgp_valid_passphrase())
if(h->security & ENCRYPT && !crypt_valid_passphrase(h->security))
return 1;
}
mutt_endwin (NULL);
......@@ -336,7 +376,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
}
pipe_msg (h, fpout, decode, print);
safe_fclose (&fpout);
fclose (fpout);
rc = mutt_wait_filter (thepid);
}
else
......@@ -344,7 +384,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
#ifdef HAVE_PGP
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (decode)
{
......@@ -353,8 +393,8 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
{
mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], M_MESSAGEHOOK);
mutt_parse_mime_message(Context, Context->hdrs[Context->v2r[i]]);
if (Context->hdrs[Context->v2r[i]]->pgp & PGPENCRYPT &&
!pgp_valid_passphrase())
if (Context->hdrs[Context->v2r[i]]->security & ENCRYPT &&
!crypt_valid_passphrase(Context->hdrs[Context->v2r[i]]->security))
return 1;
}
}
......@@ -576,18 +616,30 @@ static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags,
*cmflags = 0;
*chflags = CH_UPDATE_LEN;
#ifdef HAVE_PGP
if (!decode && decrypt && (hdr->pgp & PGPENCRYPT))
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (!decode && decrypt && (hdr->security & ENCRYPT))
{
#ifdef HAVE_PGP
if (mutt_is_multipart_encrypted(hdr->content))
{
*chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
*cmflags = M_CM_DECODE_PGP;
}
else if (mutt_is_application_pgp(hdr->content) & PGPENCRYPT)
else if (mutt_is_application_pgp(hdr->content) & ENCRYPT)
decode = 1;
}
#endif
#if defined(HAVE_PGP) && defined(HAVE_SMIME)
else
#endif
#ifdef HAVE_SMIME
if (mutt_is_application_smime(hdr->content) & ENCRYPT)
{
*chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
*cmflags = M_CM_DECODE_SMIME;
}
#endif
}
#endif /* defined(HAVE_PGP) || defined(HAVE_SMIME) */
if (decode)
{
......@@ -628,8 +680,8 @@ int mutt_save_message (HEADER *h, int delete,
int decode, int decrypt, int *redraw)
{
int i, need_buffy_cleanup;
#ifdef HAVE_PGP
int need_passphrase = 0;
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
int need_passphrase = 0, app=0;
#endif
char prompt[SHORT_STRING], buf[_POSIX_PATH_MAX];
CONTEXT ctx;
......@@ -651,10 +703,12 @@ int mutt_save_message (HEADER *h, int delete,
(delete ? _("Save%s to mailbox") : _("Copy%s to mailbox"))),
h ? "" : _(" tagged"));
if (h)
{
#ifdef HAVE_PGP
need_passphrase = h->pgp & PGPENCRYPT;
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
need_passphrase = h->security & ENCRYPT;
app = h->security;
#endif
mutt_message_hook (Context, h, M_MESSAGEHOOK);
mutt_default_save (buf, sizeof (buf), h);
......@@ -672,12 +726,14 @@ int mutt_save_message (HEADER *h, int delete,
}
}
if (h)
{
mutt_message_hook (Context, h, M_MESSAGEHOOK);
mutt_default_save (buf, sizeof (buf), h);
#ifdef HAVE_PGP
need_passphrase |= h->pgp & PGPENCRYPT;
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
need_passphrase = h->security & ENCRYPT;
app = h->security;
#endif
h = NULL;
}
......@@ -712,10 +768,8 @@ int mutt_save_message (HEADER *h, int delete,
if (!mutt_save_confirm (buf, &st))
return -1;
#ifdef HAVE_PGP
if(need_passphrase && (decode || decrypt) && !pgp_valid_passphrase())
if (need_passphrase && (decode || decrypt) && !crypt_valid_passphrase(app))
return -1;
#endif
mutt_message (_("Copying to %s..."), buf);
......@@ -865,20 +919,19 @@ void mutt_edit_content_type (HEADER *h, BODY *b, FILE *fp)
if (fp && (is_multipart (b) || mutt_is_message_type (b->type, b->subtype)))
mutt_parse_part (fp, b);
#ifdef HAVE_PGP
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
if (h)
{
if (h->content == b)
h->pgp = 0;
h->pgp |= pgp_query (b);
}
#endif /* HAVE_PGP */
h->security = 0;
h->security |= crypt_query (b);
#endif
}
}
#ifdef HAVE_PGP
static int _mutt_check_traditional_pgp (HEADER *h, int *redraw)
{
MESSAGE *msg;
......@@ -889,7 +942,7 @@ static int _mutt_check_traditional_pgp (HEADER *h, int *redraw)
return 0;
if (pgp_check_traditional (msg->fp, h->content, 0))
{
h->pgp = pgp_query (h->content);
h->security = crypt_query (h->content);
*redraw |= REDRAW_FULL;
rv = 1;
}
......
......@@ -58,11 +58,10 @@ enum
HDR_MIX,
#endif
#ifdef HAVE_PGP
HDR_PGP,
HDR_PGPSIGINFO,
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
HDR_CRYPT,
HDR_CRYPTINFO,
#endif
HDR_ATTACH = (HDR_FCC + 5) /* where to start printing the attachments */
};
......@@ -103,80 +102,204 @@ static void snd_entry (char *b, size_t blen, MUTTMENU *menu, int num)
#ifdef HAVE_SMIME
#include "smime.h"
#endif
#ifdef HAVE_PGP
#include "pgp.h"
#endif
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
static void redraw_pgp_lines (int pgp)
static void redraw_crypt_lines (HEADER *msg)
{
mvaddstr (HDR_PGP, 0, " PGP: ");
if ((pgp & (PGPENCRYPT | PGPSIGN)) == (PGPENCRYPT | PGPSIGN))
#ifdef HAVE_SMIME
int off = 0;
#endif
#if defined(HAVE_PGP) && defined(HAVE_SMIME)
if (!msg->security)
mvaddstr (HDR_CRYPT, 0, "Security: ");
else if (msg->security & APPLICATION_SMIME)
mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
else if (msg->security & APPLICATION_PGP)
mvaddstr (HDR_CRYPT, 0, " PGP: ");
#else
#ifdef HAVE_SMIME
mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
#endif
#ifdef HAVE_PGP
mvaddstr (HDR_CRYPT, 0, " PGP: ");
#endif
#endif
if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
addstr (_("Sign, Encrypt"));
else if (pgp & PGPENCRYPT)
else if (msg->security & ENCRYPT)
addstr (_("Encrypt"));
else if (pgp & PGPSIGN)
else if (msg->security & SIGN)
addstr (_("Sign"));
else
addstr (_("Clear"));
clrtoeol ();
move (HDR_PGPSIGINFO, 0);
move (HDR_CRYPTINFO, 0);
clrtoeol ();
if (pgp & PGPSIGN)
#ifdef HAVE_PGP
if (msg->security & APPLICATION_PGP && msg->security & SIGN)
printw ("%s%s", _(" sign as: "), PgpSignAs ? PgpSignAs : _("<default>"));
#endif
#ifdef HAVE_SMIME
if (msg->security & APPLICATION_SMIME && msg->security & SIGN) {
printw ("%s%s", _(" sign as: "), SmimeSignAs ? SmimeSignAs : _("<default>"));
}
if (msg->security & APPLICATION_SMIME && (msg->security & ENCRYPT)) {
mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
NONULL(SmimeCryptAlg));
off = 20;
}
#endif
}
#endif /* defined(HAVE_PGP) || defined(HAVE_SMIME) */
static int pgp_send_menu (int bits, int *redraw)
#ifdef HAVE_PGP
static int pgp_send_menu (HEADER *msg, int *redraw)
{
pgp_key_t *p;
char input_signas[SHORT_STRING];
switch (mutt_multi_choice (_("(e)ncrypt, (s)ign, sign (a)s, (b)oth, or (f)orget it? "),
switch (mutt_multi_choice (_("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (f)orget it? "),
_("esabf")))
{
case 1: /* (e)ncrypt */
bits |= PGPENCRYPT;
msg->security |= PGPENCRYPT;
break;
case 2: /* (s)ign */
bits |= PGPSIGN;
msg->security |= PGPSIGN;
break;
case 3: /* sign (a)s */
unset_option(OPTPGPCHECKTRUST);
if ((p = pgp_ask_for_key (_("Sign as: "), NULL, KEYFLAG_CANSIGN, PGP_SECRING)))
if ((p = pgp_ask_for_key (_("Sign as: "), NULL, KEYFLAG_CANSIGN, PGP_PUBRING)))
{
snprintf (input_signas, sizeof (input_signas), "0x%s", pgp_keyid (p));
mutt_str_replace (&PgpSignAs, input_signas);
pgp_free_key (&p);
bits |= PGPSIGN;
msg->security |= PGPSIGN;
pgp_void_passphrase (); /* probably need a different passphrase */
}
else
{
bits &= ~PGPSIGN;
msg->security &= ~PGPSIGN;
}
*redraw = REDRAW_FULL;
break;
case 4: /* (b)oth */
bits = PGPENCRYPT | PGPSIGN;
msg->security = PGPENCRYPT | PGPSIGN;
break;
case 5: /* (f)orget it */
bits = 0;
msg->security = 0;
break;
}
if (!*redraw)
redraw_pgp_lines (bits);
return (bits);
if(*redraw)
redraw_crypt_lines (msg);
return (msg->security);
}
#endif /* HAVE_PGP */
#ifdef HAVE_SMIME
static int smime_send_menu (HEADER *msg, int *redraw)
{
char *p;
switch (mutt_multi_choice (_("S/MIME (e)ncrypt, (s)ign, encrypt (w)ith, sign (a)s, (b)oth, or (f)orget it? "),
_("ewsabf")))
{
case 1: /* (e)ncrypt */
msg->security |= SMIMEENCRYPT;
break;
case 2: /* encrypt (w)ith */
msg->security |= SMIMEENCRYPT;
switch (mutt_multi_choice (_("1: DES, 2: Tripple-DES, 3: RC2-40,"
" 4: RC2-64, 5: RC2-128, or (f)orget it? "),
_("12345f"))) {
case 1:
mutt_str_replace (&SmimeCryptAlg, "des");
break;
case 2:
mutt_str_replace (&SmimeCryptAlg, "des3");
break;
case 3:
mutt_str_replace (&SmimeCryptAlg, "rc2-40");
break;
case 4:
mutt_str_replace (&SmimeCryptAlg, "rc2-64");
break;
case 5:
mutt_str_replace (&SmimeCryptAlg, "rc2-128");
break;
case 6: /* forget it */
break;
}
break;
case 3: /* (s)ign */
if(!SmimeSignAs)
mutt_message("Can\'t sign: No key specified. use sign(as).");
else
msg->security |= SMIMESIGN;
break;
case 4: /* sign (a)s */
if ((p = smime_ask_for_key (_("Sign as: "), NULL, 0))) {
p[mutt_strlen (p)-1] = '\0';
mutt_str_replace (&SmimeSignAs, p);
msg->security |= SMIMESIGN;
/* probably need a different passphrase */
smime_void_passphrase ();
}
else
msg->security &= ~SMIMESIGN;
*redraw = REDRAW_FULL;
break;
case 5: /* (b)oth */
msg->security = SMIMEENCRYPT | SMIMESIGN;
break;
case 6: /* (f)orget it */
msg->security = 0;
break;
}
if(*redraw)
redraw_crypt_lines (msg);
return (msg->security);
}
#endif /* HAVE_SMIME */
#ifdef MIXMASTER
static void redraw_mix_line (LIST *chain)
......@@ -269,9 +392,10 @@ static void draw_envelope (HEADER *msg, char *fcc)
#ifdef HAVE_PGP
redraw_pgp_lines (msg->pgp);
#endif /* HAVE_PGP */
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
redraw_crypt_lines (msg);
#endif /* HAVE_PGP || HAVE_SMIE */
#ifdef MIXMASTER
redraw_mix_line (msg->chain);
......@@ -1190,15 +1314,53 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
#ifdef HAVE_PGP
case OP_COMPOSE_PGP_MENU:
msg->pgp = pgp_send_menu (msg->pgp, &menu->redraw);
#ifdef HAVE_SMIME
if (msg->security & APPLICATION_SMIME)
{
if (mutt_yesorno (_("S/MIME already selected. Clear & continue ? "),
M_YES) == M_NO)
{
mutt_clear_error ();
break;
}
msg->security = 0;
}
#endif /* HAVE_SMIME */
msg->security = pgp_send_menu (msg, &menu->redraw);
redraw_crypt_lines (msg);
break;
#endif /* HAVE_PGP */
#if defined(HAVE_PGP) || defined(HAVE_SMIME)
case OP_FORGET_PASSPHRASE:
mutt_forget_passphrase ();
crypt_forget_passphrase ();
break;
#endif /* HAVE_PGP */
#endif /* HAVE_(PGP||SMIME) */
#ifdef HAVE_SMIME
case OP_COMPOSE_SMIME_MENU:
#ifdef HAVE_PGP
if (msg->security & APPLICATION_PGP)
{
if (mutt_yesorno (_("PGP already selected. Clear & continue ? "),
M_YES) == M_NO)
{
mutt_clear_error ();
break;
}
msg->security = 0;
}
#endif /* HAVE_pgp */
msg->security = smime_send_menu(msg, &menu->redraw);
redraw_crypt_lines (msg);
break;
#endif /* HAVE_SMIME */