]> granicus.if.org Git - mutt/commitdiff
Add $pgp_show_unusable.
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Jan 1999 19:53:38 +0000 (19:53 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Jan 1999 19:53:38 +0000 (19:53 +0000)
doc/manual.sgml.in
gnupgparse.c
init.h
mutt.h
pgpkey.c

index 80868e90943c0f700086fbf8726871768ac9cc6e..d49d133775b4c7e0f334d35db913af81d3deac9d 100644 (file)
@@ -3371,6 +3371,7 @@ Default: unset
 
 If set, use 64 bit PGP key IDs. Unset uses the normal 32 bit Key IDs.
 
+
 <sect2>pgp&lowbar;receive&lowbar;version<label id="pgp_receive_version">
 <p>
 Type: string<newline>
@@ -3412,6 +3413,15 @@ name="&dollar;pgp&lowbar;default&lowbar;version"> will be used. Set
 this to pgp2 (PGP 2.*), pgp5 (PGP 5.*), or gpg (GNU privacy guard) if
 you want to use a different PGP version for sending operations.
 
+<sect2>pgp&lowbar;show&lowbar;unusable<label id="pgp_show_unusable">
+<p>
+Type: boolean<newline>
+Default: set
+
+If set, mutt will display non-usable keys on the PGP key selection
+menu.  This includes keys which have been revoked, have expired, or
+have been marked as ``disabled'' by the user.
+
 <sect2>pgp&lowbar;sign&lowbar;as<label id="pgp_sign_as">
 <p>
 Type: string<newline>
index f62bb659455b73ae298b9a7c5e83bf83f1557228..4b1923683e0b20ea80450a739fe7731f51497595 100644 (file)
@@ -93,20 +93,20 @@ static pgp_key_t *parse_pub_line (char *buf, int *is_subkey, pgp_key_t *k)
        break;
       }
       case 2:                  /* trust info */
-      /*
-       * XXX - is this the owner-trust field?
-       *
-       * Actually, we'd need the trust gpg has into the 
-       * association between a user ID and a key.
-       * 
-       * - tlr
-       */
       {
        switch (*p)
        {                               /* look only at the first letter */
          case 'e':
            k->flags |= KEYFLAG_EXPIRED;
            break;
+         case 'r':
+           k->flags |= KEYFLAG_REVOKED;
+           break;
+         
+         /* produce "undefined trust" as long as gnupg doesn't
+          * have a proper trust model.
+          */
+#if 0
          case 'n':
            trust = 1;
            break;
@@ -119,9 +119,7 @@ static pgp_key_t *parse_pub_line (char *buf, int *is_subkey, pgp_key_t *k)
          case 'u':
            trust = 3;
            break;
-         case 'r':
-           k->flags |= KEYFLAG_REVOKED;
-           break;
+#endif   
        }
        break;
       }
diff --git a/init.h b/init.h
index 5734d9de0535f57ff338fb502316dea3fc3e739c..e6de673c8966d10f38459ea1523bf80f26459bda 100644 (file)
--- a/init.h
+++ b/init.h
@@ -176,6 +176,7 @@ struct option_t MuttVars[] = {
   { "pgp_long_ids",    DT_BOOL, R_NONE, OPTPGPLONGIDS, 0 },
   { "pgp_replyencrypt",        DT_BOOL, R_NONE, OPTPGPREPLYENCRYPT, 0 },
   { "pgp_replysign",   DT_BOOL, R_NONE, OPTPGPREPLYSIGN, 0 },
+  { "pgp_show_unusable", DT_BOOL, R_NONE, OPTPGPSHOWUNUSABLE, 1 },
   { "pgp_sign_as",     DT_STR,  R_NONE, UL &PgpSignAs, 0 },
   { "pgp_sign_micalg", DT_STR,  R_NONE, UL &PgpSignMicalg, UL "pgp-md5" },
   { "pgp_strict_enc",  DT_BOOL, R_NONE, OPTPGPSTRICTENC, 1 },
diff --git a/mutt.h b/mutt.h
index 5b13a84ea69a5a09115982d4c1bea280a2d5c08b..f918fd8356efe2ffa104a077e81ca57af73a6fa1 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -353,6 +353,7 @@ enum
   OPTPGPENCRYPTSELF,
   OPTPGPSTRICTENC,
   OPTFORWDECRYPT,
+  OPTPGPSHOWUNUSABLE,
 #endif
 
   /* pseudo options */
index f3bfd7c6d15fede7976b7fe474359d9b39dc62d1..d1fc91827cfba10a9512bf43ecaa11fcb986acce 100644 (file)
--- a/pgpkey.c
+++ b/pgpkey.c
@@ -146,6 +146,9 @@ static pgp_key_t *pgp_select_key (struct pgp_vinfo *pgp,
 
   for (i = 0, kp = keys; kp; kp = kp->next)
   {
+    if (!option (OPTPGPSHOWUNUSABLE) && (kp->flags & KEYFLAG_CANTUSE))
+      continue;
+    
     for (a = kp->address; a; i++, a = a->next)
       ;
   }
@@ -158,6 +161,9 @@ static pgp_key_t *pgp_select_key (struct pgp_vinfo *pgp,
 
   for (i = 0, kp = keys; kp; kp = kp->next)
   {
+    if (!option (OPTPGPSHOWUNUSABLE) && (kp->flags & KEYFLAG_CANTUSE))
+      continue;
+       
     for (a = kp->address; a; i++, a = a->next)
       KeyTable[i] = a;
   }