mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
gpg: Remove a function wrapper.
* g10/keydb.h (keydb_search): Remove macro. * g10/keydb.c (keydb_search2): Rename to keydb_search. Change all callers.
This commit is contained in:
parent
f6d7b3f1ee
commit
f3f5721e68
@ -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" );
|
||||
|
@ -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];
|
||||
|
@ -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);
|
||||
|
12
g10/keydb.c
12
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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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"),
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user