[git] GnuPG - branch, key-storage-work, updated. gnupg-2.1.0beta3-132-g4927923

by Werner Koch cvs at cvs.gnupg.org
Tue Jan 8 14:51:39 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, key-storage-work has been updated
       via  492792378dc7a79316ef742b2ffaa46c6cda282a (commit)
       via  5c565512b8af73bee2a176530663154b9277ef1c (commit)
       via  f3f5721e6843a08d1011875400f385b8cd5fe226 (commit)
      from  f6d7b3f1ee5eed32bc3257c99cb878091d26c482 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 492792378dc7a79316ef742b2ffaa46c6cda282a
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jan 8 14:44:49 2013 +0100

    gpg: Cache keybox searches.
    
    * common/iobuf.c (iobuf_seek): Fix for temp streams.
    * g10/pubkey-enc.c (get_session_key, get_it): Add some log_clock calls.
    * g10/keydb.c (dump_search_desc): New.
    (enum_keyblock_states, struct keyblock_cache): New.
    (keyblock_cache_clear): New.
    (keydb_get_keyblock, keydb_search): Implement a keyblock cache.
    (keydb_update_keyblock, keydb_insert_keyblock, keydb_delete_keyblock)
    (keydb_rebuild_caches, keydb_search_reset): Clear the cache.
    --
    
    Gpg uses the key database at several places without a central
    coordination.  This leads to several scans of the keybox for the same
    key.  To improve that we now use a simple cache to store a retrieved
    keyblock in certain cases.  In theory this caching could also be done
    for old keyrings, but it is a bit more work and questionable whether
    it is needed; the keybox scheme is anyway much faster than keyrings.
    
    Using a keybox with 20000 384 bit ECDSA/ECHD keypairs and a 252 byte
    sample text we get these values for encrypt and decrypt operations on
    an Core i5 4*3.33Ghz system.  The option --trust-model=always is used.
    Times are given in milliseconds wall time.
    
    |           | enc | dec | dec,q |
    |-----------+-----+-----+-------|
    | key 1     |  48 |  96 |    70 |
    | key 10000 |  60 |  98 |    80 |
    | key 20000 |  69 | 106 |    88 |
    | 10 keys   | 540 | 290 |    70 |
    
    The 10 keys test uses a mix of keys, the first one is used for
    decryption but all keys are looked up so that information about are
    printed.  The last column gives decryption results w/o information
    printing (--quiet).
    
    The keybox is always scanned sequentially without using any index.  By
    adding an index to the keybox it will be possible to further reduce
    the time required for keys stored to the end of the file.

diff --git a/common/iobuf.c b/common/iobuf.c
index 3ba3582..a305830 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -2311,7 +2311,7 @@ iobuf_seek (iobuf_t a, off_t newpos)
 	}
       clearerr (fp);
     }
-  else
+  else if (a->use != 3)  /* Not a temp stream.  */
     {
       for (; a; a = a->chain)
 	{
@@ -2338,7 +2338,8 @@ iobuf_seek (iobuf_t a, off_t newpos)
 	}
 #endif
     }
-  a->d.len = 0;			/* discard buffer */
+  if (a->use != 3)
+    a->d.len = 0;	/* Discard the buffer  unless it is a temp stream.  */
   a->d.start = 0;
   a->nbytes = 0;
   a->nlimit = 0;
diff --git a/g10/keydb.c b/g10/keydb.c
index 7166203..79ab5af 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -72,10 +72,42 @@ struct keydb_handle
 };
 
 
+/* This is a simple cache used to return the last result of a
+   successful long kid search.  This works only for keybox resources
+   because (due to lack of a copy_keyblock function) we need to store
+   an image of the keyblock which is fortunately instantly available
+   for keyboxes.  */
+enum keyblock_cache_states {
+  KEYBLOCK_CACHE_EMPTY,
+  KEYBLOCK_CACHE_PREPARED,
+  KEYBLOCK_CACHE_FILLED
+};
+
+struct {
+  enum keyblock_cache_states state;
+  u32 kid[2];
+  iobuf_t iobuf; /* Image of the keyblock.  */
+  u32 *sigstatus;
+  int pk_no;
+  int uid_no;
+} keyblock_cache;
+
+
 static int lock_all (KEYDB_HANDLE hd);
 static void unlock_all (KEYDB_HANDLE hd);
 
 
+static void
+keyblock_cache_clear (void)
+{
+  keyblock_cache.state = KEYBLOCK_CACHE_EMPTY;
+  xfree (keyblock_cache.sigstatus);
+  keyblock_cache.sigstatus = NULL;
+  iobuf_close (keyblock_cache.iobuf);
+  keyblock_cache.iobuf = NULL;
+}
+
+
 /* Handle the creation of a keyring or a keybox if it does not yet
    exist.  Take into acount that other processes might have the
    keyring/keybox already locked.  This lock check does not work if
@@ -427,6 +459,9 @@ keydb_new (void)
   KEYDB_HANDLE hd;
   int i, j;
 
+  if (DBG_CLOCK)
+    log_clock ("keydb_new");
+
   hd = xmalloc_clear (sizeof *hd);
   hd->found = -1;
 
@@ -787,6 +822,19 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
   if (!hd)
     return gpg_error (GPG_ERR_INV_ARG);
 
+  if (keyblock_cache.state == KEYBLOCK_CACHE_FILLED)
+    {
+      iobuf_seek (keyblock_cache.iobuf, 0);
+      err = parse_keyblock_image (keyblock_cache.iobuf,
+                                  keyblock_cache.pk_no,
+                                  keyblock_cache.uid_no,
+                                  keyblock_cache.sigstatus,
+                                  ret_kb);
+      if (err)
+        keyblock_cache_clear ();
+      return err;
+    }
+
   if (hd->found < 0 || hd->found >= hd->used)
     return gpg_error (GPG_ERR_VALUE_NOT_FOUND);
 
@@ -810,13 +858,27 @@ keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb)
           {
             err = parse_keyblock_image (iobuf, pk_no, uid_no, sigstatus,
                                         ret_kb);
-            xfree (sigstatus);
-            iobuf_close (iobuf);
+            if (!err && keyblock_cache.state == KEYBLOCK_CACHE_PREPARED)
+              {
+                keyblock_cache.state     = KEYBLOCK_CACHE_FILLED;
+                keyblock_cache.sigstatus = sigstatus;
+                keyblock_cache.iobuf     = iobuf;
+                keyblock_cache.pk_no     = pk_no;
+                keyblock_cache.uid_no    = uid_no;
+              }
+            else
+              {
+                xfree (sigstatus);
+                iobuf_close (iobuf);
+              }
           }
       }
       break;
     }
 
+  if (keyblock_cache.state != KEYBLOCK_CACHE_FILLED)
+    keyblock_cache_clear ();
+
   return err;
 }
 
@@ -914,6 +976,8 @@ keydb_update_keyblock (KEYDB_HANDLE hd, kbnode_t kb)
   if (!hd)
     return gpg_error (GPG_ERR_INV_ARG);
 
+  keyblock_cache_clear ();
+
   if (hd->found < 0 || hd->found >= hd->used)
     return gpg_error (GPG_ERR_VALUE_NOT_FOUND);
 
@@ -957,6 +1021,8 @@ keydb_insert_keyblock (KEYDB_HANDLE hd, kbnode_t kb)
   if (!hd)
     return gpg_error (GPG_ERR_INV_ARG);
 
+  keyblock_cache_clear ();
+
   if (opt.dry_run)
     return 0;
 
@@ -1017,6 +1083,8 @@ keydb_delete_keyblock (KEYDB_HANDLE hd)
   if (!hd)
     return gpg_error (GPG_ERR_INV_ARG);
 
+  keyblock_cache_clear ();
+
   if (hd->found < 0 || hd->found >= hd->used)
     return gpg_error (GPG_ERR_VALUE_NOT_FOUND);
 
@@ -1113,6 +1181,8 @@ keydb_rebuild_caches (int noisy)
 {
   int i, rc;
 
+  keyblock_cache_clear ();
+
   for (i=0; i < used_resources; i++)
     {
       if (!keyring_is_writable (all_resources[i].token))
@@ -1145,6 +1215,11 @@ keydb_search_reset (KEYDB_HANDLE hd)
   if (!hd)
     return gpg_error (GPG_ERR_INV_ARG);
 
+  keyblock_cache_clear ();
+
+  if (DBG_CLOCK)
+    log_clock ("keydb_search_reset");
+
   hd->current = 0;
   hd->found = -1;
   /* Now reset all resources.  */
@@ -1166,6 +1241,52 @@ keydb_search_reset (KEYDB_HANDLE hd)
 }
 
 
+static void
+dump_search_desc (const char *text, KEYDB_SEARCH_DESC *desc, size_t ndesc)
+{
+  int n;
+  const char *s;
+
+  for (n=0; n < ndesc; n++)
+    {
+      switch (desc[n].mode)
+        {
+        case KEYDB_SEARCH_MODE_NONE:      s = "none";      break;
+        case KEYDB_SEARCH_MODE_EXACT:     s = "exact";     break;
+        case KEYDB_SEARCH_MODE_SUBSTR:    s = "substr";    break;
+        case KEYDB_SEARCH_MODE_MAIL:      s = "mail";      break;
+        case KEYDB_SEARCH_MODE_MAILSUB:   s = "mailsub";   break;
+        case KEYDB_SEARCH_MODE_MAILEND:   s = "mailend";   break;
+        case KEYDB_SEARCH_MODE_WORDS:     s = "words";     break;
+        case KEYDB_SEARCH_MODE_SHORT_KID: s = "short_kid"; break;
+        case KEYDB_SEARCH_MODE_LONG_KID:  s = "long_kid";  break;
+        case KEYDB_SEARCH_MODE_FPR16:     s = "fpr16";     break;
+        case KEYDB_SEARCH_MODE_FPR20:     s = "fpr20";     break;
+        case KEYDB_SEARCH_MODE_FPR:       s = "fpr";       break;
+        case KEYDB_SEARCH_MODE_ISSUER:    s = "issuer";    break;
+        case KEYDB_SEARCH_MODE_ISSUER_SN: s = "issuer_sn"; break;
+        case KEYDB_SEARCH_MODE_SN:        s = "sn";        break;
+        case KEYDB_SEARCH_MODE_SUBJECT:   s = "subject";   break;
+        case KEYDB_SEARCH_MODE_KEYGRIP:   s = "keygrip";   break;
+        case KEYDB_SEARCH_MODE_FIRST:     s = "first";     break;
+        case KEYDB_SEARCH_MODE_NEXT:      s = "next";      break;
+        default:                          s = "?";         break;
+        }
+      if (!n)
+        log_debug ("%s: mode=%s", text, s);
+      else
+        log_debug ("%*s  mode=%s", (int)strlen (text), "", s);
+      if (desc[n].mode == KEYDB_SEARCH_MODE_LONG_KID)
+        log_printf (" %08lX%08lX", (unsigned long)desc[n].u.kid[0],
+                    (unsigned long)desc[n].u.kid[1]);
+      else if (desc[n].mode == KEYDB_SEARCH_MODE_SHORT_KID)
+        log_printf (" %08lX", (unsigned long)desc[n].u.kid[1]);
+      else if (desc[n].mode == KEYDB_SEARCH_MODE_SUBSTR)
+        log_printf (" '%s'", desc[n].u.name);
+    }
+}
+
+
 /*
  * Search through all keydb resources, starting at the current
  * position, for a keyblock which contains one of the keys described
@@ -1184,6 +1305,19 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
   if (DBG_CLOCK)
     log_clock ("keydb_search enter");
 
+  if (DBG_CACHE)
+    dump_search_desc ("keydb_search", desc, ndesc);
+
+  if (ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID
+      && keyblock_cache.state  == KEYBLOCK_CACHE_FILLED
+      && keyblock_cache.kid[0] == desc[0].u.kid[0]
+      && keyblock_cache.kid[1] == desc[0].u.kid[1])
+    {
+      if (DBG_CLOCK)
+        log_clock ("keydb_search leave (cached)");
+      return 0;
+    }
+
   rc = -1;
   while ((rc == -1 || gpg_err_code (rc) == GPG_ERR_EOF)
          && hd->current >= 0 && hd->current < hd->used)
@@ -1210,11 +1344,22 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
         hd->found = hd->current;
     }
 
+  rc = ((rc == -1 || gpg_err_code (rc) == GPG_ERR_EOF)
+        ? gpg_error (GPG_ERR_NOT_FOUND)
+        : rc);
+
+  keyblock_cache_clear ();
+  if (!rc && ndesc == 1 && desc[0].mode == KEYDB_SEARCH_MODE_LONG_KID)
+    {
+      keyblock_cache.state = KEYBLOCK_CACHE_PREPARED;
+      keyblock_cache.kid[0] = desc[0].u.kid[0];
+      keyblock_cache.kid[1] = desc[0].u.kid[1];
+    }
+
   if (DBG_CLOCK)
-    log_clock ("keydb_search leave");
-  return ((rc == -1 || gpg_err_code (rc) == GPG_ERR_EOF)
-          ? gpg_error (GPG_ERR_NOT_FOUND)
-          : rc);
+    log_clock (rc? "keydb_search leave (not found)"
+                 : "keydb_search leave (found)");
+  return rc;
 }
 
 
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c
index 254e810..a69536e 100644
--- a/g10/pubkey-enc.c
+++ b/g10/pubkey-enc.c
@@ -77,6 +77,9 @@ get_session_key (PKT_pubkey_enc * k, DEK * dek)
   PKT_public_key *sk = NULL;
   int rc;
 
+  if (DBG_CLOCK)
+    log_clock ("get_session_key enter");
+
   rc = openpgp_pk_test_algo2 (k->pubkey_algo, PUBKEY_USAGE_ENC);
   if (rc)
     goto leave;
@@ -129,6 +132,8 @@ get_session_key (PKT_pubkey_enc * k, DEK * dek)
 
 leave:
   free_public_key (sk);
+  if (DBG_CLOCK)
+    log_clock ("get_session_key leave");
   return rc;
 }
 
@@ -149,6 +154,9 @@ get_it (PKT_pubkey_enc *enc, DEK *dek, PKT_public_key *sk, u32 *keyid)
   size_t fpn;
   const int pkalgo = map_pk_openpgp_to_gcry (sk->pubkey_algo);
 
+  if (DBG_CLOCK)
+    log_clock ("decryption start");
+
   /* Get the keygrip.  */
   err = hexkeygrip_from_pk (sk, &keygrip);
   if (err)
@@ -321,6 +329,8 @@ get_it (PKT_pubkey_enc *enc, DEK *dek, PKT_public_key *sk, u32 *keyid)
       err = gpg_error (GPG_ERR_WRONG_SECKEY);
       goto leave;
     }
+  if (DBG_CLOCK)
+    log_clock ("decryption ready");
   if (DBG_CIPHER)
     log_printhex ("DEK is:", dek->key, dek->keylen);
 

commit 5c565512b8af73bee2a176530663154b9277ef1c
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jan 8 14:35:27 2013 +0100

    Make log_clock easier to read.
    
    * common/logging.c (log_clock): Print in microseconds.

diff --git a/common/logging.c b/common/logging.c
index a8acb52..cdfd659 100644
--- a/common/logging.c
+++ b/common/logging.c
@@ -876,7 +876,7 @@ log_clock (const char *string)
   if (!initial)
     initial = now;
 
-  log_debug ("[%llu] %s", now - initial, string);
+  log_debug ("[%6llu] %s", (now - initial)/1000, string);
 #else
   /* You need to link with -ltr to enable the above code.  */
   log_debug ("[not enabled in the source] %s", string);

commit f3f5721e6843a08d1011875400f385b8cd5fe226
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jan 8 09:43:21 2013 +0100

    gpg: Remove a function wrapper.
    
    * g10/keydb.h (keydb_search): Remove macro.
    * g10/keydb.c (keydb_search2): Rename to keydb_search.  Change all
    callers.

diff --git a/g10/delkey.c b/g10/delkey.c
index 950af0e..22f2219 100644
--- a/g10/delkey.c
+++ b/g10/delkey.c
@@ -68,7 +68,7 @@ do_delete_key( const char *username, int secret, int force, int *r_sec_avail )
                   || desc.mode == KEYDB_SEARCH_MODE_FPR16
                   || desc.mode == KEYDB_SEARCH_MODE_FPR20);
     if (!rc)
-      rc = keydb_search (hd, &desc, 1);
+      rc = keydb_search (hd, &desc, 1, NULL);
     if (rc) {
 	log_error (_("key \"%s\" not found: %s\n"), username, g10_errstr (rc));
 	write_status_text( STATUS_DELETE_PROBLEM, "1" );
diff --git a/g10/export.c b/g10/export.c
index d8d9c05..7fbcb34 100644
--- a/g10/export.c
+++ b/g10/export.c
@@ -803,7 +803,7 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
       kek = NULL;
     }
 
-  while (!(err = keydb_search2 (kdbhd, desc, ndesc, &descindex)))
+  while (!(err = keydb_search (kdbhd, desc, ndesc, &descindex)))
     {
       int skip_until_subkey = 0;
       u32 keyid[2];
diff --git a/g10/getkey.c b/g10/getkey.c
index 0030f42..60429b6 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -2465,7 +2465,7 @@ lookup (getkey_ctx_t ctx, kbnode_t *ret_keyblock, int want_secret)
   int no_suitable_key = 0;
 
   rc = 0;
-  while (!(rc = keydb_search (ctx->kr_handle, ctx->items, ctx->nitems)))
+  while (!(rc = keydb_search (ctx->kr_handle, ctx->items, ctx->nitems, NULL)))
     {
       /* If we are searching for the first key we have to make sure
          that the next iteration does not do an implicit reset.
@@ -2890,7 +2890,7 @@ have_secret_key_with_kid (u32 *keyid)
   desc.mode = KEYDB_SEARCH_MODE_LONG_KID;
   desc.u.kid[0] = keyid[0];
   desc.u.kid[1] = keyid[1];
-  while (!result && !(err = keydb_search (kdbhd, &desc, 1)))
+  while (!result && !(err = keydb_search (kdbhd, &desc, 1, NULL)))
     {
       desc.mode = KEYDB_SEARCH_MODE_NEXT;
       err = keydb_get_keyblock (kdbhd, &keyblock);
diff --git a/g10/keydb.c b/g10/keydb.c
index 186f017..7166203 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -1173,8 +1173,8 @@ keydb_search_reset (KEYDB_HANDLE hd)
  * keyring was found.
  */
 gpg_error_t
-keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
-	       size_t ndesc, size_t *descindex)
+keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
+              size_t ndesc, size_t *descindex)
 {
   gpg_error_t rc;
 
@@ -1225,7 +1225,7 @@ keydb_search_first (KEYDB_HANDLE hd)
 
   memset (&desc, 0, sizeof desc);
   desc.mode = KEYDB_SEARCH_MODE_FIRST;
-  return keydb_search (hd, &desc, 1);
+  return keydb_search (hd, &desc, 1, NULL);
 }
 
 gpg_error_t
@@ -1235,7 +1235,7 @@ keydb_search_next (KEYDB_HANDLE hd)
 
   memset (&desc, 0, sizeof desc);
   desc.mode = KEYDB_SEARCH_MODE_NEXT;
-  return keydb_search (hd, &desc, 1);
+  return keydb_search (hd, &desc, 1, NULL);
 }
 
 gpg_error_t
@@ -1247,7 +1247,7 @@ keydb_search_kid (KEYDB_HANDLE hd, u32 *kid)
   desc.mode = KEYDB_SEARCH_MODE_LONG_KID;
   desc.u.kid[0] = kid[0];
   desc.u.kid[1] = kid[1];
-  return keydb_search (hd, &desc, 1);
+  return keydb_search (hd, &desc, 1, NULL);
 }
 
 gpg_error_t
@@ -1258,5 +1258,5 @@ keydb_search_fpr (KEYDB_HANDLE hd, const byte *fpr)
   memset (&desc, 0, sizeof desc);
   desc.mode = KEYDB_SEARCH_MODE_FPR;
   memcpy (desc.u.fpr, fpr, MAX_FINGERPRINT_LEN);
-  return keydb_search (hd, &desc, 1);
+  return keydb_search (hd, &desc, 1, NULL);
 }
diff --git a/g10/keydb.h b/g10/keydb.h
index 3ba9573..fb36c81 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -144,9 +144,8 @@ gpg_error_t keydb_delete_keyblock (KEYDB_HANDLE hd);
 gpg_error_t keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved);
 void keydb_rebuild_caches (int noisy);
 gpg_error_t keydb_search_reset (KEYDB_HANDLE hd);
-#define keydb_search(a,b,c) keydb_search2((a),(b),(c),NULL)
-gpg_error_t keydb_search2 (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
-                           size_t ndesc, size_t *descindex);
+gpg_error_t keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
+                          size_t ndesc, size_t *descindex);
 gpg_error_t keydb_search_first (KEYDB_HANDLE hd);
 gpg_error_t keydb_search_next (KEYDB_HANDLE hd);
 gpg_error_t keydb_search_kid (KEYDB_HANDLE hd, u32 *kid);
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 0be1e3f..0ec616b 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -1142,7 +1142,7 @@ keyidlist(strlist_t users,KEYDB_SEARCH_DESC **klist,int *count,int fakev3)
 	}
     }
 
-  while (!(rc = keydb_search (kdbhd, desc, ndesc)))
+  while (!(rc = keydb_search (kdbhd, desc, ndesc, NULL)))
     {
       if (!users)
 	desc[0].mode = KEYDB_SEARCH_MODE_NEXT;
diff --git a/g10/revoke.c b/g10/revoke.c
index 396b6d4..6e47691 100644
--- a/g10/revoke.c
+++ b/g10/revoke.c
@@ -222,7 +222,7 @@ gen_desig_revoke( const char *uname, strlist_t locusr )
     kdbhd = keydb_new ();
     rc = classify_user_id (uname, &desc, 1);
     if (!rc)
-      rc = keydb_search (kdbhd, &desc, 1);
+      rc = keydb_search (kdbhd, &desc, 1, NULL);
     if (rc) {
 	log_error (_("key \"%s\" not found: %s\n"),uname, g10_errstr (rc));
 	goto leave;
@@ -463,7 +463,7 @@ gen_revoke (const char *uname)
   kdbhd = keydb_new ();
   rc = classify_user_id (uname, &desc, 1);
   if (!rc)
-    rc = keydb_search (kdbhd, &desc, 1);
+    rc = keydb_search (kdbhd, &desc, 1, NULL);
   if (rc)
     {
       log_error (_("secret key \"%s\" not found: %s\n"),
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 6b228d2..24ed9df 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -2110,7 +2110,7 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
   desc.mode = KEYDB_SEARCH_MODE_FIRST;
   desc.skipfnc = search_skipfnc;
   desc.skipfncvalue = full_trust;
-  rc = keydb_search (hd, &desc, 1);
+  rc = keydb_search (hd, &desc, 1, NULL);
   if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
     {
       keys[nkeys].keyblock = NULL;
@@ -2184,7 +2184,8 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
       release_kbnode (keyblock);
       keyblock = NULL;
     }
-  while ( !(rc = keydb_search (hd, &desc, 1)) );
+  while (!(rc = keydb_search (hd, &desc, 1, NULL)));
+
   if (rc && gpg_err_code (rc) != GPG_ERR_NOT_FOUND)
     {
       log_error ("keydb_search_next failed: %s\n", g10_errstr(rc));

-----------------------------------------------------------------------

Summary of changes:
 common/iobuf.c   |    5 +-
 common/logging.c |    2 +-
 g10/delkey.c     |    2 +-
 g10/export.c     |    2 +-
 g10/getkey.c     |    4 +-
 g10/keydb.c      |  169 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 g10/keydb.h      |    5 +-
 g10/keyserver.c  |    2 +-
 g10/pubkey-enc.c |   10 +++
 g10/revoke.c     |    4 +-
 g10/trustdb.c    |    5 +-
 11 files changed, 183 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list