mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
dirmngr: New options --first and --next for KS_GET.
* dirmngr/server.c (cmd_ks_get): Add option --first and --next.
(start_command_handler): Free that new ldap state.
* dirmngr/ks-engine-ldap.c (struct ks_engine_ldap_local_s): New.
(ks_ldap_new_state, ks_ldap_clear_state): New.
(ks_ldap_free_state): New.
(return_one_keyblock): New. Mostly factored out from ....
(ks_ldap_get): here. Implement --first/--next feature.
* dirmngr/ks-action.c (ks_action_get): Rename arg ldap_only to
ks_get_flags.
* dirmngr/ks-engine.h (KS_GET_FLAG_ONLY_LDAP): New.
(KS_GET_FLAG_FIRST): New.
(KS_GET_FLAG_NEXT): New.
* dirmngr/dirmngr.h (struct server_control_s): Add member
ks_get_state.
(struct ks_engine_ldap_local_s): New forward reference.
--
This feature allows to fetch keyblock by keyblock from an LDAP server.
This way tools can process and maybe filter each keyblock in a more
flexible way. Here is an example where two keyblocks for one mail
address are returned:
$ gpg-connect-agent --dirmngr
> ks_get --ldap --first <foo@example.org>
[... First keyblock is returned ]
OK
> ks_get --next
[ ... Next keyblock is returned ]
OK
> ks_get --next
ERR 167772218 No data <Dirmngr>
GnuPG_bug_id: 6224
Backported-from-master: 4de98d4468
This commit is contained in:
parent
2b2f8a1a0c
commit
20cb9319d9
6 changed files with 352 additions and 140 deletions
|
@ -188,8 +188,10 @@ struct cert_ref_s
|
|||
};
|
||||
typedef struct cert_ref_s *cert_ref_t;
|
||||
|
||||
/* Forward reference; access only via ks-engine-ldap.c. */
|
||||
struct ks_engine_ldap_local_s;
|
||||
|
||||
/* Forward references; access only through server.c. */
|
||||
/* Forward reference; access only through server.c. */
|
||||
struct server_local_s;
|
||||
|
||||
#if SIZEOF_UNSIGNED_LONG == 8
|
||||
|
@ -206,6 +208,7 @@ struct server_control_s
|
|||
int no_server; /* We are not running under server control. */
|
||||
int status_fd; /* Only for non-server mode. */
|
||||
struct server_local_s *server_local;
|
||||
struct ks_engine_ldap_local_s *ks_get_state;
|
||||
int force_crl_refresh; /* Always load a fresh CRL. */
|
||||
|
||||
int check_revocations_nest_level; /* Internal to check_revovations. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue