summaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-10-05 15:15:14 +0200
committerWerner Koch <wk@gnupg.org>2022-10-05 15:15:14 +0200
commit7a01e806eac4cd7a65eaf3e17dcd2f117ec2d327 (patch)
tree7fbc48e7f2921f1f77996c737df869cd82257d10 /dirmngr/server.c
parentdirmngr: New options --first and --next for KS_GET. (diff)
downloadgnupg2-7a01e806eac4cd7a65eaf3e17dcd2f117ec2d327.tar.xz
gnupg2-7a01e806eac4cd7a65eaf3e17dcd2f117ec2d327.zip
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
Diffstat (limited to 'dirmngr/server.c')
-rw-r--r--dirmngr/server.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c
index c97804277..04ebfd317 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -2585,6 +2585,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))