* keyserver.c (parse_keyserver_options): Accept honor-http-proxy as an
[gnupg.git] / g10 / keyid.c
index 9d98717..03e8169 100644 (file)
@@ -280,7 +280,7 @@ keyid_from_sk( PKT_secret_key *sk, u32 *keyid )
          sk->keyid[1]=keyid[1];
        }
       else
-       sk->keyid[0]=sk->keyid[1]=keyid[0]=keyid[1]=lowbits=0;
+       sk->keyid[0]=sk->keyid[1]=keyid[0]=keyid[1]=lowbits=0xFFFFFFFF;
     }
   else
     {
@@ -298,7 +298,7 @@ keyid_from_sk( PKT_secret_key *sk, u32 *keyid )
          sk->keyid[1] = keyid[1];
        }
       else
-       sk->keyid[0]=sk->keyid[1]=keyid[0]=keyid[1]=lowbits=0;
+       sk->keyid[0]=sk->keyid[1]=keyid[0]=keyid[1]=lowbits=0xFFFFFFFF;
     }
 
   return lowbits;
@@ -334,7 +334,7 @@ keyid_from_pk( PKT_public_key *pk, u32 *keyid )
          pk->keyid[1] = keyid[1];
        }
       else
-       pk->keyid[0]=pk->keyid[1]=keyid[0]=keyid[1]=lowbits=0;
+       pk->keyid[0]=pk->keyid[1]=keyid[0]=keyid[1]=lowbits=0xFFFFFFFF;
     }
   else
     {
@@ -352,7 +352,7 @@ keyid_from_pk( PKT_public_key *pk, u32 *keyid )
          pk->keyid[1] = keyid[1];
        }
       else
-       pk->keyid[0]=pk->keyid[1]=keyid[0]=keyid[1]=lowbits=0;
+       pk->keyid[0]=pk->keyid[1]=keyid[0]=keyid[1]=lowbits=0xFFFFFFFF;
     }
 
   return lowbits;
@@ -529,12 +529,41 @@ revokestr_from_pk( PKT_public_key *pk )
     static char buffer[11+5];
     time_t atime;
 
-    if(!pk->revokedate)
+    if(!pk->revoked.date)
       return _("never     ");
-    atime=pk->revokedate;
+    atime=pk->revoked.date;
     return mk_datestr (buffer, atime);
 }
 
+
+const char *
+usagestr_from_pk( PKT_public_key *pk )
+{
+  static char buffer[10];
+  int i = 0;
+  unsigned int use = pk->pubkey_usage;
+    
+  if ( use & PUBKEY_USAGE_SIG )
+    {
+      if (pk->is_primary)
+        buffer[i++] = 'C';
+      buffer[i++] = 'S';
+    }
+
+  if ( use & PUBKEY_USAGE_ENC )
+    buffer[i++] = 'E';
+
+  if ( (use & PUBKEY_USAGE_AUTH) )
+    buffer[i++] = 'A';
+
+  while (i < 4)
+    buffer[i++] = ' ';
+
+  buffer[i] = 0;
+  return buffer;
+}
+
+
 const char *
 colon_strtime (u32 t)
 {