<<< Date Index >>>     <<< Thread Index >>>

Re: Security issue / bad UI design in mutt CVS (encryption options)



* Derek Martin [Fri, 06 Aug 2004 15:04:18 +0900]:

> Given the options presented, the most obvious interpretation of what
> they do is:

  I agree with this interpretation. Trivial patch attached, use at will.
  I stay neutral about its inclusion in upstream CVS, but Thomas may do
  so if he regards it appropriate.

>   (e) ONLY encrypt the message (i.e. change the options to only
>       encrypt, regardless of what they currently are).
>   (s) ONLY sign the message, regardless of current options.
>   (a) change the key with which to sign, adding the sign option if
>       necessary
>   (b) do both, regardless of current options
>   (i) toggle in-line attachments (but change menu to indicate toggle)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                   this isn't addressed by the patch,
    but prepending "toggle " to the "(i)inline" bit could suffice.

>   (f) clear the encryption options

  thanks,

-- 
Adeodato Simó
    EM: asp16 [ykwim] alu.ua.es | PK: DA6AE621
 
A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?
--- mutt-1.5.6/pgp.c    2004-08-06 20:04:37.000000000 +0200
+++ mutt-1.5.6/pgp.c    2004-08-06 20:07:19.000000000 +0200
@@ -1476,11 +1476,11 @@
                             _("esabif")))
   {
   case 1: /* (e)ncrypt */
-    msg->security ^= ENCRYPT;
+    msg->security = (ENCRYPT | msg->security & INLINE);
     break;
 
   case 2: /* (s)ign */
-    msg->security ^= SIGN;
+    msg->security = (SIGN | msg->security & INLINE);
     break;
 
   case 3: /* sign (a)s */
@@ -1493,7 +1493,7 @@
       mutt_str_replace (&PgpSignAs, input_signas);
       pgp_free_key (&p);
       
-      msg->security |= SIGN;
+      msg->security = (SIGN | msg->security & INLINE);
        
       crypt_pgp_void_passphrase ();  /* probably need a different passphrase */
     }
@@ -1506,10 +1506,7 @@
     break;
 
   case 4: /* (b)oth */
-    if ((msg->security & (ENCRYPT | SIGN)) == (ENCRYPT | SIGN))
-      msg->security = 0;
-    else
-      msg->security |= (ENCRYPT | SIGN);
+    msg->security = (ENCRYPT | SIGN | msg->security & INLINE);
     break;
 
   case 5: /* (i)nline */