bool unlink_tempfile = false;
bool is_message = mutt_is_message_type(a->type, a->subtype);
- if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
- !crypt_valid_passphrase(a->hdr->security))
+ if ((WithCrypto != 0) && is_message && a->hdr &&
+ (a->hdr->security & ENCRYPT) && !crypt_valid_passphrase(a->hdr->security))
{
return rc;
}
mutt_message_hook(Context, cur, MUTT_MESSAGEHOOK);
/* see if crypto is needed for this message. if so, we should exit curses */
- if (WithCrypto && cur->security)
+ if ((WithCrypto != 0) && cur->security)
{
if (cur->security & ENCRYPT)
{
{
struct Pager info;
- if (WithCrypto && (cur->security & APPLICATION_SMIME) && (cmflags & MUTT_CM_VERIFY))
+ if ((WithCrypto != 0) && (cur->security & APPLICATION_SMIME) && (cmflags & MUTT_CM_VERIFY))
{
if (cur->security & GOODSIGN)
{
mutt_error(_("S/MIME signature could NOT be verified."));
}
- if (WithCrypto && (cur->security & APPLICATION_PGP) && (cmflags & MUTT_CM_VERIFY))
+ if ((WithCrypto != 0) && (cur->security & APPLICATION_PGP) && (cmflags & MUTT_CM_VERIFY))
{
if (cur->security & GOODSIGN)
mutt_message(_("PGP signature successfully verified."));
pipe_set_flags(decode, print, &cmflags, &chflags);
- if (WithCrypto && decode && h->security & ENCRYPT)
+ if ((WithCrypto != 0) && decode && h->security & ENCRYPT)
{
if (!crypt_valid_passphrase(h->security))
return;
{
mutt_message_hook(Context, h, MUTT_MESSAGEHOOK);
- if (WithCrypto && decode)
+ if ((WithCrypto != 0) && decode)
{
mutt_parse_mime_message(Context, h);
if (h->security & ENCRYPT && !crypt_valid_passphrase(h->security))
else
{
/* handle tagged messages */
- if (WithCrypto && decode)
+ if ((WithCrypto != 0) && decode)
{
for (int i = 0; i < Context->msgcount; i++)
{
*cmflags = 0;
*chflags = CH_UPDATE_LEN;
- if (WithCrypto && !decode && decrypt && (hdr->security & ENCRYPT))
+ if ((WithCrypto != 0) && !decode && decrypt && (hdr->security & ENCRYPT))
{
- if ((WithCrypto & APPLICATION_PGP) && mutt_is_multipart_encrypted(hdr->content))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_multipart_encrypted(hdr->content))
{
*chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
*cmflags = MUTT_CM_DECODE_PGP;
}
- else if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(hdr->content) & ENCRYPT)
+ else if (((WithCrypto & APPLICATION_PGP) != 0) &&
+ mutt_is_application_pgp(hdr->content) & ENCRYPT)
decode = 1;
- else if ((WithCrypto & APPLICATION_SMIME) &&
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
mutt_is_application_smime(hdr->content) & ENCRYPT)
{
*chflags = CH_NONEWLINE | CH_XMIT | CH_MIME;
if (mutt_save_confirm(buf, &st) != 0)
return -1;
- if (WithCrypto && need_passphrase && (decode || decrypt) && !crypt_valid_passphrase(app))
+ if ((WithCrypto != 0) && need_passphrase && (decode || decrypt) &&
+ !crypt_valid_passphrase(app))
return -1;
mutt_message(_("Copying to %s..."), buf);
mutt_parse_part(fp, b);
}
- if (WithCrypto && h)
+ if ((WithCrypto != 0) && h)
{
if (h->content == b)
h->security = 0;
if ((msg->security & (ENCRYPT | SIGN)))
{
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
if ((msg->security & INLINE))
addstr(_(" (inline PGP)"));
else
addstr(_(" (PGP/MIME)"));
}
- else if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
addstr(_(" (S/MIME)"));
}
mutt_window_move(MuttIndexWindow, HDR_CRYPTINFO, 0);
mutt_window_clrtoeol(MuttIndexWindow);
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP) &&
- (msg->security & SIGN))
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
+ (msg->security & APPLICATION_PGP) && (msg->security & SIGN))
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO]));
printw("%s", PgpSignAs ? PgpSignAs : _("<default>"));
}
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME) &&
- (msg->security & SIGN))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) &&
+ (msg->security & APPLICATION_SMIME) && (msg->security & SIGN))
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO]));
printw("%s", SmimeSignAs ? SmimeSignAs : _("<default>"));
}
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME) &&
(msg->security & ENCRYPT) && SmimeEncryptWith && *SmimeEncryptWith)
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
mutt_error(_("No PGP backend configured"));
break;
}
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
if (msg->security & (ENCRYPT | SIGN))
{
break;
}
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
if (msg->security & (ENCRYPT | SIGN))
{
if (flags & MUTT_CM_REPLYING)
s.flags |= MUTT_REPLYING;
- if (WithCrypto && flags & MUTT_CM_VERIFY)
+ if ((WithCrypto != 0) && flags & MUTT_CM_VERIFY)
s.flags |= MUTT_VERIFY;
rc = mutt_body_handler(body, &s);
}
- else if (WithCrypto && (flags & MUTT_CM_DECODE_CRYPT) && (hdr->security & ENCRYPT))
+ else if ((WithCrypto != 0) && (flags & MUTT_CM_DECODE_CRYPT) && (hdr->security & ENCRYPT))
{
struct Body *cur = NULL;
FILE *fp = NULL;
- if ((WithCrypto & APPLICATION_PGP) && (flags & MUTT_CM_DECODE_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (flags & MUTT_CM_DECODE_PGP) &&
(hdr->security & APPLICATION_PGP) && hdr->content->type == TYPEMULTIPART)
{
if (crypt_pgp_decrypt_mime(fpin, &fp, hdr->content, &cur))
fputs("MIME-Version: 1.0\n", fpout);
}
- if ((WithCrypto & APPLICATION_SMIME) && (flags & MUTT_CM_DECODE_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (flags & MUTT_CM_DECODE_SMIME) &&
(hdr->security & APPLICATION_SMIME) && hdr->content->type == TYPEAPPLICATION)
{
if (crypt_smime_decrypt_mime(fpin, &fp, hdr->content, &cur))
return 1;
}
}
- else if (WithCrypto && a->type == TYPEAPPLICATION)
+ else if ((WithCrypto != 0) && a->type == TYPEAPPLICATION)
{
- if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(a))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(a))
return 1;
- if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(a))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(a))
return 1;
}
switch (b->encoding)
{
case ENCQUOTEDPRINTABLE:
- decode_quoted(
- s, b->length,
- istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)), cd);
+ decode_quoted(s, b->length,
+ istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
+ mutt_is_application_pgp(b)),
+ cd);
break;
case ENCBASE64:
- mutt_decode_base64(
- s, b->length,
- istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)), cd);
+ mutt_decode_base64(s, b->length,
+ istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
+ mutt_is_application_pgp(b)),
+ cd);
break;
case ENCUUENCODED:
- decode_uuencoded(
- s, b->length,
- istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)), cd);
+ decode_uuencoded(s, b->length,
+ istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
+ mutt_is_application_pgp(b)),
+ cd);
break;
default:
decode_xbit(s, b->length,
- istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)),
+ istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
+ mutt_is_application_pgp(b)),
cd);
break;
}
/* avoid copying this part twice since removing the transfer-encoding is
* the only operation needed.
*/
- if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
handler = crypt_pgp_application_pgp_handler;
else if (ReflowText &&
(mutt_str_strcasecmp("flowed",
{
handler = alternative_handler;
}
- else if (WithCrypto && (mutt_str_strcasecmp("signed", b->subtype) == 0))
+ else if ((WithCrypto != 0) && (mutt_str_strcasecmp("signed", b->subtype) == 0))
{
p = mutt_param_get(&b->parameter, "protocol");
b->encoding = ENC7BIT;
}
}
- else if (WithCrypto && b->type == TYPEAPPLICATION)
+ else if ((WithCrypto != 0) && b->type == TYPEAPPLICATION)
{
if (OPT_DONT_HANDLE_PGP_KEYS && (mutt_str_strcasecmp("pgp-keys", b->subtype) == 0))
{
/* pass raw part through for key extraction */
plaintext = true;
}
- else if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b))
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
handler = crypt_pgp_application_pgp_handler;
- else if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(b))
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(b))
handler = crypt_smime_application_smime_handler;
}
else if (src[0] == 'c') /* crypto */
{
char *ch = NULL;
- if (WithCrypto && (hdr->security & GOODSIGN))
+ if ((WithCrypto != 0) && (hdr->security & GOODSIGN))
ch = "S";
- else if (WithCrypto && (hdr->security & ENCRYPT))
+ else if ((WithCrypto != 0) && (hdr->security & ENCRYPT))
ch = "P";
- else if (WithCrypto && (hdr->security & SIGN))
+ else if ((WithCrypto != 0) && (hdr->security & SIGN))
ch = "s";
- else if ((WithCrypto & APPLICATION_PGP) && (hdr->security & PGPKEY))
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && (hdr->security & PGPKEY))
ch = "K";
else
ch = " ";
second = get_nth_wchar(FlagChars, FlagCharDeleted);
else if (hdr->attach_del)
second = get_nth_wchar(FlagChars, FlagCharDeletedAttach);
- else if (WithCrypto && (hdr->security & GOODSIGN))
+ else if ((WithCrypto != 0) && (hdr->security & GOODSIGN))
second = "S";
- else if (WithCrypto && (hdr->security & ENCRYPT))
+ else if ((WithCrypto != 0) && (hdr->security & ENCRYPT))
second = "P";
- else if (WithCrypto && (hdr->security & SIGN))
+ else if ((WithCrypto != 0) && (hdr->security & SIGN))
second = "s";
- else if ((WithCrypto & APPLICATION_PGP) && (hdr->security & PGPKEY))
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && (hdr->security & PGPKEY))
second = "K";
else
second = " ";
}
keep = false;
}
- else if ((WithCrypto & APPLICATION_PGP) &&
+ else if (((WithCrypto & APPLICATION_PGP) != 0) &&
(mutt_str_strncasecmp("pgp:", np->data, 4) == 0))
{
msg->security = mutt_parse_crypt_hdr(np->data + 4, 0, APPLICATION_PGP);
map = SortBrowserMethods;
break;
case DT_SORT_KEYS:
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
map = SortKeyMethods;
break;
case DT_SORT_AUX:
map = SortBrowserMethods;
break;
case DT_SORT_KEYS:
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
map = SortKeyMethods;
break;
case DT_SORT_AUX:
map = SortBrowserMethods;
break;
case DT_SORT_KEYS:
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
map = SortKeyMethods;
else
map = SortMethods;
create_bindings(OpQuery, MENU_QUERY);
create_bindings(OpAlias, MENU_ALIAS);
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
create_bindings(OpPgp, MENU_PGP);
- if ((WithCrypto & APPLICATION_SMIME))
+ if (WithCrypto & APPLICATION_SMIME)
create_bindings(OpSmime, MENU_SMIME);
#ifdef CRYPT_BACKEND_GPGME
return false;
break;
case TYPEAPPLICATION:
- if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(m))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(m))
return false;
- if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(m))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(m))
return false;
break;
int t = b->type;
char *s = b->subtype;
- if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
return false;
if (t == TYPETEXT)
return true;
}
- if ((WithCrypto & APPLICATION_PGP) && t == TYPEAPPLICATION)
+ if (((WithCrypto & APPLICATION_PGP) != 0) && t == TYPEAPPLICATION)
{
if (mutt_str_strcasecmp("pgp-keys", s) == 0)
return true;
*/
void crypt_forget_passphrase(void)
{
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
crypt_pgp_void_passphrase();
- if ((WithCrypto & APPLICATION_SMIME))
+ if (WithCrypto & APPLICATION_SMIME)
crypt_smime_void_passphrase();
if (WithCrypto)
disable_coredumps();
#endif
- if ((WithCrypto & APPLICATION_PGP) && (flags & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (flags & APPLICATION_PGP))
rc = crypt_pgp_valid_passphrase();
- if ((WithCrypto & APPLICATION_SMIME) && (flags & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (flags & APPLICATION_SMIME))
rc = crypt_smime_valid_passphrase();
return rc;
if ((msg->security & SIGN) && !crypt_valid_passphrase(msg->security))
return -1;
- if ((WithCrypto & APPLICATION_PGP) && ((msg->security & PGPINLINE) == PGPINLINE))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && ((msg->security & PGPINLINE) == PGPINLINE))
{
if ((msg->content->type != TYPETEXT) ||
(mutt_str_strcasecmp(msg->content->subtype, "plain") != 0))
if (!isendwin())
mutt_endwin();
- if ((WithCrypto & APPLICATION_SMIME))
+ if (WithCrypto & APPLICATION_SMIME)
tmp_smime_pbody = msg->content;
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
tmp_pgp_pbody = msg->content;
if (CryptUsePka && (msg->security & SIGN))
if (!mailbox && EnvelopeFromAddress)
mailbox = EnvelopeFromAddress->mailbox;
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
crypt_smime_set_sender(mailbox);
- else if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
crypt_pgp_set_sender(mailbox);
if (!msg->env->from)
if (msg->security & SIGN)
{
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
tmp_pbody = crypt_smime_sign_message(msg->content);
if (!tmp_pbody)
pbody = tmp_smime_pbody = tmp_pbody;
}
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP) &&
(!(flags & ENCRYPT) || PgpRetainableSigs))
{
tmp_pbody = crypt_pgp_sign_message(msg->content);
pbody = tmp_pgp_pbody = tmp_pbody;
}
- if (WithCrypto && (msg->security & APPLICATION_SMIME) && (msg->security & APPLICATION_PGP))
+ if ((WithCrypto != 0) && (msg->security & APPLICATION_SMIME) &&
+ (msg->security & APPLICATION_PGP))
{
/* here comes the draft ;-) */
}
if (msg->security & ENCRYPT)
{
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
tmp_pbody = crypt_smime_build_smime_entity(tmp_smime_pbody, keylist);
if (!tmp_pbody)
pbody = tmp_pbody;
}
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
pbody = crypt_pgp_encrypt_message(tmp_pgp_pbody, keylist, flags & SIGN);
if (!pbody)
if (!(mutt_str_strcasecmp(p, "multipart/mixed") != 0))
return SIGN;
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
!(mutt_str_strcasecmp(p, "application/pgp-signature") != 0))
{
return PGPSIGN;
}
- if ((WithCrypto & APPLICATION_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) &&
!(mutt_str_strcasecmp(p, "application/x-pkcs7-signature") != 0))
{
return SMIMESIGN;
}
- if ((WithCrypto & APPLICATION_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) &&
!(mutt_str_strcasecmp(p, "application/pkcs7-signature") != 0))
{
return SMIMESIGN;
int mutt_is_multipart_encrypted(struct Body *b)
{
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
{
char *p = NULL;
if (m->type == TYPEAPPLICATION)
{
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
t |= mutt_is_application_pgp(m);
- if ((WithCrypto & APPLICATION_SMIME))
+ if (WithCrypto & APPLICATION_SMIME)
{
t |= mutt_is_application_smime(m);
if (t && m->goodsig)
t |= BADSIGN;
}
}
- else if ((WithCrypto & APPLICATION_PGP) && m->type == TYPETEXT)
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && m->type == TYPETEXT)
{
t |= mutt_is_application_pgp(m);
if (t && m->goodsig)
a->encoding = ENC7BIT;
convert_to_7bit(a->parts);
}
- else if ((WithCrypto & APPLICATION_PGP) && PgpStrictEnc)
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && PgpStrictEnc)
convert_to_7bit(a->parts);
}
else if (a->type == TYPEMESSAGE &&
return;
}
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
OPT_DONT_HANDLE_PGP_KEYS = true;
if (!h)
break;
}
- if ((WithCrypto & APPLICATION_PGP) && (hi->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (hi->security & APPLICATION_PGP))
{
mutt_copy_message_ctx(fpout, Context, hi, MUTT_CM_DECODE | MUTT_CM_CHARCONV, 0);
fflush(fpout);
crypt_pgp_invoke_import(tempfname);
}
- if ((WithCrypto & APPLICATION_SMIME) && (hi->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (hi->security & APPLICATION_SMIME))
{
if (hi->security & ENCRYPT)
mutt_copy_message_ctx(fpout, Context, hi,
mutt_parse_mime_message(Context, h);
if (!(h->security & ENCRYPT && !crypt_valid_passphrase(h->security)))
{
- if ((WithCrypto & APPLICATION_PGP) && (h->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (h->security & APPLICATION_PGP))
{
mutt_copy_message_ctx(fpout, Context, h, MUTT_CM_DECODE | MUTT_CM_CHARCONV, 0);
fflush(fpout);
crypt_pgp_invoke_import(tempfname);
}
- if ((WithCrypto & APPLICATION_SMIME) && (h->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (h->security & APPLICATION_SMIME))
{
if (h->security & ENCRYPT)
mutt_copy_message_ctx(fpout, Context, h,
mutt_file_unlink(tempfname);
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
OPT_DONT_HANDLE_PGP_KEYS = false;
}
if (!WithCrypto)
return 0;
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
OPT_PGP_CHECK_TRUST = true;
last = mutt_addr_append(&addrlist, msg->env->to, false);
if (oppenc_mode || (msg->security & ENCRYPT))
{
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
{
*keylist = crypt_pgp_findkeys(addrlist, oppenc_mode);
if (!*keylist)
if (PgpSelfEncrypt || (PgpEncryptSelf == MUTT_YES))
self_encrypt = PgpDefaultKey;
}
- if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
{
*keylist = crypt_smime_findkeys(addrlist, oppenc_mode);
if (!*keylist)
{
for (int i = 0; i < sigcnt; i++)
{
- if ((WithCrypto & APPLICATION_PGP) && signatures[i]->type == TYPEAPPLICATION &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && signatures[i]->type == TYPEAPPLICATION &&
(mutt_str_strcasecmp(signatures[i]->subtype, "pgp-signature") == 0))
{
if (crypt_pgp_verify_one(signatures[i], s, tempfile) != 0)
continue;
}
- if ((WithCrypto & APPLICATION_SMIME) && signatures[i]->type == TYPEAPPLICATION &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && signatures[i]->type == TYPEAPPLICATION &&
((mutt_str_strcasecmp(signatures[i]->subtype,
"x-pkcs7-signature") == 0) ||
(mutt_str_strcasecmp(signatures[i]->subtype,
*/
void crypt_invoke_message(int type)
{
- if ((WithCrypto & APPLICATION_PGP) && (type & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP))
mutt_message(_("Invoking PGP..."));
- else if ((WithCrypto & APPLICATION_SMIME) && (type & APPLICATION_SMIME))
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME))
mutt_message(_("Invoking S/MIME..."));
}
/* Returns 1 if a module backend is registered for the type */
int crypt_has_module_backend(int type)
{
- if ((WithCrypto & APPLICATION_PGP) && (type & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (type & APPLICATION_PGP) &&
crypto_module_lookup(APPLICATION_PGP))
{
return 1;
}
- if ((WithCrypto & APPLICATION_SMIME) && (type & APPLICATION_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (type & APPLICATION_SMIME) &&
crypto_module_lookup(APPLICATION_SMIME))
{
return 1;
case OP_DECODE_SAVE:
case OP_DECODE_COPY:
case OP_DECRYPT_COPY:
- if (!WithCrypto && ch == OP_DECRYPT_COPY)
+ if (!(WithCrypto != 0) && ch == OP_DECRYPT_COPY)
{
ch = -1;
break;
{
mutt_parse_mime_message(ctx, h);
- if (WithCrypto && (h->security & ENCRYPT) && !crypt_valid_passphrase(h->security))
+ if ((WithCrypto != 0) && (h->security & ENCRYPT) && !crypt_valid_passphrase(h->security))
{
mx_close_message(ctx, &msg);
if (s.fpout)
*/
code |= SENDPOSTPONEDFCC;
}
- else if ((WithCrypto & APPLICATION_PGP) &&
+ else if (((WithCrypto & APPLICATION_PGP) != 0) &&
((mutt_str_strncmp("Pgp:", np->data, 4) == 0) /* this is generated
* by old neomutt versions
*/
hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, 1, APPLICATION_PGP);
hdr->security |= APPLICATION_PGP;
}
- else if ((WithCrypto & APPLICATION_SMIME) &&
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
(mutt_str_strncmp("X-Mutt-SMIME:", np->data, 13) == 0))
{
hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, 1, APPLICATION_SMIME);
}
/* the cryptalg field must not be empty */
- if ((WithCrypto & APPLICATION_SMIME) && *smime_cryptalg)
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && *smime_cryptalg)
mutt_str_replace(&SmimeEncryptWith, smime_cryptalg);
/* Set {Smime,Pgp}SignAs, if desired. */
- if ((WithCrypto & APPLICATION_PGP) && (crypt_app == APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (crypt_app == APPLICATION_PGP) &&
(flags & SIGN) && (set_empty_signas || *sign_as))
{
mutt_str_replace(&PgpSignAs, sign_as);
}
- if ((WithCrypto & APPLICATION_SMIME) && (crypt_app == APPLICATION_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (crypt_app == APPLICATION_SMIME) &&
(flags & SIGN) && (set_empty_signas || *sign_as))
{
mutt_str_replace(&SmimeSignAs, sign_as);
/* decrypt pgp/mime encoded messages */
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
(sec_type = mutt_is_multipart_encrypted(newhdr->content)))
{
newhdr->security |= sec_type;
* resending messages
*/
- if (WithCrypto && mutt_is_multipart_signed(newhdr->content))
+ if ((WithCrypto != 0) && mutt_is_multipart_signed(newhdr->content))
{
newhdr->security |= SIGN;
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
(mutt_str_strcasecmp(
mutt_param_get(&newhdr->content->parameter, "protocol"),
"application/pgp-signature") == 0))
newhdr->security |= APPLICATION_PGP;
- else if ((WithCrypto & APPLICATION_SMIME))
+ else if (WithCrypto & APPLICATION_SMIME)
newhdr->security |= APPLICATION_SMIME;
/* destroy the signature */
if (!s.fpout)
goto bail;
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
((sec_type = mutt_is_application_pgp(b)) & (ENCRYPT | SIGN)))
{
if (sec_type & ENCRYPT)
mutt_str_replace(&b->subtype, "plain");
mutt_param_delete(&b->parameter, "x-action");
}
- else if ((WithCrypto & APPLICATION_SMIME) &&
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
((sec_type = mutt_is_application_smime(b)) & (ENCRYPT | SIGN)))
{
if (sec_type & ENCRYPT)
/* Fix encryption flags. */
/* No inline if multipart. */
- if (WithCrypto && (newhdr->security & INLINE) && newhdr->content->next)
+ if ((WithCrypto != 0) && (newhdr->security & INLINE) && newhdr->content->next)
newhdr->security &= ~INLINE;
/* Do we even support multiple mechanisms? */
{
need_secured = secured = 0;
- if ((WithCrypto & APPLICATION_SMIME) && mutt_is_application_smime(m))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(m))
{
need_secured = 1;
hdr->security |= SMIMEENCRYPT;
}
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
(mutt_is_multipart_encrypted(m) || mutt_is_malformed_multipart_pgp_encrypted(m)))
{
need_secured = 1;
break;
case OP_EXTRACT_KEYS:
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
{
recvattach_extract_pgp_keys(actx, menu);
menu->redraw = REDRAW_FULL;
break;
case OP_CHECK_TRADITIONAL:
- if ((WithCrypto & APPLICATION_PGP) && recvattach_pgp_check_traditional(actx, menu))
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
+ recvattach_pgp_check_traditional(actx, menu))
{
hdr->security = crypt_query(cur);
menu->redraw = REDRAW_FULL;
}
#endif
- if (WithCrypto && (hdr->security & ENCRYPT))
+ if ((WithCrypto != 0) && (hdr->security & ENCRYPT))
{
mutt_message(_("Deletion of attachments from encrypted messages is "
"unsupported."));
break;
}
- if (WithCrypto && (hdr->security & (SIGN | PARTSIGN)))
+ if ((WithCrypto != 0) && (hdr->security & (SIGN | PARTSIGN)))
{
mutt_message(_("Deletion of attachments from signed messages may "
"invalidate the signature."));
mutt_parse_mime_message(ctx, cur);
mutt_message_hook(ctx, cur, MUTT_MESSAGEHOOK);
- if (WithCrypto && (cur->security & ENCRYPT) && ForwardDecode)
+ if ((WithCrypto != 0) && (cur->security & ENCRYPT) && ForwardDecode)
{
/* make sure we have the user's passphrase before proceeding... */
if (!crypt_valid_passphrase(cur->security))
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV | MUTT_CM_REPLYING;
int chflags = CH_DECODE;
- if (WithCrypto && (cur->security & ENCRYPT))
+ if ((WithCrypto != 0) && (cur->security & ENCRYPT))
{
/* make sure we have the user's passphrase before proceeding... */
if (!crypt_valid_passphrase(cur->security))
return -1;
}
/* if (WithCrypto && (flags & SENDKEY)) */
- else if ((WithCrypto & APPLICATION_PGP) && (flags & SENDKEY))
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && (flags & SENDKEY))
{
struct Body *b = NULL;
- if ((WithCrypto & APPLICATION_PGP) && (b = crypt_pgp_make_key_attachment(NULL)) == NULL)
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
+ (b = crypt_pgp_make_key_attachment(NULL)) == NULL)
return -1;
b->next = msg->content;
* so fix that here */
if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP)))
{
- if ((WithCrypto & APPLICATION_SMIME) && SmimeIsDefault)
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && SmimeIsDefault)
msg->security |= APPLICATION_SMIME;
else if (WithCrypto & APPLICATION_PGP)
msg->security |= APPLICATION_PGP;
if (msg->env->from && !msg->env->from->personal && !(flags & (SENDRESEND | SENDPOSTPONED)))
msg->env->from->personal = mutt_str_strdup(RealName);
- if (!((WithCrypto & APPLICATION_PGP) && (flags & SENDKEY)))
+ if (!(((WithCrypto & APPLICATION_PGP) != 0) && (flags & SENDKEY)))
mutt_file_fclose(&tempfp);
if (flags & SENDMAILX)
* This is done after allowing the user to edit the message so that security
* settings can be configured with send2-hook and $edit_headers.
*/
- if (WithCrypto && (msg->security == 0) &&
+ if ((WithCrypto != 0) && (msg->security == 0) &&
!(flags & (SENDBATCH | SENDMAILX | SENDPOSTPONED | SENDRESEND)))
{
if (CryptAutosign)
msg->security |= SIGN;
if (CryptReplysignencrypted && cur && (cur->security & ENCRYPT))
msg->security |= SIGN;
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
((msg->security & (ENCRYPT | SIGN)) || CryptOpportunisticEncrypt))
{
if (PgpAutoinline)
*/
if (cur)
{
- if ((WithCrypto & APPLICATION_PGP) && CryptAutopgp && (cur->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && CryptAutopgp &&
+ (cur->security & APPLICATION_PGP))
{
msg->security |= APPLICATION_PGP;
}
- else if ((WithCrypto & APPLICATION_SMIME) && CryptAutosmime &&
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) && CryptAutosmime &&
(cur->security & APPLICATION_SMIME))
{
msg->security |= APPLICATION_SMIME;
*/
if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP)))
{
- if ((WithCrypto & APPLICATION_SMIME) && CryptAutosmime && SmimeIsDefault)
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && CryptAutosmime && SmimeIsDefault)
{
msg->security |= APPLICATION_SMIME;
}
- else if ((WithCrypto & APPLICATION_PGP) && CryptAutopgp)
+ else if (((WithCrypto & APPLICATION_PGP) != 0) && CryptAutopgp)
{
msg->security |= APPLICATION_PGP;
}
- else if ((WithCrypto & APPLICATION_SMIME) && CryptAutosmime)
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) && CryptAutosmime)
{
msg->security |= APPLICATION_SMIME;
}
if (msg->content->next)
msg->content = mutt_make_multipart(msg->content);
- if (WithCrypto && PostponeEncrypt && (msg->security & ENCRYPT))
+ if ((WithCrypto != 0) && PostponeEncrypt && (msg->security & ENCRYPT))
{
char *encrypt_as = NULL;
- if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP))
encrypt_as = PgpDefaultKey;
- else if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME))
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME))
encrypt_as = SmimeDefaultKey;
if (!(encrypt_as && *encrypt_as))
encrypt_as = PostponeEncryptAs;
struct Body *save_sig = NULL;
struct Body *save_parts = NULL;
- if (WithCrypto && (msg->security & (ENCRYPT | SIGN)) && FccClear)
+ if ((WithCrypto != 0) && (msg->security & (ENCRYPT | SIGN)) && FccClear)
msg->content = clear_content;
/* check to see if the user wants copies of all attachments */
if (query_quadoption(FccAttach, _("Save attachments in Fcc?")) != MUTT_YES &&
msg->content->type == TYPEMULTIPART)
{
- if (WithCrypto && (msg->security & (ENCRYPT | SIGN)) &&
+ if ((WithCrypto != 0) && (msg->security & (ENCRYPT | SIGN)) &&
((mutt_str_strcmp(msg->content->subtype, "encrypted") == 0) ||
(mutt_str_strcmp(msg->content->subtype, "signed") == 0)))
{
msg->content = tmpbody;
- if (WithCrypto && save_sig)
+ if ((WithCrypto != 0) && save_sig)
{
/* cleanup the second signature structures */
if (save_content->parts)
msg->content->parts->next = save_sig;
msg->content->parts->parts->next = save_parts;
}
- else if (WithCrypto && save_content)
+ else if ((WithCrypto != 0) && save_content)
{
/* destroy the new encrypted body. */
mutt_free_body(&save_content);
#endif
}
- if (WithCrypto && (msg->security & ENCRYPT))
+ if ((WithCrypto != 0) && (msg->security & ENCRYPT))
FREE(&pgpkeylist);
- if (WithCrypto && free_clear_content)
+ if ((WithCrypto != 0) && free_clear_content)
mutt_free_body(&clear_content);
/* set 'replied' flag only if the user didn't change/remove
static bool write_as_text_part(struct Body *b)
{
return (mutt_is_text_part(b) ||
- ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(b)));
+ (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b)));
}
int mutt_write_mime_body(struct Body *a, FILE *f)
}
/* This is pretty gross, but it's the best solution for now... */
- if ((WithCrypto & APPLICATION_PGP) && a->type == TYPEAPPLICATION &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && a->type == TYPEAPPLICATION &&
(mutt_str_strcmp(a->subtype, "pgp-encrypted") == 0))
{
fputs("Version: 1\n", f);
{
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = MUTT_CM_DECODE | MUTT_CM_CHARCONV;
- if ((WithCrypto & APPLICATION_PGP))
+ if (WithCrypto & APPLICATION_PGP)
pgp &= ~PGPENCRYPT;
- if ((WithCrypto & APPLICATION_SMIME))
+ if (WithCrypto & APPLICATION_SMIME)
pgp &= ~SMIMEENCRYPT;
}
- else if (WithCrypto && ForwardDecrypt && (hdr->security & ENCRYPT))
+ else if ((WithCrypto != 0) && ForwardDecrypt && (hdr->security & ENCRYPT))
{
- if ((WithCrypto & APPLICATION_PGP) && mutt_is_multipart_encrypted(hdr->content))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_multipart_encrypted(hdr->content))
{
chflags |= CH_MIME | CH_NONEWLINE;
cmflags = MUTT_CM_DECODE_PGP;
pgp &= ~PGPENCRYPT;
}
- else if ((WithCrypto & APPLICATION_PGP) &&
+ else if (((WithCrypto & APPLICATION_PGP) != 0) &&
(mutt_is_application_pgp(hdr->content) & PGPENCRYPT))
{
chflags |= CH_MIME | CH_TXTPLAIN;
cmflags = MUTT_CM_DECODE | MUTT_CM_CHARCONV;
pgp &= ~PGPENCRYPT;
}
- else if ((WithCrypto & APPLICATION_SMIME) &&
+ else if (((WithCrypto & APPLICATION_SMIME) != 0) &&
mutt_is_application_smime(hdr->content) & SMIMEENCRYPT)
{
chflags |= CH_MIME | CH_TXTPLAIN;
fprintf(msg->fp, "%s", mutt_date_make_date(buf, sizeof(buf)));
/* (postponement) if the mail is to be signed or encrypted, save this info */
- if ((WithCrypto & APPLICATION_PGP) && post && (hdr->security & APPLICATION_PGP))
+ if (((WithCrypto & APPLICATION_PGP) != 0) && post && (hdr->security & APPLICATION_PGP))
{
fputs("X-Mutt-PGP: ", msg->fp);
if (hdr->security & ENCRYPT)
}
/* (postponement) if the mail is to be signed or encrypted, save this info */
- if ((WithCrypto & APPLICATION_SMIME) && post && (hdr->security & APPLICATION_SMIME))
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && post && (hdr->security & APPLICATION_SMIME))
{
fputs("X-Mutt-SMIME: ", msg->fp);
if (hdr->security & ENCRYPT)