Package: gnupg2 / 2.2.12-1+deb10u1

Metadata

Package Version Patches format
gnupg2 2.2.12-1+deb10u1 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
debian packaging/avoid beta warning.patch | (download)

autogen.sh | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 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

debian packaging/avoid regenerating defsincdate use shipped file.patch | (download)

doc/Makefile.am | 7 0 + 7 - 0 !
1 file changed, 7 deletions(-)

 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
block ptrace on secret daemons/Avoid simple memory dumps via ptrace.patch | (download)

agent/gpg-agent.c | 8 8 + 0 - 0 !
configure.ac | 2 1 + 1 - 0 !
scd/scdaemon.c | 9 9 + 0 - 0 !
3 files changed, 18 insertions(+), 1 deletion(-)

 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://dev.gnupg.org/T1211

dirmngr idling/dirmngr hkp Avoid potential race condition when some.patch | (download)

dirmngr/ks-engine-hkp.c | 23 10 + 13 - 0 !
1 file changed, 10 insertions(+), 13 deletions(-)

 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>

dirmngr idling/dirmngr Avoid need for hkp housekeeping.patch | (download)

dirmngr/dirmngr.c | 3 0 + 3 - 0 !
dirmngr/dirmngr.h | 1 0 + 1 - 0 !
dirmngr/ks-engine-hkp.c | 72 35 + 37 - 0 !
3 files changed, 35 insertions(+), 41 deletions(-)

 dirmngr: 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>

dirmngr idling/dirmngr Avoid automatically checking upstream swdb.patch | (download)

dirmngr/dirmngr.c | 2 0 + 2 - 0 !
doc/dirmngr.texi | 7 4 + 3 - 0 !
2 files changed, 4 insertions(+), 5 deletions(-)

 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>

gpg agent idling/agent Create framework of scheduled timers.patch | (download)

agent/gpg-agent.c | 84 57 + 27 - 0 !
1 file changed, 57 insertions(+), 27 deletions(-)

 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()
gpg agent idling/agent Allow threads to interrupt main select loop wi.patch | (download)

agent/agent.h | 1 1 + 0 - 0 !
agent/gpg-agent.c | 18 17 + 1 - 0 !
2 files changed, 18 insertions(+), 1 deletion(-)

 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>

gpg agent idling/agent Avoid tight timer tick when possible.patch | (download)

agent/call-scd.c | 2 2 + 0 - 0 !
agent/gpg-agent.c | 29 27 + 2 - 0 !
2 files changed, 29 insertions(+), 2 deletions(-)

 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>

gpg agent idling/agent Avoid scheduled checks on socket when inotify .patch | (download)

agent/gpg-agent.c | 2 2 + 0 - 0 !
1 file changed, 2 insertions(+)

 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>

from master/gpg default to 3072 bit RSA keys.patch | (download)

agent/command.c | 2 1 + 1 - 0 !
doc/wks.texi | 4 2 + 2 - 0 !
g10/keygen.c | 9 4 + 5 - 0 !
g10/keyid.c | 4 2 + 2 - 0 !
4 files changed, 9 insertions(+), 10 deletions(-)

 gpg: default to 3072-bit rsa keys.

* agent/command.c (hlp_genkey): update help text to suggest the use of
3072 bits.
* doc/wks.texi: Make example match default generation.
* g10/keygen.c (DEFAULT_STD_KEY_PARAM): update to
rsa3072/cert,sign+rsa3072/encr, and fix neighboring comment,
(gen_rsa, get_keysize_range): update default from 2048 to 3072).
* g10/keyid.c (pubkey_string): update comment so that first example
is the default 3072-bit RSA.

--

3072-bit RSA is widely considered to be 128-bit-equivalent security.
This is a sensible default in 2017.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

(cherry picked from commit 909fbca19678e6e36968607e8a2348381da39d8c)

from master/gpg default to AES 256.patch | (download)

g10/main.h | 4 3 + 1 - 0 !
1 file changed, 3 insertions(+), 1 deletion(-)

 gpg: default to aes-256.

* g10/main.h (DEFAULT_CIPHER_ALGO): Prefer AES256 by default.

--

It's 2017, and pretty much everyone has AES-256 available.  Symmetric
crypto is also rarely the bottleneck (asymmetric crypto is much more
expensive).  AES-256 provides some level of protection against
large-scale decryption efforts, and longer key lengths provide a hedge
against unforseen cryptanalysis.

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

from master/agent Fix cancellation handling for scdaemon.patch | (download)

agent/call-scd.c | 41 0 + 41 - 0 !
1 file changed, 41 deletions(-)

 agent: fix cancellation handling for scdaemon.

* agent/call-scd.c (cancel_inquire): Remove.
(agent_card_pksign, agent_card_pkdecrypt, agent_card_writekey)
(agent_card_scd): Don't call cancel_inquire.

--

Since libassuan 2.1.0, cancellation command "CAN" is handled within
the library, by assuan_transact.  So, cancel_inquire just caused
spurious "CAN" command to scdaemon which resulted an error.

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

update defaults/gpg Default to SHA 512 for all signature types on RS.patch | (download)

configure.ac | 2 1 + 1 - 0 !
g10/main.h | 2 1 + 1 - 0 !
g10/misc.c | 5 1 + 4 - 0 !
3 files changed, 3 insertions(+), 6 deletions(-)

 gpg: default to sha-512 for all signature types on rsa keys.

* g10/main.h (DEFAULT_DIGEST_ALGO): Use SHA512 instead of SHA256 in
--gnupg mode (leave strict RFC and PGP modes alone).
* configure.ac: Do not allow disabling sha512.
* g10/misc.c (map_md_openpgp_to_gcry): Always support SHA512.

--

SHA512 is more performant on most 64-bit platforms than SHA256, and
offers a better security margin.  It is also widely implemented.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

update defaults/gpg Prefer SHA 512 and SHA 384 in personal digest.patch | (download)

g10/keygen.c | 10 5 + 5 - 0 !
1 file changed, 5 insertions(+), 5 deletions(-)

 gpg: prefer sha-512 and sha-384 in personal-digest-preferences.

* g10/keygen.c (keygen_set_std_prefs): prefer SHA-512
and SHA-384 by default.

--

In 8ede3ae29a39641a2f98ad9a4cf61ea99085a892, upstream changed the
defaults for --default-preference-list to advertise a preference for
SHA-512, without touching --personal-digest-preferences.  This makes
the same change for --personal-digest-preferences, since every modern
OpenPGP library supports them all.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

Make gpg zip use tar from PATH.patch | (download)

tools/gpg-zip.in | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 make gpg-zip use tar from $path

Apparently there is no clean way to configure this from ./configure,
and upstream is deprecating gpg-zip anyway.  So just force-set tar to
be manually "tar" (meaning, that we should look in the $PATH at
runtime).

See also https://dev.gnupg.org/T4251 and https://bugs.debian.org/913582

fix spelling.patch | (download)

doc/tools.texi | 6 3 + 3 - 0 !
1 file changed, 3 insertions(+), 3 deletions(-)

 fix spelling


from 2.2.13/wks Do not use compression for the encrypted data.patch | (download)

tools/gpg-wks-client.c | 1 1 + 0 - 0 !
tools/gpg-wks-server.c | 1 1 + 0 - 0 !
2 files changed, 2 insertions(+)

 wks: do not use compression for the encrypted data.

* tools/gpg-wks-client.c (encrypt_response): Add arg -z0.
* tools/gpg-wks-server.c (encrypt_stream): Ditto.
--

If for example a server was built without the development packages of
the compression libraries installed, the server will not be able to
decrypt a request.  In theory this can't happen due to the preference
system but it is just to easy to create the server's key using a
from 2.2.13/Silence compiler warnings new with gcc 8.patch | (download)

dirmngr/dns.c | 17 12 + 5 - 0 !
tests/gpgscm/scheme.c | 12 12 + 0 - 0 !
2 files changed, 24 insertions(+), 5 deletions(-)

 silence compiler warnings new with gcc 8.

* dirmngr/dns.c: Include gpgrt.h.  Silence -Warray-bounds also gcc.
* tests/gpgscm/scheme.c: Include gpgrt.h.
(Eval_Cycle): Ignore -Wimplicit-fallthrough.
--

The funny use of case and labels in the CASE macro seems confuse the
fallthrough detection.

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

from 2.2.13/gpg Stop early when trying to create a primary Elgamal ke.patch | (download)

g10/misc.c | 7 7 + 0 - 0 !
1 file changed, 7 insertions(+)

 gpg: stop early when trying to create a primary elgamal key.

* g10/misc.c (openpgp_pk_test_algo2): Add extra check.
--

The problem is that --key-gen --batch with a parameter file didn't
detect that Elgamal is not capable of signing and so an error was only
triggered at the time the self-signature was created.  See the code
comment for details.

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

from 2.2.13/doc Mark keyserver options timeout and http proxy as obso.patch | (download)

doc/gpg.texi | 30 5 + 25 - 0 !
1 file changed, 5 insertions(+), 25 deletions(-)

 doc: mark keyserver-options timeout and http-proxy as obsolete.

--

(cherry picked from commit 6c000d4b78b836686e5a2789cc88a41e465e4400)
(cherry picked from commit 9fd6ba268f1fdf77cc5baa6e8fd3ab28e432e49b)

from 2.2.13/gpg Allow generating Ed25519 key from an existing key.patch | (download)

g10/misc.c | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 gpg: allow generating ed25519 key from an existing key.

* g10/misc.c (map_pk_gcry_to_openpgp): Add EdDSA mapping.
--

Due to this missing mapping a "gpg --export --full-gen-key" with
selection "13 - Existing key" did not worked for an ed25519 key.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 346a98fabe03adf2e202e36fc2aa24b1c2571154)
(cherry picked from commit 31d2a1eecaee766919b18bc42b918d9168f601f8)

from 2.2.13/dirmngr Fix initialization of assuan s nPth hook.patch | (download)

dirmngr/dirmngr.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 dirmngr: fix initialization of assuan's npth hook.

* dirmngr/dirmngr.c (main): Move assuan_set_system_hooks to...
(thread_init): ... here.

--

Cherry picked master commit of:
	1f8817475f59ede3f28f57edc10ba56bbdd08b49

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

from 2.2.13/agent Clear bogus pinentry cache when it causes an error.patch | (download)

agent/agent.h | 11 10 + 1 - 0 !
agent/call-pinentry.c | 37 18 + 19 - 0 !
agent/findkey.c | 12 11 + 1 - 0 !
3 files changed, 39 insertions(+), 21 deletions(-)

 agent: clear bogus pinentry cache, when it causes an error.

* agent/agent.h (PINENTRY_STATUS_*): Expose to public.
(struct pin_entry_info_s): Add status.
* agent/call-pinentry.c (agent_askpin): Clearing the ->status
before the loop, let the assuan_transact set ->status.  When
failure with PINENTRY_STATUS_PASSWORD_FROM_CACHE, it returns
soon.
* agent/findkey.c (unprotect): Clear the pinentry cache,
when it causes an error.

--

Cherry-picked from master commit of:
	      02a2633a7f0b7d91aa48ea615fb3a0edfd6ed6bb

Debian-bug-id: 919856
GnuPG-bug-id: 4348
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 9109bb9919f84d5472b7e62e84b961414a79d3c2)

from 2.2.13/gpg Emit an ERROR status if no key was found with list ke.patch | (download)

g10/keylist.c | 1 1 + 0 - 0 !
1 file changed, 1 insertion(+)

 gpg: emit an error status if no key was found with --list-keys.

* g10/keylist.c (list_one): Emit status line.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 140fda8c61422ec055c3f7e214cc35706c4320dd)
(cherry picked from commit 14ea581a1c040b53b0ad4c51136a7948363b1e4b)

from 2.2.14/common Fix gnupg_wait_processes.patch | (download)

common/exechelp-posix.c | 50 26 + 24 - 0 !
1 file changed, 26 insertions(+), 24 deletions(-)

 common: fix gnupg_wait_processes.

* common/exechelp-posix.c (gnupg_wait_processes): Loop for r_exitcodes
even if we already see an error.

--

The value stored by waitpid for exit code is encoded;  It requires
decoded by WEXITSTATUS macro, regardless of an error.

For example, when one of processes is already exited and another is
still running, it resulted wrong value of in r_exitcodes[n].

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

from 2.2.14/scd Distinguish cancel by user and protocol error.patch | (download)

scd/apdu.c | 3 2 + 1 - 0 !
scd/apdu.h | 3 2 + 1 - 0 !
scd/iso7816.c | 3 2 + 1 - 0 !
3 files changed, 6 insertions(+), 3 deletions(-)

 scd: distinguish cancel by user and protocol error.

* scd/apdu.h (SW_HOST_CANCELLED): New.
* scd/apdu.c (host_sw_string): Support SW_HOST_CANCELLED.
(pcsc_error_to_sw): Return SW_HOST_CANCELLED for PCSC_E_CANCELLED.
* scd/iso7816.c (map_sw): Return GPG_ERR_INV_RESPONSE for
SW_HOST_ABORTED and GPG_ERR_CANCELED for SW_HOST_CANCELLED.

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

from 2.2.14/gpg Fix comparison.patch | (download)

g10/gpgcompose.c | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 gpg: fix comparison.

* g10/gpgcompose.c (literal_name): Complain if passed zero arguments,
not one or fewer.

Signed-off-by: Neal H. Walfield <neal@walfield.org>
(cherry picked from commit 1ed21eee79749b976b4a935f2279b162634e9c5e)

from 2.2.14/gpgscm Build well even if NDEBUG defined.patch | (download)

tests/gpgscm/scheme.c | 4 3 + 1 - 0 !
1 file changed, 3 insertions(+), 1 deletion(-)

 gpgscm: build well even if ndebug defined.

* gpgscm/scheme.c (gc_reservation_failure): Fix adding ";".
[!NDEBUG] (scheme_init_custom_alloc): Don't init seserved_lineno.

--

Cherry icked from master commit of:
	e140c6d4f581be1a60a34b67b16430452f3987e8

In some build environment, NDEBUG is defined (although it's
bad practice).  This change supports such a situation.

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

from 2.2.14/agent Fix for suggested Libgcrypt use.patch | (download)

agent/divert-scd.c | 17 16 + 1 - 0 !
1 file changed, 16 insertions(+), 1 deletion(-)

 agent: fix for suggested libgcrypt use.

* agent/divert-scd.c (divert_pkdecrypt): Skip a flags parameter.
--

The libgcrypt docs say that a "flags" parameter should always be used
in the input of pkdecrypt.  Thus we should allow that parameter also
when parsing an s-expression to figure out the algorithm for use with
scdaemon.

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

from 2.2.14/gpgsm default to 3072 bit keys.patch | (download)

doc/gpgsm.texi | 2 1 + 1 - 0 !
doc/howto-create-a-server-cert.texi | 14 7 + 7 - 0 !
sm/certreqgen-ui.c | 2 1 + 1 - 0 !
sm/certreqgen.c | 4 2 + 2 - 0 !
sm/gpgsm.c | 2 1 + 1 - 0 !
5 files changed, 12 insertions(+), 12 deletions(-)

 gpgsm: default to 3072-bit keys.

* doc/gpgsm.texi, doc/howto-create-a-server-cert.texi: : update
default to 3072 bits.
* sm/certreqgen-ui.c (gpgsm_gencertreq_tty): update default to
3072 bits.
* sm/certreqgen.c (proc_parameters): update default to 3072 bits.
* sm/gpgsm.c (main): print correct default_pubkey_algo.

--

3072-bit RSA is widely considered to be 128-bit-equivalent security.
This is a sensible default in 2017.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>

(cherry picked from commit 7955262151a5c755814dd23414e6804f79125355)
(cherry picked from commit 121286d9d1506dbaad9ba33bae2e459814fe5849)

from 2.2.14/sm Don t mark a cert as de vs compliant if it leads to SH.patch | (download)

sm/keylist.c | 15 12 + 3 - 0 !
1 file changed, 12 insertions(+), 3 deletions(-)

 sm: don't mark a cert as de-vs compliant if it leads to sha-1 sigs.

* sm/keylist.c (print_compliance_flags): Also check the digest_algo.
Add new arg 'cert'.
--

A certificate with algorithm sha1WithRSAEncryption can be de-vs
compliant (e.g. if the next in the chain used sha256WithRSAEncryption
to sign it and RSA is long enough) but flagging it as such is useless
because that certificate can't be used because it will create
signatures using the non-compliant SHA-1 algorithm.

Well, it could be used for encryption.  But also evaluating the
key-usage flags here would make it harder for the user to understand
why certain certificates are listed as de-vs compliant and others are
not.

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

Reworked to also pass the CERT.  Note that 2.2 won't get the PK
Screening feature.

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

from 2.2.14/gpgv Improve documentation for keyring choices.patch | (download)

doc/gpgv.texi | 15 8 + 7 - 0 !
1 file changed, 8 insertions(+), 7 deletions(-)

 gpgv: improve documentation for keyring choices

* doc/gpgv.texi: Improve documentation for keyring choices

--

From the existing documentation, it's not clear whether the default
keyring will always be mixed into the set of keyrings, or whether it
will be skipped if a --keyring is present.  The updated text here
attempts to describe the keyring selection logic more completely.

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

from 2.2.14/agent Support mode ssh option for CLEAR_PASSPHRASE.patch | (download)

agent/command.c | 18 10 + 8 - 0 !
1 file changed, 10 insertions(+), 8 deletions(-)

 agent: support --mode=ssh option for clear_passphrase.

* agent/command.c (cmd_clear_passphrase): Add support for SSH.

--

GnuPG-bug-id: 4340
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit ae966bbe9b16ed68a51391afdde615339755e22d)
(cherry picked from commit 77a285a0a94994ee9b42289897f9bf3075c7192d)

from 2.2.14/tests Add disable scdaemon in gpg agent.conf.patch | (download)

tests/gpgme/gpgme-defs.scm | 3 1 + 2 - 0 !
tests/gpgsm/gpgsm-defs.scm | 5 1 + 4 - 0 !
tests/inittests | 1 1 + 0 - 0 !
tests/openpgp/defs.scm | 5 1 + 4 - 0 !
tests/pkits/inittests | 1 1 + 0 - 0 !
5 files changed, 5 insertions(+), 10 deletions(-)

 tests: add "disable-scdaemon" in gpg-agent.conf.

* tests/openpgp/defs.scm: Add "disable-scdaemon".  Remove
  "scdaemon-program".
* tests/gpgme/gpgme-defs.scm, tests/gpgsm/gpgsm-defs.scm: Likewise.
* tests/inittests, tests/pkits/inittests: Add "disable-scdaemon"

--

Before this change, running "make check" accesses USB device by
scdaemon on host computer.  If there is any smartcard/token available,
it may affect test results.  Because default key choice depends on
smartcard/token availability now and existing tests have nothing about
testing smartcard/token, disabling scdaemon is good.

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

from 2.2.14/sm Print Yubikey attestation extensions with dump cert.patch | (download)

sm/keylist.c | 40 37 + 3 - 0 !
1 file changed, 37 insertions(+), 3 deletions(-)

 sm: print yubikey attestation extensions with --dump-cert.

* sm/keylist.c (oidtranstbl): Add Yubikey OIDs.
(OID_FLAG_HEX): New.
(print_hex_extn): New.
(list_cert_raw): Make use of that flag.

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

from 2.2.14/gpg Make invalid primary key algos obvious in key listing.patch | (download)

g10/keylist.c | 10 9 + 1 - 0 !
1 file changed, 9 insertions(+), 1 deletion(-)

 gpg: make invalid primary key algos obvious in key listings.

* g10/keylist.c (print_key_line): Print a warning for invalid algos.
--

Non-OpenPGP compliant keys now show a warning flag on the sec or pub
line like in:

  gpg: can't encode a 256 bit MD into a 88 bits frame, algo=8
  sec   cv25519 2019-01-30 [INVALID_ALGO]
        4239F3D606A19258E7A88C3F9A3F4F909C5034C5
  uid           [ultimate] ffffff

Instead of showing the usage flags "[CE]".  Without this patch only
the error message is printed and the reason for it was not immediately
obvious (cv25519 is encryption only but we always consider the primary
key as having the "C" flag).

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

from 2.2.14/dirmngr Add CSRF protection exception for protonmail.patch | (download)

dirmngr/http.c | 45 40 + 5 - 0 !
1 file changed, 40 insertions(+), 5 deletions(-)

 dirmngr: add csrf protection exception for protonmail.

* dirmngr/http.c (same_host_p): Add exception table.
--

Please: Adding entries to this table shall be an exception and not the
rule.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 134c3c16523b1a267ebdd2df6339240fd9e1e3b3)
(cherry picked from commit 557c721e787e7e6d311ccb48d8aa677123061cf5)

from 2.2.14/gpg During secret key import print sec instead of pub.patch | (download)

g10/gpgcompose.c | 5 3 + 2 - 0 !
g10/import.c | 11 7 + 4 - 0 !
g10/keyedit.c | 23 14 + 9 - 0 !
g10/keyedit.h | 2 1 + 1 - 0 !
4 files changed, 25 insertions(+), 16 deletions(-)

 gpg: during secret key import print "sec" instead of "pub".

* g10/keyedit.c (show_basic_key_info): New arg 'print_sec'.  Remove
useless code for "sub" and "ssb".
* g10/import.c (import_one): Pass FROM_SK to show_basic_key_info.  Do
not print the first  keyinfo in FROM_SK mode.
printing.
--

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

from 2.2.14/tests Add sample secret key w o binding signatures.patch | (download)

tests/openpgp/samplekeys/README | 10 10 + 0 - 0 !
tests/openpgp/samplekeys/pgp-desktop-skr.asc | 56 56 + 0 - 0 !
2 files changed, 66 insertions(+)

 tests: add sample secret key w/o binding signatures.

--

GnuPG-bug-id: 4392
(cherry picked from commit 8c20a363c221438373439cde8c242e04c1bd925e)
(cherry picked from commit 61fc831885b0860e2143587b614c5a57f8c3f45f)

from 2.2.14/gpg Avoid importing secret keys if the keyblock is not va.patch | (download)

g10/import.c | 122 100 + 22 - 0 !
g10/kbnode.c | 2 1 + 1 - 0 !
g10/keydb.h | 13 7 + 6 - 0 !
tests/openpgp/ecc.scm | 2 1 + 1 - 0 !
tests/openpgp/samplekeys/README | 2 2 + 0 - 0 !
5 files changed, 111 insertions(+), 30 deletions(-)

 gpg: avoid importing secret keys if the keyblock is not valid.

* g10/keydb.h (struct kbnode_struct): Replace unused field RECNO by
new field TAG.
* g10/kbnode.c (alloc_node): Change accordingly.
* g10/import.c (import_one): Add arg r_valid.
(sec_to_pub_keyblock): Set tags.
(resync_sec_with_pub_keyblock): New.
(import_secret_one): Change return code to gpg_error_t.   Return an
error code if sec_to_pub_keyblock failed.  Resync secret keyblock.
--

When importing an invalid secret key ring for example without key
binding signatures or no UIDs, gpg used to let gpg-agent store the
secret keys anyway.  This is clearly a bug because the diagnostics
before claimed that for example the subkeys have been skipped.
Importing the secret key parameters then anyway is surprising in
particular because a gpg -k does not show the key.  After importing
the public key the secret keys suddenly showed up.

This changes the behaviour of
GnuPG-bug-id: 4392
to me more consistent but is not a solution to the actual bug.

Caution: The ecc.scm test now fails because two of the sample keys
         don't have binding signatures.

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

from 2.2.14/gpg Allow import of PGP desktop exported secret keys.patch | (download)

g10/import.c | 381 304 + 77 - 0 !
g10/keyedit.c | 2 1 + 1 - 0 !
g10/main.h | 3 2 + 1 - 0 !
3 files changed, 307 insertions(+), 79 deletions(-)

 gpg: allow import of pgp desktop exported secret keys.

* g10/import.c (NODE_TRANSFER_SECKEY): New.
(import): Add attic kludge.
(transfer_secret_keys): Add arg only_marked.
(resync_sec_with_pub_keyblock): Return removed seckeys via new arg
r_removedsecs.
(import_secret_one): New arg r_secattic.  Change to take ownership of
arg keyblock.  Implement extra secret key import logic.  Factor some
code out to ...
(do_transfer): New.
(import_matching_seckeys): New.
--

The PGP desktops exported secret keys are really stupid.  And they
even a have kind of exception in rfc4880 which does not rule that
out (section 11.2):

  [...]  Implementations SHOULD include self-signatures on any user
  IDs and subkeys, as this allows for a complete public key to be
  automatically extracted from the transferable secret key.
  Implementations MAY choose to omit the self-signatures, especially
  if a transferable public key accompanies the transferable secret
  key.

Now if they would only put the public key before the secret
key. Anyway we now have a workaround for that ugliness.

GnuPG-bug-id: 4392
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 5205512fc092c53c0a52c8379ef2a129ce6e58a9)
(cherry picked from commit 0e73214dd208fca4df26ac796416c6f25b3ae50d)

from 2.2.14/gpg Do not bail out on v5 keys in the local keyring.patch | (download)

g10/import.c | 6 4 + 2 - 0 !
g10/keydb.c | 13 9 + 4 - 0 !
g10/keylist.c | 2 2 + 0 - 0 !
g10/keyring.c | 2 2 + 0 - 0 !
g10/parse-packet.c | 2 1 + 1 - 0 !
5 files changed, 18 insertions(+), 7 deletions(-)

 gpg: do not bail out on v5 keys in the local keyring.

* g10/parse-packet.c (parse_key): Return GPG_ERR_UNKNOWN_VERSION
instead of invalid packet.
* g10/keydb.c (parse_keyblock_image): Do not map the unknown version
error to invalid keyring.
(keydb_search): Skip unknown version errors simlar to legacy keys.
* g10/keyring.c (keyring_rebuild_cache): Skip keys with unknown
versions.
* g10/import.c (read_block): Handle unknown version.
--

When using gpg 2.3 the local keyring may contain v5 keys.  This patch
allows the use of such a keyring also with a 2.2 version which does
not support v5 keys.  We will probably need some more tweaking here
but this covers the most common cases of listing keys and also
importing v5 keys.

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

from 2.2.15/doc fix formatting error.patch | (download)

doc/gpg.texi | 3 2 + 1 - 0 !
1 file changed, 2 insertions(+), 1 deletion(-)

 doc: fix formatting error

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

from 2.2.15/wkd New command print wkd hash for gpg wks client.patch | (download)

doc/wks.texi | 4 4 + 0 - 0 !
tools/gpg-wks-client.c | 85 83 + 2 - 0 !
tools/gpg-wks-server.c | 2 1 + 1 - 0 !
tools/gpg-wks.h | 3 2 + 1 - 0 !
tools/wks-util.c | 47 39 + 8 - 0 !
5 files changed, 129 insertions(+), 12 deletions(-)

 wkd: new command --print-wkd-hash for gpg-wks-client.

* tools/gpg-wks-client.c (aPrintWKDHash): New.
(opts) : Add "--print-wkd-hash".
(main): Implement that command.
(proc_userid_from_stdin): New.
* tools/wks-util.c (wks_fname_from_userid): Add option HASH_ONLY.
(wks_cmd_print_wkd_hash): New.
--

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

from 2.2.15/doc Clarify option no keyring.patch | (download)

doc/gpg.texi | 3 2 + 1 - 0 !
1 file changed, 2 insertions(+), 1 deletion(-)

 doc: clarify option --no-keyring.

--
GnuPG-bug-id: 4424

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

from 2.2.15/wkd New command print wkd url for gpg wks client.patch | (download)

doc/wks.texi | 8 6 + 2 - 0 !
tools/gpg-wks-client.c | 19 17 + 2 - 0 !
tools/gpg-wks.h | 1 1 + 0 - 0 !
tools/wks-util.c | 27 26 + 1 - 0 !
4 files changed, 50 insertions(+), 5 deletions(-)

 wkd: new command --print-wkd-url for gpg-wks-client.

* tools/gpg-wks-client.c (aPrintWKDURL): New.
(opts): Add option.
(main): Implement.
* tools/wks-util.c (wks_cmd_print_wkd_url): New.

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

from 2.2.15/agent Allow other ssh fingerprint algos in KEYINFO.patch | (download)

agent/command.c | 24 20 + 4 - 0 !
1 file changed, 20 insertions(+), 4 deletions(-)

 agent: allow other ssh fingerprint algos in keyinfo.

* agent/command.c (cmd_keyinfo): Allow for --ssh-fpr=ALGO.  Default to
the standard algo.

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

from 2.2.15/sm Allow decryption even if expired other keys are config.patch | (download)

sm/gpgsm.c | 11 11 + 0 - 0 !
1 file changed, 11 insertions(+)

 sm: allow decryption even if expired other keys are configured.

* sm/gpgsm.c (main): Add special handling for bad keys in decrypt
mode.
--

The problem can easily be tested by adding --encrypt-to EXPIRED_KEY to
a decryption command.  With that patch the errors are printed but
decryption continues and the process returns success unless other
errors occur.

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

from 2.2.16/gpg Don t use EdDSA algo ID for ECDSA curves.patch | (download)

g10/keygen.c | 25 18 + 7 - 0 !
1 file changed, 18 insertions(+), 7 deletions(-)

 gpg: don't use eddsa algo id for ecdsa curves.

* g10/keygen.c (ask_curve): Change algo ID to ECDSA if it changed from
an EdDSA curve.

--

(cherry picked from commit 4324560b2c0bb76a1769535c383424a042e505ae)

This change matters when it is called from ask_card_keyattr.

Some-comments-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 2f455d18ab99a1d94029d3f607ae918bd5c9fecf)

from 2.2.16/g10 Fix symmetric cipher algo constant for ECDH.patch | (download)

g10/ecdh.c | 2 1 + 1 - 0 !
scd/app-openpgp.c | 4 2 + 2 - 0 !
2 files changed, 3 insertions(+), 3 deletions(-)

 g10: fix symmetric cipher algo constant for ecdh.

* g10/ecdh.c (kek_params_table): Use CIPHER_ALGO_AES192 for
ECC strength 384, according to RFC-6637.

--

Reported-by: Trevor Bentley
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit af3efd149f555d36a455cb2ea311ff81caf5124c)
(cherry picked from commit 38c2a9a644e0bc1e2594ea437a5930982f7b8c4e)

from 2.2.16/dirmngr Better error code for http status 413.patch | (download)

dirmngr/ks-engine-hkp.c | 4 4 + 0 - 0 !
dirmngr/ks-engine-http.c | 4 4 + 0 - 0 !
dirmngr/ocsp.c | 4 4 + 0 - 0 !
3 files changed, 12 insertions(+)

 dirmngr: better error code for http status 413.

* dirmngr/ks-engine-hkp.c (send_request): New case for 413.
* 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 0a30ce036a615bc95382e0640d185b031f8c6a63)

from 2.2.16/gpg Set a limit of 5 to the number of keys imported from .patch | (download)

g10/import.c | 25 21 + 4 - 0 !
1 file changed, 21 insertions(+), 4 deletions(-)

 gpg: set a limit of 5 to the number of keys imported from the wkd.

* g10/import.c (import): Limit the number of considered keys to 5.
(import_one): Return the first fingerprint in case of WKD.
--

The Web Key Directory should carry only one key.  However, some
providers like to put old or expired keys also into the WKD.  I don't
thunk that this is a good idea but I heard claims that this is needed
for them to migrate existing key data bases.

This patch puts a limit on 5 on it (we had none right now) and also
fixes the issue that gpg could not work immediately with the requested
key because the code uses the fingerprint of the key to use the
imported key.  Now the first key is used.  On a second try (w/o
accessing the WKD) the regular key selection mechanism would be in
effect.  I think this is the most conservative approach.  Let's see
whether it helps.

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

from 2.2.16/gpg Accept also armored data from the WKD.patch | (download)

g10/keyserver.c | 5 3 + 2 - 0 !
1 file changed, 3 insertions(+), 2 deletions(-)

 gpg: accept also armored data from the wkd.

* g10/keyserver.c (keyserver_import_wkd): Clear NO_ARMOR.
--

We may even adjust the specs to allow that.  It should not be a
problem for any OpenPGP implementation because armored keys are very
common and de-armoring code is de-facto a mandatory feature.

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

from 2.2.16/g10 Fix double free when locating by mbox.patch | (download)

g10/getkey.c | 3 1 + 2 - 0 !
1 file changed, 1 insertion(+), 2 deletions(-)

 g10: fix double free when locating by mbox

* g10/getkey.c (get_best_pubkey_byname): Set new.uid always
to NULL after use.

--
pubkey_cmp is not guranteed to set new.uid.
from 2.2.16/gpg Use just the addrspec from the Signer s UID.patch | (download)

g10/parse-packet.c | 9 9 + 0 - 0 !
1 file changed, 9 insertions(+)

 gpg: use just the addrspec from the signer's uid.

* g10/parse-packet.c (parse_signature): Take only the addrspec from a
Signer's UID subpacket.
--

This is to address a problem in the currentr OpenKeychain which put
the entire UID into the subpacket.  For example our Tofu code can only
use the addrspec and not the entire UID.

Reported-by: Wiktor Kwapisiewicz <wiktor@metacode.biz>
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 05204b72497db093f5d2da4a2446c0264a946296)

from 2.2.16/doc Minor doc fix to dirmngr.patch | (download)

doc/dirmngr.texi | 4 1 + 3 - 0 !
1 file changed, 1 insertion(+), 3 deletions(-)

 doc: minor doc fix to dirmngr.

--

Reported-by: dkg
(cherry picked from commit 781d2c5c8995b92e58fcf344fa8931523583f537)

from 2.2.16/dirmngr Add a CSRF expection for pm.me.patch | (download)

agent/command.c | 4 2 + 2 - 0 !
dirmngr/http.c | 3 2 + 1 - 0 !
2 files changed, 4 insertions(+), 3 deletions(-)

 dirmngr: add a csrf expection for pm.me

--

Also comment typo fix.

(cherry picked from commit 7c4029110ab45d02e746ddcc13a87952ca0099f5)

from 2.2.16/doc correct documentation for gpgconf kill.patch | (download)

doc/tools.texi | 11 6 + 5 - 0 !
1 file changed, 6 insertions(+), 5 deletions(-)

 doc: correct documentation for gpgconf --kill

* doc/tools.texi(gpgconf): Correct documentation for gpgconf --kill.

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

from 2.2.16/gpg Change update_keysig_packet to replace SHA 1 by SHA 2.patch | (download)

g10/sign.c | 7 7 + 0 - 0 !
1 file changed, 7 insertions(+)

 gpg: change update_keysig_packet to replace sha-1 by sha-256.

* g10/sign.c (update_keysig_packet): Convert digest algo when needed.
--

Several gpg commands try to keep most properties of a key signature
when updating (i.e. creating a new version of a key signature).  This
included the use of the current hash-algorithm.  This patch changes
this so that SHA-1 or RMD160 are replaced by SHA-256 if
possible (i.e. for RSA signatures).  Affected commands are for example
--quick-set-expire and --quick-set-primary-uid.

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