gpg: Fix --recv-key in case of a given fingerprint.
authorWerner Koch <wk@gnupg.org>
Mon, 30 Sep 2019 16:03:31 +0000 (18:03 +0200)
committerWerner Koch <wk@gnupg.org>
Mon, 30 Sep 2019 16:03:31 +0000 (18:03 +0200)
* g10/keyserver.c (keyserver_retrieval_screener): Compare against
actual length.
--

This was a long standing and annoying regression due to changes
for v5 keys.  Really simple to fix :-).

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/keyserver.c

index c2e304f..4d4a3de 100644 (file)
@@ -1054,7 +1054,8 @@ keyserver_retrieval_screener (kbnode_t keyblock, void *opaque)
         {
           if (desc[n].mode == KEYDB_SEARCH_MODE_FPR)
             {
-              if (fpr_len == desc[n].fprlen && !memcmp (fpr, desc[n].u.fpr, 32))
+              if (fpr_len == desc[n].fprlen
+                  && !memcmp (fpr, desc[n].u.fpr, desc[n].fprlen))
                 return 0;
             }
           else if (desc[n].mode == KEYDB_SEARCH_MODE_LONG_KID)