From: Dale Woolridge Date: Tue, 15 Apr 2003 09:52:06 +0000 (+0000) Subject: The "sign (a)s" code strips the pgp application bit causing drawing X-Git-Tag: pre-type-punning-patch~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c56ee77fc7428826df1a6fad96cd011e112af648;p=mutt The "sign (a)s" code strips the pgp application bit causing drawing issues in redraw_crypt_lines(). Other bits (well bit = encrypt) are ignored as a result. I've only tested with pgp, but the same problem exists in the smime code too. This inline patch (against cvs head revision) fixes the problem. --- diff --git a/compose.c b/compose.c index a822824e..451fdd2f 100644 --- a/compose.c +++ b/compose.c @@ -166,11 +166,11 @@ static int pgp_send_menu (HEADER *msg, int *redraw) _("esabf"))) { case 1: /* (e)ncrypt */ - msg->security |= PGPENCRYPT; + msg->security |= ENCRYPT; break; case 2: /* (s)ign */ - msg->security |= PGPSIGN; + msg->security |= SIGN; break; case 3: /* sign (a)s */ @@ -184,20 +184,20 @@ static int pgp_send_menu (HEADER *msg, int *redraw) mutt_str_replace (&PgpSignAs, input_signas); crypt_pgp_free_key (&p); - msg->security |= PGPSIGN; + msg->security |= SIGN; crypt_pgp_void_passphrase (); /* probably need a different passphrase */ } else { - msg->security &= ~PGPSIGN; + msg->security &= ~SIGN; } *redraw = REDRAW_FULL; break; case 4: /* (b)oth */ - msg->security = PGPENCRYPT | PGPSIGN; + msg->security = ENCRYPT | SIGN; break; case 5: /* (f)orget it */ @@ -205,6 +205,11 @@ static int pgp_send_menu (HEADER *msg, int *redraw) break; } + if (msg->security && msg->security != APPLICATION_PGP) + msg->security |= APPLICATION_PGP; + else + msg->security = 0; + if(*redraw) redraw_crypt_lines (msg); return (msg->security); @@ -223,11 +228,11 @@ static int smime_send_menu (HEADER *msg, int *redraw) _("eswabf"))) { case 1: /* (e)ncrypt */ - msg->security |= SMIMEENCRYPT; + msg->security |= ENCRYPT; break; case 3: /* encrypt (w)ith */ - msg->security |= SMIMEENCRYPT; + msg->security |= ENCRYPT; switch (mutt_multi_choice (_("1: DES, 2: Triple-DES, 3: RC2-40," " 4: RC2-64, 5: RC2-128, or (f)orget it? "), _("12345f"))) { @@ -256,7 +261,7 @@ static int smime_send_menu (HEADER *msg, int *redraw) if(!SmimeDefaultKey) mutt_message("Can\'t sign: No key specified. use sign(as)."); else - msg->security |= SMIMESIGN; + msg->security |= SIGN; break; case 4: /* sign (a)s */ @@ -265,19 +270,19 @@ static int smime_send_menu (HEADER *msg, int *redraw) p[mutt_strlen (p)-1] = '\0'; mutt_str_replace (&SmimeDefaultKey, p); - msg->security |= SMIMESIGN; + msg->security |= SIGN; /* probably need a different passphrase */ crypt_smime_void_passphrase (); } else - msg->security &= ~SMIMESIGN; + msg->security &= ~SIGN; *redraw = REDRAW_FULL; break; case 5: /* (b)oth */ - msg->security = SMIMEENCRYPT | SMIMESIGN; + msg->security = ENCRYPT | SIGN; break; case 6: /* (f)orget it */ @@ -285,6 +290,11 @@ static int smime_send_menu (HEADER *msg, int *redraw) break; } + if (msg->security && msg->security != APPLICATION_SMIME) + msg->security |= APPLICATION_SMIME; + else + msg->security = 0; + if(*redraw) redraw_crypt_lines (msg); return (msg->security);