chiark / gitweb /
gnupg2.git
4 years agoreduce timeouts to intermediate value racetest-stretch
Ian Jackson [Sat, 6 Jan 2018 20:54:40 +0000 (20:54 +0000)]
reduce timeouts to intermediate value

4 years agoDEBUGGING PATCH FROM NIIBE (2)
Ian Jackson [Sat, 6 Jan 2018 13:53:30 +0000 (13:53 +0000)]
DEBUGGING PATCH FROM NIIBE (2)

4 years agoDEBUGGING PRINT FROM NIIBE
Ian Jackson [Thu, 24 Aug 2017 07:36:25 +0000 (08:36 +0100)]
DEBUGGING PRINT FROM NIIBE

4 years agoincrease timeouts
Ian Jackson [Tue, 22 Aug 2017 18:17:05 +0000 (19:17 +0100)]
increase timeouts

4 years agochangelog: add a thing
Ian Jackson [Tue, 22 Aug 2017 18:13:46 +0000 (19:13 +0100)]
changelog: add a thing

4 years agoRecord gnupg2 (2.1.18-8~deb9u1) in archive suite stretch
Daniel Kahn Gillmor [Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)]
Record gnupg2 (2.1.18-8~deb9u1) in archive suite stretch

Record that
  2.1.18-8~deb9u1      Import of source package
should be treated as descended from
  2.1.18-6             dgit client's archive history view

4 years agogpg: Avoid spurious warnings about trust packets.
Daniel Kahn Gillmor [Sat, 6 May 2017 02:37:23 +0000 (22:37 -0400)]
gpg: Avoid spurious warnings about trust packets.

* g10/keydb.c (parse_keyblock_image): Do not emit a warning when
skipping a trust packet.

--

2.1.20 and later store trust packets in the keybox.  If an older
version (like 2.1.18) ends up accessing a keybox that 2.1.20 or later
has used, it produces many spurious warnings like:

    gpg: skipped packet of type 12 in keybox

This is a temporary cleanup to avoid these specific warnings; it can
be dropped when moving to 2.1.20 or later.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic avoid-spurious-warnings
Gbp-Pq: Name 0078-gpg-Avoid-spurious-warnings-about-trust-packets.patch

4 years agog10: remove skeleton options files
Daniel Kahn Gillmor [Mon, 17 Apr 2017 14:51:55 +0000 (10:51 -0400)]
g10: remove skeleton options files

* build-aux/speed/w32/inst.nsi: stop installing skeleton files.
* doc/gpg.texi: stop documenting skeleton files.
* g10/Makefile.am: stop installing skeleton files.
* g10/openfile.c (copy_options_file): Remove.
(try_make_homedir): do not call copy_options_file()

The defaults for gpg and dirmngr are good.  Both programs should work
fine for the simple case without any config file.  The skeleton config
files were being copied at first use (when the defaults are fine).
But when the user needs to fiddle with them (after they've become
sophisticated users), they're likely out of date because gpg has been
upgraded since then.  So they're used for documentation, but they're
stale documentation, which is probably worse than a clean empty file.

--

GnuPG-bug-id: 3086
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic skel-file-removal
Gbp-Pq: Name 0077-g10-remove-skeleton-options-files.patch

4 years agog10: Skip signing keys where no secret key is available.
Simon Arlott [Sun, 5 Feb 2017 21:31:35 +0000 (16:31 -0500)]
g10: Skip signing keys where no secret key is available.

* g10/getkey.c (finish_lookup): When requiring PUBKEY_USAGE_SIG, skip
over keys where no signing key is available.

--

This should only be relevant when gpg is required to choose which key
to sign with -- if verifying signatures, we already know which subkey
to look at, and indeed gpg doesn't seem to have a problem with this.

This patch comes from
https://bugs.gnupg.org/gnupg/file793/sign-fix.patch

I (dkg) have reviewed and tested it with missing local keys, and it
makes sense to me as the default behavior.  If the user has the secret
key for a signing-capable subkey available and the command is --sign,
it should be used.

If the user has explicitly specified a subkey that happens to be
missing (e.g. with the trailing ! for --default-key 0x${FPR}!) then
this does not override that behavior (the signature will still fail).

GnuPG-bug-id: 1967
Debian-bug-id: 834922

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic skip-missing-signing-keys
Gbp-Pq: Name 0076-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch

4 years agodirmngr: Fix aliasing problem in dns.c.
NIIBE Yutaka [Tue, 25 Apr 2017 12:00:41 +0000 (21:00 +0900)]
dirmngr: Fix aliasing problem in dns.c.

* dirmngr/dns.c (dns_ai_setent): Care about aliasing.

--

Co-authored-by: Tomas Mraz
GnuPG-bug-id: 3105
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 247932f367f856e7ce91528e14f0aaf838150857)

Gbp-Pq: Name 0075-dirmngr-Fix-aliasing-problem-in-dns.c.patch

4 years agog10: invalidate the fd cache for keyring.
NIIBE Yutaka [Mon, 24 Apr 2017 22:48:51 +0000 (07:48 +0900)]
g10: invalidate the fd cache for keyring.

* g10/keyring.c (keyring_search_reset): Don't keep the FD cache.

--

GnuPG-bug-id: 3096
Fixes-commit: 5556eca5acd46983bff0b38a1ffbc2f07fbaba9f
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 116cfd60779fbb3540da629db54dc2e148f4a3a2)

Gbp-Pq: Name 0074-g10-invalidate-the-fd-cache-for-keyring.patch

4 years agodirmngr: Fix final close of LISTEN_FD.
NIIBE Yutaka [Tue, 18 Apr 2017 00:04:11 +0000 (09:04 +0900)]
dirmngr: Fix final close of LISTEN_FD.

* dirmngr/dirmngr.c (handle_connections): Close LISTEN_FD.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 4b2581dc0ea1d03e70023bb0748aa0c21c0a2173)

Gbp-Pq: Name 0073-dirmngr-Fix-final-close-of-LISTEN_FD.patch

4 years agog10: Minor fixes.
NIIBE Yutaka [Mon, 17 Apr 2017 00:15:13 +0000 (09:15 +0900)]
g10: Minor fixes.

* g10/export.c (cleartext_secret_key_to_openpgp): No initialization.
(do_export_one_keyblock): Initialize with GPG_ERR_NOT_FOUND.
* g10/getkey.c (get_best_pubkey_byname): Add non-null check.
* g10/tofu.c (tofu_set_policy): ERR initialize to 0.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 0dec0cc281dfa26db89f8cc5ee002dea5c2b2e81)

Gbp-Pq: Name 0072-g10-Minor-fixes.patch

4 years agog10: Fix import/export filter property match.
NIIBE Yutaka [Mon, 17 Apr 2017 00:08:31 +0000 (09:08 +0900)]
g10: Fix import/export filter property match.

* g10/import.c (impex_filter_getval): Fix to "else if".

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit af5f8ecf51f5e1f33e832d4946d02313b78a0536)

Gbp-Pq: Name 0071-g10-Fix-import-export-filter-property-match.patch

4 years agodirmngr: Fix http.c for sockaddr_storage.
NIIBE Yutaka [Thu, 13 Apr 2017 05:46:57 +0000 (14:46 +0900)]
dirmngr: Fix http.c for sockaddr_storage.

dirmngr/http.c (use_socks): Use sockaddr_storage.
(my_sock_new_for_addr, connect_server): Likewise.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 86dcb03134fd4957d51ebaa06b7991239f9ee56a)

Gbp-Pq: Name 0070-dirmngr-Fix-http.c-for-sockaddr_storage.patch

4 years agodirmngr: Fix alignment of ADDR.
NIIBE Yutaka [Thu, 13 Apr 2017 05:33:33 +0000 (14:33 +0900)]
dirmngr: Fix alignment of ADDR.

* dirmngr/dns-stuff.h (dns_addrinfo_s): Use struct sockaddr_storage
for size and alignment.
* dirmngr/dns-stuff.c (resolve_name_libdns): Follow the change.
(resolve_dns_name): Use struct sockaddr_storage.
(resolve_addr_standard, resolve_dns_addr): Likewise.
(resolve_dns_addr): Likewise.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 892b33bb2c57785927ea6652091191da2deed464)

Gbp-Pq: Name 0069-dirmngr-Fix-alignment-of-ADDR.patch

4 years agotools: Fix condition for gpg-connect-agent.
NIIBE Yutaka [Wed, 12 Apr 2017 07:01:16 +0000 (16:01 +0900)]
tools: Fix condition for gpg-connect-agent.

* tools/gpg-connect-agent.c (start_agent): Add paren.

--

The intention is comparing the error code depending opt.use_dirmngr.
Considering C Operator Precedence, we should have paren here.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit f52f6af834cc488d11612e349e4af023d69a45f4)

Gbp-Pq: Name 0068-tools-Fix-condition-for-gpg-connect-agent.patch

4 years agodirmngr: Fix possible null reference.
NIIBE Yutaka [Wed, 12 Apr 2017 06:58:11 +0000 (15:58 +0900)]
dirmngr: Fix possible null reference.

* dirmngr/dns.c (dns_error_t dns_trace_fput): Check NULL.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 7ae1857c90ab43ad9e31f0fb6dbd37f25cc37278)

Gbp-Pq: Name 0067-dirmngr-Fix-possible-null-reference.patch

4 years agodoc: Explain the '>' in a key listing.
Werner Koch [Fri, 7 Apr 2017 08:26:55 +0000 (10:26 +0200)]
doc: Explain the '>' in a key listing.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 9c9fde1495be4accf4526a2626110876fd9d788d)

Gbp-Pq: Name 0066-doc-Explain-the-in-a-key-listing.patch

4 years agogpg: Fix printing of offline taken subkey.
Werner Koch [Fri, 7 Apr 2017 08:11:07 +0000 (10:11 +0200)]
gpg: Fix printing of offline taken subkey.

* g10/keylist.c (list_keyblock_print): Set SECRET to 2 and not 0x32.
--

Reported-by: Danielle McLean <dani@00dani.me>
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 547bc01d57528ecc27b3b5e16797967a7f88fecf)

Gbp-Pq: Name 0065-gpg-Fix-printing-of-offline-taken-subkey.patch

4 years agoagent: Serialize access to passphrase cache.
NIIBE Yutaka [Thu, 6 Apr 2017 23:39:26 +0000 (08:39 +0900)]
agent: Serialize access to passphrase cache.

* agent/cache.c (encryption_lock): Remove.
(cache_lock): New.  Now, we have coarse grain lock to serialize
entire cache access.
(initialize_module_cache): Use CACHE_LOCK.
(init_encryption, new_data): Remove ENCRYPTION_LOCK.
(agent_flush_cache, agent_put_cache, agent_get_cache): Lock the cache.

--

GnuPG-bug-id: 3027
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit ebe12be034f052cdec871f0d8ad1bfab85d7b943)

Gbp-Pq: Name 0064-agent-Serialize-access-to-passphrase-cache.patch

4 years agodirmngr: New option --disable-ipv6
Werner Koch [Mon, 3 Apr 2017 18:56:12 +0000 (20:56 +0200)]
dirmngr: New option --disable-ipv6

* dirmngr/dirmngr.h (struct opt): Add field 'disable_ipv6'.
* dirmngr/dirmngr.c (oDisableIPv6): New const.
(opts): New option --disable-ipv6.
(parse_rereadable_options): Set that option.
* dirmngr/dns-stuff.c (opt_disable_ipv6): New var.
(set_dns_disable_ipv6): New.
(resolve_name_standard): Make use of it.
* dirmngr/ks-engine-finger.c (ks_finger_fetch): Take care of
OPT.DISABLE_IPV6.
* dirmngr/ks-engine-hkp.c (map_host): Ditto.
(send_request): Ditto.
* dirmngr/ks-engine-http.c (ks_http_fetch): Ditto.
* dirmngr/ocsp.c (do_ocsp_request): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 3533b854408fa93734742b2ee12b62aa0d55ff28)

Gbp-Pq: Name 0063-dirmngr-New-option-disable-ipv6.patch

4 years agodirmngr: Handle EIO which is sometimes returned by cookie functions.
Werner Koch [Mon, 3 Apr 2017 18:23:18 +0000 (20:23 +0200)]
dirmngr: Handle EIO which is sometimes returned by cookie functions.

* dirmngr/ks-engine-hkp.c (handle_send_request_error): Handle EIO.
--

Suggested-by: Andre Heinecke
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit cc32ddbcba8c53d3e2cad952d72f62dc73911042)

Gbp-Pq: Name 0062-dirmngr-Handle-EIO-which-is-sometimes-returned-by-co.patch

4 years agodirmngr: Always print a warning for a missing /etc/hosts.
Werner Koch [Mon, 3 Apr 2017 18:20:27 +0000 (20:20 +0200)]
dirmngr: Always print a warning for a missing /etc/hosts.

* dirmngr/dns-stuff.c (libdns_init): No Windows specific handling of a
missing /etc/hosts.
--

My last comment on this was flawed.  Windows seems to always have its
version of /etc/hosts.  Only the en passant fixed bad escaping led me
assume that this was the case.  Thanks to Andre for complaining about
my comment remark.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 35c843c815306f36d1efbc52f5e2f6bac3f67aec)

Gbp-Pq: Name 0061-dirmngr-Always-print-a-warning-for-a-missing-etc-hos.patch

4 years agodirmngr: Do not assume that /etc/hosts exists.
Werner Koch [Mon, 3 Apr 2017 17:10:50 +0000 (19:10 +0200)]
dirmngr: Do not assume that /etc/hosts exists.

* dirmngr/dns-stuff.c (libdns_init): Do not bail out.
--

A standard Windows installation does not have a hosts file and thus we
can't bail out here.  We should also not bail out on a Unix system
because /etc/hosts is just one method in  nsswitch.conf.

Fixes-commit: 88f1505f0613894d5544290a170119eb538921e5
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 5d873f288e86edfb684f4dd57ac36466b06494a4)

Gbp-Pq: Name 0060-dirmngr-Do-not-assume-that-etc-hosts-exists.patch

4 years agogpg: Handle critical marked 'Reason for Revocation'.
Werner Koch [Mon, 3 Apr 2017 06:51:52 +0000 (08:51 +0200)]
gpg: Handle critical marked 'Reason for Revocation'.

* g10/parse-packet.c (can_handle_critical): Add
SIGSUBPKT_REVOC_REASON.
--

Some software seems to mark that subpacket as criticial.  Although gpg
has no special treatment for a revocation reasons (except for
--list-packets) we can accept a criticial marked anyway.  There are no
mandatary rules specified on how to handle a revocation reason.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 3f6d949011f485613bb4bd3e06a2643be79cce40)

Gbp-Pq: Name 0059-gpg-Handle-critical-marked-Reason-for-Revocation.patch

4 years agocommon: Avoid undefined behavior.
Justus Winter [Thu, 30 Mar 2017 13:44:35 +0000 (15:44 +0200)]
common: Avoid undefined behavior.

* common/iobuf.c (iobuf_read_line): Do not consider 'length' if
'buffer' is NULL.

Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 214fa9012296d796b78f1a3106d656639cf50aef)

Gbp-Pq: Name 0058-common-Avoid-undefined-behavior.patch

4 years agog10: Fix memory leak.
Justus Winter [Tue, 28 Mar 2017 10:10:28 +0000 (12:10 +0200)]
g10: Fix memory leak.

* g10/decrypt-data.c (decrypt_data): Free 'filename'.

Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 6d3edfd972c1114f43f6b35773dc25e0256f48f4)

Gbp-Pq: Name 0057-g10-Fix-memory-leak.patch

4 years agocommon: Fix connecting to the agent.
Justus Winter [Mon, 27 Mar 2017 14:14:20 +0000 (16:14 +0200)]
common: Fix connecting to the agent.

* common/homedir.c (_gnupg_socketdir_internal): Fix error handling.
--

Prior to 26086b36 the non-existance of the socket directory was
considered an error if a non-default home directory is used.  Since
26086b36 we now create the directory on demand, but the function still
returned the fallback path.  This made the agent bind the socket in
the socket directory, and the client trying to connect to the socket
in the home directory.

Fixes-commit: 26086b362ff47d21b1abefaf674a6464bf0a8921
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit caf00915532e6e8e509738962964edcd14fb0654)

Gbp-Pq: Name 0056-common-Fix-connecting-to-the-agent.patch

4 years agocommon: Implicitly do a gpgconf --create-socketdir.
Werner Koch [Thu, 23 Mar 2017 08:38:19 +0000 (09:38 +0100)]
common: Implicitly do a gpgconf --create-socketdir.

* common/homedir.c (_gnupg_socketdir_internal): Create the
sub-directory.
--

Although there is no auto cleanup (yet) this should be helpful.  Let's
see whether possibly leaving stale directories around is better than
running into trouble when --create-socketdir was not used.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 26086b362ff47d21b1abefaf674a6464bf0a8921)

Gbp-Pq: Name 0055-common-Implicitly-do-a-gpgconf-create-socketdir.patch

4 years agodirmngr: Fix error handling.
Justus Winter [Tue, 21 Mar 2017 13:22:13 +0000 (14:22 +0100)]
dirmngr: Fix error handling.

* dirmngr/dns-stuff.c (libdns_init): Convert error before printing it.

Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 483c1288a8f86dc6bf93d0d3f2865ecc246aecba)

Gbp-Pq: Name 0054-dirmngr-Fix-error-handling.patch

4 years agodirmngr: Load the hosts file into libdns.
Justus Winter [Tue, 21 Mar 2017 13:18:25 +0000 (14:18 +0100)]
dirmngr: Load the hosts file into libdns.

* dirmngr/dns-stuff.c (libdns_init): Actually load the hosts file into
libdns.
--

Previously, connecting to key servers specified in /etc/hosts was not
possible because libdns' hosts structure was initialized, but not
filled with the content of the hosts file.

GnuPG-bug-id: 2977
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 88f1505f0613894d5544290a170119eb538921e5)

Gbp-Pq: Name 0053-dirmngr-Load-the-hosts-file-into-libdns.patch

4 years agogpg: Make sure the conflict set includes the current key.
Neal H. Walfield [Fri, 17 Mar 2017 12:36:51 +0000 (13:36 +0100)]
gpg: Make sure the conflict set includes the current key.

* g10/tofu.c (get_trust): Sanity check CONFLICT_SET after calling
get_policy.  If POLICY is 'auto' and the default policy is 'ask', make
sure CONFLICT_SET includes the current key.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2959
Debian-bug-id: 854829

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit b1106b4d640325c60a7212a4a44e4f67c0e3312d)

Gbp-Pq: Name 0052-gpg-Make-sure-the-conflict-set-includes-the-current-.patch

4 years agodirmngr: Ignore warning alerts in the GNUTLS handshake.
Werner Koch [Fri, 17 Mar 2017 11:46:09 +0000 (12:46 +0100)]
dirmngr: Ignore warning alerts in the GNUTLS handshake.

* dirmngr/http.c (send_request) [GNUTLS]: Don't bail out on warning
alerts.
--

GnuPG-bug-id: 2833
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 69c521df422a6c9a6b0a93e45c9373a8b6ceb28e)

Gbp-Pq: Name 0051-dirmngr-Ignore-warning-alerts-in-the-GNUTLS-handshak.patch

4 years agogpg: Flush stdout before printing stats with --check-sigs.
Werner Koch [Mon, 13 Mar 2017 16:42:08 +0000 (17:42 +0100)]
gpg: Flush stdout before printing stats with --check-sigs.

* g10/keylist.c (print_signature_stats): Flush stdout.
(list_keyblock_colon): Use es_flush instead of fflush.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 9a77b3b6e41f97b1209ad61c04b3dd33242ecae8)

Gbp-Pq: Name 0050-gpg-Flush-stdout-before-printing-stats-with-check-si.patch

4 years agodoc: Add a note to the trust model direct.
Werner Koch [Wed, 8 Mar 2017 09:46:09 +0000 (10:46 +0100)]
doc: Add a note to the trust model direct.

* doc/gpg.texi (GPG Configuration Options): Add note.  Chnage Index
from trust-mode:foo to trust-model:foo.

(cherry picked from commit f0257b4a86b73f5b956028e68590b6d2a23ea4da)

Gbp-Pq: Name 0049-doc-Add-a-note-to-the-trust-model-direct.patch

4 years agogpg: Fix attempt to double free an UID structure.
Werner Koch [Sun, 5 Mar 2017 22:24:15 +0000 (23:24 +0100)]
gpg: Fix attempt to double free an UID structure.

* g10/getkey.c (get_best_pubkey_byname): Set released .UID to NULL.
--

Phil Pennock reported an assertion failure when doing

  % gpg --auto-key-locate dane --locate-keys someone
  gpg: Ohhhh jeeee: Assertion "uid->ref > 0" in \
         free_user_id failed (free-packet.c:310)

on his keyring.  This patch is not tested but a good guess.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 4a130bbc2c2f4be6e8c6357512a943f435ade28f)

Gbp-Pq: Name 0048-gpg-Fix-attempt-to-double-free-an-UID-structure.patch

4 years agogpg: Fix possible segv when attribute packets are filtered.
Werner Koch [Fri, 3 Mar 2017 08:50:40 +0000 (09:50 +0100)]
gpg: Fix possible segv when attribute packets are filtered.

* g10/import.c (impex_filter_getval): Handle PKT_ATTRIBUTE the same as
PKT_USER_ID
(apply_drop_sig_filter): Ditto.
--

The old code was plainly wrong in that it considered PKT_ATTRIBUTE to
use a PKT_signature object.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 5f6f3f5cae8a95ed469129f9677782c17951dab3)

Gbp-Pq: Name 0047-gpg-Fix-possible-segv-when-attribute-packets-are-fil.patch

4 years agog10: Signal an error when trying to revoke non-existant UID.
Justus Winter [Thu, 2 Mar 2017 10:39:00 +0000 (11:39 +0100)]
g10: Signal an error when trying to revoke non-existant UID.

* g10/keyedit.c (keyedit_quick_revuid): Signal an error when trying to
revoke non-existant UID.
* tests/openpgp/quick-key-manipulation.scm: Test that.

GnuPG-bug-id: 2962
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 62d21a4ab4029b32ea129f1cf3a0e1f22e2fb7b0)

Gbp-Pq: Name 0046-g10-Signal-an-error-when-trying-to-revoke-non-exista.patch

4 years agocommon,tools: Always escape newlines when escaping data.
Justus Winter [Wed, 1 Mar 2017 16:47:47 +0000 (17:47 +0100)]
common,tools: Always escape newlines when escaping data.

* common/stringhelp.c (do_percent_escape): Always escape newlines.
* tools/gpgconf-comp.c (gc_percent_escape): Likewise.
--
Newlines always pose a problem for a line-based communication format.

GnuPG-bug-id: 2387
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit e064c75b08a523f738108428fe0c417a46e66238)

Gbp-Pq: Name 0045-common-tools-Always-escape-newlines-when-escaping-da.patch

4 years agogpg: Make --export-options work with --export-secret-keys.
Werner Koch [Wed, 1 Mar 2017 13:41:47 +0000 (14:41 +0100)]
gpg: Make --export-options work with --export-secret-keys.

* g10/export.c (export_seckeys): Add arg OPTIONS and pass it to
do_export.
(export_secsubkeys): Ditto.
* g10/gpg.c (main): Pass opt.export_options to export_seckeys and
export_secsubkeys
--

Back in the old days we did not used the export options for secret
keys export because of a lot of duplicated code and that the old
secring.gpg was anyway smaller that the pubring.gpg.  With 2.1 it was
pretty easy to enable it.

Reported-by: Peter Lebbing
GnuPG-bug-id: 2973
(cherry picked from commit 891ab23411b7f20ef37d8bde81d9857b083235df)

Gbp-Pq: Name 0044-gpg-Make-export-options-work-with-export-secret-keys.patch

4 years agogpg: Allow creating keys using an existing ECC key.
Werner Koch [Wed, 1 Mar 2017 12:36:01 +0000 (13:36 +0100)]
gpg: Allow creating keys using an existing ECC key.

* common/sexputil.c (get_pk_algo_from_canon_sexp): Remove arg R_ALGO.
Change to return the algo id.  Reimplement using get_pk_algo_from_key.
* g10/keygen.c (check_keygrip): Adjust for change.
* sm/certreqgen-ui.c (check_keygrip): Ditto.
--

GnuPG-bug-id: 2976
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 2bbdeb8ee87a6c7ec211be16391a11b7c6030bed)

Gbp-Pq: Name 0043-gpg-Allow-creating-keys-using-an-existing-ECC-key.patch

4 years agogpg,tools: Make auto-key-retrieve configurable via gpgconf.
Justus Winter [Tue, 28 Feb 2017 13:59:11 +0000 (14:59 +0100)]
gpg,tools: Make auto-key-retrieve configurable via gpgconf.

* g10/gpg.c (gpgconf_list): Add 'auto-key-retrieve'.
* tools/gpgconf-comp.c (gc_options_gpg): Likewise.

GnuPG-bug-id: 2381
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit d379a0174cca595204b32da9a66c513a1304e6d0)

Gbp-Pq: Name 0042-gpg-tools-Make-auto-key-retrieve-configurable-via-gp.patch

4 years agogpg,tools: Make trust-model configurable via gpgconf.
Justus Winter [Tue, 28 Feb 2017 12:15:42 +0000 (13:15 +0100)]
gpg,tools: Make trust-model configurable via gpgconf.

* g10/gpg.c (gpgconf_list): Add 'trust-model'.
* tools/gpgconf-comp.c (gc_options_gpg): Likewise.

GnuPG-bug-id: 2381
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit ebeccd73eb85f9027f0985d77dfe901266c6ddef)

Gbp-Pq: Name 0041-gpg-tools-Make-trust-model-configurable-via-gpgconf.patch

4 years agogpgv,w32: Fix --status-fd.
Werner Koch [Tue, 28 Feb 2017 08:35:41 +0000 (09:35 +0100)]
gpgv,w32: Fix --status-fd.

* g10/gpgv.c (main): Use translate_sys2libc_fd_int for --status-fd.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 8a67dc4c4324b617b5a3fea51c59c674488544d6)

Gbp-Pq: Name 0040-gpgv-w32-Fix-status-fd.patch

4 years agodirmngr: Avoid PTR lookup for hosts in a pool
Werner Koch [Wed, 15 Feb 2017 16:03:57 +0000 (17:03 +0100)]
dirmngr: Avoid PTR lookup for hosts in a pool

* dirmngr/ks-engine-hkp.c (add_host): Don't to a PTR lookup for hosts
in a pool.
--

GnuPG-bug-id: 2928
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit da2ba20868093e3054d18adc2b1bc56cb23e4ba7)

Gbp-Pq: Name 0039-dirmngr-Avoid-PTR-lookup-for-hosts-in-a-pool.patch

4 years agogpg: Make --export-ssh-key work for the primary key.
Werner Koch [Tue, 14 Feb 2017 09:55:13 +0000 (10:55 +0100)]
gpg: Make --export-ssh-key work for the primary key.

* g10/export.c (export_ssh_key): Also check the primary key.
--

If no suitable subkey was found for export, we now check whether the
primary key is suitable for export and export this one.  Without this
change it was only possible to export the primary key by using the '!'
suffix in the key specification.

Also added a sample key for testing this.

GnuPG-bug-id: 2957
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit b456e5be91dc064fc9509ea86edab113721ed299)

Gbp-Pq: Name 0038-gpg-Make-export-ssh-key-work-for-the-primary-key.patch

4 years agodirmngr: Do a DNS lookup even if it is missing from nsswitch.conf.
Werner Koch [Mon, 13 Feb 2017 19:09:26 +0000 (20:09 +0100)]
dirmngr: Do a DNS lookup even if it is missing from nsswitch.conf.

* dirmngr/dns-stuff.c (libdns_init): Do not print error message for a
missing nsswitch.conf.  Make sure that tehre is a DNS entry.
--

GnuPG-bug-id: 2948
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit dee026d761ae3d7594c3dbc5b3fa842df53cc189)

Gbp-Pq: Name 0037-dirmngr-Do-a-DNS-lookup-even-if-it-is-missing-from-n.patch

4 years agogpgconf: No ENOENT warning with --change-options et al.
Werner Koch [Mon, 13 Feb 2017 18:38:53 +0000 (19:38 +0100)]
gpgconf: No ENOENT warning with --change-options et al.

* tools/gpgconf-comp.c (retrieve_options_from_program): Check ERRNO
before printing a warning.
--

It is common that a conf files does not exist - thus we should not
print a warning.

GnuPG-bug-id: 2944

BTW: The error messages in gpgconf should be reworked to match those
of the other components.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 30dac0486b6357e84fbe79c612eea940b654e4d1)

Gbp-Pq: Name 0036-gpgconf-No-ENOENT-warning-with-change-options-et-al.patch

4 years agogpg: Print a warning if no command has been given.
Werner Koch [Mon, 13 Feb 2017 12:09:51 +0000 (13:09 +0100)]
gpg: Print a warning if no command has been given.

* g10/gpg.c (main): Print in the default case.
--

GnuPG-bug-id: 2943
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 810adfd47801fc01e45fb71af9f05c91f7890cdb)

Gbp-Pq: Name 0035-gpg-Print-a-warning-if-no-command-has-been-given.patch

4 years agogpg: Fix memory leak in the error case of signature creation.
Werner Koch [Fri, 10 Feb 2017 16:16:07 +0000 (17:16 +0100)]
gpg: Fix memory leak in the error case of signature creation.

* g10/sign.c (write_signature_packets): Free SIG.  Also replace
xcalloc by xtrycalloc.
--

If do_sign fails SIG was not released.  Note that in the good case SIG
is transferred to PKT and freed by free_packet.

Reported-by: Stephan Müller
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 5996c7bf99f3a681393fd9589276399ebc956cff)

Gbp-Pq: Name 0034-gpg-Fix-memory-leak-in-the-error-case-of-signature-c.patch

4 years agocommon: Avoid warning about implicit declaration of gnupg_fd_valid.
Daniel Kahn Gillmor [Wed, 8 Feb 2017 17:05:08 +0000 (12:05 -0500)]
common: Avoid warning about implicit declaration of gnupg_fd_valid.

* common/logging.c: Add #include "sysutils.h".

--

Without this, we see:

logging.c:573:9: warning: implicit declaration of function \
  ‘gnupg_fd_valid’ [-Wimplicit-function-declaration]
   if (! gnupg_fd_valid (fd))
         ^~~~~~~~~~~~~~

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
(cherry picked from commit 8810314e377a9cb6612150a57cf99260ed0bb9f6)

Gbp-Pq: Name 0033-common-Avoid-warning-about-implicit-declaration-of-g.patch

4 years agogpg,common: Make sure that all fd given are valid.
Justus Winter [Wed, 8 Feb 2017 12:49:41 +0000 (13:49 +0100)]
gpg,common: Make sure that all fd given are valid.

* common/sysutils.c (gnupg_fd_valid): New function.
* common/sysutils.h (gnupg_fd_valid): New declaration.
* common/logging.c (log_set_file): Use the new function.
* g10/cpr.c (set_status_fd): Likewise.
* g10/gpg.c (main): Likewise.
* g10/keylist.c (read_sessionkey_from_fd): Likewise.
* g10/passphrase.c (set_attrib_fd): Likewise.
* tests/openpgp/Makefile.am (XTESTS): Add the new test.
* tests/openpgp/issue2941.scm: New file.
--

Consider a situation where the user passes "--status-fd 3" but file
descriptor 3 is not open.

During the course of executing the rest of the commands, it's possible
that gpg itself will open some files, and file descriptor 3 will get
allocated.

In this situation, the status information will be appended directly to
whatever file happens to have landed on fd 3 (the trustdb? the
keyring?).

This is a potential data destruction issue for all writable file
descriptor options:

   --status-fd
   --attribute-fd
   --logger-fd

It's also a potential issue for readable file descriptor options, but
the risk is merely weird behavior, and not data corruption:

   --override-session-key-fd
   --passphrase-fd
   --command-fd

Fixes this by checking whether the fd is valid early on before using
it.

GnuPG-bug-id: 2941
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 6823ed46584e753de3aba48a00ab738ab009a860)

Gbp-Pq: Name 0032-gpg-common-Make-sure-that-all-fd-given-are-valid.patch

4 years agogpg: Fix aliases --list-key, --list-sig, and --check-sig.
Daniel Kahn Gillmor [Sat, 4 Feb 2017 06:23:32 +0000 (01:23 -0500)]
gpg: Fix aliases --list-key, --list-sig, and --check-sig.

* g10/gpg.c (opts): Define commands with ARGPARSE_c
instead of ARGPARSE_s_n.

--

These three entries are commands, but they're being treated as a
string-based option for some reason.  However, if you try to use them
concurrently with another command like --clearsign, you'll get "gpg:
conflicting commands".

Furthermore, because they're marked as options, their flags differ
from the commands that they alias, they cause ambiguity in
abbreviation (e.g. try "gpg --list-ke") which should have been fixed
by 7249ab0f95d1f6cb8ee61eefedc79801bb56398f.

Marking them explicitly as commands for argparse should be more
accurate and should resolve the abbreviation ambiguity issue.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
gpg: fix aliases --list-key, --list-sig, and --check-sig.

* g10/gpg.c: ARGPARSE_OPTS opts[]: define commands with ARGPARSE_c
instead of ARGPARSE_s_n.

--

These three entries are commands, but they're being treated as a
string-based option for some reason.  However, if you try to use them
concurrently with another command like --clearsign, you'll get "gpg:
conflicting commands".

Furthermore, because they're marked as options, their flags differ
from the commands that they alias, they cause ambiguity in
abbreviation (e.g. try "gpg --list-ke") which should have been fixed
by 7249ab0f95d1f6cb8ee61eefedc79801bb56398f.

Marking them explicitly as commands for argparse should be more
accurate and should resolve the abbreviation ambiguity issue.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
(cherry picked from commit f31120a5aa40b6e4e89d41d1d5d34e0f7da173b4)

Gbp-Pq: Name 0031-gpg-Fix-aliases-list-key-list-sig-and-check-sig.patch

4 years agoscd: Fix factory-reset.
NIIBE Yutaka [Fri, 17 Feb 2017 08:30:05 +0000 (03:30 -0500)]
scd: Fix factory-reset.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Backport from master branch:

    99d4dfe83
    e2792813a
    031e3fa7b

Additionally, fix another bug when tested with 2.1.18-7 with PC/SC.

Gbp-Pq: Name 0030-scd-Fix-factory-reset.patch

4 years agoscd: Fix use case of PC/SC.
NIIBE Yutaka [Mon, 13 Feb 2017 02:09:13 +0000 (11:09 +0900)]
scd: Fix use case of PC/SC.

* scd/apdu.c (apdu_open_reader): Add an argument APP_EMPTY.
When CCID driver fails to open, try PC/SC if APP is nothing.
* scd/app.c (select_application): Supply arg if APP is nothing.

--

After scanning available card readers by CCID driver, scdaemon should
try PC/SC service if no APP is registered yet.  Also, when the slot
is allocated for PC/SC (ccid.handle==NULL), it should not call
ccid_compare_BAI, otherwise scdaemon crashes.

Debian-bug-id: 852702, 854005, 854595, 854616

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Gbp-Pq: Name 0029-scd-Fix-use-case-of-PC-SC.patch

4 years agoscd: Backport two fixes from master.
NIIBE Yutaka [Sat, 4 Feb 2017 23:34:08 +0000 (08:34 +0900)]
scd: Backport two fixes from master.

* scd/app.c (app_new_register): Initialize by -1, so that it can detect
an error correctly when card reader can't power-on the card initially.
* scd/command.c (open_card_with_request): Release APP before the scan.

--
The first one-liner patch handles an erroneous card.

The second patch handles the case when we repeatedly do
signing/decrypting by a single session of scdaemon.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Gbp-Pq: Name 0028-scd-Backport-two-fixes-from-master.patch

4 years agodoc: Clarify abbreviation of --help.
Daniel Kahn Gillmor [Sat, 4 Feb 2017 06:28:08 +0000 (01:28 -0500)]
doc: Clarify abbreviation of --help.

* doc/gpg.texi: clarify abbreviation of --help.

Debian-bug-id: 852979
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
(cherry picked from commit f2b276dffbe2435b17abf2b3c51684d3636f3f11)

Gbp-Pq: Name 0027-doc-Clarify-abbreviation-of-help.patch

4 years agogpg: More diagnostics for a launched pinentry.
Werner Koch [Fri, 3 Feb 2017 11:04:52 +0000 (12:04 +0100)]
gpg: More diagnostics for a launched pinentry.

* agent/call-pinentry.c (start_pinentry): Call getinfo/ttyinfo.
* g10/server.c (gpg_proxy_pinentry_notify): Simplify the output so
that we do not change the code when adding new fields to
PINENTRY_LAUNCHED.
--

This patch changes the --verbose output of gpg to show
for example

  gpg: pinentry launched (5228 gtk2 1.0.1-beta10 \
  /dev/pts/4 xterm localhost:10.0)

the used tty, its type, and the value of DISPLAY in addiion to the
pid, flavor, and version.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 7052a0d77cf8f3a445b252a809d29be445788625)

Gbp-Pq: Name 0026-gpg-More-diagnostics-for-a-launched-pinentry.patch

4 years agogpg: Don't assume that strtoul interprets "" as 0.
Neal H. Walfield [Thu, 2 Feb 2017 14:48:45 +0000 (15:48 +0100)]
gpg: Don't assume that strtoul interprets "" as 0.

* g10/tofu.c (show_statistics): If there are not records, return 0
instead of NULL.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2853

According to SUSv3:

  If the subject sequence is empty or does not have the expected form,
  no conversion is performed
  ...
  If no conversion could be performed, 0 is returned and errno may be
  set to [EINVAL].

  http://pubs.opengroup.org/onlinepubs/007908799/xsh/strtol.html

It appears that MacOS X sets errno to EINVAL, but glibc doesn't.
Hence, we map NULL to 0 explicitly.

(cherry picked from commit 407f5f9baea5591f148974240a87dfb43e5efef3)

Gbp-Pq: Name 0025-gpg-Don-t-assume-that-strtoul-interprets-as-0.patch

4 years agogpg: Ensure TOFU bindings associated with UTKs are registered as usual
Neal H. Walfield [Thu, 2 Feb 2017 13:24:38 +0000 (14:24 +0100)]
gpg: Ensure TOFU bindings associated with UTKs are registered as usual

* g10/tofu.c (get_trust): Call get_policy before short-circuiting the
policy lookup for ultimately trusted keys to make sure the binding is
added to the bindings table, if necessary.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2929
(cherry picked from commit 769272ba87f282a69e8d5f9bb27c86e6bec4496b)

Gbp-Pq: Name 0024-gpg-Ensure-TOFU-bindings-associated-with-UTKs-are-re.patch

4 years agogpg: If there is a TOFU conflict, elide the too few message warning.
Neal H. Walfield [Thu, 2 Feb 2017 12:26:17 +0000 (13:26 +0100)]
gpg: If there is a TOFU conflict, elide the too few message warning.

* g10/tofu.c (tofu_get_validity): If there was a conflict, don't also
print out a warning about too few messages.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit a08c781739e7561093f32b732c4991f2bd817ec2)

Gbp-Pq: Name 0023-gpg-If-there-is-a-TOFU-conflict-elide-the-too-few-me.patch

4 years agogpg: Only print out TOFU statistics for conflicts in interactive mode
Neal H. Walfield [Thu, 2 Feb 2017 12:24:57 +0000 (13:24 +0100)]
gpg: Only print out TOFU statistics for conflicts in interactive mode

* g10/tofu.c (get_trust): Add arguments POLICYP and CONFLICT_SETP.  If
they are not NULL, return the policy and conflict set (if there is
one), respectively.  Update callers.  If MAY_ASK is FALSE, don't print
out the statistics.
(tofu_register_encryption): If there is a conflict and we haven't yet
printed the statistics about the conflicting bindings, do so now.
(tofu_get_validity): Likewise.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2914
(cherry picked from commit 027b81b35fe36692005b8dba22d9eb2db05e8c80)

Gbp-Pq: Name 0022-gpg-Only-print-out-TOFU-statistics-for-conflicts-in-.patch

4 years agogpg: Add newline to output.
Neal H. Walfield [Thu, 2 Feb 2017 10:00:51 +0000 (11:00 +0100)]
gpg: Add newline to output.

* g10/tofu.c (ask_about_binding): Add newline to output.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit 74268180e5a3acc827f3a369f1fe5971f3bbe285)

Gbp-Pq: Name 0021-gpg-Add-newline-to-output.patch

4 years agogpg: Remove period at end of warning.
Neal H. Walfield [Fri, 6 Jan 2017 10:51:08 +0000 (11:51 +0100)]
gpg: Remove period at end of warning.

* g10/tofu.c (tofu_register_encryption): Remove period at end of
warning.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit 6f9d8a956b2ca0f5a0eb7acc656fc17af2f2de47)

Gbp-Pq: Name 0020-gpg-Remove-period-at-end-of-warning.patch

4 years agodirmngr: New option --no-use-tor and internal changes.
Werner Koch [Wed, 1 Feb 2017 16:54:14 +0000 (17:54 +0100)]
dirmngr: New option --no-use-tor and internal changes.

* 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 <wk@gnupg.org>
(cherry picked from commit 7440119e729d3fdedda8a9b44b70f8959beea8d7)

Gbp-Pq: Name 0019-dirmngr-New-option-no-use-tor-and-internal-changes.patch

4 years agogpg: Fix searching for mail addresses in keyrings.
Justus Winter [Wed, 25 Jan 2017 15:33:20 +0000 (16:33 +0100)]
gpg: Fix searching for mail addresses in keyrings.

* 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 "<foo@example.org>"' 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. 'foo@example.org'.

GnuPG-bug-id: 2930
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 3f4f20ee6eff052c88647b820d9ecfdbd8df0f40)

Gbp-Pq: Name 0018-gpg-Fix-searching-for-mail-addresses-in-keyrings.patch

4 years agoagent: Fix double free.
Justus Winter [Wed, 25 Jan 2017 12:51:57 +0000 (13:51 +0100)]
agent: Fix double free.

* 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 <justus@g10code.com>
(cherry picked from commit e175152ef7515921635bf1e00383e812668d13fc)

Gbp-Pq: Name 0017-agent-Fix-double-free.patch

4 years agogpg: Print a warning on Tor problems.
Werner Koch [Tue, 24 Jan 2017 19:45:31 +0000 (20:45 +0100)]
gpg: Print a warning on Tor problems.

* 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 <wk@gnupg.org>
(cherry picked from commit 770b75a746836773909af25ccb9b480e61cea677)

Gbp-Pq: Name 0016-gpg-Print-a-warning-on-Tor-problems.patch

4 years agodirmngr: Simplify error returning inside http.c.
Werner Koch [Tue, 24 Jan 2017 17:41:43 +0000 (18:41 +0100)]
dirmngr: Simplify error returning inside http.c.

* 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 <wk@gnupg.org>
(cherry picked from commit 51e5a5e5a46279809848b4ab4419f35045336010)

Gbp-Pq: Name 0015-dirmngr-Simplify-error-returning-inside-http.c.patch

4 years agodirmngr: New option --disable-ipv4.
Werner Koch [Tue, 24 Jan 2017 15:36:28 +0000 (16:36 +0100)]
dirmngr: New option --disable-ipv4.

* 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 <wk@gnupg.org>
(cherry picked from commit 72736af86a501592d974d46ff754a63959e183bd)

Gbp-Pq: Name 0014-dirmngr-New-option-disable-ipv4.patch

4 years agotools: Improve error handling.
Justus Winter [Mon, 23 Jan 2017 13:24:22 +0000 (14:24 +0100)]
tools: Improve error handling.

* 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 <justus@g10code.com>
(cherry picked from commit b0348fdb26637b0bcbd68a96c1746a1613b309af)

Gbp-Pq: Name 0013-tools-Improve-error-handling.patch

4 years agotools: Fix memory leak.
Justus Winter [Mon, 23 Jan 2017 10:52:30 +0000 (11:52 +0100)]
tools: Fix memory leak.

* 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 <justus@g10code.com>
(cherry picked from commit 5b28f025085b386e0ec49535d4cd3f875a414eb0)

Gbp-Pq: Name 0012-tools-Fix-memory-leak.patch

4 years agoagent: Avoid scheduled checks on socket when inotify is working.
Daniel Kahn Gillmor [Tue, 1 Nov 2016 04:57:44 +0000 (00:57 -0400)]
agent: Avoid scheduled checks on socket when inotify is working.

* agent/gpg-agent.c (handle_connections): When inotify is working, we
do not need to schedule a timer to evaluate whether we control our own
socket or not.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic gpg-agent-idling
Gbp-Pq: Name 0004-agent-Avoid-scheduled-checks-on-socket-when-inotify-.patch

4 years agoagent: Avoid tight timer tick when possible.
Daniel Kahn Gillmor [Tue, 1 Nov 2016 04:14:10 +0000 (00:14 -0400)]
agent: Avoid tight timer tick when possible.

* agent/gpg-agent.c (need_tick): Evaluate whether the short-phase
handle_tick() is needed.
(handle_connections): On each cycle of the select loop, adjust whether
we should call handle_tick() or not.
(start_connection_thread_ssh, do_start_connection_thread): Signal the
main loop when the child terminates.
* agent/call-scd.c (start_scd): Call interrupt_main_thread_loop() once
the scdaemon thread context has started up.

--

With this change, an idle gpg-agent that has no scdaemon running only
wakes up once a minute (to check_own_socket).

Thanks to Ian Jackson and NIIBE Yutaka who helped me improve some of
the blocking and corner cases.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic gpg-agent-idling
Gbp-Pq: Name 0003-agent-Avoid-tight-timer-tick-when-possible.patch

4 years agoagent: Allow threads to interrupt main select loop with SIGCONT.
Daniel Kahn Gillmor [Tue, 1 Nov 2016 04:45:23 +0000 (00:45 -0400)]
agent: Allow threads to interrupt main select loop with SIGCONT.

* agent/gpg-agent.c (interrupt_main_thread_loop): New function on
non-windows platforms, allows other threads to interrupt the main loop
if there's something that the main loop might be interested in.

--

For example, the main loop might be interested in changes in program
state that affect the timers it expects to see.

I don't know how to do this on Windows platforms, but i welcome any
proposed improvements.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic gpg-agent-idling
Gbp-Pq: Name 0002-agent-Allow-threads-to-interrupt-main-select-loop-wi.patch

4 years agoagent: Create framework of scheduled timers.
Daniel Kahn Gillmor [Tue, 1 Nov 2016 01:27:36 +0000 (21:27 -0400)]
agent: Create framework of scheduled timers.

agent/gpg-agent.c (handle_tick): Remove intermittent call to
check_own_socket.
(tv_is_set): Add inline helper function for readability.
(handle_connections) Create general table of pending scheduled
timeouts.

--

handle_tick() does fine-grained, rapid activity.  check_own_socket()
is supposed to happen at a different interval.

Mixing the two of them makes it a requirement that one interval be a
multiple of the other, which isn't ideal if there are different delay
strategies that we might want in the future.

Creating an extensible regular timer framework in handle_connections
should make it possible to have any number of cadenced timers fire
regularly, without requiring that they happen in cadences related to
each other.

It should also make it possible to dynamically change the cadence of
any regularly-scheduled timeout.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic gpg-agent-idling
Gbp-Pq: Name 0001-agent-Create-framework-of-scheduled-timers.patch

4 years agodirmngr: Drop useless housekeeping.
Daniel Kahn Gillmor [Sat, 29 Oct 2016 06:15:08 +0000 (02:15 -0400)]
dirmngr: Drop useless housekeeping.

* dirmngr/dirmngr.c (handle_tick, time_for_housekeeping_p,
housekeeping_thread): Remove, no longer needed.
(handle_connections): Drop any attempt at a timeout, since no
housekeeping is necessary.

--

The housekeeping thread no longer does anything, and the main loop was
waking up every 60 seconds for no good reason.  The code is simpler
and the runtime is more efficient if we drop this.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic dirmngr-idling
Gbp-Pq: Name 0005-dirmngr-Drop-useless-housekeeping.patch

4 years agodirmngr: Avoid automatically checking upstream swdb.
Daniel Kahn Gillmor [Mon, 21 Nov 2016 04:09:24 +0000 (23:09 -0500)]
dirmngr: Avoid automatically checking upstream swdb.

* dirmngr/dirmngr.c (housekeeping_thread): Avoid automatically
checking upstream's software database.  In Debian, software updates
should be handled by the distro mechanism, and additional upstream
checks only confuse the user.
* doc/dirmngr.texi: document that --allow-version-check does nothing.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic dirmngr-idling
Gbp-Pq: Name 0004-dirmngr-Avoid-automatically-checking-upstream-swdb.patch

4 years agodimrngr: Avoid need for hkp housekeeping.
Daniel Kahn Gillmor [Sat, 29 Oct 2016 06:00:50 +0000 (02:00 -0400)]
dimrngr: Avoid need for hkp housekeeping.

* dirmngr/ks-engine-hkp.c (host_is_alive): New function.  Test whether
host is alive and resurrects it if it has been dead long enough.
(select_random_host, map_host, ks_hkp_mark_host): Use host_is_alive
instead of testing hostinfo_t->dead directly.
(ks_hkp_housekeeping): Remove function, no longer needed.
* dirmngr/dirmngr.c (housekeeping_thread): Remove call to
ks_hkp_housekeeping.

--

Rather than resurrecting hosts upon scheduled resurrection times, test
whether hosts should be resurrected as they're inspected for being
dead.  This removes the need for explicit housekeeping, and makes host
resurrections happen "just in time", rather than being clustered on
HOUSEKEEPING_INTERVAL seconds.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic dirmngr-idling
Gbp-Pq: Name 0002-dimrngr-Avoid-need-for-hkp-housekeeping.patch

4 years agodirmngr: hkp: Avoid potential race condition when some hosts die.
Daniel Kahn Gillmor [Sat, 29 Oct 2016 05:25:05 +0000 (01:25 -0400)]
dirmngr: hkp: Avoid potential race condition when some hosts die.

* dirmngr/ks-engine-hkp.c (select_random_host): Use atomic pass
through the host table instead of risking out-of-bounds write.

--

Multiple threads may write to hosttable[x]->dead while
select_random_host() is running.  For example, a housekeeping thread
might clear the ->dead bit on some entries, or another connection to
dirmngr might manually mark a host as alive.

If one or more hosts are resurrected between the two loops over a
given table in select_random_host(), then the allocation of tbl might
not be large enough, resulting in a write past the end of tbl on the
second loop.

This change collapses the two loops into a single loop to avoid this
discrepancy: each host's "dead" bit is now only checked once.

As Werner points out, this isn't currently strictly necessary, since
npth will not switch threads unless a blocking system call is made,
and no blocking system call is made in these two loops.

However, in a subsequent change in this series, we will call a
function in this loop, and that function may sometimes write(2), or
call other functions, which may themselves block.  Keeping this as a
single-pass loop avoids the need to keep track of what might block and
what might not.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Gbp-Pq: Topic dirmngr-idling
Gbp-Pq: Name 0001-dirmngr-hkp-Avoid-potential-race-condition-when-some.patch

4 years agoavoid regenerating defsincdate (use shipped file)
Daniel Kahn Gillmor [Mon, 29 Aug 2016 16:34:42 +0000 (12:34 -0400)]
avoid regenerating defsincdate (use shipped file)

upstream ships doc/defsincdate in its tarballs.  but doc/Makefile.am
tries to rewrite doc/defsincdate if it notices that any of the files
have been modified more recently, and it does so assuming that we're
running from a git repo.

However, we'd rather ship the documents cleanly without regenerating
defsincdate -- we don't have a git repo available (debian builds from
upstream tarballs) and any changes to the texinfo files (e.g. from
debian/patches/) might result in different dates on the files than we
expect after they're applied by dpkg or quilt or whatever, which makes
the datestamp unreproducible.

Gbp-Pq: Topic debian-packaging
Gbp-Pq: Name 0003-avoid-regenerating-defsincdate-use-shipped-file.patch

4 years agoAvoid simple memory dumps via ptrace
Daniel Kahn Gillmor [Wed, 12 Aug 2015 00:28:26 +0000 (20:28 -0400)]
Avoid simple memory dumps via ptrace

This avoids needing to setgid gpg-agent.  It probably doesn't defend
against all possible attacks, but it defends against one specific (and
easy) one.  If there are other protections we should do them too.

This will make it slightly harder to debug the agent because the
normal user won't be able to attach gdb to it directly while it runs.

The remaining options for debugging are:

 * launch the agent from gdb directly
 * connect gdb to a running agent as the superuser

Upstream bug: https://bugs.gnupg.org/gnupg/issue1211

Gbp-Pq: Topic block-ptrace-on-agent
Gbp-Pq: Name 0002-Avoid-simple-memory-dumps-via-ptrace.patch

4 years agoavoid-beta-warning
Debian GnuPG Maintainers [Tue, 14 Apr 2015 14:02:31 +0000 (10:02 -0400)]
avoid-beta-warning

avoid self-describing as a beta

Using autoreconf against the source as distributed in tarball form
invariably results in a package that thinks it's a "beta" package,
which produces the "THIS IS A DEVELOPMENT VERSION" warning string.

since we use dh_autoreconf, i need this patch to avoid producing
builds that announce themselves as DEVELOPMENT VERSIONs.

See discussion at:

 http://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029065.html

Gbp-Pq: Topic debian-packaging
Gbp-Pq: Name 0001-avoid-beta-warning.patch

4 years agognupg2 (2.1.18-8~deb9u1) stretch; urgency=medium
Daniel Kahn Gillmor [Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)]
gnupg2 (2.1.18-8~deb9u1) stretch; urgency=medium

  * Bugfix update for debian stretch point release.

[dgit import unpatched gnupg2 2.1.18-8~deb9u1]

4 years agoImport gnupg2_2.1.18-8~deb9u1.debian.tar.bz2
Daniel Kahn Gillmor [Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)]
Import gnupg2_2.1.18-8~deb9u1.debian.tar.bz2

[dgit import tarball gnupg2 2.1.18-8~deb9u1 gnupg2_2.1.18-8~deb9u1.debian.tar.bz2]

5 years agoscd: Fix use case of PC/SC.
NIIBE Yutaka [Mon, 13 Feb 2017 02:09:13 +0000 (11:09 +0900)]
scd: Fix use case of PC/SC.

* scd/apdu.c (apdu_open_reader): Add an argument APP_EMPTY.
When CCID driver fails to open, try PC/SC if APP is nothing.
* scd/app.c (select_application): Supply arg if APP is nothing.

--

After scanning available card readers by CCID driver, scdaemon should
try PC/SC service if no APP is registered yet.  Also, when the slot
is allocated for PC/SC (ccid.handle==NULL), it should not call
ccid_compare_BAI, otherwise scdaemon crashes.

Debian-bug-id: 852702, 854005, 854595, 854616

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Gbp-Pq: Name 0029-scd-Fix-use-case-of-PC-SC.patch

5 years agoscd: Backport two fixes from master.
NIIBE Yutaka [Sat, 4 Feb 2017 23:34:08 +0000 (08:34 +0900)]
scd: Backport two fixes from master.

* scd/app.c (app_new_register): Initialize by -1, so that it can detect
an error correctly when card reader can't power-on the card initially.
* scd/command.c (open_card_with_request): Release APP before the scan.

--
The first one-liner patch handles an erroneous card.

The second patch handles the case when we repeatedly do
signing/decrypting by a single session of scdaemon.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Gbp-Pq: Name 0028-scd-Backport-two-fixes-from-master.patch

5 years agodoc: Clarify abbreviation of --help.
Daniel Kahn Gillmor [Sat, 4 Feb 2017 06:28:08 +0000 (01:28 -0500)]
doc: Clarify abbreviation of --help.

* doc/gpg.texi: clarify abbreviation of --help.

Debian-bug-id: 852979
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
(cherry picked from commit f2b276dffbe2435b17abf2b3c51684d3636f3f11)

Gbp-Pq: Name 0027-doc-Clarify-abbreviation-of-help.patch

5 years agogpg: More diagnostics for a launched pinentry.
Werner Koch [Fri, 3 Feb 2017 11:04:52 +0000 (12:04 +0100)]
gpg: More diagnostics for a launched pinentry.

* agent/call-pinentry.c (start_pinentry): Call getinfo/ttyinfo.
* g10/server.c (gpg_proxy_pinentry_notify): Simplify the output so
that we do not change the code when adding new fields to
PINENTRY_LAUNCHED.
--

This patch changes the --verbose output of gpg to show
for example

  gpg: pinentry launched (5228 gtk2 1.0.1-beta10 \
  /dev/pts/4 xterm localhost:10.0)

the used tty, its type, and the value of DISPLAY in addiion to the
pid, flavor, and version.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 7052a0d77cf8f3a445b252a809d29be445788625)

Gbp-Pq: Name 0026-gpg-More-diagnostics-for-a-launched-pinentry.patch

5 years agogpg: Don't assume that strtoul interprets "" as 0.
Neal H. Walfield [Thu, 2 Feb 2017 14:48:45 +0000 (15:48 +0100)]
gpg: Don't assume that strtoul interprets "" as 0.

* g10/tofu.c (show_statistics): If there are not records, return 0
instead of NULL.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2853

According to SUSv3:

  If the subject sequence is empty or does not have the expected form,
  no conversion is performed
  ...
  If no conversion could be performed, 0 is returned and errno may be
  set to [EINVAL].

  http://pubs.opengroup.org/onlinepubs/007908799/xsh/strtol.html

It appears that MacOS X sets errno to EINVAL, but glibc doesn't.
Hence, we map NULL to 0 explicitly.

(cherry picked from commit 407f5f9baea5591f148974240a87dfb43e5efef3)

Gbp-Pq: Name 0025-gpg-Don-t-assume-that-strtoul-interprets-as-0.patch

5 years agogpg: Ensure TOFU bindings associated with UTKs are registered as usual
Neal H. Walfield [Thu, 2 Feb 2017 13:24:38 +0000 (14:24 +0100)]
gpg: Ensure TOFU bindings associated with UTKs are registered as usual

* g10/tofu.c (get_trust): Call get_policy before short-circuiting the
policy lookup for ultimately trusted keys to make sure the binding is
added to the bindings table, if necessary.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2929
(cherry picked from commit 769272ba87f282a69e8d5f9bb27c86e6bec4496b)

Gbp-Pq: Name 0024-gpg-Ensure-TOFU-bindings-associated-with-UTKs-are-re.patch

5 years agogpg: If there is a TOFU conflict, elide the too few message warning.
Neal H. Walfield [Thu, 2 Feb 2017 12:26:17 +0000 (13:26 +0100)]
gpg: If there is a TOFU conflict, elide the too few message warning.

* g10/tofu.c (tofu_get_validity): If there was a conflict, don't also
print out a warning about too few messages.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit a08c781739e7561093f32b732c4991f2bd817ec2)

Gbp-Pq: Name 0023-gpg-If-there-is-a-TOFU-conflict-elide-the-too-few-me.patch

5 years agogpg: Only print out TOFU statistics for conflicts in interactive mode
Neal H. Walfield [Thu, 2 Feb 2017 12:24:57 +0000 (13:24 +0100)]
gpg: Only print out TOFU statistics for conflicts in interactive mode

* g10/tofu.c (get_trust): Add arguments POLICYP and CONFLICT_SETP.  If
they are not NULL, return the policy and conflict set (if there is
one), respectively.  Update callers.  If MAY_ASK is FALSE, don't print
out the statistics.
(tofu_register_encryption): If there is a conflict and we haven't yet
printed the statistics about the conflicting bindings, do so now.
(tofu_get_validity): Likewise.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
GnuPG-bug-id: 2914
(cherry picked from commit 027b81b35fe36692005b8dba22d9eb2db05e8c80)

Gbp-Pq: Name 0022-gpg-Only-print-out-TOFU-statistics-for-conflicts-in-.patch

5 years agogpg: Add newline to output.
Neal H. Walfield [Thu, 2 Feb 2017 10:00:51 +0000 (11:00 +0100)]
gpg: Add newline to output.

* g10/tofu.c (ask_about_binding): Add newline to output.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit 74268180e5a3acc827f3a369f1fe5971f3bbe285)

Gbp-Pq: Name 0021-gpg-Add-newline-to-output.patch

5 years agogpg: Remove period at end of warning.
Neal H. Walfield [Fri, 6 Jan 2017 10:51:08 +0000 (11:51 +0100)]
gpg: Remove period at end of warning.

* g10/tofu.c (tofu_register_encryption): Remove period at end of
warning.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
(cherry picked from commit 6f9d8a956b2ca0f5a0eb7acc656fc17af2f2de47)

Gbp-Pq: Name 0020-gpg-Remove-period-at-end-of-warning.patch

5 years agodirmngr: New option --no-use-tor and internal changes.
Werner Koch [Wed, 1 Feb 2017 16:54:14 +0000 (17:54 +0100)]
dirmngr: New option --no-use-tor and internal changes.

* 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 <wk@gnupg.org>
(cherry picked from commit 7440119e729d3fdedda8a9b44b70f8959beea8d7)

Gbp-Pq: Name 0019-dirmngr-New-option-no-use-tor-and-internal-changes.patch

5 years agogpg: Fix searching for mail addresses in keyrings.
Justus Winter [Wed, 25 Jan 2017 15:33:20 +0000 (16:33 +0100)]
gpg: Fix searching for mail addresses in keyrings.

* 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 "<foo@example.org>"' 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. 'foo@example.org'.

GnuPG-bug-id: 2930
Signed-off-by: Justus Winter <justus@g10code.com>
(cherry picked from commit 3f4f20ee6eff052c88647b820d9ecfdbd8df0f40)

Gbp-Pq: Name 0018-gpg-Fix-searching-for-mail-addresses-in-keyrings.patch

5 years agoagent: Fix double free.
Justus Winter [Wed, 25 Jan 2017 12:51:57 +0000 (13:51 +0100)]
agent: Fix double free.

* 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 <justus@g10code.com>
(cherry picked from commit e175152ef7515921635bf1e00383e812668d13fc)

Gbp-Pq: Name 0017-agent-Fix-double-free.patch

5 years agogpg: Print a warning on Tor problems.
Werner Koch [Tue, 24 Jan 2017 19:45:31 +0000 (20:45 +0100)]
gpg: Print a warning on Tor problems.

* 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 <wk@gnupg.org>
(cherry picked from commit 770b75a746836773909af25ccb9b480e61cea677)

Gbp-Pq: Name 0016-gpg-Print-a-warning-on-Tor-problems.patch