summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am7
-rw-r--r--acconfig.h19
-rw-r--r--attach.c13
-rw-r--r--commands.c139
-rw-r--r--compose.c131
-rw-r--r--configure.in73
-rw-r--r--copy.c34
-rw-r--r--copy.h22
-rw-r--r--crypt.c465
-rw-r--r--cryptglue.c416
-rw-r--r--curs_main.c72
-rw-r--r--functions.h34
-rw-r--r--globals.h48
-rw-r--r--gnupgparse.c8
-rw-r--r--handler.c110
-rw-r--r--hdrline.c24
-rw-r--r--headers.c11
-rw-r--r--hook.c7
-rw-r--r--init.c24
-rw-r--r--init.h95
-rw-r--r--keymap.c25
-rw-r--r--keymap.h8
-rw-r--r--main.c25
-rw-r--r--mutt.h39
-rw-r--r--mutt_crypt.h227
-rw-r--r--muttlib.c35
-rw-r--r--mx.c21
-rw-r--r--pager.c55
-rw-r--r--parse.c17
-rw-r--r--pattern.c39
-rw-r--r--pgp.c88
-rw-r--r--pgp.h48
-rw-r--r--pgpkey.c52
-rw-r--r--pgplib.c17
-rw-r--r--pgplib.h48
-rw-r--r--pgppubring.c35
-rw-r--r--pop.c14
-rw-r--r--postpone.c70
-rw-r--r--protos.h2
-rw-r--r--recvattach.c100
-rw-r--r--send.c203
-rw-r--r--sendlib.c95
-rw-r--r--smime.c75
-rw-r--r--smime.h41
-rw-r--r--sort.h4
45 files changed, 1602 insertions, 1533 deletions
diff --git a/Makefile.am b/Makefile.am
index 7a1ea863..cf172649 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,6 +18,7 @@ BUILT_SOURCES = keymap_defs.h patchlist.c
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 \
+ crypt.c cryptglue.c \
commands.c complete.c compose.c copy.c curs_lib.c curs_main.c date.c \
edit.c enter.c flags.c init.c filter.c from.c getdomain.c \
handler.c hash.c hdrline.c headers.c help.c hook.c keymap.c \
@@ -58,21 +59,21 @@ CPPFLAGS=@CPPFLAGS@ -I$(includedir)
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 crypt.c smime.c pgp.c pgpinvoke.c pgpkey.c \
+ mutt_tunnel.c pop.c pop_auth.c pop_lib.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 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 \
+ globals.h hash.h history.h init.h keymap.h crypt.h \
mailbox.h mapping.h md5.h mime.h mutt.h mutt_curses.h mutt_menu.h \
mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.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 smime_keys.pl pgplib.h Muttrc.head Muttrc \
- makedoc.c stamp-doc-rc README.SSL crypt.h smime.h\
+ makedoc.c stamp-doc-rc README.SSL smime.h\
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
ChangeLog.old mkchangelog.sh cvslog2changelog.pl
diff --git a/acconfig.h b/acconfig.h
index 423995a6..206a664c 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,26 +1,7 @@
-/*
- * Define if you have problems with mutt not detecting new/old mailboxes
- * over NFS. Some NFS implementations incorrectly cache the attributes
- * of small files.
- */
-#undef NFS_ATTRIBUTE_HACK
-
-/*
- * Is mail spooled to the user's home directory? If defined, MAILPATH should
- * be set to the filename of the spool mailbox relative the the home
- * directory.
- * use: configure --with-homespool=FILE
- */
-#undef HOMESPOOL
-
/* program to use for shell commands */
#define EXECSHELL "/bin/sh"
-/* Enable exact regeneration of email addresses as parsed? NOTE: this requires
- significant more memory when defined. */
-#undef EXACT_ADDRESS
-
/* Define to `int' if <signal.h> doesn't define. */
#undef sig_atomic_t
diff --git a/attach.c b/attach.c
index 7a3c3bca..a491d186 100644
--- a/attach.c
+++ b/attach.c
@@ -27,14 +27,7 @@
#include "mailbox.h"
#include "copy.h"
#include "mx.h"
-
-#ifdef HAVE_PGP
-#include "pgp.h"
-#endif
-
-#ifdef HAVE_SMIME
-#include "smime.h"
-#endif
+#include "mutt_crypt.h"
#include <ctype.h>
#include <stdlib.h>
@@ -416,11 +409,9 @@ 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);
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- if (is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
+ if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase(a->hdr->security))
return (rc);
-#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);
diff --git a/commands.c b/commands.c
index 20dd5b73..c268ef4a 100644
--- a/commands.c
+++ b/commands.c
@@ -26,6 +26,7 @@
#include "copy.h"
#include "mx.h"
#include "pager.h"
+#include "mutt_crypt.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -38,19 +39,6 @@
#include "buffy.h"
#endif
-
-
-#ifdef HAVE_PGP
-#include "pgp.h"
-#endif
-
-
-#ifdef HAVE_SMIME
-#include "smime.h"
-#endif
-
-
-
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
@@ -81,16 +69,13 @@ int mutt_display_message (HEADER *cur)
mutt_parse_mime_message (Context, cur);
mutt_message_hook (Context, cur, M_MESSAGEHOOK);
-#if defined (HAVE_PGP) || defined (HAVE_SMIME)
- /* see if PGP is needed for this message. if so, we should exit curses */
- if (cur->security)
+ /* see if crytpo is needed for this message. if so, we should exit curses */
+ if (WithCrypto && cur->security)
{
if (cur->security & ENCRYPT)
{
-#ifdef HAVE_SMIME
if (cur->security & APPLICATION_SMIME)
- smime_getkeys (cur->env);
-#endif
+ crypt_smime_getkeys (cur->env);
if(!crypt_valid_passphrase(cur->security))
return 0;
@@ -108,22 +93,17 @@ int mutt_display_message (HEADER *cur)
if (cmflags & M_CM_VERIFY || cur->security & ENCRYPT)
{
-#ifdef HAVE_PGP
if (cur->security & APPLICATION_PGP)
{
if (cur->env->from)
- pgp_invoke_getkeys (cur->env->from);
-
- mutt_message _("Invoking PGP...");
+ crypt_pgp_invoke_getkeys (cur->env->from);
+
+ crypt_invoke_message (APPLICATION_PGP);
}
-#endif
-#ifdef HAVE_SMIME
if (cur->security & APPLICATION_SMIME)
- mutt_message _("Invoking OpenSSL...");
-#endif
+ crypt_invoke_message (APPLICATION_SMIME);
}
-#endif /* defined (HAVE_PGP) || defined (HAVE_SMIME) */
mutt_mktemp (tempfile);
@@ -178,25 +158,26 @@ int mutt_display_message (HEADER *cur)
safe_fclose (&fpfilterout); /* XXX - check result? */
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- /* update crypto information for this message */
- cur->security |= crypt_query (cur->content);
+ if (WithCrypto)
+ {
+ /* update crypto information for this message */
+ cur->security |= crypt_query (cur->content);
- /* Remove color cache for this message, in case there
- are color patterns for both ~g and ~V */
- cur->pair = 0;
-#endif
+ /* Remove color cache for this message, in case there
+ are color patterns for both ~g and ~V */
+ cur->pair = 0;
+ }
if (builtin)
{
pager_t info;
-#ifdef HAVE_SMIME
- if (cur->security & APPLICATION_SMIME && (cmflags & M_CM_VERIFY))
+ if (WithCrypto
+ && (cur->security & APPLICATION_SMIME) && (cmflags & M_CM_VERIFY))
{
if (cur->security & GOODSIGN)
{
- if (!smime_verify_sender(cur))
+ if (!crypt_smime_verify_sender(cur))
mutt_message ( _("S/MIME signature successfully verified."));
else
mutt_error ( _("S/MIME certificate owner does not match sender."));
@@ -204,14 +185,12 @@ int mutt_display_message (HEADER *cur)
else if (cur->security & SIGN || cur->security & BADSIGN)
mutt_error ( _("S/MIME signature could NOT be verified."));
}
-#endif
-#ifdef HAVE_PGP
- if ((cur->security & APPLICATION_PGP) && (cmflags & M_CM_VERIFY))
+ 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."));
-#endif
/* Invoke the builtin pager */
memset (&info, 0, sizeof (pager_t));
@@ -328,15 +307,12 @@ void pipe_msg (HEADER *h, FILE *fp, int decode, int print)
pipe_set_flags (decode, print, &cmflags, &chflags);
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- if (decode && h->security & ENCRYPT)
- {
- if(!crypt_valid_passphrase(h->security))
- return;
- endwin ();
- }
-#endif
-
+ if (WithCrypto && decode && h->security & ENCRYPT)
+ {
+ if(!crypt_valid_passphrase(h->security))
+ return;
+ endwin ();
+ }
if (decode)
mutt_parse_mime_message (Context, h);
@@ -369,15 +345,13 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
mutt_message_hook (Context, h, M_MESSAGEHOOK);
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- if (decode)
+ if (WithCrypto && decode)
{
mutt_parse_mime_message (Context, h);
if(h->security & ENCRYPT && !crypt_valid_passphrase(h->security))
return 1;
}
mutt_endwin (NULL);
-#endif
if ((thepid = mutt_create_filter (cmd, &fpout, NULL, NULL)) < 0)
{
@@ -392,11 +366,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
else
{ /* handle tagged messages */
-
-
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
-
- if (decode)
+ if (WithCrypto && decode)
{
for (i = 0; i < Context->vcount; i++)
if(Context->hdrs[Context->v2r[i]]->tagged)
@@ -408,7 +378,6 @@ static int _mutt_pipe_message (HEADER *h, char *cmd,
return 1;
}
}
-#endif
if (split)
{
@@ -626,30 +595,24 @@ static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags,
*cmflags = 0;
*chflags = CH_UPDATE_LEN;
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- if (!decode && decrypt && (hdr->security & ENCRYPT))
+ if (WithCrypto && !decode && decrypt && (hdr->security & ENCRYPT))
{
-#ifdef HAVE_PGP
- if (mutt_is_multipart_encrypted(hdr->content))
+ if ((WithCrypto & APPLICATION_PGP)
+ && 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) & ENCRYPT)
+ else if ((WithCrypto & APPLICATION_PGP)
+ && 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)
+ else if ((WithCrypto & APPLICATION_SMIME)
+ && 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)
{
@@ -690,9 +653,7 @@ int mutt_save_message (HEADER *h, int delete,
int decode, int decrypt, int *redraw)
{
int i, need_buffy_cleanup;
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
int need_passphrase = 0, app=0;
-#endif
char prompt[SHORT_STRING], buf[_POSIX_PATH_MAX];
CONTEXT ctx;
struct stat st;
@@ -716,10 +677,11 @@ int mutt_save_message (HEADER *h, int delete,
if (h)
{
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
+ if (WithCrypto)
+ {
need_passphrase = h->security & ENCRYPT;
app = h->security;
-#endif
+ }
mutt_message_hook (Context, h, M_MESSAGEHOOK);
mutt_default_save (buf, sizeof (buf), h);
}
@@ -741,10 +703,11 @@ int mutt_save_message (HEADER *h, int delete,
{
mutt_message_hook (Context, h, M_MESSAGEHOOK);
mutt_default_save (buf, sizeof (buf), h);
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- need_passphrase = h->security & ENCRYPT;
- app = h->security;
-#endif
+ if (WithCrypto)
+ {
+ need_passphrase = h->security & ENCRYPT;
+ app = h->security;
+ }
h = NULL;
}
}
@@ -778,10 +741,9 @@ int mutt_save_message (HEADER *h, int delete,
if (!mutt_save_confirm (buf, &st))
return -1;
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- if (need_passphrase && (decode || decrypt) && !crypt_valid_passphrase(app))
+ if (WithCrypto && need_passphrase && (decode || decrypt)
+ && !crypt_valid_passphrase(app))
return -1;
-#endif
mutt_message (_("Copying to %s..."), buf);
@@ -933,19 +895,16 @@ 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);
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- if (h)
+ if (WithCrypto && h)
{
if (h->content == b)
h->security = 0;
h->security |= crypt_query (b);
}
-#endif
}
-#ifdef HAVE_PGP
static int _mutt_check_traditional_pgp (HEADER *h, int *redraw)
{
MESSAGE *msg;
@@ -954,7 +913,7 @@ static int _mutt_check_traditional_pgp (HEADER *h, int *redraw)
mutt_parse_mime_message (Context, h);
if ((msg = mx_open_message (Context, h->msgno)) == NULL)
return 0;
- if (pgp_check_traditional (msg->fp, h->content, 0))
+ if (crypt_pgp_check_traditional (msg->fp, h->content, 0))
{
h->security = crypt_query (h->content);
*redraw |= REDRAW_FULL;
@@ -981,4 +940,4 @@ int mutt_check_traditional_pgp (HEADER *h, int *redraw)
return rv;
}
-#endif
+
diff --git a/compose.c b/compose.c
index fe12d126..28d87a9c 100644
--- a/compose.c
+++ b/compose.c
@@ -58,10 +58,8 @@ enum
HDR_MIX,
#endif
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
HDR_CRYPT,
HDR_CRYPTINFO,
-#endif
HDR_ATTACH = (HDR_FCC + 5) /* where to start printing the attachments */
};
@@ -102,38 +100,27 @@ 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)
+#include "mutt_crypt.h"
static void redraw_crypt_lines (HEADER *msg)
{
-#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)
+ if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_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 if ((WithCrypto & APPLICATION_SMIME))
mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
- else if (msg->security & APPLICATION_PGP)
+ else if ((WithCrypto & 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
-
+ else
+ return;
if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
addstr (_("Sign, Encrypt"));
@@ -147,31 +134,33 @@ static void redraw_crypt_lines (HEADER *msg)
move (HDR_CRYPTINFO, 0);
clrtoeol ();
-#ifdef HAVE_PGP
- if (msg->security & APPLICATION_PGP && msg->security & SIGN)
+ if ((WithCrypto & APPLICATION_PGP)
+ && 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) {
+
+ if ((WithCrypto & APPLICATION_SMIME)
+ && msg->security & APPLICATION_SMIME && msg->security & SIGN) {
printw ("%s%s", _(" sign as: "), SmimeDefaultKey ? SmimeDefaultKey : _("<default>"));
}
- if (msg->security & APPLICATION_SMIME && (msg->security & ENCRYPT)) {
+
+ if ((WithCrypto & APPLICATION_SMIME)
+ && 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) */
-#ifdef HAVE_PGP
static int pgp_send_menu (HEADER *msg, int *redraw)
{
- pgp_key_t *p;
+ pgp_key_t p;
char input_signas[SHORT_STRING];
+ if (!(WithCrypto & APPLICATION_PGP))
+ return msg->security;
+
switch (mutt_multi_choice (_("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, or (f)orget it? "),
_("esabf")))
{
@@ -184,18 +173,19 @@ static int pgp_send_menu (HEADER *msg, int *redraw)
break;
case 3: /* sign (a)s */
-
unset_option(OPTPGPCHECKTRUST);
- if ((p = pgp_ask_for_key (_("Sign as: "), NULL, KEYFLAG_CANSIGN, PGP_PUBRING)))
+ if ((p = crypt_pgp_ask_for_key (_("Sign as: "), NULL,
+ KEYFLAG_CANSIGN, PGP_PUBRING)))
{
- snprintf (input_signas, sizeof (input_signas), "0x%s", pgp_keyid (p));
+ snprintf (input_signas, sizeof (input_signas), "0x%s",
+ crypt_pgp_keyid (p));
mutt_str_replace (&PgpSignAs, input_signas);
- pgp_free_key (&p);
+ crypt_pgp_free_key (&p);
msg->security |= PGPSIGN;
- pgp_void_passphrase (); /* probably need a different passphrase */
+ crypt_pgp_void_passphrase (); /* probably need a different passphrase */
}
else
{
@@ -218,15 +208,15 @@ static int pgp_send_menu (HEADER *msg, int *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;
+ char *p;
+
+ if (!(WithCrypto & APPLICATION_SMIME))
+ return msg->security;
switch (mutt_multi_choice (_("S/MIME (e)ncrypt, (s)ign, encrypt (w)ith, sign (a)s, (b)oth, or (f)orget it? "),
_("eswabf")))
@@ -270,14 +260,14 @@ static int smime_send_menu (HEADER *msg, int *redraw)
case 4: /* sign (a)s */
- if ((p = smime_ask_for_key (_("Sign as: "), NULL, 0))) {
+ if ((p = crypt_smime_ask_for_key (_("Sign as: "), NULL, 0))) {
p[mutt_strlen (p)-1] = '\0';
mutt_str_replace (&SmimeDefaultKey, p);
msg->security |= SMIMESIGN;
/* probably need a different passphrase */
- smime_void_passphrase ();
+ crypt_smime_void_passphrase ();
}
else
msg->security &= ~SMIMESIGN;
@@ -298,7 +288,7 @@ static int smime_send_menu (HEADER *msg, int *redraw)
redraw_crypt_lines (msg);
return (msg->security);
}
-#endif /* HAVE_SMIME */
+
#ifdef MIXMASTER
@@ -332,7 +322,7 @@ static void redraw_mix_line (LIST *chain)
c += mutt_strlen (t) + 2;
}
}
-#endif
+#endif /* MIXMASTER */
static int
check_attachments(ATTACHPTR **idx, short idxlen)
@@ -390,12 +380,8 @@ static void draw_envelope (HEADER *msg, char *fcc)
mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);
mutt_paddstr (W, fcc);
-
-
-#if defined(HAVE_PGP) || defined(HAVE_SMIME)
- redraw_crypt_lines (msg);
-#endif /* HAVE_PGP || HAVE_SMIE */
-
+ if (WithCrypto)
+ redraw_crypt_lines (msg);
#ifdef MIXMASTER
redraw_mix_line (msg->chain);
@@ -735,9 +721,9 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
-#ifdef HAVE_PGP
case OP_COMPOSE_ATTACH_KEY:
-
+ if (!(WithCrypto & APPLICATION_PGP))
+ break;
if (idxlen == idxmax)
{
safe_realloc ((void **) &idx, sizeof (ATTACHPTR *) * (idxmax += 5));
@@ -745,7 +731,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
}
idx[idxlen] = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
- if ((idx[idxlen]->content = pgp_make_key_attachment(NULL)) != NULL)
+ if ((idx[idxlen]->content = crypt_pgp_make_key_attachment(NULL)) != NULL)
{
idx[idxlen]->level = (idxlen > 0) ? idx[idxlen-1]->level : 0;
@@ -769,8 +755,6 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
}
break;
-#endif
-
case OP_COMPOSE_ATTACH_FILE:
@@ -1310,11 +1294,11 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
-#ifdef HAVE_PGP
case OP_COMPOSE_PGP_MENU:
-
-#ifdef HAVE_SMIME
- if (msg->security & APPLICATION_SMIME)
+ if (!(WithCrypto & APPLICATION_PGP))
+ break;
+ if ((WithCrypto & APPLICATION_SMIME)
+ && msg->security & APPLICATION_SMIME)
{
if (mutt_yesorno (_("S/MIME already selected. Clear & continue ? "),
M_YES) == M_NO)
@@ -1324,27 +1308,22 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
}
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:
-
crypt_forget_passphrase ();
break;
-#endif /* HAVE_(PGP||SMIME) */
-
-#ifdef HAVE_SMIME
case OP_COMPOSE_SMIME_MENU:
+ if (!(WithCrypto & APPLICATION_SMIME))
+ break;
-#ifdef HAVE_PGP
- if (msg->security & APPLICATION_PGP)
+ if ((WithCrypto & APPLICATION_PGP)
+ && msg->security & APPLICATION_PGP)
{
if (mutt_yesorno (_("PGP already selected. Clear & continue ? "),
M_YES) == M_NO)
@@ -1354,13 +1333,10 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
}
msg->security = 0;
}
-#endif /* HAVE_pgp */
msg->security = smime_send_menu(msg, &menu->redraw);
redraw_crypt_lines (msg);
break;
-#endif /* HAVE_SMIME */
-
#ifdef MIXMASTER
case OP_COMPOSE_MIX:
@@ -1398,3 +1374,4 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
return (r);
}
+
diff --git a/configure.in b/configure.in
index 4b0ad2b9..89988923 100644
--- a/configure.in
+++ b/configure.in
@@ -56,6 +56,34 @@ fi
AC_SUBST(DEBUGGER)
+# The following templates should be used with newer automakes
+# instead of acconfig.h
+#
+#AH_TEMPLATE([sig_atomic_t],
+# [/* Define to `int' if <signal.h> doesn't define.])
+#AH_TEMPLATE([HAVE_START_COLOR],
+# [Define if you have start_color, as a function or macro.])
+#AH_TEMPLATE([HAVE_TYPEAHEAD],
+# [Define if you have typeahead, as a function or macro.])
+#AH_TEMPLATE([HAVE_BKGDSET],
+# [Define if you have bkgdset, as a function or macro.])
+#AH_TEMPLATE([HAVE_CURS_SET],
+# [Define if you have curs_set, as a function or macro.])
+#AH_TEMPLATE([HAVE_META],
+# [Define if you have meta, as a function or macro.])
+#AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS],
+# [Define if you have use_default_colors, as a function or macro.])
+#AH_TEMPLATE([HAVE_RESIZETERM],
+# [Define if you have resizeterm, as a function or macro.])
+#AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
+# [Some systems declare sig_atomic_t as volatile, some others -- no.
+# This define will have value `sig_atomic_t' or
+# `volatile sig_atomic_t' accordingly.])
+#AH_TEMPLATE([ICONV_NONTRANS],
+# [Define as 1 if iconv() only converts exactly and we should treat
+# all return values other than (size_t)(-1) as equivalent.])
+
+
ac_aux_path_sendmail=/usr/sbin:/usr/lib
AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$ac_aux_path_sendmail)
AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL",[ Where to find sendmail on your system. ])
@@ -73,10 +101,10 @@ else
])
if test x$have_pgp != xno ; then
- AC_DEFINE(HAVE_PGP,1,[ Define if you want PGP support. ])
+ AC_DEFINE(CRYPT_BACKEND_CLASSIC_PGP,1,
+ [ Define if you want classic PGP support. ])
PGPAUX_TARGET="pgpring pgpewrap"
MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o"
- OPS="$OPS \$(srcdir)/OPS.PGP"
fi
AC_ARG_