aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/ks-engine-ldap.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Replace GNUPG_GCC_A_ macros by GPGRT_ATTR_ macros.Werner Koch2015-07-261-1/+1
| | | | | | | | | | | | | * common/util.h: Provide replacement for GPGRT_ATTR_ macros when using libgpg-error < 1.20. * common/mischelp.h: Ditto. * common/types.h: Ditto. -- Given that libgpg-error is a dependency of all GnuPG related libraries it is better to define such macros at only one place instead of having similar macros at a lot of places. For now we need repalcement macros, though.
* dirmngr: Fix segfault in ldap engineKristian Fiskerstrand2015-05-071-1/+3
| | | | | (ks-engine-ldap.c) Fix segfault caused by missing check whether uri is initialized
* dirmngr,w32: Replace functions not available under Windows.Werner Koch2015-04-101-4/+5
| | | | | * dirmngr/ks-engine-ldap.c (extract_attributes): Replace isoptime and gmtime_r.
* dirmngr,w32: Avoid name clash with existing functionWerner Koch2015-04-101-6/+7
| | | | * dirmngr/ks-engine-ldap.c (ldap_connect): Rename to my_ldap_connect.
* dirmngr: Don't use alloca.Neal H. Walfield2015-03-311-2/+5
| | | | | | | | * dirmngr/ks-engine-ldap.c (ks_ldap_put): Replace use of alloca with xmalloc and xfree. -- Signed-off-by: Neal H. Walfield <[email protected]>
* dirmngr: Simplify truncation of long strings in debug code.Neal H. Walfield2015-03-311-17/+10
| | | | | | | | * dirmngr/ks-engine-ldap.c (modlist_dump): Simplify truncation of long strings. -- Signed-off-by: Neal H. Walfield <[email protected]>
* dirmngr: Correct indentation.Neal H. Walfield2015-03-311-108/+107
| | | | | -- Signed-off-by: Neal H. Walfield <[email protected]>
* dirmngr: Fix resource leaks and check rare errors.Werner Koch2015-03-251-23/+37
| | | | | | | | | | | | | * dirmngr/ks-engine-ldap.c (keyspec_to_ldap_filter): Fix resource leak. (ks_ldap_search): Check error from es_fopenmem. Use LDAP_ERR where required. (modlist_dump): Check error from es_fopenmem. (uncescape): s/int/size_t/. Use existing macros. (extract_attributes): Use existing trim function. (ks_ldap_put): Do not segv on error from modlist_dump. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Minor cleanups.Werner Koch2015-03-251-23/+21
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/ks-engine-ldap.c [__riscos__]: Remove doubled util.h. (ldap_to_gpg_err): s/GPG_ERR_GENERAL/GPG_ERR_INTERNAL/. (tm2ldaptime): Use snprintf. (ldap_connect): Get error code prior to log_error and and use modern function. Use xfree, xtrustrdup etc. (modlist_lookup): Use GNUPG_GCC_A_USED. (modlist_free): Use xfree. -- sprintf has been replaced by snprintf to avoid warnings on some platforms. xfree et al. is required so that replacement functions are used if defined. For example the Libgcrypt functions which may not be fully compatible with standard free. Impossible conditions should use GPG_ERR_INTERNAL. Signed-off-by: Werner Koch <[email protected]>
* Add support to talking to LDAP key servers.Neal H. Walfield2015-03-231-0/+2055
* g10/call-dirmngr.c (record_output): New function. (ks_put_inq_cb): Use it here to generate a --with-colons like output instead of a custom format. * dirmngr/ks-action.c: Include "ldap-parse-uri.h". (ks_action_help): If the provided URI is an LDAP URI, then use ldap_parse_uri to parse. Call ks_ldap_help. (ks_action_search): If passed an LDAP URI, then call ks_ldap_search. (ks_action_get): Likewise. (ks_action_put): Likewise. Also, change data from a 'const void *' to a 'void *' and add info and infolen parameters. Add note that function may modify DATA. * dirmngr/ks-action.h (ks_action_put): Update declaration accordingly. * dirmngr/server.c: Include "ldap-parse-uri.h". (cmd_keyserver): If ITEM->URI is an LDAP URI, parse it using ldap_parse_uri. (hlp_ks_put): Improve documentation. (cmd_ks_put): Also pass info and infolen to ks_action_put. Improve documentation. * dirmngr/ks-engine.h (ks_ldap_help): New declaration. (ks_ldap_search): Likewise. (ks_ldap_get): Likewise. (ks_ldap_put): Likewise. * dirmngr/ks-engine-ldap.c: New file. * dirmngr/Makefile.am (dirmngr_SOURCES): Add ks-engine-ldap.c, ldap-parse-uri.c and ldap-parse-uri.h. (dirmngr_LDADD) [USE_LDAP]: Add $(ldaplibs). -- Signed-off-by: Neal H. Walfield <[email protected]>