if (sign && !(security & SEC_AUTOCRYPT) && !crypt_valid_passphrase(security))
return -1;
- if ((WithCrypto & APPLICATION_PGP) && !(security & SEC_AUTOCRYPT) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && !(security & SEC_AUTOCRYPT) &&
((security & PGP_INLINE) == PGP_INLINE))
{
if ((e->content->type != TYPE_TEXT) ||
* Protected Headers. */
if (!C_FccBeforeSend)
{
- if (WithCrypto && (e->security & (SEC_ENCRYPT | SEC_SIGN | SEC_AUTOCRYPT)) && C_FccClear)
+ if ((WithCrypto != 0) && (e->security & (SEC_ENCRYPT | SEC_SIGN | SEC_AUTOCRYPT)) && C_FccClear)
{
e->content = clear_content;
e->security &= ~(SEC_ENCRYPT | SEC_SIGN | SEC_AUTOCRYPT);
mutt_encode_descriptions(e_post->content, true);
- if (WithCrypto && C_PostponeEncrypt && (e_post->security & (SEC_ENCRYPT | SEC_AUTOCRYPT)))
+ if ((WithCrypto != 0) && C_PostponeEncrypt && (e_post->security & (SEC_ENCRYPT | SEC_AUTOCRYPT)))
{
if (((WithCrypto & APPLICATION_PGP) != 0) && (e_post->security & APPLICATION_PGP))
encrypt_as = C_PgpDefaultKey;
e_templ->security |= SEC_SIGN;
if (C_CryptReplysignencrypted && e_cur && (e_cur->security & SEC_ENCRYPT))
e_templ->security |= SEC_SIGN;
- if ((WithCrypto & APPLICATION_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) &&
((e_templ->security & (SEC_ENCRYPT | SEC_SIGN)) || C_CryptOpportunisticEncrypt))
{
if (C_PgpAutoinline)
else if ((e_templ->security & (SEC_ENCRYPT | SEC_AUTOCRYPT)) ||
((e_templ->security & SEC_SIGN) && (e_templ->content->type == TYPE_APPLICATION)))
{
- mutt_body_free(&e_templ->content); /* destroy PGP data */
- e_templ->content = clear_content; /* restore clear text. */
+ if (e_templ->content != clear_content)
+ {
+ mutt_body_free(&e_templ->content); /* destroy PGP data */
+ e_templ->content = clear_content; /* restore clear text. */
+ }
}
else if ((e_templ->security & SEC_SIGN) && (e_templ->content->type == TYPE_MULTIPART))
{