aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Rename a var to avoid a shadowing warning.Werner Koch2017-01-121-3/+5
| | | | | | | | | * g10/keygen.c (keygen_set_std_prefs): Rename variable. -- I consider it better not to use the name of a commonly used function. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix t-gettime for a time_t of 64 and a long of 32 bit.Werner Koch2017-01-122-5/+14
| | | | | | | | | | | | * configure.ac (AC_CHECK_HEADERS): Add stdint.h. * common/t-gettime.c: Include stdint.h. (UINTMAX_C): Define replacement. (test_isotime2epoch): Use UINTMAX_C for the >32 bit constants. -- This is for example the case on 32 bit OpenBSD. Signed-off-by: Werner Koch <[email protected]>
* build: Make autogen.sh more POSIX friendly.Werner Koch2017-01-121-3/+6
| | | | | | | * autogen.sh: Replace non POSIX "cp -a" and "head -c". -- Signed-off-by: Werner Koch <[email protected]>
* libdns: Silence -Wstrict-prototypes on some function ptrs.Werner Koch2017-01-121-0/+13
| | | | | | * dirmngr/dns.c (dns_rrtype): Ignore -Wstrict-prototypes warning. Signed-off-by: Werner Koch <[email protected]>
* libdns: Provide replacement for EPROTO.Werner Koch2017-01-121-0/+4
| | | | | | | | | | | * dirmngr/dns.c (EPROTO) ![EPROTO]: Define to EPROTONOSUPPORT. -- This is the same replacement we use in Libassuan (commit 8ab3b9273524bd344bdb90dd5d3bc8e5f53ead6e) to make it work on OpenBSD and may other BSD based OSes. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: After a connection failure log a hint if Tor is not running.Werner Koch2017-01-111-0/+11
| | | | | | | * dirmngr/ks-engine-hkp.c (handle_send_request_error): Check whether Tor is running. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Mark hosts dead on ENETDOWN.Werner Koch2017-01-111-0/+5
| | | | | | | * dirmngr/ks-engine-hkp.c (handle_send_request_error): Take care of ENETDOWN. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Fix Tor access for v6 addresses.Werner Koch2017-01-111-1/+63
| | | | | | | | | | | | | | | | | | | * dirmngr/http.c (use_socks): New. (my_sock_new_for_addr): New. (connect_server): Replace assuan_sock_new by my_sock_new_for_addr. -- Libassuan always uses 127.0.0.1 to connect to the local Tor proxy. https.c used to create a socket for the actual address family and thus the connect call in Libassuan fails when it tries to connect to a v6 address using a v4 socket. It would be cleaner to have the my_sock_new_for_addr function as a public interface in Libassuan; for now we need to duplicate some code. from Libassuan. GnuPG-bug-id: 2902 Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Remove warnings about unused global variables.Werner Koch2017-01-112-2/+2
| | | | | | | * dirmngr/crlcache.c (oidstr_issuingDistributionPoint): Comment. * dirmngr/ocsp.c (oidstr_certHash): Comment. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Implement debug option "network" for http.Werner Koch2017-01-112-3/+6
| | | | | | * dirmngr/dirmngr.c (parse_rereadable_options): Set http debugging. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add debug code to http.c.Werner Koch2017-01-112-22/+54
| | | | | | | | | | | | | * dirmngr/http.c (opt_verbose, opt_debug): New vars. (http_set_verbose): New function. (_my_socket_new): Add debug output. (_my_socket_ref, _my_socket_unref, session_unref): Call log_debug if OPT_DEBUG has ben set to 2 in a debugger. (http_session_new, http_session_ref): Ditto. (send_request, http_start_data): Print debug output for the request. (parse_response): Change to use log_debug_string for the response. Signed-off-by: Werner Koch <[email protected]>
* common: New function log_debug_with_string.Werner Koch2017-01-112-37/+106
| | | | | | | | | | | | | | | * common/logging.c (do_logv): Factor some code out to ... (print_prefix): new. (log_logv): Add arg EXTRASTRING and print it. Change all callers to pass NULL for it. (log_debug_with_string): New. Uses EXTRASTRING. -- This function can be used to print a human readable buffer in addition to a log message to the log stream. This function will keep all lines together and prefix them with ">> ". Signed-off-by: Werner Koch <[email protected]>
* common: Avoid unnecessary ambiguity in argparse.Daniel Kahn Gillmor2017-01-111-1/+3
| | | | | | | | | | | | | * common/argparse.c (find_long_option): Avoid unnecessary ambiguity. -- If two struct ARGPARSE_OPTS share a prefix in their long_opt name, but have the exact same short_opt and flags, they are aliases and not distinct options. Avoid reporting this as an ambiguity, so that (for example) both --clearsign and --clear-sign can be invoked as --clear. Signed-off-by: Daniel Kahn Gillmor <[email protected]> Debian-Bug-Id: 850475
* systemd-user: Enable "systemctl --user reload {dirmngr,gpg-agent}"Daniel Kahn Gillmor2017-01-102-0/+2
| | | | | | | | | | | | * doc/examples/systemd-user/*.service: Add ExecReload directives to indicate the canonical way to reload the services. GnuPG recommends reloading the agent and dirmngr with "gpgconf --reload". if anyone is running them as systemd user services, they might ask them to reload in the systemd way, so teach systemd the right thing to do. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* doc: Mention dirmngr.confWerner Koch2017-01-101-2/+15
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* tests: Improve gpgconf test.Justus Winter2017-01-102-6/+25
| | | | | | | | * tests/openpgp/defs.scm (valgrind): New variable. (gpg-config): Fix clearing an option. * tests/openpgp/gpgconf.scm: Also toggle 'quiet'. Signed-off-by: Justus Winter <[email protected]>
* tools: Fix memory leaks and improve error handling.Justus Winter2017-01-103-6/+52
| | | | | | | | | | | | | * tools/gpgconf-comp.c (gc_option_free): New function. (gc_components_free): Likewise. (gc_components_init): Likewise. (retrieve_options_from_program): Use 'xfree', fix memory leak. (change_options_program): Improve error handling. (gc_component_change_options): Fix memory leaks. * tools/gpgconf.c (main): Initialize components. * tools/gpgconf.h (gc_components_init): New prototype. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for gpgconf.Justus Winter2017-01-103-2/+73
| | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/defs.scm (percent-encode): New function. (gpg-conf): Generalize so that we can feed stdin. (gpg-config): New function. * tests/openpgp/gpgconf.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* common: Fix fallback code.Justus Winter2017-01-102-2/+2
| | | | | | | | * common/logging.c (_log_assert): Fix the variant for compilers that do not support __FUNCTION__. * common/logging.h (_log_assert): Likewise. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Use "pgpkey-hkps" and "pgpkey-hkp" for SRV record lookups.Werner Koch2017-01-091-29/+34
| | | | | | | | | | | | | * dirmngr/ks-engine-hkp.c (map_host): Chnage arg NO_SRV to SRVTAG. (make_host_part): Rewrite. -- This fixes a regression from 2.0 and 1.4 where these tags have been in used since 2009. For whatever reason this was not ported to 2.1 and "hkp" was always used. GnuPG-bug-id: 2451 Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Do not use a SRV record for HKP if a port was specified.Werner Koch2017-01-093-28/+40
| | | | | | | | | | | | | | | | | * dirmngr/http.h (parsed_uri_s): Add field EXPLICIT_PORT. * dirmngr/http.c (do_parse_uri): That it. * dirmngr/ks-engine-hkp.c (map_host): Add arg NO_SRV. (make_host_part): Ditto. (ks_hkp_resolve): Set NO_SRV from EXPLICIT_PORT. (ks_hkp_search): Ditto. (ks_hkp_get): Ditto. (ks_hkp_put): Ditto. -- This implements the behaviour of the keyserver helpers from 1.4 and 2.0. Signed-off-by: Werner Koch <[email protected]>
* doc: Update man page for watchgnupgWerner Koch2017-01-091-18/+25
| | | | | | -- 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: Improve debug output for TLS.Werner Koch2017-01-081-0/+8
| | | | | | * dirmngr/misc.c (dump_cert): Also print SubjectAltNames. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Change internal SRV lookup API.Werner Koch2017-01-085-37/+31
| | | | | | | | | | | | | * dirmngr/dns-stuff.c (get_dns_srv): Add args SERVICE and PROTO. * dirmngr/http.c (connect_server): Simplify SRV lookup. * dirmngr/ks-engine-hkp.c (map_host): Ditto. * dirmngr/t-dns-stuff.c (main): Adjust for changed get_dns_srv. -- This new API is more convenient because it includes commonly used code. Note that right now http.c's SRV record code is not used. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Strip root zone suffix from libdns SRV results.Werner Koch2017-01-081-0/+4
| | | | | | | | | * dirmngr/dns-stuff.c (getsrv_libdns): Strip trailing dot from the target. -- See-also: b200e636ab20d2aa93d9f71f3789db5a04af0a56 Signed-off-by: Werner Koch <[email protected]>
* agent,w32: Fix annoying output to DebugView.Werner Koch2017-01-062-7/+14
| | | | | | | | | * agent/gpg-agent.c (startup_fd_list): Do not define for W32. (main) [W32]: Do not call get_all_open_fds. -- GnuPG-bug-id: 2267 Signed-off-by: Werner Koch <[email protected]>
* doc: Document summary values of TOFU_STATSAndre Heinecke2017-01-061-0/+13
| | | | | | -- Signed-off-by: Andre Heinecke <[email protected]>
* scd: Fix for --disable-ccid for scdaemon.NIIBE Yutaka2017-01-061-6/+7
| | | | | | | | * scd/apdu.c (apdu_dev_list_finish): Don't call ccid_dev_scan_finish with no table. (apdu_open_reader): Only increment when it's zero. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Fix for --disable-ccid-driver.NIIBE Yutaka2017-01-061-1/+6
| | | | | | | * scd/apdu.c [HAVE_LIBUSB] (apdu_dev_list_start): Conditionalize. [HAVE_LIBUSB] (apdu_dev_list_finish, apdu_open_reader): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Support multiple readers by CCID driver.NIIBE Yutaka2017-01-066-190/+589
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/apdu.c (new_reader_slot): Lock is now in apdu_dev_list_start. (close_pcsc_reader_direct, close_ccid_reader): RDRNAME is handled... (apdu_close_reader): ... by this function now. (apdu_prepare_exit): Likewise. (open_ccid_reader): Open with dev_list. (apdu_dev_list_start, apdu_dev_list_finish): New. (apdu_open_one_reader): New. (apdu_open_reader): Support multiple readers. * scd/app.c (select_application): With SCAN, opening all readers available, and register as new APP. (app_write_learn_status): app->ref_count == 0 is valid for APP which is not yet used. (app_list_start, app_list_finish): New. * scd/ccid-driver.c (struct ccid_driver_s): Remove RID and BCD_DEVICE. Add BAI. (parse_ccid_descriptor): BCD_DEVICE is now on the arguments. (ccid_dev_scan, ccid_dev_scan_finish): New. (ccid_get_BAI, ccid_compare_BAI, ccid_open_usb_reader): New. (ccid_open_reader): Support multiple readers. (ccid_set_progress_cb, ccid_close_reader): No RID any more. -- With this change, multiple readers/tokens are supported by the internal CCID driver of GnuPG. Until the changes of upper layers (scdaemon, gpg-agent, and gpg front end), only a single reader is used, though. Signed-off-by: NIIBE Yutaka <[email protected]>
* Silence two -Wlogical-op warnings.Werner Koch2017-01-052-3/+7
| | | | | | | | * common/tlv.c (parse_ber_header): Avoid compiler warning about a duplicate condition. * tools/gpgtar-create.c (pattern_valid_p): Likewise. Signed-off-by: Werner Koch <[email protected]>
* doc: Mention gpgv in the description of gpg --verify.Werner Koch2017-01-051-0/+7
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* tests: New test for --{show,override}-session-key.Justus Winter2017-01-052-0/+46
| | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/decrypt-session-key.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix macro.Justus Winter2017-01-053-8/+12
| | | | | | | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): Make hygienic, use define-macro, do not change to the ephemeral home directory. * tests/gpgsm/setup.scm: Change to the ephemeral home directory. * tests/openpgp/setup.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* g10: avoid warning when --disable-tofuDaniel Kahn Gillmor2017-01-041-1/+1
| | | | | If configured with --disable-tofu, we see compiler warnings about an unused variable. This should remove those warnings.
* doc: Add release announcement pointers to NEWS entries.Werner Koch2017-01-041-2/+97
| | | | | | | | | -- These are used by the website buider to link to the announcement mails. Signed-off-by: Werner Koch <[email protected]>
* tests,w32: Fix locating the components.Justus Winter2017-01-041-9/+29
| | | | | | | | | | | * tests/openpgp/defs.scm (percent-decode): New function. (bin-prefix): New variable. (installed?): Likewise. (tool-hardcoded): Use the new variables. (gpg-conf): Use the new function to decode the values. (gpg-components): Do not use '--build-prefix' when 'installed?'. Signed-off-by: Justus Winter <[email protected]>
* doc: Extend dirmngr's --allow-version-check descriptionWerner Koch2017-01-031-1/+7
| | | | --
* dirmngr: Make sure Tor mode is also set for DNS on SIGHUP.Werner Koch2017-01-035-37/+14
| | | | | | | | | | | | | | | | | | | * 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 debug message on correctly initialized libdns.Werner Koch2017-01-031-1/+4
| | | | | | | | | | * dirmngr/dns-stuff.c (libdns_init): Add debug level diagnostic on success. -- This output may help to avoid questions when evaluating an Assuan log. Signed-off-by: Werner Koch <[email protected]>
* common: Turn assertions into expressions.Justus Winter2017-01-021-8/+8
| | | | | | | * common/logging.h (log_assert): Turn this into an expression so it can be used in expressions. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix faked time in the TOFU test.Justus Winter2017-01-021-1/+1
| | | | | | * tests/openpgp/tofu.scm (GPG): Fix time delta. Signed-off-by: Justus Winter <[email protected]>
* g13: Improve printing of debug infos.Werner Koch2017-01-021-1/+1
| | | | | | * g13/g13tuple.c (all_printable): Make it work. Signed-off-by: Werner Koch <[email protected]>
* Replace use of variable-length-arrays.Werner Koch2017-01-025-18/+42
| | | | | | | | | | | | | * common/t-iobuf.c (main): Replace variable-length-array. * g10/gpgcompose.c (mksubpkt_callback): Ditto. (encrypted): Ditto. * g10/t-stutter.c (log_hexdump): Ditto. (oracle_test): Ditto. * g10/tofu.c (get_policy): Ditto. Use "%zu" for size_t. * scd/app-openpgp.c (ecc_writekey): Replace variable-length-array. Check for zero length OID_LEN. Signed-off-by: Werner Koch <[email protected]>
* build: Enable gcc warnings to detect non-portable code.Werner Koch2017-01-021-0/+9
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpgscm: Fail if too many arguments are given.Justus Winter2017-01-022-6/+4
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Enable check. * tests/gpgscm/tests.scm (test::report): Remove superfluous argument. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add 'finally', rework all macros.Justus Winter2017-01-022-44/+52
| | | | | | | | | | | | | | | * tests/gpgscm/init.scm (finally): New macro. * tests/gpgscm/tests.scm (letfd): Rewrite. (with-working-directory): Likewise. (with-temporary-working-directory): Likewise. (lettmp): Likewise. -- Rewrite all our macros using 'define-macro'. Use the new control flow mechanism 'finally', or 'dynamic-wind' where appropriate. Make sure the macros are hygienic. Reduce code duplication. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use boxed values for source locations.Justus Winter2017-01-022-46/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct port): Use boxed values for filename and current line. This allows us to use the same Scheme object for labeling all expressions in a file. * tests/gpgscm/scheme.c (file_push): Use boxed type for filename. (mark): Mark location objects of port objects. (gc): Mark location objects in the load stack. (port_clear_location): New function. (port_reset_current_line): Likewise. (port_increment_current_line): Likewise. (file_pop): Adapt accordingly. (port_rep_from_filename): Likewise. (port_rep_from_file): Likewise. (port_close): Likewise. (skipspace): Likewise. (token): Likewise. (_Error_1): Likewise. (opexe_0): Likewise. (opexe_5): Likewise. (scheme_deinit): Likewise. (scheme_load_file): Likewise. (scheme_load_named_file): Likewise. Signed-off-by: Justus Winter <[email protected]>
* doc: Remove warning that DNS is not routed via TorWerner Koch2017-01-021-4/+2
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>