From: Richard Russon Date: Mon, 19 Mar 2018 16:19:46 +0000 (+0000) Subject: check WithCrypto against zero X-Git-Tag: neomutt-20180323~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96c31a46ab3cde117749d6ee2d3d78216c8ee50f;p=neomutt check WithCrypto against zero --- diff --git a/attach.c b/attach.c index 8c65f8f15..c3861d10e 100644 --- a/attach.c +++ b/attach.c @@ -380,8 +380,8 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr, 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; } diff --git a/commands.c b/commands.c index 2cb8e2d07..b8158eda1 100644 --- a/commands.c +++ b/commands.c @@ -82,7 +82,7 @@ int mutt_display_message(struct Header *cur) 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) { @@ -193,7 +193,7 @@ int mutt_display_message(struct Header *cur) { 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) { @@ -208,7 +208,7 @@ int mutt_display_message(struct Header *cur) 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.")); @@ -364,7 +364,7 @@ static void pipe_msg(struct Header *h, FILE *fp, int decode, int print) 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; @@ -393,7 +393,7 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print, { 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)) @@ -417,7 +417,7 @@ static int pipe_message(struct Header *h, char *cmd, int decode, int print, else { /* handle tagged messages */ - if (WithCrypto && decode) + if ((WithCrypto != 0) && decode) { for (int i = 0; i < Context->msgcount; i++) { @@ -685,16 +685,17 @@ static void set_copy_flags(struct Header *hdr, int decode, int decrypt, *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; @@ -826,7 +827,8 @@ int mutt_save_message(struct Header *h, int delete, int decode, int decrypt) 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); @@ -1034,7 +1036,7 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp) mutt_parse_part(fp, b); } - if (WithCrypto && h) + if ((WithCrypto != 0) && h) { if (h->content == b) h->security = 0; diff --git a/compose.c b/compose.c index 8eabece6d..8a4176225 100644 --- a/compose.c +++ b/compose.c @@ -270,14 +270,14 @@ static void redraw_crypt_lines(struct Header *msg) 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)")); } @@ -288,8 +288,8 @@ static void redraw_crypt_lines(struct Header *msg) 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])); @@ -297,8 +297,8 @@ static void redraw_crypt_lines(struct Header *msg) printw("%s", PgpSignAs ? PgpSignAs : _("")); } - 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])); @@ -306,7 +306,7 @@ static void redraw_crypt_lines(struct Header *msg) printw("%s", SmimeSignAs ? SmimeSignAs : _("")); } - 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); @@ -1601,7 +1601,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */ 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)) { @@ -1636,7 +1636,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */ break; } - if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP)) + if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP)) { if (msg->security & (ENCRYPT | SIGN)) { diff --git a/copy.c b/copy.c index 229c69e79..2f9530476 100644 --- a/copy.c +++ b/copy.c @@ -664,17 +664,17 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags, 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)) @@ -682,7 +682,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags, 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)) diff --git a/handler.c b/handler.c index 4def5ceda..2a8f00a2c 100644 --- a/handler.c +++ b/handler.c @@ -1254,11 +1254,11 @@ int mutt_can_decode(struct Body *a) 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; } @@ -1574,23 +1574,27 @@ void mutt_decode_attachment(struct Body *b, struct State *s) 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; } @@ -1817,7 +1821,7 @@ int mutt_body_handler(struct Body *b, struct State *s) /* 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", @@ -1853,7 +1857,7 @@ int mutt_body_handler(struct Body *b, struct State *s) { 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"); @@ -1880,16 +1884,16 @@ int mutt_body_handler(struct Body *b, struct State *s) 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; } diff --git a/hdrline.c b/hdrline.c index 7cb3dbe80..fd0bb77da 100644 --- a/hdrline.c +++ b/hdrline.c @@ -1244,13 +1244,13 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co 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 = " "; @@ -1308,13 +1308,13 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co 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 = " "; diff --git a/header.c b/header.c index 02841a7c2..6cbcb3c72 100644 --- a/header.c +++ b/header.c @@ -204,7 +204,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, } 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); diff --git a/init.c b/init.c index 4e74fac9b..a5ed994c5 100644 --- a/init.c +++ b/init.c @@ -405,7 +405,7 @@ int mutt_option_set(const struct Option *val, struct Buffer *err) map = SortBrowserMethods; break; case DT_SORT_KEYS: - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) map = SortKeyMethods; break; case DT_SORT_AUX: @@ -2692,7 +2692,7 @@ static int parse_set(struct Buffer *tmp, struct Buffer *s, unsigned long data, map = SortBrowserMethods; break; case DT_SORT_KEYS: - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) map = SortKeyMethods; break; case DT_SORT_AUX: @@ -3530,7 +3530,7 @@ int var_to_string(int idx, char *val, size_t len) map = SortBrowserMethods; break; case DT_SORT_KEYS: - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) map = SortKeyMethods; else map = SortMethods; diff --git a/keymap.c b/keymap.c index fd204dc55..fb6dc1d84 100644 --- a/keymap.c +++ b/keymap.c @@ -795,10 +795,10 @@ void km_init(void) 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 diff --git a/muttlib.c b/muttlib.c index b21b3ac14..ba3514210 100644 --- a/muttlib.c +++ b/muttlib.c @@ -360,9 +360,9 @@ bool mutt_needs_mailcap(struct Body *m) 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; @@ -379,7 +379,7 @@ bool mutt_is_text_part(struct Body *b) 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) @@ -391,7 +391,7 @@ bool mutt_is_text_part(struct Body *b) 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; diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index bca2b822f..c4b1523f8 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -79,10 +79,10 @@ void crypt_current_time(struct State *s, char *app_name) */ 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) @@ -115,10 +115,10 @@ int crypt_valid_passphrase(int flags) 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; @@ -140,7 +140,7 @@ int mutt_protect(struct Header *msg, char *keylist) 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)) @@ -196,9 +196,9 @@ int mutt_protect(struct Header *msg, char *keylist) 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)) @@ -214,9 +214,9 @@ int mutt_protect(struct Header *msg, char *keylist) 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) @@ -225,7 +225,7 @@ int mutt_protect(struct Header *msg, char *keylist) 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) @@ -233,7 +233,7 @@ int mutt_protect(struct Header *msg, char *keylist) 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); @@ -244,7 +244,8 @@ int mutt_protect(struct Header *msg, char *keylist) 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 ;-) */ } @@ -252,7 +253,7 @@ int mutt_protect(struct Header *msg, char *keylist) 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) @@ -272,7 +273,7 @@ int mutt_protect(struct Header *msg, char *keylist) 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) @@ -324,18 +325,18 @@ int mutt_is_multipart_signed(struct Body *b) 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; @@ -346,7 +347,7 @@ int mutt_is_multipart_signed(struct Body *b) int mutt_is_multipart_encrypted(struct Body *b) { - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) { char *p = NULL; @@ -570,10 +571,10 @@ int crypt_query(struct Body *m) 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) @@ -582,7 +583,7 @@ int crypt_query(struct Body *m) 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) @@ -682,7 +683,7 @@ void convert_to_7bit(struct Body *a) 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 && @@ -721,7 +722,7 @@ void crypt_extract_keys_from_messages(struct Header *h) return; } - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) OPT_DONT_HANDLE_PGP_KEYS = true; if (!h) @@ -740,7 +741,7 @@ void crypt_extract_keys_from_messages(struct Header *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); @@ -750,7 +751,7 @@ void crypt_extract_keys_from_messages(struct Header *h) 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, @@ -782,7 +783,7 @@ void crypt_extract_keys_from_messages(struct Header *h) 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); @@ -791,7 +792,7 @@ void crypt_extract_keys_from_messages(struct Header *h) 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, @@ -821,7 +822,7 @@ void crypt_extract_keys_from_messages(struct Header *h) mutt_file_unlink(tempfname); - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) OPT_DONT_HANDLE_PGP_KEYS = false; } @@ -847,7 +848,7 @@ int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode) 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); @@ -862,7 +863,7 @@ int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode) 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) @@ -874,7 +875,7 @@ int crypt_get_keys(struct Header *msg, char **keylist, int oppenc_mode) 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) @@ -1027,7 +1028,7 @@ int mutt_signed_handler(struct Body *a, struct State *s) { 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) @@ -1036,7 +1037,7 @@ int mutt_signed_handler(struct Body *a, struct State *s) 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, diff --git a/ncrypt/cryptglue.c b/ncrypt/cryptglue.c index 456d47dc5..8644cc3ef 100644 --- a/ncrypt/cryptglue.c +++ b/ncrypt/cryptglue.c @@ -120,22 +120,22 @@ void crypt_init(void) */ 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; diff --git a/pager.c b/pager.c index f40273087..693c5b1c2 100644 --- a/pager.c +++ b/pager.c @@ -3047,7 +3047,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e 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; diff --git a/pattern.c b/pattern.c index 8285f9177..28b1f82eb 100644 --- a/pattern.c +++ b/pattern.c @@ -940,7 +940,7 @@ static int msg_search(struct Context *ctx, struct Pattern *pat, int msgno) { 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) diff --git a/postpone.c b/postpone.c index 7bd84cc20..1c21065c3 100644 --- a/postpone.c +++ b/postpone.c @@ -354,7 +354,7 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr, */ 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 */ @@ -363,7 +363,7 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr, 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); @@ -499,18 +499,18 @@ int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app) } /* 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); @@ -573,7 +573,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, /* 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; @@ -597,15 +597,15 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, * 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 */ @@ -670,7 +670,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, 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) @@ -692,7 +692,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, 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) @@ -732,7 +732,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, /* 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? */ diff --git a/recvattach.c b/recvattach.c index 05f39ded9..81cc38be0 100644 --- a/recvattach.c +++ b/recvattach.c @@ -983,7 +983,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Header { 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; @@ -1014,7 +1014,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Header 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; @@ -1218,7 +1218,7 @@ void mutt_view_attachments(struct Header *hdr) break; case OP_EXTRACT_KEYS: - if ((WithCrypto & APPLICATION_PGP)) + if (WithCrypto & APPLICATION_PGP) { recvattach_extract_pgp_keys(actx, menu); menu->redraw = REDRAW_FULL; @@ -1226,7 +1226,8 @@ void mutt_view_attachments(struct Header *hdr) 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; @@ -1274,13 +1275,13 @@ void mutt_view_attachments(struct Header *hdr) } #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.")); diff --git a/send.c b/send.c index 4832ff55f..12d744055 100644 --- a/send.c +++ b/send.c @@ -407,7 +407,7 @@ static int include_forward(struct Context *ctx, struct Header *cur, FILE *out) 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)) @@ -466,7 +466,7 @@ static int include_reply(struct Context *ctx, struct Header *cur, FILE *out) 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)) @@ -903,11 +903,12 @@ static int generate_body(FILE *tempfp, struct Header *msg, int flags, 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; @@ -1202,7 +1203,7 @@ int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur) * 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; @@ -1578,7 +1579,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, 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) @@ -1678,7 +1679,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, * 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) @@ -1691,7 +1692,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, 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) @@ -1713,11 +1714,12 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, */ 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; @@ -1730,15 +1732,15 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, */ 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; } @@ -1821,13 +1823,13 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, 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; @@ -2028,14 +2030,14 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, 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))) { @@ -2087,7 +2089,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, msg->content = tmpbody; - if (WithCrypto && save_sig) + if ((WithCrypto != 0) && save_sig) { /* cleanup the second signature structures */ if (save_content->parts) @@ -2101,7 +2103,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, 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); @@ -2154,10 +2156,10 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile, #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 diff --git a/sendlib.c b/sendlib.c index 4839c42bc..6c7ed46c4 100644 --- a/sendlib.c +++ b/sendlib.c @@ -410,7 +410,7 @@ int mutt_write_mime_header(struct Body *a, FILE *f) 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) @@ -445,7 +445,7 @@ 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); @@ -1381,27 +1381,27 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, i { 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; @@ -3005,7 +3005,7 @@ int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, 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) @@ -3024,7 +3024,7 @@ int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, } /* (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)