]> granicus.if.org Git - mutt/commitdiff
The "sign (a)s" code strips the pgp application bit causing drawing
authorDale Woolridge <dale-flea-mutt-bug@woolridge.org>
Tue, 15 Apr 2003 09:52:06 +0000 (09:52 +0000)
committerDale Woolridge <dale-flea-mutt-bug@woolridge.org>
Tue, 15 Apr 2003 09:52:06 +0000 (09:52 +0000)
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.

compose.c

index a822824ee6eff47015c30320e0ed6bd02e904556..451fdd2fe273f71d4aae95b4cde9ba989361568b 100644 (file)
--- 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);