]> granicus.if.org Git - neomutt/commitdiff
Fix handling of revocation certificates.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 26 Jun 2001 10:25:39 +0000 (10:25 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 26 Jun 2001 10:25:39 +0000 (10:25 +0000)
pgplib.h
pgppubring.c

index 1b4ba4f1eb0599b63c55927479c7fd31cd7e3186..0f0641864ba2d365c74f38d9842029012d5273ea 100644 (file)
--- a/pgplib.h
+++ b/pgplib.h
 
 #define KEYFLAG_ABILITIES (KEYFLAG_CANSIGN|KEYFLAG_CANENCRYPT|KEYFLAG_PREFER_ENCRYPTION|KEYFLAG_PREFER_SIGNING)
 
+typedef struct pgp_signature
+{
+  struct pgp_signature *next;
+  unsigned char sigtype;
+  unsigned long sid1;
+  unsigned long sid2;
+}
+pgp_sig_t;
+
 typedef struct pgp_keyinfo
 {
   char *keyid;
@@ -50,19 +59,11 @@ typedef struct pgp_keyinfo
   int numalg;
   const char *algorithm;
   struct pgp_keyinfo *parent;
+  struct pgp_signature *sigs;
   struct pgp_keyinfo *next;
 }
 pgp_key_t;
 
-typedef struct pgp_signature
-{
-  struct pgp_signature *next;
-  unsigned char sigtype;
-  unsigned long sid1;
-  unsigned long sid2;
-}
-pgp_sig_t;
-
 typedef struct pgp_uid
 {
   char *addr;
index 39f77f3000f3ae34dac16ef53c9e86a1917c95e3..0de705400afc9fbcdad09cc9d841e32874c911f0 100644 (file)
@@ -460,10 +460,9 @@ static int pgp_parse_pgp3_sig (unsigned char *buff, size_t l, pgp_key_t * p, pgp
        {
          if (skl < 8)
            break;
-         signerid1 = 0;
+         signerid2 = signerid1 = 0;
          for (i = 0; i < 4; i++)
            signerid1 = (signerid1 << 8) + buff[j++];
-         signerid2 = 0;
          for (i = 0; i < 4; i++)
            signerid2 = (signerid2 << 8) + buff[j++];
          
@@ -582,6 +581,7 @@ static pgp_key_t *pgp_parse_keyblock (FILE * fp)
 
        last = &p->next;
        addr = &p->address;
+       lsig = &p->sigs;
        
        if (pt == PT_SUBKEY || pt == PT_SUBSECKEY)
        {
@@ -772,6 +772,21 @@ static void print_userid (const char *id)
   }
 }
 
+static void dump_signatures (pgp_sig_t *sig)
+{
+  for (; sig; sig = sig->next)
+  {
+    if (sig->sigtype == 0x10 || sig->sigtype == 0x11 ||
+       sig->sigtype == 0x12 || sig->sigtype == 0x13)
+      printf ("sig::::%08lX%08lX::::::%X:\n",
+             sig->sid1, sig->sid2, sig->sigtype);
+    else if (sig->sigtype == 0x20)
+      printf ("rev::::%08lX%08lX::::::%X:\n",
+             sig->sid1, sig->sid2, sig->sigtype);
+  }
+}
+
+
 static char gnupg_trustletter (int t)
 {
   switch (t)
@@ -844,17 +859,12 @@ static void pgpring_dump_keyblock (pgp_key_t *p)
       
       if (dump_signatures)
       {
-       for (sig = uid->sigs; sig; sig = sig->next)
-       {
-         if (sig->sigtype == 0x10 || sig->sigtype == 0x11 ||
-             sig->sigtype == 0x12 || sig->sigtype == 0x13)
-           printf ("sig::::%08lX%08lX:::::::\n",
-                   sig->sid1, sig->sid2);
-         else if (sig->sigtype == 0x20)
-           printf ("rev::::%08lX%08lX:::::::\n",
-                   sig->sid1, sig->sid2);
-           
-       }
+       if (first)
+         dump_signatures (p->sigs);
+       
+       dump_signatures (uid->sigs);
+      }
+       
       }
     }
   }