aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* dirmngr: Print a SOURCE status for WKD requests.Werner Koch2017-07-241-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/server.c (cmd_wkd_get): Print a SOURCE status. -- This status allows to see whether the the WKD requests has been resolved from the standard address or from a SRV record derived one. We return only host and port and not the .well-known suffix because that is obvious. HTTP redirects are not taken in account because they may chnage at any time due to load balancing etc and not relevant for gpg which may use the URL to detect changes in the WKD results. For example my current setup returns S SOURCE https://wkd.gnupg.org for [email protected]. Without a SRV record S SOURCE https://gnupg.org would have been returned. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New function dirmngr_status_printf.Werner Koch2017-07-241-0/+18
| | | | | | * dirmngr/server.c (dirmngr_status_printf): New. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Fix license note in server.cWerner Koch2017-07-121-15/+0
| | | | | | | | | | -- This double license note was accidentally added while only wanting to add another copyright line. Fixes-commit: 3419a339d9c4e800bf30e9021e05982d8c1021c1 Signed-off-by: Werner Koch <[email protected]>
* Change license of some files to LGPLv2.1.Werner Koch2017-06-191-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * COPYING.LIB: Rename to COPYING.LGPL3. * COPYING.LGPL21: New. * COPYING.GPL2: New. * Makefile.am: Distribute them. * AUTHORS: Update license pointers. Add BSI as copyright holder. * common/compliance.c, common/compliance.h: Add BSI copyright notice. Break overlong lines. * dirmngr/loadswdb.c: Add BSI copyright notices. * dirmngr/server.c: Ditto. * tools/call-dirmngr.c: Change license to LGPLv2.1. Add BSI copyright notice. * tools/call-dirmngr.h: Ditto. * tools/gpg-wks-client.c: Ditto. * tools/gpg-wks-server.c: Ditto. * tools/gpg-wks.h: Ditto. * tools/mime-maker.c: Ditto. * tools/mime-maker.h: Ditto. * tools/mime-parser.c: Ditto. * tools/mime-parser.h: Ditto. * tools/send-mail.c: Ditto. * tools/send-mail.h: Ditto. * tools/wks-receive.c: Ditto. * tools/wks-util.c: Ditto. * tools/rfc822parse.c, tools/rfc822parse.h: Change license to LGPLv2.1. -- For better deployment it seems to be better to make the Web Key Directory code more easily available. Some code was been developed under contract of the BSI. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Implement HTTP connect timeouts of 15 or 2 seconds.Werner Koch2017-06-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (oConnectTimeout, oConnectQuickTimeout): New enums. (opts): New options --connect-timeout and --connect-quick-timeout. (DEFAULT_CONNECT_TIMEOUT): New. (DEFAULT_CONNECT_QUICK_TIMEOUT): New. (parse_rereadable_options): Handle new options. (post_option_parsing): New. Use instead of direct calls to set_debug() and set_tor_mode (). (main): Setup default timeouts. (dirmngr_init_default_ctrl): Set standard connect timeout. * dirmngr/dirmngr.h (opt): New fields connect_timeout and connect_quick_timeout. (server_control_s): New field timeout. * dirmngr/ks-engine-finger.c (ks_finger_fetch): Pass timeout to http_raw_connect. * dirmngr/ks-engine-hkp.c (send_request): Call http_session_set_timeout. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/server.c (cmd_wkd_get, cmd_ks_search, cmd_ks_get) (cmd_ks_fetch): Implement --quick option. -- The standard connect timeouts are way to long so we add a timeout to the connect calls. Also implement the --quick option which is already used by gpg for non-important requests (e.g. looking up a key for verification). Signed-off-by: Werner Koch <[email protected]>
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-281-3/+3
| | | | | | | | | | -- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
* Remove -I option to common.NIIBE Yutaka2017-03-071-3/+3
| | | | | | | | | | | | | * dirmngr/Makefile.am (AM_CPPFLAGS): Remove -I$(top_srcdir)/common. * g10/Makefile.am (AM_CPPFLAGS): Ditto. * g13/Makefile.am (AM_CPPFLAGS): Ditto. * kbx/Makefile.am (AM_CPPFLAGS): Ditto. * scd/Makefile.am (AM_CPPFLAGS): Ditto. * sm/Makefile.am (AM_CPPFLAGS): Ditto. * tools/Makefile.am (AM_CPPFLAGS): Ditto. * Throughout: Follow the change. Signed-off-by: NIIBE Yutaka <[email protected]>
* Clean up word replication.Yuri Chornoivan2017-02-211-1/+1
| | | | | | | | | -- This fixes extra word repetitions (like "the the" or "is is") in the code and docs. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Add special treatment for the standard hkps pool to ntbtls.Werner Koch2017-02-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/validate.h (VALIDATE_FLAG_SYSTRUST): Remove (VALIDATE_FLAG_EXTRATRUST): Remove (VALIDATE_FLAG_TRUST_SYSTEM): New. (VALIDATE_FLAG_TRUST_CONFIG): New. (VALIDATE_FLAG_TRUST_HKP): New. (VALIDATE_FLAG_TRUST_HKPSPOOL): New. (VALIDATE_FLAG_MASK_TRUST): New. * dirmngr/validate.c (check_header_constants): New. (validate_cert_chain): Call new function. Simplify call to is_trusted_cert. * dirmngr/crlcache.c (crl_parse_insert): Pass VALIDATE_FLAG_TRUST_CONFIG to validate_cert_chain * dirmngr/server.c (cmd_validate): Use VALDIATE_FLAG_TRUST_SYSTEM and VALIDATE_FLAG_TRUST_CONFIG. * dirmngr/http-ntbtls.c (gnupg_http_tls_verify_cb): Check provided TLS context. Set trustclass flags using the new VALIDATE_FLAG_TRUST values. * dirmngr/certcache.c (cert_cache_init): Load the standard pool certificate prior to the --hkp-cacerts. -- Note that this changes the way the standard cert is used: We require that it is installed at /usr/share/gnupg and we do not allow to change it. If this is not desired, the the standard cert can be removed or replaced by a newer one. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New Assuan option "http-crl".Werner Koch2017-02-211-0/+5
| | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (server_control_s): New flag 'http_no_crl'. * dirmngr/dirmngr.c (dirmngr_init_default_ctrl): Set this flag. * dirmngr/server.c (option_handler): New option "http-crl" * dirmngr/http.h (HTTP_FLAG_NO_CRL): New flag. * dirmngr/http-ntbtls.c (gnupg_http_tls_verify_cb): Consult this flag. * dirmngr/ks-engine-hkp.c (send_request): Set flag depending on CTRL. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/t-http.c (main): New option --no-crl. -- This new option can be used to enable CRL checks on a per session base. The default is not to use CRLs for https connections. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add per-session verify callback to http.cWerner Koch2017-02-181-7/+8
| | | | | | | | | | | | | | | | | | | * dirmngr/http.h (http_verify_cb_t): New type. * dirmngr/http.c (http_session_s): Add fields flags, verify_cb, and verify_cb_value. (http_session_new): Remove arg tls_priority. Add args verify_cb and verify-cb_value. Store them in the session object. (send_request): Use per-session verify callback. (http_verify_server_credentials) [HTTP_USE_NTBTLS]: Return GPG_ERR_NOT_IMPLEMENTED. * dirmngr/ks-engine-hkp.c (send_request): Adjust for changed http_session_new. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/t-http.c (main): Ditto. * dirmngr/server.c (do_get_cert_local): Replace xmalloc by malloc. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add option --no-crl to the VALIDATE cmd.Werner Koch2017-02-171-11/+10
| | | | | | | | | | | | | | | * dirmngr/validate.h: Remove enums VALIDATE_MODE_*. (VALIDATE_FLAG_SYSTRUST, VALIDATE_FLAG_EXTRATRUST) (VALIDATE_FLAG_CRL, VALIDATE_FLAG_RECURSIVE) (VALIDATE_FLAG_OCSP, VALIDATE_FLAG_TLS) (VALIDATE_FLAG_NOCRLCHECK): New constants. * dirmngr/validate.c (validate_cert_chain): Change arg 'mode' to 'flags'. Change code accordingly. Remove NO-CRL in TLS mode kludge. * dirmngr/crlcache.c (crl_parse_insert): Change to use flag values for the validate_cert_chain call. * dirmngr/server.c (cmd_validate): Ditto. Add new option --no-crl. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add options --tls and --systrust to the VALIDATE cmd.Werner Koch2017-02-171-20/+84
| | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/certcache.h (certlist_s, certlist_t): New. * dirmngr/certcache.c (read_certlist_from_stream): New. (release_certlist): New. * dirmngr/server.c (MAX_CERTLIST_LENGTH): New. (cmd_validate): Add options --tls and --systrust. Implement them using a kludge for now. * dirmngr/validate.c (validate_cert_chain): Support systrust checking. Add kludge to disable the CRL checking for tls mode. -- This can now be used to test a list of certificates as returned by TLS. Put the certs PEM encoded into a a file certlist.pem with the target certificate being the first. Then run gpg-connect-agent --dirmngr \ '/definqfile CERTLIST wiki-gnupg-chain.pem' \ 'validate --systrust --tls' /bye CRLS check has been disabled becuase we can't yet pass the systrust flag to the CRL checking code. Signed-off-by: Werner Koch <[email protected]>
* indent: Reformat and extend some comments in dirmngr.Werner Koch2017-02-161-15/+14
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Replace stpcpy chains by strconcat.Werner Koch2017-02-161-7/+2
| | | | | | | | | | | | * dirmngr/certcache.c (find_cert_bysn): Use strconcat. (find_cert_bysubject): Ditto. * dirmngr/http.c (store_header): Ditto. * dirmngr/ldap.c (make_url): Ditto. * dirmngr/server.c (get_cert_local_ski): Ditto. (do_get_cert_local): Use xstrconcat. -- Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New option --no-use-tor and internal changes.Werner Koch2017-02-011-3/+7
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (disable_dns_tormode): New. * dirmngr/dirmngr.c (oNoUseTor): New const. (opts): New option --no-use-tor. (tor_mode): New var. (parse_rereadable_options): Change to use TOR_MODE. (dirmngr_use_tor): New. (set_tor_mode): Call disable_dns_tormode. Implement oNoUseTor. * dirmngr/dirmngr.h (opt): Remove field 'use_tor'. Replace all references by a call to dirmngr_use_tor(). * dirmngr/server.c (cmd_getinfo): Distinguish between default and enforced TOR_MODE. -- This patch replaces the global variable opt.use_tar by a function testing a file local mode flag. This patch prepares for a use-tor-if-available mode. GnuPG-bug-id: 2935 Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Implement experimental SRV record lookup for WKD.Werner Koch2017-01-081-1/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/server.c (cmd_wkd_get): Support SRV records. -- This patch changes the way a WKD query is done. Now we first look for a SRV record for service "openpgpkey" and port "tcp" under the to-be-queried domain. If such a record was found and the target host matches the to-be-queried domain or is a suffix to that domain, that target host is used instead of the domain name. The SRV record also allows to change the port and obviously can be used for load-balancing. For example a query for the submission address of example.org with the SRV record specification _openpgpkey._tcp IN SRV 0 0 0 wkd.foo.org. IN SRV 0 0 0 wkd.example.net. IN SRV 0 0 4711 wkd.example.org. (queried using the name "_openpgpkey._tcp.example.org") would fetch from this URL: https://wkd.example.org:4711/.well-known/openpgpkey/submission-address Note that the first two SRV records won't be used because foo.org and example.net do not match example.org. We require that the target host is identical to the domain or be a subdomain of it. This is so that an attacker modifying the SRV records needs to setup a server in a sub-domain of the actual domain and can't use an arbitrary domain. Whether this is a sufficient requirement is not clear and needs further discussion. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Make sure Tor mode is also set for DNS on SIGHUP.Werner Koch2017-01-031-7/+0
| | | | | | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (enable_dns_tormode): Always succeed. (reload_dns_stuff): Reset tor port. * dirmngr/dirmngr.c (set_tor_mode): Also enable Tor mode for DNS. (main): Remove warning that Tor mode may not fully work. * dirmngr/server.c (cmd_dns_cert): Remove explicit Tor for DNS initialization. * dirmngr/t-dns-stuff.c (main): Remove option --new-circuit and error checking for enable_dns_tormode. -- This patch also resets the port on SIGHUP so that after starting Tor SIGHUP is sufficient to use Tor. Without the SIGHUP and when not using the Tor browser Dirmngr would keep on trying the Tor browser port. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New configure option --disable-libdns.Werner Koch2016-12-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Add option --disable-libdns (USE_LIBDNS): New ac_subst and am_conditional. (USE_C99_CFLAGS): Set only if libdns is used. * dirmngr/Makefile.am (dirmngr_SOURCES): Move dns.c and dns.h to ... (dirmngr_SOURCES) [USE_LIBDNS0: here. (t_common_src): Ditto. * dirmngr/dirmngr.c (oRecursiveResolver): New constant. (opts): New option "--recursive-resolver". (parse_rereadable_options): Set option. * dirmngr/t-dns-stuff.c (main): Add option --recursive-resolver. * dirmngr/server.c (cmd_getinfo): Depend output of "dnsinfo" on the new variables. * dirmngr/dns-stuff.c: Include dns.h only if USE_DNSLIB is defined. Also build and call dnslib functions only if USE_DNSLIB is defined. (recursive_resolver): New var. (enable_recursive_resolver): New func. (recursive_resolver_p): New func. -- In case users run into problems building GnuPG, the configure option allows to disable that support and continue w/o Tor support using the system resolver. --recursive-resolver was easy enough to implement and may be useful in some situation. It does not fully work, though. Signed-off-by: Werner Koch <[email protected]>
* dirmngr,build: Remove support for ADNS.Justus Winter2016-12-141-6/+0
| | | | | | | | | | | | | | | * autogen.rc: Remove '--with-adns' argument. * configure.ac: Remove check for ADNS. * dirmngr/dns-stuff.c: Remove all code that uses ADNS. * dirmngr/server.c (cmd_getinfo): Update status line. * doc/dirmngr.texi: Do not mention ADNS. -- We used ADNS to support queries over Tor. However, our patch to ADNS that adds Tor support was never accepted upstream. Furthermore, there are other shortcomings that let us to consider alternatives. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Add option --standard-resolver.Werner Koch2016-12-011-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (oStandardResolver): New constant. (opts): New option --standard-resolver. (parse_rereadable_options): Set option. * dirmngr/dns-stuff.c: Refactor all code to support the new option. (standard_resolver): New var. (enable_standard_resolver, standard_resolver_p): New func. * dirmngr/http.c (connect_server): Remove USE_DNS_SRV build conditional. * dirmngr/ks-engine-hkp.c (map_host): Ditto. * dirmngr/server.c (cmd_getinfo) <dnsinfo>: Take care of new option * configure.ac (HAVE_ADNS_IF_TORMODE): Remove var ADNSLIB. ac_define USE_ADNS in the adns checking code. Remove options --disable-dns-srv and --disable-dns-cert. Always look for the system resolver. Print warning if no system resolver was found. (USE_DNS_CERT, USE_DNS_SRV): Remove ac_defines. (HAVE_SYSTEM_RESOLVER): New ac_define. (USE_DNS_SRV): Remove am_conditional; not used anyway. -- This option allows for runtime switching to the system's standard resolver. This is mainly useful to work around possible bugs in the optional resolver libraries (as of now ADNS). Note that on Windows there is no code to use systems's resolver and thus for full functionality dirmngr must be build with a separate resolver. This patch also does way with configure options to disable the use of CERT and SRV records. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Use a default keyserver if none is explicitly setDaniel Kahn Gillmor2016-11-171-1/+5
| | | | | | | | | | | | | | | | | | * configure.ac: Define DIRMNGR_DEFAULT_KEYSERVER. * dirmngr/server.c (ensure_keyserver): Use it if no keyservers are set. * doc/dirmngr.texi: Document this behavior. -- A user who doesn't specify a keyserver, but asks gnupg to fetch a key currently just gets a simple error messages "No keyserver available". If the user is asking to contact a keyserver, we should have a reasonable default, and not require them to fiddle with settings when they might not know what settings to choose. This patch makes the default hkps://hkps.pool.sks-keyservers.net. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Add command to only load the swdb.Werner Koch2016-11-161-385/+17
| | | | | | | | | | | | | | | | | | | | | | | * dirmngr/loadswdb.c: New. * dirmngr/Makefile.am (dirmngr_SOURCES): Add that file. * dirmngr/server.c: Remove includes cpparray.h and exectool.h. (cmd_loadswdb): New. (parse_version_number,parse_version_string): Remove. (my_mktmpdir, cmp_version): Remove. (fetch_into_tmpdir): Remove. (struct verify_swdb_parm_s): Remove. (verify_swdb_status_cb): Remove. (cmd_versioncheck): Remove. (register_commands): Register LOADSWDB. Remove VERSIONCHECK. -- This change is required to to the new design where gpgconf does the version check w/o network access and only dirmngr is responsible for getting the swdb. In the next installment the loading will be triggered as needed. Signed-off-by: Werner Koch <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* dirmngr: Fix signature checking.Werner Koch2016-10-271-25/+76
| | | | | | | | | | | | | | * dirmngr/server.c: Include cpparray.h. (verify_swdb_parm_s): New. (verify_swdb_status_cb): New. (cmd_versioncheck): Use gpgv to correclty verify the signature. Rename some variable to comply with GNU standards. -- Relying on the return code of gpg is not a robust way to check signatures. We better use our dedicated tool. Signed-off-by: Werner Koch <[email protected]>
* Fix typos.Justus Winter2016-10-271-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* dirmngr: report actual socket name.Daniel Kahn Gillmor2016-10-271-1/+1
| | | | | | | | | | | | | | * dirmngr/dirmngr.[ch] (dirmngr_get_current_socket_name): new function to report known socket name. * dirmngr/server.c (cmd_getinfo): use dirmngr_get_current_socket_name to report correct socket name. -- This fixes the output of 'getinfo socket_name' when dirmngr is invoked with --socket-name. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Fix help string and argument.NIIBE Yutaka2016-10-271-2/+2
| | | | | | | | * dirmngr/server.c (hlp_versioncheck): Add a newline. (cmd_versioncheck): Fix argument. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Allow command VERSIONCHECK to handle 3 part version numbers.Werner Koch2016-10-251-35/+83
| | | | | | | | | | * dirmngr/server.c (parse_version_string): Add arg MICRO and set it. (cmp_version): Extend to handle the MICRO part. (confucius_mktmpdir): Rename to my_mktmpdir. (my_mktmpdir): xstrconcat does not fail; use strconcat. (fetch_into_tmpdir): Improve error checking. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Fix segfault in VERSIONCHECK.Kai Michaelis2016-10-241-2/+2
| | | | | * dirmngr/server.c (cmd_versioncheck): The VERSIONCHECK command crashes when called without program version.
* dirmngr: improve VERSIONCHECKKai Michaelis2016-10-191-99/+133
| | | | | Replace strtok_r() and code formatting. Use code from libgpg-error for version comparison.
* dirmngr: use gnupg_mkdtemp instead of mkstempKai Michaelis2016-10-141-20/+44
| | | | MinGW on debian does not support mkstemp.
* dirmngr: add VERSIONCHECK commandKai Michaelis2016-10-141-0/+227
| | | | | | | Given an application name and version VERSIONCHECK fetches the software version list from version.gnupg.org, verifies the signature and returns whenever the given version is older (UPDATE), current (CURRENT) or newer (ROLLBACK).
* spelling: conenction should be connectionDaniel Kahn Gillmor2016-09-151-1/+1
| | | | | | * dirmngr/server.c, sm/server.c: s/conenction/connection/ Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Exclude D lines from the IPC debug output.Werner Koch2016-09-051-4/+72
| | | | | | | | | | | | | | | | * dirmngr/dirmngr.h: Include asshelp.h. * dirmngr/server.c (server_local_s): Add inhibit_dara_logging fields. (data_line_write): Implement logging inhibit. (data_line_cookie_close): Print non-logged D lines. (cmd_wkd_get, cmd_ks_get, cmd_ks_fetch): Do not log D lines. (dirmngr_assuan_log_monitor): New. * dirmngr/dirmngr.c (main): Register monitor function. -- In particular with large keys the D lines clutter the log output and make it unusable. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add --policy-flags option to WKD_GET.Werner Koch2016-09-021-3/+12
| | | | | | * dirmngr/server.c (cmd_wkd_get): Add new option. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Remove all system daemon features.Werner Koch2016-08-181-43/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (opts): Remove fields 'system_service' and 'system_daemon'. * common/homedir.c (dirmngr_sys_socket_name): Remove. (dirmngr_user_socket_name): Rename to ... (dirmngr_socket_name): this. Change call callers. * common/asshelp.c (start_new_dirmngr): Remove the system socket feature. * tools/gpgconf.c (list_dirs): Do not print "dirmngr-sys-socket". * sm/server.c (gpgsm_server): Adjust for removed system socket feature. * dirmngr/server.c (cmd_getinfo): Ditto. (cmd_killdirmngr): Remove check for system daemon. (cmd_reloaddirmngr): Ditto. * dirmngr/dirmngr.c (USE_W32_SERVICE): Remove macro. (aService): Remove. (opts): Remove --service. (w32_service_control): Remove. (real_main, call_real_main) [W32]: Remove wrapper. (main): Remove Windows system service feature. Remove system dameon feature. Use only the "~/.gnupg/dirmngr_ldapservers.conf" file. * dirmngr/certcache.c (load_certs_from_dir): Remove warning in the system dameon case. * dirmngr/crlcache.c (DBDIR_D): Always use "~/.gnupg/crls.d". * dirmngr/ocsp.c (validate_responder_cert): Do not call validate_cert_chain which was used only in system daemon mode. * dirmngr/validate.c (validate_cert_chain): Always use the code. -- We are now starting dirmngr as needed as a user daemon. The deprecated system daemon mode does not anymore make sense. In case a system wide daemon is required, it is better to setup a dedicated account to run dirmngr and tweak socket permissions accordingly. Signed-off-by: Werner Koch <[email protected]>
* build: Require latest released librariesWerner Koch2016-07-141-7/+2
| | | | | | | | | | | | | | * agent/protect.c (OCB_MODE_SUPPORTED): Remove macro. (do_encryption): Always support OCB. (do_decryption): Ditto. (agent_unprotect): Ditto. * dirmngr/server.c (is_tor_running): Unconditionally build this. -- Although not technically required, it is easier to require them to avoid bug reports due to too old library versions. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: add option to retrieve extra WKS info.Werner Koch2016-06-281-8/+22
| | | | | | * dirmngr/server.c (cmd_wkd_get): Add option --submission-address. Signed-off-by: Werner Koch <[email protected]>
* Replace use of opt.homedir by accessor functions.Werner Koch2016-06-071-16/+7
| | | | | | | | | | | | | | | | | | | * common/homedir.c (the_gnupg_homedir): New var. (gnupg_set_homedir): New. (gnupg_homedir): New. * g10/options.h (struct opt): Remove 'homedir' and replace all users by the new accessor functions. * g13/g13-common.h (struct opt): Ditto. * scd/scdaemon.h (struct opt): Ditto. * sm/gpgsm.h (struct opt): Ditto. * dirmngr/dirmngr.h (struct opt): Ditto. * agent/preset-passphrase.c (opt_homedir): Ditto. * agent/protect-tool.c (opt_homedir): Ditto. -- This will make detection of a non-default homedir easier. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Adjust the WKD lookup to specs version -01.Werner Koch2016-05-181-2/+0
| | | | | | | | | * dirmngr/server.c (cmd_wkd_get): Remove second occurrence of the domain part. -- This change updates gnupg to comply with draft-koch-openpgp-webkey-service-01
* dirmngr: Add experimental command WKD_GET.Werner Koch2016-04-271-4/+74
| | | | | | | * dirmngr/server.c (cmd_wkd_get): New. (register_commands): Add command WKD_GET. Signed-off-by: Werner Koch <[email protected]>
* common: Consolidate Assuan server argument handling.Justus Winter2016-03-021-72/+1
| | | | | | | | | | | | | | | * common/Makefile.am (common_sources): Add new files. * common/server-help.c: New file. * common/server-help.h: Likewise. * agent/command.c: Drop argument handling primitives in favor of using the consolidated ones. * dirmngr/server.c: Likewise. * g10/server.c: Likewise. * g13/server.c: Likewise. * scd/command.c: Likewise. * sm/server.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Add command to print the resolver version.Werner Koch2015-12-041-0/+12
| | | | * dirmngr/server.c (cmd_getinfo): Add sub-command "dnsinfo".
* dirmngr: Switch to an onion address if Tor is running.Werner Koch2015-12-021-26/+118
| | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (opt): Turn field 'keyserver' into an strlist. * dirmngr/dirmngr.c (parse_rereadable_options): Allow multiple --keyserver options. * dirmngr/server.c (server_local_s): Add field 'tor_state'. (release_uri_item_list): New. (release_ctrl_keyservers): Use it. (start_command_handler): Release list of keyservers. (is_tor_running): New. (cmd_getinfo): Re-implement "tor" subcommand using new fucntion. (ensure_keyserver): Rewrite. * g10/dirmngr-conf.skel: Add two keyserver options. -- This feature is independent of --use-tor and automagically uses Tor if available. The dirmngr.conf file needs to specify two keyservers to make this work. For new installations this is done using the skeleton file. This feature requires the Libassuan 2.4.2 to work. This patch also fixes a memory leak of opt.keyserver en passant. Signed-off-by: Werner Koch <[email protected]>
* Silence compiler warnings related to not using assuan_fd_t.Werner Koch2015-11-271-2/+2
| | | | | | | | | | | | * common/call-gpg.c (start_gpg): Use assuan_fd_t. Note that the declaration was already fixed by a previous change. * dirmngr/server.c (cmd_getinfo): Use assuan_fd_t. -- Note that this matters only for Windows and it does not harm as long as we can only build for 32 bit Windows withsizeof(int)==sizeof(void*). Signed-off-by: Werner Koch <[email protected]>
* Avoid incompatible pointer assignment warnings on Windows.Werner Koch2015-11-271-4/+4
| | | | | | | | | | | | | | * common/logging.c (fun_writer): Use gpgrt_ssize_t instead of ssize_t. * dirmngr/server.c (data_line_cookie_write): Ditto. * sm/certdump.c (format_name_writer): Ditto. * sm/server.c (data_line_cookie_write): Ditto. * dirmngr/http.c (cookie_read, cookie_write): Ditto. -- See the release notes of libgpg-error 1.15 for background info on gpgrt_ssize_t. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Allow testing for a running Tor via "getinfo tor".Werner Koch2015-11-271-2/+19
| | | | | | | * dirmngr/server.c (cmd_getinfo): Print an S line if Tor is not running. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Improve output of "getinfo tor".Werner Koch2015-11-261-1/+7
| | | | | | * dirmngr/server.c (cmd_getinfo): Print a message along with OK. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Change to new ADNS Tor mode init scheme.Werner Koch2015-11-091-2/+2
| | | | | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (tor_credentials): New. (enable_dns_tormode): Add arg new_circuit and update tor_credentials. (my_adns_init): Rework to set Tor mode using a config file options and always use credentials. * dirmngr/server.c (cmd_dns_cert): Improve error message. * dirmngr/t-dns-stuff.c (main): Add option --new-circuit. -- Note that the option --new-circuit in t-dns-stuff is not really useful because a new circuit is also used for the first call to the function. Todo: We need to find a policy when to requrest a new curcuit and we also need to add credentials to the assuan_sock_connect calls. Signed-off-by: Werner Koch <[email protected]>