Symbols like 'SIGN' and 'INLINE' are hard to search for.
return;
/* Grab protected headers to update in the index */
- if (cur->security & SIGN)
+ if (cur->security & SEC_SIGN)
{
/* Don't update on a bad signature.
*
* encrypted part of a nested encrypt/signed. But properly handling that
* case would require more complexity in the decryption handlers, which
* I'm not sure is worth it. */
- if (!(cur->security & GOODSIGN))
+ if (!(cur->security & SEC_GOODSIGN))
return;
if (mutt_is_multipart_signed(cur->content) && cur->content->parts)
prot_headers = cur->content->mime_headers;
}
}
- if (!prot_headers && (cur->security & ENCRYPT))
+ if (!prot_headers && (cur->security & SEC_ENCRYPT))
{
if ((WithCrypto & APPLICATION_PGP) &&
(mutt_is_valid_multipart_pgp_encrypted(cur->content) ||
/* see if crypto is needed for this message. if so, we should exit curses */
if ((WithCrypto != 0) && cur->security)
{
- if (cur->security & ENCRYPT)
+ if (cur->security & SEC_ENCRYPT)
{
if (cur->security & APPLICATION_SMIME)
crypt_smime_getkeys(cur->env);
cmflags |= MUTT_CM_VERIFY;
}
- else if (cur->security & SIGN)
+ else if (cur->security & SEC_SIGN)
{
/* find out whether or not the verify signature */
/* L10N: Used for the $crypt_verify_sig prompt */
}
}
- if (cmflags & MUTT_CM_VERIFY || cur->security & ENCRYPT)
+ if (cmflags & MUTT_CM_VERIFY || cur->security & SEC_ENCRYPT)
{
if (cur->security & APPLICATION_PGP)
{
if (WithCrypto)
{
/* update crypto information for this message */
- cur->security &= ~(GOODSIGN | BADSIGN);
+ cur->security &= ~(SEC_GOODSIGN | SEC_BADSIGN);
cur->security |= crypt_query(cur->content);
/* Remove color cache for this message, in case there
{
if ((WithCrypto != 0) && (cur->security & APPLICATION_SMIME) && (cmflags & MUTT_CM_VERIFY))
{
- if (cur->security & GOODSIGN)
+ if (cur->security & SEC_GOODSIGN)
{
if (crypt_smime_verify_sender(cur) == 0)
mutt_message(_("S/MIME signature successfully verified"));
else
mutt_error(_("S/MIME certificate owner does not match sender"));
}
- else if (cur->security & PARTSIGN)
+ else if (cur->security & SEC_PARTSIGN)
mutt_message(_("Warning: Part of this message has not been signed"));
- else if (cur->security & SIGN || cur->security & BADSIGN)
+ else if (cur->security & SEC_SIGN || cur->security & SEC_BADSIGN)
mutt_error(_("S/MIME signature could NOT be verified"));
}
if ((WithCrypto != 0) && (cur->security & APPLICATION_PGP) && (cmflags & MUTT_CM_VERIFY))
{
- if (cur->security & GOODSIGN)
+ if (cur->security & SEC_GOODSIGN)
mutt_message(_("PGP signature successfully verified"));
- else if (cur->security & PARTSIGN)
+ else if (cur->security & SEC_PARTSIGN)
mutt_message(_("Warning: Part of this message has not been signed"));
- else if (cur->security & SIGN)
+ else if (cur->security & SEC_SIGN)
mutt_message(_("PGP signature could NOT be verified"));
}
pipe_set_flags(decode, print, &cmflags, &chflags);
- if ((WithCrypto != 0) && decode && e->security & ENCRYPT)
+ if ((WithCrypto != 0) && decode && e->security & SEC_ENCRYPT)
{
if (!crypt_valid_passphrase(e->security))
return;
if ((WithCrypto != 0) && decode)
{
mutt_parse_mime_message(m, en->email);
- if ((en->email->security & ENCRYPT) && !crypt_valid_passphrase(en->email->security))
+ if ((en->email->security & SEC_ENCRYPT) &&
+ !crypt_valid_passphrase(en->email->security))
return 1;
}
mutt_endwin();
{
mutt_message_hook(m, en->email, MUTT_MESSAGE_HOOK);
mutt_parse_mime_message(m, en->email);
- if ((en->email->security & ENCRYPT) && !crypt_valid_passphrase(en->email->security))
+ if ((en->email->security & SEC_ENCRYPT) &&
+ !crypt_valid_passphrase(en->email->security))
{
return 1;
}
*cmflags = 0;
*chflags = CH_UPDATE_LEN;
- if ((WithCrypto != 0) && !decode && decrypt && (e->security & ENCRYPT))
+ if ((WithCrypto != 0) && !decode && decrypt && (e->security & SEC_ENCRYPT))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_multipart_encrypted(e->content))
{
*cmflags = MUTT_CM_DECODE_PGP;
}
else if (((WithCrypto & APPLICATION_PGP) != 0) &&
- mutt_is_application_pgp(e->content) & ENCRYPT)
+ mutt_is_application_pgp(e->content) & SEC_ENCRYPT)
{
decode = 1;
}
else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
- mutt_is_application_smime(e->content) & ENCRYPT)
+ mutt_is_application_smime(e->content) & SEC_ENCRYPT)
{
*chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
*cmflags = MUTT_CM_DECODE_SMIME;
if (WithCrypto)
{
- need_passphrase = (en->email->security & ENCRYPT);
+ need_passphrase = (en->email->security & SEC_ENCRYPT);
app = en->email->security;
}
mutt_message_hook(m, en->email, MUTT_MESSAGE_HOOK);
return;
}
- if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
+ if ((msg->security & (SEC_ENCRYPT | SEC_SIGN)) == (SEC_ENCRYPT | SEC_SIGN))
{
SETCOLOR(MT_COLOR_COMPOSE_SECURITY_BOTH);
addstr(_("Sign, Encrypt"));
}
- else if (msg->security & ENCRYPT)
+ else if (msg->security & SEC_ENCRYPT)
{
SETCOLOR(MT_COLOR_COMPOSE_SECURITY_ENCRYPT);
addstr(_("Encrypt"));
}
- else if (msg->security & SIGN)
+ else if (msg->security & SEC_SIGN)
{
SETCOLOR(MT_COLOR_COMPOSE_SECURITY_SIGN);
addstr(_("Sign"));
}
NORMAL_COLOR;
- if ((msg->security & (ENCRYPT | SIGN)))
+ if ((msg->security & (SEC_ENCRYPT | SEC_SIGN)))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
- if ((msg->security & INLINE))
+ if ((msg->security & SEC_INLINE))
addstr(_(" (inline PGP)"));
else
addstr(_(" (PGP/MIME)"));
addstr(_(" (S/MIME)"));
}
- if (CryptOpportunisticEncrypt && (msg->security & OPPENCRYPT))
+ if (CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT))
addstr(_(" (OppEnc mode)"));
mutt_window_clrtoeol(MuttIndexWindow);
mutt_window_clrtoeol(MuttIndexWindow);
if (((WithCrypto & APPLICATION_PGP) != 0) &&
- (msg->security & APPLICATION_PGP) && (msg->security & SIGN))
+ (msg->security & APPLICATION_PGP) && (msg->security & SEC_SIGN))
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO]));
}
if (((WithCrypto & APPLICATION_SMIME) != 0) &&
- (msg->security & APPLICATION_SMIME) && (msg->security & SIGN))
+ (msg->security & APPLICATION_SMIME) && (msg->security & SEC_SIGN))
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO]));
}
if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME) &&
- (msg->security & ENCRYPT) && SmimeEncryptWith && *SmimeEncryptWith)
+ (msg->security & SEC_ENCRYPT) && SmimeEncryptWith && *SmimeEncryptWith)
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: "));
}
if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
- if (msg->security & (ENCRYPT | SIGN))
+ if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
if (mutt_yesorno(_("S/MIME already selected. Clear and continue? "),
MUTT_YES) != MUTT_YES)
mutt_clear_error();
break;
}
- msg->security &= ~(ENCRYPT | SIGN);
+ msg->security &= ~(SEC_ENCRYPT | SEC_SIGN);
}
msg->security &= ~APPLICATION_SMIME;
msg->security |= APPLICATION_PGP;
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
- if (msg->security & (ENCRYPT | SIGN))
+ if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
if (mutt_yesorno(_("PGP already selected. Clear and continue? "), MUTT_YES) != MUTT_YES)
{
mutt_clear_error();
break;
}
- msg->security &= ~(ENCRYPT | SIGN);
+ msg->security &= ~(SEC_ENCRYPT | SEC_SIGN);
}
msg->security &= ~APPLICATION_PGP;
msg->security |= APPLICATION_SMIME;
rc = mutt_body_handler(body, &s);
}
- else if ((WithCrypto != 0) && (flags & MUTT_CM_DECODE_CRYPT) && (e->security & ENCRYPT))
+ else if ((WithCrypto != 0) && (flags & MUTT_CM_DECODE_CRYPT) && (e->security & SEC_ENCRYPT))
{
struct Body *cur = NULL;
FILE *fp = NULL;
else if (src[0] == 'c') /* crypto */
{
const char *ch = NULL;
- if ((WithCrypto != 0) && (e->security & GOODSIGN))
+ if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
ch = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_GOOD_SIGN);
- else if ((WithCrypto != 0) && (e->security & ENCRYPT))
+ else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
ch = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_ENCRYPTED);
- else if ((WithCrypto != 0) && (e->security & SIGN))
+ else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
ch = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_SIGNED);
else if (((WithCrypto & APPLICATION_PGP) != 0) && ((e->security & PGP_KEY) == PGP_KEY))
{
second = get_nth_wchar(FlagChars, FLAG_CHAR_DELETED);
else if (e->attach_del)
second = get_nth_wchar(FlagChars, FLAG_CHAR_DELETED_ATTACH);
- else if ((WithCrypto != 0) && (e->security & GOODSIGN))
+ else if ((WithCrypto != 0) && (e->security & SEC_GOODSIGN))
second = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_GOOD_SIGN);
- else if ((WithCrypto != 0) && (e->security & ENCRYPT))
+ else if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
second = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_ENCRYPTED);
- else if ((WithCrypto != 0) && (e->security & SIGN))
+ else if ((WithCrypto != 0) && (e->security & SEC_SIGN))
second = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_SIGNED);
else if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & PGP_KEY))
second = get_nth_wchar(CryptChars, FLAG_CHAR_CRYPT_CONTAINS_KEY);
bool is_message = mutt_is_message_type(a->type, a->subtype);
if ((WithCrypto != 0) && is_message && a->email &&
- (a->email->security & ENCRYPT) && !crypt_valid_passphrase(a->email->security))
+ (a->email->security & SEC_ENCRYPT) && !crypt_valid_passphrase(a->email->security))
{
return rc;
}
if (!WithCrypto)
return -1;
- if (!(msg->security & (ENCRYPT | SIGN)))
+ if (!(msg->security & (SEC_ENCRYPT | SEC_SIGN)))
return 0;
- if ((msg->security & SIGN) && !crypt_valid_passphrase(msg->security))
+ if ((msg->security & SEC_SIGN) && !crypt_valid_passphrase(msg->security))
return -1;
if (((WithCrypto & APPLICATION_PGP) != 0) && ((msg->security & PGP_INLINE) == PGP_INLINE))
if (WithCrypto & APPLICATION_PGP)
tmp_pgp_pbody = msg->content;
- if (CryptUsePka && (msg->security & SIGN))
+ if (CryptUsePka && (msg->security & SEC_SIGN))
{
/* Set sender (necessary for e.g. PKA). */
const char *mailbox = NULL;
msg->content->mime_headers = protected_headers;
}
- if (msg->security & SIGN)
+ if (msg->security & SEC_SIGN)
{
if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
}
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP) &&
- (!(flags & ENCRYPT) || PgpRetainableSigs))
+ (!(flags & SEC_ENCRYPT) || PgpRetainableSigs))
{
tmp_pbody = crypt_pgp_sign_message(msg->content);
if (!tmp_pbody)
goto bail;
- flags &= ~SIGN;
+ flags &= ~SEC_SIGN;
pbody = tmp_pbody;
tmp_pgp_pbody = tmp_pbody;
}
}
}
- if (msg->security & ENCRYPT)
+ if (msg->security & SEC_ENCRYPT)
{
if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
- pbody = crypt_pgp_encrypt_message(tmp_pgp_pbody, keylist, (flags & SIGN));
+ pbody = crypt_pgp_encrypt_message(tmp_pgp_pbody, keylist, (flags & SEC_SIGN));
if (!pbody)
{
/* did we perform a retainable signature? */
return 0;
if (!(mutt_str_strcasecmp(p, "multipart/mixed") != 0))
- return SIGN;
+ return SEC_SIGN;
if (((WithCrypto & APPLICATION_PGP) != 0) &&
!(mutt_str_strcasecmp(p, "application/pgp-signature") != 0))
/**
* crypt_query - Check out the type of encryption used
* @param m Body of email
- * @retval num Flags, e.g. #GOODSIGN
+ * @retval num Flags, e.g. #SEC_GOODSIGN
* @retval 0 Error
*
* Set the cached status values if there are any.
{
t |= mutt_is_application_smime(m);
if (t && m->goodsig)
- t |= GOODSIGN;
+ t |= SEC_GOODSIGN;
if (t && m->badsig)
- t |= BADSIGN;
+ t |= SEC_BADSIGN;
}
}
else if (((WithCrypto & APPLICATION_PGP) != 0) && m->type == TYPE_TEXT)
{
t |= mutt_is_application_pgp(m);
if (t && m->goodsig)
- t |= GOODSIGN;
+ t |= SEC_GOODSIGN;
}
if (m->type == TYPE_MULTIPART)
t |= mutt_is_malformed_multipart_pgp_encrypted(m);
if (t && m->goodsig)
- t |= GOODSIGN;
+ t |= SEC_GOODSIGN;
}
if (m->type == TYPE_MULTIPART || m->type == TYPE_MESSAGE)
u &= v;
w |= v;
}
- t |= u | (w & ~GOODSIGN);
+ t |= u | (w & ~SEC_GOODSIGN);
- if ((w & GOODSIGN) && !(u & GOODSIGN))
- t |= PARTSIGN;
+ if ((w & SEC_GOODSIGN) && !(u & SEC_GOODSIGN))
+ t |= SEC_PARTSIGN;
}
return t;
struct Email *e = en->email;
mutt_parse_mime_message(Context->mailbox, e);
- if (e->security & ENCRYPT && !crypt_valid_passphrase(e->security))
+ if (e->security & SEC_ENCRYPT && !crypt_valid_passphrase(e->security))
{
mutt_file_fclose(&fpout);
break;
if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME))
{
- if (e->security & ENCRYPT)
+ if (e->security & SEC_ENCRYPT)
{
mutt_copy_message_ctx(fpout, Context->mailbox, e,
MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME,
*keylist = NULL;
- if (oppenc_mode || (msg->security & ENCRYPT))
+ if (oppenc_mode || (msg->security & SEC_ENCRYPT))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
if (!WithCrypto)
return;
- if (!(CryptOpportunisticEncrypt && (msg->security & OPPENCRYPT)))
+ if (!(CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT)))
return;
crypt_get_keys(msg, &pgpkeylist, 1);
if (pgpkeylist)
{
- msg->security |= ENCRYPT;
+ msg->security |= SEC_ENCRYPT;
FREE(&pgpkeylist);
}
else
{
- msg->security &= ~ENCRYPT;
+ msg->security &= ~SEC_ENCRYPT;
}
}
*/
bool mutt_should_hide_protected_subject(struct Email *e)
{
- if (CryptProtectedHeadersWrite && (e->security & ENCRYPT) && !(e->security & INLINE) &&
- CryptProtectedHeadersSubject && *CryptProtectedHeadersSubject)
+ if (CryptProtectedHeadersWrite && (e->security & SEC_ENCRYPT) &&
+ !(e->security & SEC_INLINE) && CryptProtectedHeadersSubject && *CryptProtectedHeadersSubject)
{
return true;
}
{
switch (signed_type)
{
- case SIGN:
+ case SEC_SIGN:
if (a->next->type != TYPE_MULTIPART ||
(mutt_str_strcasecmp(a->next->subtype, "mixed") != 0))
{
* gpgme_send_menu - Show the user the encryption/signing menu
* @param msg Email
* @param is_smime True if an SMIME message
- * @retval num Flags, e.g. #APPLICATION_SMIME | #ENCRYPT
+ * @retval num Flags, e.g. #APPLICATION_SMIME | #SEC_ENCRYPT
*/
static int gpgme_send_menu(struct Email *msg, int is_smime)
{
* NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
* letter choices for those.
*/
- if (CryptOpportunisticEncrypt && (msg->security & OPPENCRYPT))
+ if (CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT))
{
if (is_smime)
{
mutt_str_replace(is_smime ? &SmimeDefaultKey : &PgpSignAs, input_signas);
crypt_free_key(&p);
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
}
break;
case 'b': /* (b)oth */
- msg->security |= (ENCRYPT | SIGN);
+ msg->security |= (SEC_ENCRYPT | SEC_SIGN);
break;
case 'C':
- msg->security &= ~SIGN;
+ msg->security &= ~SEC_SIGN;
break;
case 'c': /* (c)lear */
- msg->security &= ~(ENCRYPT | SIGN);
+ msg->security &= ~(SEC_ENCRYPT | SEC_SIGN);
break;
case 'e': /* (e)ncrypt */
- msg->security |= ENCRYPT;
- msg->security &= ~SIGN;
+ msg->security |= SEC_ENCRYPT;
+ msg->security &= ~SEC_SIGN;
break;
case 'm': /* (p)gp or s/(m)ime */
break;
case 'O': /* oppenc mode on */
- msg->security |= OPPENCRYPT;
+ msg->security |= SEC_OPPENCRYPT;
crypt_opportunistic_encrypt(msg);
break;
case 'o': /* oppenc mode off */
- msg->security &= ~OPPENCRYPT;
+ msg->security &= ~SEC_OPPENCRYPT;
break;
case 'S': /* (s)ign in oppenc mode */
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
break;
case 's': /* (s)ign */
- msg->security &= ~ENCRYPT;
- msg->security |= SIGN;
+ msg->security &= ~SEC_ENCRYPT;
+ msg->security |= SEC_SIGN;
break;
}
}
/**
* send_menu - Ask the user whether to sign and/or encrypt the email
* @param msg Email
- * @retval num Flags, e.g. #APPLICATION_PGP | #ENCRYPT
+ * @retval num Flags, e.g. #APPLICATION_PGP | #SEC_ENCRYPT
*/
int (*send_menu)(struct Email *msg);
/**
/**
* pgp_traditional_encryptsign - Create an inline PGP encrypted, signed email
* @param a Body of the email
- * @param flags Flags, e.g. #ENCRYPT
+ * @param flags Flags, e.g. #SEC_ENCRYPT
* @param keylist List of keys to encrypt to (space-separated)
* @retval ptr New encrypted/siged Body
* @retval NULL Error
extern char *SmimeVerifyCommand;
extern char *SmimeVerifyOpaqueCommand;
-#define ENCRYPT (1 << 0) ///< Email is encrypted
-#define SIGN (1 << 1) ///< Email is signed
-#define GOODSIGN (1 << 2) ///< Email has a valid signature
-#define BADSIGN (1 << 3) ///< Email has a bad signature
-#define PARTSIGN (1 << 4) ///< Not all parts of the email is signed
-#define SIGNOPAQUE (1 << 5) ///< Email has an opaque signature (encrypted)
-#define KEYBLOCK (1 << 6) ///< Email has a key attached
-#define INLINE (1 << 7) ///< Email has an inline signature
-#define OPPENCRYPT (1 << 8) ///< Opportunistic encrypt mode
+#define SEC_ENCRYPT (1 << 0) ///< Email is encrypted
+#define SEC_SIGN (1 << 1) ///< Email is signed
+#define SEC_GOODSIGN (1 << 2) ///< Email has a valid signature
+#define SEC_BADSIGN (1 << 3) ///< Email has a bad signature
+#define SEC_PARTSIGN (1 << 4) ///< Not all parts of the email is signed
+#define SEC_SIGNOPAQUE (1 << 5) ///< Email has an opaque signature (encrypted)
+#define SEC_KEYBLOCK (1 << 6) ///< Email has a key attached
+#define SEC_INLINE (1 << 7) ///< Email has an inline signature
+#define SEC_OPPENCRYPT (1 << 8) ///< Opportunistic encrypt mode
#define APPLICATION_PGP (1 << 9) ///< Use PGP to encrypt/sign
#define APPLICATION_SMIME (1 << 10) ///< Use SMIME to encrypt/sign
#define PGP_TRADITIONAL_CHECKED (1 << 11) ///< Email has a traditional (inline) signature
-#define PGP_ENCRYPT (APPLICATION_PGP | ENCRYPT)
-#define PGP_SIGN (APPLICATION_PGP | SIGN)
-#define PGP_GOODSIGN (APPLICATION_PGP | GOODSIGN)
-#define PGP_KEY (APPLICATION_PGP | KEYBLOCK)
-#define PGP_INLINE (APPLICATION_PGP | INLINE)
-
-#define SMIME_ENCRYPT (APPLICATION_SMIME | ENCRYPT)
-#define SMIME_SIGN (APPLICATION_SMIME | SIGN)
-#define SMIME_GOODSIGN (APPLICATION_SMIME | GOODSIGN)
-#define SMIME_BADSIGN (APPLICATION_SMIME | BADSIGN)
-#define SMIME_OPAQUE (APPLICATION_SMIME | SIGNOPAQUE)
+#define PGP_ENCRYPT (APPLICATION_PGP | SEC_ENCRYPT)
+#define PGP_SIGN (APPLICATION_PGP | SEC_SIGN)
+#define PGP_GOODSIGN (APPLICATION_PGP | SEC_GOODSIGN)
+#define PGP_KEY (APPLICATION_PGP | SEC_KEYBLOCK)
+#define PGP_INLINE (APPLICATION_PGP | SEC_INLINE)
+
+#define SMIME_ENCRYPT (APPLICATION_SMIME | SEC_ENCRYPT)
+#define SMIME_SIGN (APPLICATION_SMIME | SEC_SIGN)
+#define SMIME_GOODSIGN (APPLICATION_SMIME | SEC_GOODSIGN)
+#define SMIME_BADSIGN (APPLICATION_SMIME | SEC_BADSIGN)
+#define SMIME_OPAQUE (APPLICATION_SMIME | SEC_SIGNOPAQUE)
/* WITHCRYPTO actually replaces ifdefs so make the code more readable.
* Because it is defined as a constant and known at compile time, the
int c;
struct FgetConv *fc = NULL;
- if (flags & ENCRYPT)
+ if (flags & SEC_ENCRYPT)
send_charset = "us-ascii";
else
send_charset = "utf-8";
if (pgp_use_gpg_agent())
*PgpPass = 0;
- if (flags & SIGN)
+ if (flags & SEC_SIGN)
fprintf(pgpin, "%s\n", PgpPass);
mutt_file_fclose(&pgpin);
if (empty)
{
- if (flags & SIGN)
+ if (flags & SEC_SIGN)
pgp_class_void_passphrase(); /* just in case */
unlink(pgpoutfile);
return NULL;
b->type = TYPE_TEXT;
b->subtype = mutt_str_strdup("plain");
- mutt_param_set(&b->parameter, "x-action", (flags & ENCRYPT) ? "pgp-encrypted" : "pgp-signed");
+ mutt_param_set(&b->parameter, "x-action",
+ (flags & SEC_ENCRYPT) ? "pgp-encrypted" : "pgp-signed");
mutt_param_set(&b->parameter, "charset", send_charset);
b->filename = mutt_str_strdup(pgpoutfile);
b->noconv = true;
b->use_disp = false;
- if (!(flags & ENCRYPT))
+ if (!(flags & SEC_ENCRYPT))
b->encoding = a->encoding;
return b;
return msg->security;
/* If autoinline and no crypto options set, then set inline. */
- if (PgpAutoinline &&
- !((msg->security & APPLICATION_PGP) && (msg->security & (SIGN | ENCRYPT))))
+ if (PgpAutoinline && !((msg->security & APPLICATION_PGP) &&
+ (msg->security & (SEC_SIGN | SEC_ENCRYPT))))
{
- msg->security |= INLINE;
+ msg->security |= SEC_INLINE;
}
msg->security |= APPLICATION_PGP;
char *mime_inline = NULL;
- if (msg->security & INLINE)
+ if (msg->security & SEC_INLINE)
{
/* L10N: The next string MUST have the same highlighted letter
One of them will appear in each of the three strings marked "(inline"), below. */
* NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
* letter choices for those.
*/
- if (CryptOpportunisticEncrypt && (msg->security & OPPENCRYPT))
+ if (CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT))
{
- if (msg->security & (ENCRYPT | SIGN))
+ if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
snprintf(promptbuf, sizeof(promptbuf),
/* L10N: PGP options (inline) (opportunistic encryption is on) */
/* When the message is not selected for signing or encryption, the toggle
* between PGP/MIME and Traditional doesn't make sense.
*/
- if (msg->security & (ENCRYPT | SIGN))
+ if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
snprintf(promptbuf, sizeof(promptbuf),
/* L10N: PGP options (inline) (opportunistic encryption is off) */
/* Opportunistic encryption is unset */
else
{
- if (msg->security & (ENCRYPT | SIGN))
+ if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
snprintf(promptbuf, sizeof(promptbuf),
/* L10N: PGP options (inline) */
mutt_str_replace(&PgpSignAs, input_signas);
pgp_free_key(&p);
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
crypt_pgp_void_passphrase(); /* probably need a different passphrase */
}
break;
case 'b': /* (b)oth */
- msg->security |= (ENCRYPT | SIGN);
+ msg->security |= (SEC_ENCRYPT | SEC_SIGN);
break;
case 'C':
- msg->security &= ~SIGN;
+ msg->security &= ~SEC_SIGN;
break;
case 'c': /* (c)lear */
- msg->security &= ~(ENCRYPT | SIGN);
+ msg->security &= ~(SEC_ENCRYPT | SEC_SIGN);
break;
case 'e': /* (e)ncrypt */
- msg->security |= ENCRYPT;
- msg->security &= ~SIGN;
+ msg->security |= SEC_ENCRYPT;
+ msg->security &= ~SEC_SIGN;
break;
case 'i': /* toggle (i)nline */
- msg->security ^= INLINE;
+ msg->security ^= SEC_INLINE;
break;
case 'O': /* oppenc mode on */
- msg->security |= OPPENCRYPT;
+ msg->security |= SEC_OPPENCRYPT;
crypt_opportunistic_encrypt(msg);
break;
case 'o': /* oppenc mode off */
- msg->security &= ~OPPENCRYPT;
+ msg->security &= ~SEC_OPPENCRYPT;
break;
case 'S': /* (s)ign in oppenc mode */
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
break;
case 's': /* (s)ign */
- msg->security &= ~ENCRYPT;
- msg->security |= SIGN;
+ msg->security &= ~SEC_ENCRYPT;
+ msg->security |= SEC_SIGN;
break;
}
}
* @param[in] pgperrfd stderr for the command, or -1 (OPTIONAL)
* @param[in] fname Filename to pass to the command
* @param[in] uids List of IDs/fingerprints, space separated
- * @param[in] flags Flags, e.g. #SIGN, #ENCRYPT
+ * @param[in] flags Flags, e.g. #SEC_SIGN, #SEC_ENCRYPT
* @retval num PID of the created process
* @retval -1 Error creating pipes or forking
*
int pgpinfd, int pgpoutfd, int pgperrfd,
const char *fname, const char *uids, int flags)
{
- if (flags & ENCRYPT)
+ if (flags & SEC_ENCRYPT)
{
return pgp_invoke(pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
- (flags & SIGN), fname, NULL, uids,
- (flags & SIGN) ? PgpEncryptSignCommand : PgpEncryptOnlyCommand);
+ (flags & SEC_SIGN), fname, NULL, uids,
+ (flags & SEC_SIGN) ? PgpEncryptSignCommand : PgpEncryptOnlyCommand);
}
else
{
return 1;
}
- if (e->security & ENCRYPT)
+ if (e->security & SEC_ENCRYPT)
{
mutt_copy_message_ctx(fpout, Context->mailbox, e, MUTT_CM_DECODE_CRYPT & MUTT_CM_DECODE_SMIME,
CH_MIME | CH_WEED | CH_NONEWLINE);
mutt_file_fclose(&tmpfp);
FILE *smimein = NULL;
- if ((type & ENCRYPT) &&
+ if ((type & SEC_ENCRYPT) &&
(thepid = smime_invoke_decrypt(&smimein, NULL, NULL, -1, fileno(smimeout),
fileno(smimeerr), tmpfname)) == -1)
{
mutt_file_fclose(&smimeerr);
return NULL;
}
- else if ((type & SIGNOPAQUE) &&
- (thepid = smime_invoke_verify(&smimein, NULL, NULL, -1, fileno(smimeout),
- fileno(smimeerr), NULL, tmpfname, SIGNOPAQUE)) == -1)
+ else if ((type & SEC_SIGNOPAQUE) &&
+ (thepid = smime_invoke_verify(&smimein, NULL, NULL, -1,
+ fileno(smimeout), fileno(smimeerr),
+ NULL, tmpfname, SEC_SIGNOPAQUE)) == -1)
{
mutt_file_fclose(&smimeout);
mutt_file_unlink(tmpfname);
return NULL;
}
- if (type & ENCRYPT)
+ if (type & SEC_ENCRYPT)
{
if (!smime_class_valid_passphrase())
smime_class_void_passphrase();
state_attach_puts(_("[-- End of OpenSSL output --]\n\n"), s);
}
- if (type & ENCRYPT)
+ if (type & SEC_ENCRYPT)
{
state_attach_puts(_("[-- The following data is S/MIME"
" encrypted --]\n"),
fflush(smimeout);
rewind(smimeout);
- if (type & ENCRYPT)
+ if (type & SEC_ENCRYPT)
{
/* void the passphrase, even if that wasn't the problem */
if (fgetc(smimeout) == EOF)
if (s->flags & MUTT_DISPLAY)
{
- if (type & ENCRYPT)
+ if (type & SEC_ENCRYPT)
state_attach_puts(_("\n[-- End of S/MIME encrypted data. --]\n"), s);
else
state_attach_puts(_("\n[-- End of S/MIME signed data. --]\n"), s);
}
- if (type & SIGNOPAQUE)
+ if (type & SEC_SIGNOPAQUE)
{
char *line = NULL;
int lineno = 0;
* NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
* letter choices for those.
*/
- if (CryptOpportunisticEncrypt && (msg->security & OPPENCRYPT))
+ if (CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT))
{
/* L10N: S/MIME options (opportunistic encryption is on) */
prompt = _("S/MIME (s)ign, encrypt (w)ith, sign (a)s, (c)lear, or (o)ppenc "
mutt_str_replace(&SmimeSignAs, key->hash);
smime_free_key(&key);
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
/* probably need a different passphrase */
crypt_smime_void_passphrase();
break;
case 'b': /* (b)oth */
- msg->security |= (ENCRYPT | SIGN);
+ msg->security |= (SEC_ENCRYPT | SEC_SIGN);
break;
case 'c': /* (c)lear */
- msg->security &= ~(ENCRYPT | SIGN);
+ msg->security &= ~(SEC_ENCRYPT | SEC_SIGN);
break;
case 'C':
- msg->security &= ~SIGN;
+ msg->security &= ~SEC_SIGN;
break;
case 'e': /* (e)ncrypt */
- msg->security |= ENCRYPT;
- msg->security &= ~SIGN;
+ msg->security |= SEC_ENCRYPT;
+ msg->security &= ~SEC_SIGN;
break;
case 'O': /* oppenc mode on */
- msg->security |= OPPENCRYPT;
+ msg->security |= SEC_OPPENCRYPT;
crypt_opportunistic_encrypt(msg);
break;
case 'o': /* oppenc mode off */
- msg->security &= ~OPPENCRYPT;
+ msg->security &= ~SEC_OPPENCRYPT;
break;
case 'S': /* (s)ign in oppenc mode */
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
break;
case 's': /* (s)ign */
- msg->security &= ~ENCRYPT;
- msg->security |= SIGN;
+ msg->security &= ~SEC_ENCRYPT;
+ msg->security |= SEC_SIGN;
break;
case 'w': /* encrypt (w)ith */
{
- msg->security |= ENCRYPT;
+ msg->security |= SEC_ENCRYPT;
do
{
switch (mutt_multi_choice(_("Choose algorithm family: 1: DES, 2: "
{
mutt_parse_mime_message(m, e);
- if ((WithCrypto != 0) && (e->security & ENCRYPT) && !crypt_valid_passphrase(e->security))
+ if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT) &&
+ !crypt_valid_passphrase(e->security))
{
mx_msg_close(m, &msg);
if (s.fpout)
case MUTT_CRYPT_SIGN:
if (!WithCrypto)
break;
- return pat->not^((e->security & SIGN) ? 1 : 0);
+ return pat->not^((e->security & SEC_SIGN) ? 1 : 0);
case MUTT_CRYPT_VERIFIED:
if (!WithCrypto)
break;
- return pat->not^((e->security & GOODSIGN) ? 1 : 0);
+ return pat->not^((e->security & SEC_GOODSIGN) ? 1 : 0);
case MUTT_CRYPT_ENCRYPT:
if (!WithCrypto)
break;
- return pat->not^((e->security & ENCRYPT) ? 1 : 0);
+ return pat->not^((e->security & SEC_ENCRYPT) ? 1 : 0);
case MUTT_PGP_KEY:
if (!(WithCrypto & APPLICATION_PGP))
break;
* @param p Header string to parse
* @param set_empty_signas Allow an empty "Sign as"
* @param crypt_app App, e.g. #APPLICATION_PGP
- * @retval num Flags, e.g. #ENCRYPT
+ * @retval num Flags, e.g. #SEC_ENCRYPT
*/
int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app)
{
case 'e':
case 'E':
- flags |= ENCRYPT;
+ flags |= SEC_ENCRYPT;
break;
case 'i':
case 'I':
- flags |= INLINE;
+ flags |= SEC_INLINE;
break;
/* This used to be the micalg parameter.
case 'o':
case 'O':
- flags |= OPPENCRYPT;
+ flags |= SEC_OPPENCRYPT;
break;
case 's':
case 'S':
- flags |= SIGN;
+ flags |= SEC_SIGN;
q = sign_as;
if (*(p + 1) == '<')
/* Set {Smime,Pgp}SignAs, if desired. */
if (((WithCrypto & APPLICATION_PGP) != 0) && (crypt_app == APPLICATION_PGP) &&
- (flags & SIGN) && (set_empty_signas || *sign_as))
+ (flags & SEC_SIGN) && (set_empty_signas || *sign_as))
{
mutt_str_replace(&PgpSignAs, sign_as);
}
if (((WithCrypto & APPLICATION_SMIME) != 0) && (crypt_app == APPLICATION_SMIME) &&
- (flags & SIGN) && (set_empty_signas || *sign_as))
+ (flags & SEC_SIGN) && (set_empty_signas || *sign_as))
{
mutt_str_replace(&SmimeSignAs, sign_as);
}
*/
if ((WithCrypto != 0) && mutt_is_multipart_signed(newhdr->content))
{
- newhdr->security |= SIGN;
+ newhdr->security |= SEC_SIGN;
if (((WithCrypto & APPLICATION_PGP) != 0) &&
(mutt_str_strcasecmp(
mutt_param_get(&newhdr->content->parameter, "protocol"),
goto bail;
if (((WithCrypto & APPLICATION_PGP) != 0) &&
- ((sec_type = mutt_is_application_pgp(b)) & (ENCRYPT | SIGN)))
+ ((sec_type = mutt_is_application_pgp(b)) & (SEC_ENCRYPT | SEC_SIGN)))
{
- if (sec_type & ENCRYPT)
+ if (sec_type & SEC_ENCRYPT)
{
if (!crypt_valid_passphrase(APPLICATION_PGP))
goto bail;
mutt_param_delete(&b->parameter, "x-action");
}
else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
- ((sec_type = mutt_is_application_smime(b)) & (ENCRYPT | SIGN)))
+ ((sec_type = mutt_is_application_smime(b)) & (SEC_ENCRYPT | SEC_SIGN)))
{
- if (sec_type & ENCRYPT)
+ if (sec_type & SEC_ENCRYPT)
{
if (!crypt_valid_passphrase(APPLICATION_SMIME))
goto bail;
/* Fix encryption flags. */
/* No inline if multipart. */
- if ((WithCrypto != 0) && (newhdr->security & INLINE) && newhdr->content->next)
- newhdr->security &= ~INLINE;
+ if ((WithCrypto != 0) && (newhdr->security & SEC_INLINE) && newhdr->content->next)
+ newhdr->security &= ~SEC_INLINE;
/* Do we even support multiple mechanisms? */
newhdr->security &= WithCrypto | ~(APPLICATION_PGP | APPLICATION_SMIME);
{
need_secured = 1;
- if (type & ENCRYPT)
+ if (type & SEC_ENCRYPT)
{
if (!crypt_valid_passphrase(APPLICATION_SMIME))
goto decrypt_failed;
goto decrypt_failed;
}
- if (secured && (type & ENCRYPT))
+ if (secured && (type & SEC_ENCRYPT))
e->security |= SMIME_ENCRYPT;
}
}
#endif
- if ((WithCrypto != 0) && (e->security & ENCRYPT))
+ if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
{
mutt_message(_("Deletion of attachments from encrypted messages is "
"unsupported"));
break;
}
- if ((WithCrypto != 0) && (e->security & (SIGN | PARTSIGN)))
+ if ((WithCrypto != 0) && (e->security & (SEC_SIGN | SEC_PARTSIGN)))
{
mutt_message(_("Deletion of attachments from signed messages may "
"invalidate the signature"));
mutt_parse_mime_message(m, e);
mutt_message_hook(m, e, MUTT_MESSAGE_HOOK);
- if ((WithCrypto != 0) && (e->security & ENCRYPT) && ForwardDecode)
+ if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT) && ForwardDecode)
{
/* make sure we have the user's passphrase before proceeding... */
if (!crypt_valid_passphrase(e->security))
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV | MUTT_CM_REPLYING;
int chflags = CH_DECODE;
- if ((WithCrypto != 0) && (e->security & ENCRYPT))
+ if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
{
/* make sure we have the user's passphrase before proceeding... */
if (!crypt_valid_passphrase(e->security))
if (CryptOpportunisticEncrypt)
{
- msg->security |= OPPENCRYPT;
+ msg->security |= SEC_OPPENCRYPT;
crypt_opportunistic_encrypt(msg);
}
}
struct Body *save_sig = NULL;
struct Body *save_parts = NULL;
- if ((WithCrypto != 0) && (msg->security & (ENCRYPT | SIGN)) && FccClear)
+ if ((WithCrypto != 0) && (msg->security & (SEC_ENCRYPT | SEC_SIGN)) && FccClear)
{
msg->content = clear_content;
- msg->security &= ~(ENCRYPT | SIGN);
+ msg->security &= ~(SEC_ENCRYPT | SEC_SIGN);
mutt_env_free(&msg->content->mime_headers);
}
/* check to see if the user wants copies of all attachments */
if (msg->content->type == TYPE_MULTIPART)
{
- if ((WithCrypto != 0) && (msg->security & (ENCRYPT | SIGN)) &&
+ if ((WithCrypto != 0) && (msg->security & (SEC_ENCRYPT | SEC_SIGN)) &&
((mutt_str_strcmp(msg->content->subtype, "encrypted") == 0) ||
(mutt_str_strcmp(msg->content->subtype, "signed") == 0)))
{
if ((clear_content->type == TYPE_MULTIPART) &&
query_quadoption(FccAttach, _("Save attachments in Fcc?")) == MUTT_NO)
{
- if (!(msg->security & ENCRYPT) && (msg->security & SIGN))
+ if (!(msg->security & SEC_ENCRYPT) && (msg->security & SEC_SIGN))
{
/* save initial signature and attachments */
save_sig = msg->content->parts->next;
mutt_encode_descriptions(msg->content, true);
- if ((WithCrypto != 0) && PostponeEncrypt && (msg->security & ENCRYPT))
+ if ((WithCrypto != 0) && PostponeEncrypt && (msg->security & SEC_ENCRYPT))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
encrypt_as = PgpDefaultKey;
if (encrypt_as && *encrypt_as)
{
- is_signed = msg->security & SIGN;
+ is_signed = msg->security & SEC_SIGN;
if (is_signed)
- msg->security &= ~SIGN;
+ msg->security &= ~SEC_SIGN;
pgpkeylist = mutt_str_strdup(encrypt_as);
clear_content = msg->content;
if (mutt_protect(msg, pgpkeylist) == -1)
{
if (is_signed)
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
FREE(&pgpkeylist);
msg->content = mutt_remove_multipart(msg->content);
decode_descriptions(msg->content);
}
if (is_signed)
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
FREE(&pgpkeylist);
mutt_encode_descriptions(msg->content, false);
!(flags & (SEND_BATCH | SEND_MAILX | SEND_POSTPONED | SEND_RESEND)))
{
if (CryptAutosign)
- msg->security |= SIGN;
+ msg->security |= SEC_SIGN;
if (CryptAutoencrypt)
- msg->security |= ENCRYPT;
- if (CryptReplyencrypt && cur && (cur->security & ENCRYPT))
- msg->security |= ENCRYPT;
- if (CryptReplysign && cur && (cur->security & SIGN))
- msg->security |= SIGN;
- if (CryptReplysignencrypted && cur && (cur->security & ENCRYPT))
- msg->security |= SIGN;
+ msg->security |= SEC_ENCRYPT;
+ if (CryptReplyencrypt && cur && (cur->security & SEC_ENCRYPT))
+ msg->security |= SEC_ENCRYPT;
+ if (CryptReplysign && cur && (cur->security & SEC_SIGN))
+ msg->security |= SEC_SIGN;
+ if (CryptReplysignencrypted && cur && (cur->security & SEC_ENCRYPT))
+ msg->security |= SEC_SIGN;
if (((WithCrypto & APPLICATION_PGP) != 0) &&
- ((msg->security & (ENCRYPT | SIGN)) || CryptOpportunisticEncrypt))
+ ((msg->security & (SEC_ENCRYPT | SEC_SIGN)) || CryptOpportunisticEncrypt))
{
if (PgpAutoinline)
- msg->security |= INLINE;
- if (PgpReplyinline && cur && (cur->security & INLINE))
- msg->security |= INLINE;
+ msg->security |= SEC_INLINE;
+ if (PgpReplyinline && cur && (cur->security & SEC_INLINE))
+ msg->security |= SEC_INLINE;
}
if (msg->security || CryptOpportunisticEncrypt)
* or CryptReplyencrypt, then don't enable opportunistic encrypt for
* the message.
*/
- if (!(msg->security & ENCRYPT))
+ if (!(msg->security & SEC_ENCRYPT))
{
- msg->security |= OPPENCRYPT;
+ msg->security |= SEC_OPPENCRYPT;
crypt_opportunistic_encrypt(msg);
}
}
if (WithCrypto)
{
- if (msg->security & (ENCRYPT | SIGN))
+ if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
/* save the decrypted attachments */
clear_content = msg->content;
{
if (!WithCrypto)
;
- else if ((msg->security & ENCRYPT) ||
- ((msg->security & SIGN) && msg->content->type == TYPE_APPLICATION))
+ else if ((msg->security & SEC_ENCRYPT) ||
+ ((msg->security & SEC_SIGN) && msg->content->type == TYPE_APPLICATION))
{
mutt_body_free(&msg->content); /* destroy PGP data */
msg->content = clear_content; /* restore clear text. */
}
- else if ((msg->security & SIGN) && msg->content->type == TYPE_MULTIPART)
+ else if ((msg->security & SEC_SIGN) && msg->content->type == TYPE_MULTIPART)
{
mutt_body_free(&msg->content->parts->next); /* destroy sig */
msg->content = mutt_remove_multipart(msg->content);
if (WithCrypto)
{
- if ((MimeForwardDecode || ForwardDecrypt) && (e->security & ENCRYPT))
+ if ((MimeForwardDecode || ForwardDecrypt) && (e->security & SEC_ENCRYPT))
{
if (!crypt_valid_passphrase(e->security))
return NULL;
if (WithCrypto & APPLICATION_SMIME)
pgp &= ~SMIME_ENCRYPT;
}
- else if ((WithCrypto != 0) && ForwardDecrypt && (e->security & ENCRYPT))
+ else if ((WithCrypto != 0) && ForwardDecrypt && (e->security & SEC_ENCRYPT))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_multipart_encrypted(e->content))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && post && (e->security & APPLICATION_PGP))
{
fputs("X-Mutt-PGP: ", msg->fp);
- if (e->security & ENCRYPT)
+ if (e->security & SEC_ENCRYPT)
fputc('E', msg->fp);
- if (e->security & OPPENCRYPT)
+ if (e->security & SEC_OPPENCRYPT)
fputc('O', msg->fp);
- if (e->security & SIGN)
+ if (e->security & SEC_SIGN)
{
fputc('S', msg->fp);
if (PgpSignAs && *PgpSignAs)
fprintf(msg->fp, "<%s>", PgpSignAs);
}
- if (e->security & INLINE)
+ if (e->security & SEC_INLINE)
fputc('I', msg->fp);
fputc('\n', msg->fp);
}
if (((WithCrypto & APPLICATION_SMIME) != 0) && post && (e->security & APPLICATION_SMIME))
{
fputs("X-Mutt-SMIME: ", msg->fp);
- if (e->security & ENCRYPT)
+ if (e->security & SEC_ENCRYPT)
{
fputc('E', msg->fp);
if (SmimeEncryptWith && *SmimeEncryptWith)
fprintf(msg->fp, "C<%s>", SmimeEncryptWith);
}
- if (e->security & OPPENCRYPT)
+ if (e->security & SEC_OPPENCRYPT)
fputc('O', msg->fp);
- if (e->security & SIGN)
+ if (e->security & SEC_SIGN)
{
fputc('S', msg->fp);
if (SmimeSignAs && *SmimeSignAs)
fprintf(msg->fp, "<%s>", SmimeSignAs);
}
- if (e->security & INLINE)
+ if (e->security & SEC_INLINE)
fputc('I', msg->fp);
fputc('\n', msg->fp);
}