1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

dirmngr: Support paged LDAP mode for KS_GET

* dirmngr/ks-engine-ldap.c (PAGE_SIZE): New.
(struct ks_engine_ldap_local_s): Add several new fields.
(ks_ldap_clear_state): Release them.
(search_and_parse): Factored out from ks_ldap_get and extended to
support the paged mode.
(ks_ldap_get):  Implement the pages mode for --first and --next.
* dirmngr/server.c (cmd_ks_get): Provide a dummy passphrase in --first
mode.
* dirmngr/Makefile.am (dirmngr_LDADD): Add LBER_LIBS.
--

The paged mode allows to retrieve more items than the servers usually
limit (e.g. 1000 for an LDS).  This patch also allows to use --first
without a patter to retrieve all keyblocks (except for disabled and
revoked keys).

GnuPG-bug-id: 6224
Backported-from-master: 7a01e806ea
This commit is contained in:
Werner Koch 2022-10-05 15:15:14 +02:00
parent 20cb9319d9
commit a70a3204c2
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 215 additions and 37 deletions

View file

@ -2583,6 +2583,17 @@ cmd_ks_get (assuan_context_t ctx, char *line)
goto leave;
}
if (!list && (flags & KS_GET_FLAG_FIRST))
{
/* Need to add a dummy pattern if no pattern is given. */
if (!add_to_strlist_try (&list, ""))
{
err = gpg_error_from_syserror ();
goto leave;
}
}
if ((flags & KS_GET_FLAG_NEXT))
{
if (list || (flags & ~KS_GET_FLAG_NEXT))