[PATCH 2/3] display key fingerprints if offered by keyserver

Stefan Tomanek tomanek at internet-sicherheit.de
Fri Sep 13 08:58:36 CEST 2013


This change tries to make use of complete key fingerprints if those are
offered by the consulted keyserver. If a keyserver returns the entire
fingerprint as a user id, it will be shown to the user searching the
database.

Signed-off-by: Stefan Tomanek <tomanek at internet-sicherheit.de>
---
 g10/keyserver.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/g10/keyserver.c b/g10/keyserver.c
index 1eadff1..440c6a1 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -462,6 +462,8 @@ print_keyrec(int number,struct keyrec *keyrec)
 {
   int i;
 
+  char *fp_str = NULL;
+
   iobuf_writebyte(keyrec->uidbuf,0);
   iobuf_flush_temp(keyrec->uidbuf);
   printf("(%d)\t%s  ",number,iobuf_get_temp_buffer(keyrec->uidbuf));
@@ -503,6 +505,7 @@ print_keyrec(int number,struct keyrec *keyrec)
       printf("key ");
       for(i=0;i<16;i++)
 	printf("%02X",keyrec->desc.u.fpr[i]);
+      fp_str = format_fingerprint(keyrec->desc.u.fpr, 16);
       break;
 
       /* If we get a modern fingerprint, we have the most
@@ -512,6 +515,7 @@ print_keyrec(int number,struct keyrec *keyrec)
 	u32 kid[2];
 	keyid_from_fingerprint(keyrec->desc.u.fpr,20,kid);
 	printf("key %s",keystr(kid));
+        fp_str = format_fingerprint(keyrec->desc.u.fpr, 20);
       }
       break;
 
@@ -540,6 +544,14 @@ print_keyrec(int number,struct keyrec *keyrec)
     printf(" (%s)",_("expired"));
 
   printf("\n");
+  if(fp_str)
+    {
+      printf("\t%s ", _("      Key fingerprint ="));
+      printf("%s", fp_str);
+      xfree(fp_str);
+      printf("\n");
+    }
+  printf("\n");
 }
 
 /* Returns a keyrec (which must be freed) once a key is complete, and
-- 
1.7.10.4



More information about the Gnupg-devel mailing list