aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Explain commit e175152ef7515921635bf1e00383e812668d13fc.Werner Koch2017-01-301-1/+9
| | | | --
* scd: Fix GetSlotStatus.NIIBE Yutaka2017-01-303-29/+31
| | | | | | | | | | | | | | | * scd/apdu.c (get_status_reader): Add ON_WIRE arg, here. (ct_get_status, pcsc_get_status_direct, pcsc_get_status_wrapped) (pcsc_get_status, get_status_ccid, my_rapdu_get_status): Likewise. (reset_pcsc_reader_wrapped, open_pcsc_reader_wrapped): Follow the change. (apdu_get_status_internal): It's lower-level driver which judge it's not needed. Otherwise, it can't detect the removal. * scd/ccid-driver.c (ccid_slot_status): After the POWERED_OFF check, we can skip sending GetSlotStatus packet on wire, when no need. Signed-off-by: NIIBE Yutaka <[email protected]> Fixes-commit: c8eee4d396a751d41fd1ee1e1b87b851fca172a
* scd: Don't send GET_STATUS packet if not needed.NIIBE Yutaka2017-01-301-8/+19
| | | | | | | | | * scd/apdu.c (apdu_get_status_internal): Add ON_WIRE arg. (apdu_connect): Call apdu_get_status_internal with ON_WIRE enabled. (apdu_get_status): For periodical check, call apdu_get_status_internal with ON_WIRE disabled. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Fix cancel INTERRUPT transfer.NIIBE Yutaka2017-01-291-19/+10
| | | | | | | * scd/ccid-driver.c (do_close_reader): Don't lock events, but check the return value of libusb_cancel_transfer. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: More changes on watching removal of card/reader.NIIBE Yutaka2017-01-275-113/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * scd/app-common.h (struct app_ctx_s): Rename field to periodical_check_needed. * scd/scdaemon.c (update_usb): Rename from update_fdset_for_usb. Don't use libusb_get_pollfds any more. (scd_kick_the_loop): New. (need_tick): Follow the rename. (handle_connections): No libusb event handling here. * scd/app.c (app_new_register): Follow the change of rename. (select_application, scd_update_reader_status_file): Likewise. * scd/ccid-driver.c (ccid_usb_thread_is_alive): New. (intr_cb): Call scd_kick_the_loop. (ccid_usb_thread): New. Thread to invoke INTERRUPT callback. (ccid_open_usb_reader): Add thread invocation. (ccid_require_get_status): Remove LIBUSB_WORKS_EXPECTED_FOR_INTERRUPT_ENDP. (do_close_reader): Carefully handle handle->transfer. (get_escaped_usb_string): Insert npth_unprotect/npth_protect. (do_close_reader, bulk_out, bulk_in, abort_cmd, ccid_slot_status) (ccid_transceive, ccid_transceive_secure): Likewise. -- It found that libusb_get_pollfds is not supported on Windows. Besides, it's a bit difficult to use for the select loop. Thus, we use the thread named ccid_usb_thread, instead. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Fix release of transfer object.NIIBE Yutaka2017-01-271-17/+28
| | | | | | | | * scd/ccid-driver.c (intr_cb): Handle LIBUSB_TRANSFER_CANCELLED. (do_close_reader): When callback is active, call libusb_cancel_transfer and wait callback is fired off. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Improve watching USB device removal.NIIBE Yutaka2017-01-278-106/+127
| | | | | | | | | | | | | | | | | | | | | | | * scd/apdu.c(struct reader_table_s): Add require_get_status. (apdu_connect): Change return value meaning. Call apdu_reset here. * scd/app.c (app_new_register): Add require_get_status. (select_application): Use the return value of apdu_connect. (scd_update_reader_status_file): Call update_fdset_for_usb with checking all_have_intr_endp. (app_list_start, app_list_finish): Remove. * scd/ccid-driver.c (struct ccid_driver_s): Add transfer. (intr_cb): Don't call libusb_transfer in this callback. (ccid_require_get_status): New. (do_close_reader): Call libusb_transfer here. * scd/scdaemon.c (update_fdset_for_usb): Remove the first argument. -- With Gnuk Token, it works fine as expected. With Gemalto reader, intr_cb is not called when card is removed. So, the macro LIBUSB_WORKS_EXPECTED_FOR_INTERRUPT_ENDP is not defined yet. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Wake up the select when new USB scan.NIIBE Yutaka2017-01-271-6/+45
| | | | | | | | | | | | | | | * scd/scdaemon.c (update_fdset_for_usb): Wake up the select(2). (handle_connections): Use a kind of "self-pipe" technique. -- Use pipe to wake up select(2). If UNIX-only, signal could be used. For portability, "self-pipe" is better, here. Setup for non-blocking for pipe fds are not needed, because speed of USB device insertion is limited by human physical interaction; No one can do hundreds of device insertion/removal-s per second. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Only submit apdu_get_status when needed.NIIBE Yutaka2017-01-267-42/+145
| | | | | | | | | | | | | | | * scd/apdu.c (apdu_dev_list_finish): Return Boolean value if all device support INTERRUPT transfer. * scd/ccid-driver.c (ccid_dev_scan_finish): Likewise. * scd/app.c (app_new_register): Fix initial value of card_status. (select_application): Call update_fdset_for_usb. (scd_update_reader_status_file): Ditto. * scd/scdaemon.c (update_fdset_for_usb, need_tick): New. (handle_connections): Call handle_tick when select returns. Let select watch USB file descriptors, too. Call libusb_handle_events_timeout_completed for INTERRUPT transfer. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Fix APP reference counting.NIIBE Yutaka2017-01-262-2/+1
| | | | | | | | | * scd/app.c (scd_update_reader_status_file): Don't call another release_application_internal. * scd/command.c (open_card_with_request): Don't require APPTYPE != NULL. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Add INTERRUPT endp support to CCID driver.NIIBE Yutaka2017-01-262-4/+70
| | | | | | | | | | * scd/app.c (scd_update_reader_status_file): Fix releas of APP. * scd/ccid-driver.c (struct ccid_driver_s): Add INTR_BUF. (intr_cb, ccid_setup_intr): New. (ccid_open_usb_reader): Call ccid_setup_intr. (ccid_slot_status): Return CCID_DRIVER_ERR_NO_READER when removed. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Fix searching for mail addresses in keyrings.Justus Winter2017-01-251-4/+18
| | | | | | | | | | | | * g10/keyring.c (compare_name): Fix KEYDB_SEARCH_MODE_MAIL* searches in keyrings when the UID is a plain addr-spec. -- Previously, 'gpg --list-key "<[email protected]>"' failed if 1/ the keyring format is used and 2/ the key's UID is a plain addr-spec (cf. RFC2822 section 4.3), e.g. '[email protected]'. GnuPG-bug-id: 2930 Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Fix GPGME tests requiring a pinentry.Justus Winter2017-01-251-2/+4
| | | | | | | | | | | * tests/gpgme/gpgme-defs.scm: Use our fake pinentry, and configure it to supply the correct passphrase. -- Previously, the GPGME tests used the fake pinentry distributed with GPGME which is a Bourne shell script. Use the fake pinentry from GnuPG instead. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Fix gpgsm signature verification test.Justus Winter2017-01-251-4/+4
| | | | | | | | | | | * tests/gpgsm/verify.scm: Use 'call-with-binary-output-file' to avoid automatic line-ending conversion. -- Previously, Windows' automatic line-ending conversion turned '\n' into '\r\n' when writing the sample to a file, making the signature invalid. Signed-off-by: Justus Winter <[email protected]>
* agent: Fix double free.Justus Winter2017-01-251-2/+15
| | | | | | | | | | | | | | | | | * agent/cache.c (agent_store_cache_hit): Make sure the update is atomic. -- Previously, the function freed the last key, and duplicated the new key after doing that. There is a chance, however, that calling the allocator surrenders control to a different thread, causing a double free if a different thread also calls this function. To make sure the update is atomic under the non-preemptive thread model, we must make sure not to surrender control to a different thread. Therefore, we avoid calling the allocator during the update. Signed-off-by: Justus Winter <[email protected]>
* tests: Skip GPGME tests that are not built.Justus Winter2017-01-251-2/+5
| | | | | | | | | | * tests/gpgme/wrap.scm: Skip tests that are not built. -- Previously, all tests from GPGME's test suite that were not built (e.g. because GPGME was not configured with QT) were marked as failures. Signed-off-by: Justus Winter <[email protected]>
* tests,w32: Fix locating GPGME's tests on Windows.Justus Winter2017-01-251-1/+1
| | | | | | | | | | * tests/gpgme/run-tests.scm: Qualify the test with the executable extension. -- Previously, the test suite could not locate the test executables on Windows because the Windows-specific file extension was missing. Signed-off-by: Justus Winter <[email protected]>
* gpg: Print a warning on Tor problems.Werner Koch2017-01-242-16/+70
| | | | | | | | | | | | * dirmngr/ks-engine-hkp.c (tor_not_running_p): New. (map_host): Call that to print a warning. (handle_send_request_error): Ditto and avoid marking the host dead. Also print a tor_config_problem warning. Add arg CTRL; adjust callers to pass that new arg. * g10/call-dirmngr.c (ks_status_cb): Detect and print the new warnings. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Simplify error returning inside http.c.Werner Koch2017-01-241-51/+50
| | | | | | | | | | | | * dirmngr/http.c (connect_server): Change to return an gpg_error_t and to store socket at the passed address. (http_raw_connect, send_request): Adjust accordingly. -- This change removes cruft from the code and allows to return the error code from the name lookup. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New option --disable-ipv4.Werner Koch2017-01-2410-6/+46
| | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.c (oDisableIPv4): New const. (opts): New option --disable-ipv4. (parse_rereadable_options): Set that option. * dirmngr/dirmngr.h (opt): New field 'disable_ipv4'. * dirmngr/dns-stuff.c (opt_disable_ipv4): bew var. (set_dns_disable_ipv4): New. (resolve_name_standard): Skip v4 addresses when OPT_DISABLE_IPV4 is set. * dirmngr/ks-engine-hkp.c (map_host): Ditto. (send_request): Pass HTTP_FLAG_IGNORE_IPv4 if opt.disable_v4 is set. * dirmngr/crlfetch.c (crl_fetch): Ditto. * dirmngr/ks-engine-finger.c (ks_finger_fetch): Ditto. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/ocsp.c (do_ocsp_request): Ditto. Signed-off-by: Werner Koch <[email protected]>
* tools: Use platform abstraction for I/O.Justus Winter2017-01-241-10/+10
| | | | | | | | | | | | * tools/gpg-connect-agent.c (main): Use a gpgrt_stream_t for 'script_fp'. Adapt accordingly. -- Werner asked me to make gpgconf use the platform abstractions that were introduced after gpgconf's inception. After doing that, I realized that 'read_line' is only used in two more places, one of which this patch takes care of. Signed-off-by: Justus Winter <[email protected]>
* tools: Use platform abstraction for I/O.Justus Winter2017-01-241-96/+95
| | | | | | | | | | | | | | * tools/gpgconf-comp.c (retrieve_options_from_file): Use a gpgrt_stream_t for 'list_file'. Adapt accordingly. (copy_file): Likewise for 'src' and 'dst'. (change_options_file): Likewise for 'src_file' and 'dest_file'. (change_options_program): Likewise for 'src_file' and 'dest_file'. (gc_process_gpgconf_conf): Likewise for 'config'. -- Werner asked me to make gpgconf use the platform abstractions that were introduced after gpgconf's inception. Signed-off-by: Justus Winter <[email protected]>
* tools: Use platform abstraction for renaming files.Justus Winter2017-01-241-22/+16
| | | | | | | | | | | * tools/gpgconf-comp.c (gc_component_change_options): Use 'gnupg_rename_file'. Also, block signals across all renames in an attempt to make the whole process atomic. -- Werner asked me to make gpgconf use the platform abstractions that were introduced after gpgconf's inception. Signed-off-by: Justus Winter <[email protected]>
* tools: Add comments explaining the functions parameters.Justus Winter2017-01-241-2/+27
| | | | | | | | | | | | | | | | * tools/gpgconf-comp.c (change_options_file): Add comments explaining the functions parameters. (change_options_program): Likewise. -- From reading those two functions it is not clear why we write the new configuration to the source file, and read the current configuration from the destination file. The identifiers are named for the benefit of the callee. Note that identifiers that require that much explanation are poorly chosen. Signed-off-by: Justus Winter <[email protected]>
* tools: Improve error handling.Justus Winter2017-01-241-0/+2
| | | | | | | | | | * tools/gpgconf-comp.c (gp_component_change_options): Improve error handling when reading from stdin. -- Previously, errors encountered while reading the configuration changes were ignored. Signed-off-by: Justus Winter <[email protected]>
* tools: Fix memory leak.Justus Winter2017-01-241-0/+2
| | | | | | | | | * tools/gpgconf-comp.c (change_options_file): Fix leak. -- Previously, 'src_filename' and 'orig_filename' leaked if creating the backup file failed. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test demonstrating issue2929.Justus Winter2017-01-242-1/+34
| | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/issue2929.scm: New file. -- This test demonstrates a problem with the TOFU trust model when a new key is created. Signed-off-by: Justus Winter <[email protected]>
* tests: Enable gpgconf test.Justus Winter2017-01-241-4/+1
| | | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Re-add gpgconf.scm. -- This partially reverts 25e029823813e190a18b601af60efcb1fb3b84af. That change was not sufficiently motivated, and our continuous integration server shows no recent distcheck failures. Signed-off-by: Justus Winter <[email protected]>
* speedo: Remove the unused ADNS package.Werner Koch2017-01-232-22/+1
| | | | --
* Update NEWS with link to release announcement.Werner Koch2017-01-231-0/+2
| | | | --
* Post release updatesWerner Koch2017-01-232-1/+5
| | | | --
* Release 2.1.18gnupg-2.1.18Werner Koch2017-01-231-1/+61
| | | | Signed-off-by: Werner Koch <[email protected]>
* build: Change make distcheck configure and temp. remove gpgconf.scm.Werner Koch2017-01-232-2/+5
| | | | | | | | * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Also test gpgtar and wks-tools. Disable ntbtls. * tests/openpgp/Makefile.am (XTESTS): Temporary remove gpgconf.scm. Signed-off-by: Werner Koch <[email protected]>
* po: Auto updateWerner Koch2017-01-2325-0/+174
| | | | --
* po: Translate two new strings to GermanWerner Koch2017-01-231-1/+7
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* Update copyright notices for 2017.Werner Koch2017-01-239-17/+17
| | | | | | | | -- Also some http:// -> https:// fixes. Signed-off-by: Werner Koch <[email protected]>
* Fix format string errors and some missing error case initialization.Werner Koch2017-01-2310-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/logging.c (do_logv): Remove extra parentheses in comparison. * dirmngr/dns-stuff.c (resolve_addr_libdns): Init RES so that dns_res_close is given a defined value in the error case. * dirmngr/http.c (cookie_read, cookie_write) [HTTP_USE_NTBTLS]: Fix format string char. * dirmngr/ks-engine-hkp.c (ks_hkp_help): Remove duplicate "const". * dirmngr/ks-engine-http.c (ks_http_help): Ditto. * dirmngr/ks-engine-kdns.c (ks_kdns_help): Ditto. * dirmngr/ks-engine-ldap.c (ks_ldap_help): Ditto. * scd/app-p15.c (send_keypairinfo, do_getattr): Fix format string char. * tools/gpgconf-comp.c (gpg_agent_runtime_change): Init PID for the error case. (scdaemon_runtime_change): Ditto. (dirmngr_runtime_change): Ditto. * tools/gpgconf.c (query_swdb): Init VALUE_SIZE_UL. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: On SIGHUP mark all keyservers alive.Werner Koch2017-01-233-0/+25
| | | | | | | * dirmngr/ks-engine-hkp.c (ks_hkp_reload): New. * dirmngr/dirmngr.c (dirmngr_sighup_action): Call it. Signed-off-by: Werner Koch <[email protected]>
* libdns: Hack to skip negation term.Gaetan Bisson2017-01-231-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dns.c (dns_nssconf_loadfile): Skip negation terms in nsswitch.conf parser. -- This small patch was submitted along with this comment: We've been having issues over at Arch Linux with the new libdns code. Our /etc/nsswitch.conf contains the following line: hosts: files mymachines resolve [!UNAVAIL=return] dns myhostname And it turns out dirmngr fails to parse the negation statement (the bang in !UNAVAIL). This results in gnupg not being able to resolve any name. Looking at dirmngr/dns.c it was unclear to me how to properly handle such negations. The dns_anyconf_scan calls used in dns_nssconf_loadfile do not allow to store a negation bit easily... In the meantime, I wrote the attached patch which ignores those statements altogether. It makes libdns work as expected for us. Commit log written by wk
* dirmngr: Print debug message only with --debug.Werner Koch2017-01-231-1/+2
| | | | | | | | * dirmngr/dns-stuff.c (libdns_init): Call log_debug only if opt_debug is set. -- Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Handle missing nsswitch.conf.Phil Pennock2017-01-231-1/+10
| | | | | | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (libdns_init): Fallback to files,dns. -- Signed-off-by: Phil Pennock <[email protected]> ChangeLog entry by wk. This fixed the problem: Short version: macOS doesn't include /etc/nsswitch.conf and GnuPG's dirmngr is hard-erroring when that file is missing, such that no DNS operations succeed and --recv-key returns ENOENT type errors to the caller. Signed-off-by: Werner Koch <[email protected]>
* dco: Register Phil Pennock.Werner Koch2017-01-231-0/+4
| | | | --
* gpg: Fix misleading log message when checking regexp.Damien Goutte-Gattat2017-01-231-2/+2
| | | | | | | | | | | | | * src/trustdb.c (check_regexp): Correctly print whether the regexp matched or not. -- This patch fixes the log message displayed when gpg attempts to match the regexp associated with a trust signature with an user ID. The current message interprets the 'ret' variable backwards, and displays 'YES' when the regexp actually fails to match. Signed-off-by: Damien Goutte-Gattat <[email protected]>
* po: Fixes to the German translationWerner Koch2017-01-231-9/+9
| | | | | | | | | | | | | | | | | | | | | | -- Justus reported that the German translation for the key listing in --edit-key does "usage: E" -> "Aufruf: E" which is clearly wrong. It turnd out that this translation was once marked as fuzzy and accidentally unfuzzied by me. "Aufruf" (bug) -> "Nutzung" "Leistungsfähigkeit" -> "Nutzung" "Signaturfähigkeit" -> "Signaturnutzbarkeit" etc. The last two are in the key generation menu. Also changed the key code for "Umschalten der Signaturnutzbarkeit" from "U" to "S". "Nutzung" is here better than "Fähigkeit" because the latter is more connected to the property of the algorithm, where the former better expresses an arbitrary choice. Signed-off-by: Werner Koch <[email protected]>
* gpg: New export and import options "backup" and "restore".Werner Koch2017-01-234-5/+52
| | | | | | | | | | | | | | | | * g10/export.c (parse_export_options): Add "backup" and its alias "export-backup". (do_export_one_keyblock): Export ring trust packets in backup mode. * g10/import.c (parse_import_options): Add "restore" and its alias "import-restore". (read_block): Import ring trust packets. -- These options are intended to, well, backup and restore keys between GnuPG implementations. These options may eventually be enhanced to backup and restore all public key related information. Signed-off-by: Werner Koch <[email protected]>
* scd: Fix INTERRUPT transfer.NIIBE Yutaka2017-01-231-5/+6
| | | | | | | | * scd/ccid-driver.c (find_endpoint): Don't return Bulk endpoint as Interrupt endpoint. (ccid_poll): Call libusb_interrupt_transfer. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Print a commit id in the generated ChangeLogWerner Koch2017-01-191-1/+4
| | | | | | | * build-aux/gitlog-to-changelog: Print an extra line with the commit id. Signed-off-by: Werner Koch <[email protected]>
* common: Fix buffer copy code again.Werner Koch2017-01-191-20/+14
| | | | | | | | | | | | * common/exectool.c (my_error_from_errno): Remove. (copy_buffer_do_copy): Do without var RC. (copy_buffer_flush): Ditto. Use ERRNO instead of es_write return code. (gnupg_exec_tool): Correctly return errors from es_read. -- Fixes-commit: 55c9212a2338bf0b07c8cf3a69bcedaa28d48d43 Signed-off-by: Werner Koch <[email protected]>
* gpg: Allow to freeze faked system time.Damien Goutte-Gattat2017-01-193-3/+16
| | | | | | | | | | | | | | | | * g10/gpg.c (main): If the parameter for --faked-system-time ends with a '!', freeze time at the specified point. * common/gettime.c (gnupg_set_time): Allow to freeze the time at an arbitrary time instead of only the current time. * doc/gpg.texi: Update documentation for --faked-system-time. -- This patch allows the user to modify the behavior of the --faked-system-time option: by appending a '!' to the parameter, time in GnuPG will be frozen at the specified time, instead of advancing normally from that time onward. Signed-off-by: Damien Goutte-Gattat <[email protected]>
* common: Clarify use of vars in buffer copy code.Werner Koch2017-01-191-16/+26
| | | | | | | | | | | | | | | * common/exectool.c (my_error_from_errno): New. (copy_buffer_do_copy): Use separate vars for errno values and gpg-error values for clarity. s/assert/log_assert/. (copy_buffer_flush): Ditto. (gnupg_exec_tool_stream): Use gpg_err_code when testing. -- NB: It is surprising that es_write seems not to set ERRNO but only returns the ERRNO value. Need to check whether this is really the case. Signed-off-by: Werner Koch <[email protected]>