gnupg.git
7 months agoagent: New GETINFO sub-commands "s2k_count_cal" and "s2k_time".
Werner Koch [Mon, 6 Nov 2017 13:20:03 +0000 (14:20 +0100)]
agent: New GETINFO sub-commands "s2k_count_cal" and "s2k_time".

* agent/command.c (cmd_getinfo): New sub-commands.
* agent/protect.c (get_standard_s2k_count): Factor some code out to ...
(get_calibrated_s2k_count): new.
(get_standard_s2k_time): New.

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

7 months agoagent: New option --s2k-count.
Werner Koch [Mon, 6 Nov 2017 12:57:30 +0000 (13:57 +0100)]
agent: New option --s2k-count.

* agent/agent.h (opt): New field 's2k_count'.
* agent/gpg-agent.c (oS2KCount): New enum value.
(opts): New option --s2k-count.
(parse_rereadable_options): Set opt.s2k_count.
--

This option is useful to speed up the starting of gpg-agent and in
cases where the auto-calibration runs into problems due to a broken
time measurement facility.

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

7 months agog10: Unattended key generation "Key-Grip" and "Subkey-Grip".
NIIBE Yutaka [Wed, 1 Nov 2017 01:19:35 +0000 (10:19 +0900)]
g10: Unattended key generation "Key-Grip" and "Subkey-Grip".

* g10/keygen.c (pSUBKEYGRIP): New.
(read_parameter_file): Add "Key-Grip" and "Subkey-Grip".
(do_generate_keypair): Support pSUBKEYGRIP.

--

In the manual, it says "Key-Grip".  gpgsm also supports "Key-Grip".
Adding "Subkey-Grip" now, adding "Key-Grip" makes sense.

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

7 months agog10: Simplify "factory-reset" procedure.
NIIBE Yutaka [Mon, 30 Oct 2017 02:59:11 +0000 (11:59 +0900)]
g10: Simplify "factory-reset" procedure.

* g10/card-util.c (factory_reset): Simplify.

--

In this summer, I got report about old code before this change didn't
work with newer Yubikey.  I got another report test version of OpenPGP
card V3.3 implementation didn't work, either.  Then, I confirmed that
according to the OpenPGP card specification, the procedure of old code
is not expected by its author.

This change simplify "factory-reset" as simple.

Only versions of Gnuk 1.2.2, 1.2.3, 1.2.4, won't work with this
change.  That's because the factory-reset feature of Gnuk was
introduced by reading the implementation of GnuPG, instead of reading
the specification.  Gnuk 1.2.5 and later works well.  All OpenPGPcard
implementations I have work well (2.0, 2.1, 2.2, test version of 3).

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

7 months agopo: Update Russian translation
Ineiev [Tue, 31 Oct 2017 11:22:51 +0000 (14:22 +0300)]
po: Update Russian translation

7 months agopo: Fixed one string wrongly marked as fuzzy.
Werner Koch [Thu, 2 Nov 2017 16:43:21 +0000 (17:43 +0100)]
po: Fixed one string wrongly marked as fuzzy.

--

These seems to a a small gettext bug which claimed that
 "NOTE: There is no guarantee that the card supports[...]"
was changed.  Also committed changes due to msgmerge.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agopo: Update German translation
Werner Koch [Thu, 2 Nov 2017 16:38:02 +0000 (17:38 +0100)]
po: Update German translation

--

7 months agogpg: Introduce magic value 25519 to switch a card to ECC.
Werner Koch [Thu, 2 Nov 2017 16:11:03 +0000 (17:11 +0100)]
gpg: Introduce magic value 25519 to switch a card to ECC.

* g10/card-util.c (ask_card_keyattr): Handle special value 25519.
(do_change_keyattr): Allow changing to cv25519/ed25519.
(generate_card_keys): Ditto.
(card_generate_subkey): Ditto.
--

This is kludge to make it easier for gnuk to be switched into ECC
mode.  This is basically the same change as
commit ea09b6cded9d31a8ebd91878553c3eaa2b76e817
but without the string change in show_keysize_warning.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpg: Rename two card related functions in card-util.
Werner Koch [Fri, 27 Oct 2017 12:44:53 +0000 (14:44 +0200)]
gpg: Rename two card related functions in card-util.

* g10/card-util.c (ask_card_rsa_keysize): Rename to ask_card_keyattr.
(do_change_rsa_keysize): Rename to do_change_keyattr.
--

We want to support other algos than RSA and thus we need a better name
for the functions.

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

7 months agoagent: Fix returning GPG_ERR_NOT_FOUND wrongly.
NIIBE Yutaka [Thu, 2 Nov 2017 07:23:10 +0000 (16:23 +0900)]
agent: Fix returning GPG_ERR_NOT_FOUND wrongly.

* agent/learncard.c (agent_handle_learn): Find SERIALNO.

--

Bug is: "gpg-connect-agent learn /bye" just fails wrongly.

Fixes-commit: 8c8ce8711d9c938fcb982b0341e6b052742cb887
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 5e96fe72e477d09e35ccee48af0fd9ab2b3ae409)

7 months agocommon: Accept the Z-suffix for yymmddThhmmssZ format.
NIIBE Yutaka [Tue, 19 Sep 2017 07:09:05 +0000 (16:09 +0900)]
common: Accept the Z-suffix for yymmddThhmmssZ format.

* common/gettime.c (isotime_p): Accept the Z suffix.

--

The intention is use for human interface.

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

7 months agoagent: Clean up pinentry access locking.
NIIBE Yutaka [Fri, 27 Oct 2017 00:54:48 +0000 (09:54 +0900)]
agent: Clean up pinentry access locking.

* agent/agent.h (struct server_control_s): Rename PINENTRY_ACTIVE.
* agent/call-pinentry.c (entry_owner): Remove.
(agent_reset_query): Use thread private object of PINENTRY_ACTIVE.
(unlock_pinentry): Add CTRL to arguments to access thread private.
Check and decrement PINENTRY_ACTIVE for recursive use.
(start_pinentry): Check and increment PINENTRY_ACTIVE for recursion.
(agent_askpin): Follow the change of unlock_pinentry API.
(agent_get_passphrase, agent_get_confirmation): Likewise.
(agent_show_message, agent_popup_message_start): Likewise.
(agent_popup_message_stop, agent_clear_passphrase): Likewise.

--

We use the member PINENTRY_ACTIVE as a thread private object.
It's only valid for a single thread at a time.

It would be possible to have a thread shared object of
PINENTRY_ACTIVE, keeping ENTRY_OWNER for distinguishing its
owner (which is also a thread shared object).  But, in this case,
access to ENTRY_OWNER is tricky (only comparison to accessing thread
would be OK with no lock), or we need to introduce another lock for
accessing ENTRY_OWNER, which complicates the code too much.

So, simply have a thread private object for recursive pinentry access.

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

7 months agoagent: Allow recursive use of pinentry.
NIIBE Yutaka [Thu, 26 Oct 2017 05:40:38 +0000 (14:40 +0900)]
agent: Allow recursive use of pinentry.

* agent/agent.h (struct server_control_s): Add pinentry_level.
* agent/call-pinentry.c (agent_popup_message_stop): Not clear
ENTRY_CTX here.
(unlock_pinentry): Handle recursion.  Clear ENTRY_CTX here.
(start_pinentry): Allow recursive use.

--

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

7 months agoagent, tests: Support --disable-scdaemon build case.
NIIBE Yutaka [Thu, 26 Oct 2017 02:24:39 +0000 (11:24 +0900)]
agent, tests: Support --disable-scdaemon build case.

* agent/command.c (cmd_scd): Support !BUILD_WITH_SCDAEMON.
* tests/openpgp/defs.scm (create-gpghome): Likewise.
* tests/gpgsm/gpgsm-defs.scm (create-gpgsmhome): Likewise.

--

We could modify gpg-agent to remove all support of scdaemon, with no
inclusion of call-scd.c, divert-scd.c, and learncard.c, but it would
not be worth to do that.

GnuPG-bug-id: 3316
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
7 months agoFix comment of configure.
NIIBE Yutaka [Thu, 26 Oct 2017 02:19:45 +0000 (11:19 +0900)]
Fix comment of configure.

* configure.ac (BUILD_WITH_DIRMNGR): Comment fix.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
7 months agogpg: Avoid superfluous sig check info during import.
Werner Koch [Tue, 24 Oct 2017 19:11:38 +0000 (21:11 +0200)]
gpg: Avoid superfluous sig check info during import.

* g10/key-check.c (print_info): New.
(key_check_all_keysigs): Print sig checking results only in debug
mode.  Prettify the stats info and suppress them in quiet mode.

--

This also makes usable stats by prefixing them with the key and the
program name.

GnuPG-bug-id: 3397
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agobuild: New configure option --enable-werror
Werner Koch [Tue, 24 Oct 2017 16:42:37 +0000 (18:42 +0200)]
build: New configure option --enable-werror

* configure.ac: Implement that option.
--

This can be used as a workaround in case of bogus autoconf tests.

GnuPG-bug-id: 2423
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agobuild: Do not mess with CFLAGS in configure.
Werner Koch [Tue, 24 Oct 2017 16:34:28 +0000 (18:34 +0200)]
build: Do not mess with CFLAGS in configure.

* configure.ac: Do not mess with the user provided CFLAGS.
--

A problem was claimed with some configure tests if the user provided
CFLAGS=-Werror.  The commit introducing this

Fixes-commit: 02eb9fc9d5863abcfed6af704e618f8cac7cc2e8

does not mention a concrete case.  Anyway, messing with CFLAGS is a
bad idea because configure tests will then test something different
than what is used later (cf. autoconf manual).  Tests which depend on
the whether -Werror is used needsto be fixed.

Note that in certain cases we modify CFLAGS.  This is only done for
some configure options or if the platform requires the use of special
compiler flags (e.g. on HP/UX).

GnuPG-bug-id: 2423

7 months agosm: Do not expect X.509 keyids to be unique
Rainer Perske [Tue, 24 Oct 2017 15:29:04 +0000 (17:29 +0200)]
sm: Do not expect X.509 keyids to be unique

* sm/certlist.c (gpgsm_find_cert): Add arg allow_ambiguous and use it.
* sm/call-dirmngr.c (inq_certificate): Pass true to ALLOW_AMBIGUOUS
(run_command_inq_cb): Ditto.
* sm/gpgsm.c (main): Pass false.
* sm/server.c (cmd_passwd): Pass false.

--

As described in my report T1644, it is possible that multiple
certificates exist with the same Distinguished Name and the same key.
In this case, verifying S/MIME signatures and other actions fail with
"certificate not found: Ambiguous name". For details see the bug
report.

To circumvent the problem, I am patching GnuPG since 2014 so that in
this case the newest of the ambiguous certificates is used.

This is not an ultimate solution of the problem: You should try every
certificate with the same DN until verification succeeds or until all
certificates fail, and if multiple certificates of a chain are
ambiguous you even have to check every combination. You may even
consider checking the keyUsage attributes of the ambiguous certificates
to reduce the number of combinations.

But in the existing case of the certificates in the German Research
Network (DFN) PKI where the newest one is the valid one and all
ambiguous certificates have the same keyUsage attributes, this patch
has proven to be sufficient over the last three years.

With every GnuPG update, I have adapted the patch, luckily I never
needed to change anything except line numbers.

GnuPG-bug-id: 1644

ChangeLog log written by wk, comment taken from mail.  Signed-off line
was missing in the plain diff.  However the mail with the patch and
the DCO posted as reply to that mail were both signed.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpgconf: Ignore non-installed components with --apply-profile.
Werner Koch [Tue, 24 Oct 2017 10:01:07 +0000 (12:01 +0200)]
gpgconf: Ignore non-installed components with --apply-profile.

* tools/gpgconf-comp.c (retrieve_options_from_program): Add arg
only_installed.
(gc_component_retrieve_options): Use this if we want to process all
components.
--

Note that this also also ignores them in --with-defaults.  This is
useful for systems which come without scdaemon.

GnuPG-bug-id: 3313
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpg: Improve the "secret key available" notice in keyedit.c
Werner Koch [Tue, 24 Oct 2017 08:56:13 +0000 (10:56 +0200)]
gpg: Improve the "secret key available" notice in keyedit.c

* g10/keyedit.c (KEYEDIT_NEED_SUBSK): New.
(cmds): Add this flag to keytocard, bkuptocard, expire, and passwd.
(keyedit_menu): Check whether only subkeys are available and take care
of that in the command check and in the HELP listing.  Also print a
different notice if only subkeys are available.
--

Print "Secret key is available" and the bailing out in all commands
which require the _primary_ secret key was surprising.  Now we print
another notice and adjust the checks.

GnuPG-bug-id: 3463
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpg: Remove unused flags from keyedit.c.
Werner Koch [Tue, 24 Oct 2017 07:31:49 +0000 (09:31 +0200)]
gpg: Remove unused flags from keyedit.c.

* g10/keyedit.c (KEYEDIT_NOT_SK, KEYEDIT_ONLY_SK): Remove.
(cmds): Remove them.
--

These flags were cruft from the time we had to switch between secret
and public key view.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agodoc: Fix "SEE ALSO" section of gpgv.
Werner Koch [Fri, 20 Oct 2017 06:56:39 +0000 (08:56 +0200)]
doc: Fix "SEE ALSO" section of gpgv.

--

7 months agogpg: Fix creating on-disk subkey with on-card primary key.
Werner Koch [Thu, 19 Oct 2017 16:10:37 +0000 (18:10 +0200)]
gpg: Fix creating on-disk subkey with on-card primary key.

* g10/keygen.c (generate_subkeypair): Ignore error code issued for
trying to verify a card based key.
--

We try to verify the primary key and thus seed the passphrase cache
before generating the subkey.  However, the verification does not yet
work for on-card keys and thus the PASSWD --verify send to the agent
returns an error.  This patch detects this error and continues without
a seeded passphrase cache.  After all that pre-seeding is just a
convenience.

GnuPG-bug-id: 3280
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpg: Print sec/sbb with --import-option import-show or show-only.
Werner Koch [Thu, 19 Oct 2017 15:12:36 +0000 (17:12 +0200)]
gpg: Print sec/sbb with --import-option import-show or show-only.

* g10/import.c (import_one): Pass FROM_SK to list_keyblock_direct.
--

Note that this will likely add the suffix '#' top "sec" because the
secret key has not yet (or will not be) imported.  If the secret key
already exists locally another suffix might be printed.  The upshot is
that the suffix has no usefulness.

GnuPG-bug-id: 3431
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpg: Make --dry-run and show-only work for secret keys.
Werner Koch [Thu, 19 Oct 2017 15:05:39 +0000 (17:05 +0200)]
gpg: Make --dry-run and show-only work for secret keys.

* g10/import.c (import_secret_one): Check for dry-run before
transferring keys.
--

The use of --dry-run or --import-option show-only had no effect when
importing a secret key and the public key already existed.  If the
public key did not exist an error message inhibited the import of the
secret key.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agodirmngr: Do not follow https-to-http redirects.
Damien Goutte-Gattat [Sun, 8 Oct 2017 16:30:52 +0000 (17:30 +0100)]
dirmngr: Do not follow https-to-http redirects.

* dirmngr/ks-engine-http.c (ks_http_fetch): Forbid redirects from
a https URI to a http URI.
--

GnuPG-bug-id: 3436
Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
7 months agog10: Fix find_and_check_key for multiple keyrings.
NIIBE Yutaka [Thu, 19 Oct 2017 02:08:24 +0000 (11:08 +0900)]
g10: Fix find_and_check_key for multiple keyrings.

* g10/pkclist.c (find_and_check_key): Call get_validity on a specific
keyblock.

--

When we have multiple keyrings, get_validity after
get_best_pubkey_byname should access same keyring.  Or else, the
situation of an expired key in keyring A but valid key in keyring B
causes SEGV.

Thanks to Guido Günther for the use case and the log.

Debian-bug-id: 878812
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
7 months agogpg: Keep a lock during the read-update/insert cycle in import.
Werner Koch [Wed, 18 Oct 2017 16:28:52 +0000 (18:28 +0200)]
gpg: Keep a lock during the read-update/insert cycle in import.

* g10/keydb.c (keydb_handle): New field 'keep_lock'.
(keydb_release): Clear that flag.
(keydb_lock): New function.
(unlock_all): Skip if KEEP_LOCK is set.
* g10/getkey.c (get_keyblock_byfprint_fast): Call keep_lock if
requested.
--

That change is straightforward.  It helps to avoid the race condition
that another gpg process inserts a key while the first process is
between the search and the insert.

A similar change is due for gpgsm.

Note that the key edit operations may still suffer from a race.

GnuPG-bug-id: 3446

7 months agogpg: Improve keydb handling in the main import function.
Werner Koch [Wed, 18 Oct 2017 15:52:41 +0000 (17:52 +0200)]
gpg: Improve keydb handling in the main import function.

* g10/getkey.c (get_pubkey_byfprint_fast): Factor most code out to ...
(get_keyblock_byfprint_fast): .. new function.
* g10/import.c (revocation_present): s/int rc/gpg_error_t err/.
(import_one): Use get_keyblock_byfprint_fast to get the keyblock and a
handle.  Remove the now surplus keyblock fetch in the merge branch.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpg: Simplify keydb handling of the main import function.
Werner Koch [Wed, 18 Oct 2017 11:09:47 +0000 (13:09 +0200)]
gpg: Simplify keydb handling of the main import function.

* g10/import.c (import_keys_internal): Return gpg_error_t instead of
int.  Change var names.
(import_keys_es_stream): Ditto.
(import_one): Ditto.  Use a single keydb_new and simplify the use of
of keydb_release.
--

Note that this opens a keydb handle before we call
get_pubkey_byfprint_fast which internally uses another key db handle.
A further patch will cleanup this double use.  Note that we also
disable the keydb caching for the insert case.

The s/int/gpg_error_t/ has been done while checking the call chains of
the import functions and making sure that gpg_err_code is always used.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agosm: Fix colon listing of fields > 12 in crt records.
Werner Koch [Tue, 17 Oct 2017 18:56:55 +0000 (20:56 +0200)]
sm: Fix colon listing of fields > 12 in crt records.

* sm/keylist.c (print_capabilities): Move colon printing ...
(list_cert_colon): to here.
--

Fixes-commit: 7af008bfe1641938a6c2c995cb065829fa05a693
Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agogpg: Workaround for junk after --trusted-key.
Werner Koch [Thu, 28 Sep 2017 12:10:12 +0000 (14:10 +0200)]
gpg: Workaround for junk after --trusted-key.

* g10/trust.c (register_trusted_key): Cut off everthing starting as a
hash sign.
--

This problem is fallout from
commit f99830b72812395da5451152bdd2f2d90a7cb7fb
which fixes
GnuPG-bug-id: 1206

The same could happen with other options taking keyids but we won't
change that because a trailing '#' does not indicate a comment.  So
this is really only a workaround and eventually we will
deprecate --trusted-key anyway or require a fingerprint as a value.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agodoc: Make --check-sigs more prominent.
Werner Koch [Wed, 27 Sep 2017 15:18:55 +0000 (17:18 +0200)]
doc: Make --check-sigs more prominent.

--

It seems people are using --list-sigs instead of --check-sigs and do
not realize that the signatures are not checked at all.  We better
highlight the use of --check-sigs to avoid this UI problem.

Suggested-by: Andrew Gallagher
Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agopo: Remove trailing colon from a German pinentry string.
Werner Koch [Tue, 26 Sep 2017 09:52:18 +0000 (11:52 +0200)]
po: Remove trailing colon from a German pinentry string.

--

8 months agopo: Fix German translation.
Werner Koch [Sun, 24 Sep 2017 07:56:26 +0000 (09:56 +0200)]
po: Fix German translation.

--

Reported-by: engelmarkus
8 months agoPost release updates
Werner Koch [Tue, 19 Sep 2017 06:34:36 +0000 (08:34 +0200)]
Post release updates

--

8 months agoRelease 2.2.1 gnupg-2.2.1
Werner Koch [Tue, 19 Sep 2017 06:13:44 +0000 (08:13 +0200)]
Release 2.2.1

8 months agodirmngr: Use system certs if --hkp-cacert is not used.
Werner Koch [Mon, 18 Sep 2017 20:49:05 +0000 (22:49 +0200)]
dirmngr: Use system certs if --hkp-cacert is not used.

* dirmngr/certcache.c (any_cert_of_class): New var.
(put_cert): Set it.
(cert_cache_deinit): Clear it.
(cert_cache_any_in_class): New func.
* dirmngr/http-ntbtls.c (gnupg_http_tls_verify_cb): Add hack to
override empty list of HKP certs.
--

This patch carries the changes for GNUTLS from commit
7c1613d41566f7d8db116790087de323621205fe over to NTBTLS.  NTBTLS works
quite different and thus we need to do it this way.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agopo: Minor Grammar update of the Greek translation
Dimitris Maroulidis [Mon, 18 Sep 2017 14:23:43 +0000 (16:23 +0200)]
po: Minor Grammar update of the Greek translation

--
GnuPG-bug-id: 3409

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agowks: Create a new user id if provider wants mailbox-only.
Werner Koch [Mon, 18 Sep 2017 13:37:21 +0000 (15:37 +0200)]
wks: Create a new user id if provider wants mailbox-only.

* tools/gpg-wks-client.c (get_key): Add arg 'exact'.
(add_user_id): New.
(command_send): Create new user id.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agowks: Send only the newest UID to the server.
Werner Koch [Mon, 18 Sep 2017 10:52:20 +0000 (12:52 +0200)]
wks: Send only the newest UID to the server.

* tools/wks-util.c (list_key_status_cb): Rename to key_status_cb.
(wks_filter_uid): New.
(wks_list_key): Allow FPR to be NULL.  Return an error if no
fingerprint was found.
* tools/gpg-wks-server.c (process_new_key)
(check_and_publish): Remove now useless extra check for FPR.
* tools/gpg-wks-client.c (command_check): Ditto.
(command_send): Filter out the newest uid.
--

This fixes the case of having several userids with all the the same
mailbox.  Now we use the latest user id created.  This patch is also a
prerequisite to automatically create a new user id for providers with
the mailbox-only policy.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agowks: Print the UID creation time with gpg-wks-client --check.
Werner Koch [Mon, 18 Sep 2017 09:31:36 +0000 (11:31 +0200)]
wks: Print the UID creation time with gpg-wks-client --check.

* tools/gpg-wks.h (uidinfo_list_s): Add field 'created'.
* tools/wks-util.c (append_to_uidinfo_list): Add arf 'created'.
(wks_list_key): Pass timestamp to append_to_uidinfo_list.
* tools/gpg-wks-client.c (command_check): Print UID creation time.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agowks: Use dedicated type to convey user ids.
Werner Koch [Mon, 18 Sep 2017 09:16:07 +0000 (11:16 +0200)]
wks: Use dedicated type to convey user ids.

* tools/gpg-wks.h (uidinfo_list_s, uidinfo_list_t): New.
* tools/wks-util.c (append_to_uidinfo_list): New.
(free_uidinfo_list): New.
(wks_list_key): Change arg r_mboxes to uidinfo_list_t.  Use
append_to_uidinfo_list.
* tools/gpg-wks-server.c (sserver_ctx_s): Replace strlist_t by
uidinfo_list_t.
(process_new_key): Ditto.
(check_and_publish): Ditto.
(command_receive_cb): Replace free_strlist by free_uidinfo_list.
* tools/gpg-wks-client.c (command_check): Replace strlist_t by
uidinfo_list_t.  Also print user id in verbose mode.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpgv: Initialize compliance checker.
Werner Koch [Wed, 13 Sep 2017 07:18:15 +0000 (09:18 +0200)]
gpgv: Initialize compliance checker.

* g10/gpgv.c (main): Call gnupg_initialize_compliance.
--

The compliance checker needs to be initialize so that it won't let
spit out a "not suitable" message.  We use the module name of gpg.
Because there is no option to change the compliance mode in gpgv we
will always be in the default (CO_GNUPG) mode.  It also does not make
much sense to have it here because gpgv expects a "curated" keyring.

GnuPG-bug-id: 3404
Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agowks: Add hack for the broken posteo system
Werner Koch [Tue, 12 Sep 2017 16:08:09 +0000 (18:08 +0200)]
wks: Add hack for the broken posteo system

* tools/gpg-wks-client.c (command_send): Additional hack for posteo.
Check the protocol-version flag.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agowks: Add new policy flag protocol-version
Werner Koch [Tue, 12 Sep 2017 16:05:00 +0000 (18:05 +0200)]
wks: Add new policy flag protocol-version

* tools/gpg-wks.h (policy_flags_s): Add field protocol_version.
* tools/wks-util.c (wks_parse_policy): Add new policy flag.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpg: Fix "Fix key generation with only an email part".
Werner Koch [Tue, 12 Sep 2017 12:38:44 +0000 (14:38 +0200)]
gpg: Fix "Fix key generation with only an email part".

* g10/keygen.c (proc_parameter_file): Don't check the result of
stpcpy.
--

Fixes-commit: 7089dcc54099a4909ce7d386c07ab87e1398e2eb
Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agowks: Use unencrypted draft-1 mode for posteo.de
Werner Koch [Tue, 12 Sep 2017 12:32:29 +0000 (14:32 +0200)]
wks: Use unencrypted draft-1 mode for posteo.de

* tools/gpg-wks-client.c (command_send): Allow sending in draft-1
mode.
--

Obviously Posteo did not implement the current draft and thus it was
not possible to send a request to them.  This hack uses the old method
for posteo.de.  Not sending it encrypted is okay here because they use
authenticated sending anyway.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agotools: New function mime_maker_add_body_data.
Werner Koch [Tue, 12 Sep 2017 12:29:04 +0000 (14:29 +0200)]
tools: New function mime_maker_add_body_data.

* tools/mime-maker.c (mime_maker_add_body_data): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agotests: Fix a test which specifies expiration date.
NIIBE Yutaka [Fri, 8 Sep 2017 05:21:29 +0000 (14:21 +0900)]
tests: Fix a test which specifies expiration date.

* tests/openpgp/quick-key-manipulation.scm: Fix expiration time
comparison.

--

This is a bug fix for Amelia Earhart who is probably in UTC-12.

When expiration date is specified, GnuPG interprets it as noon of the
date in local time.

Before this fix, the test compared the value by 2145916800 which is
2038-01-01 00:00:00 in UTC with allowance of 1 day.  When the test
was ran in UTC-12 timezone, it failed because of noon in the timezone
is midnight of the next day in UTC.

GnuPG-bug-id: 3393
Reported-by: Daniel Kahn Gillmor
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
9 months agoscd: Fix for large ECC keys.
NIIBE Yutaka [Tue, 29 Aug 2017 05:35:47 +0000 (14:35 +0900)]
scd: Fix for large ECC keys.

* scd/app-openpgp.c (do_decipher): Support larger length.

--

Reported-by: Achim Pietig <achim@pietig.com>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
9 months agogpg: Fix key generation with only an email part.
Werner Koch [Mon, 11 Sep 2017 09:29:13 +0000 (11:29 +0200)]
gpg: Fix key generation with only an email part.

* g10/keygen.c (proc_parameter_file): Special case the email only
case.
--

Using a parameter file like

  %ask-passphrase
  key-type:      RSA
  key-length:    2048
  key-usage:     sign
  subkey-type:   RSA
  subkey-length: 2048
  subkey-usage:  encrypt
  name-email:    foo@example.org

with "gpg --gen-key --patch" the result was this key

  pub   rsa2048 2017-09-11 [SC]
        63A8C1BA12CC289A0E8072C971C7F8D4A18CE0BE
  uid           [ultimate]  <foo@example.org>
  sub   rsa2048 2017-09-11 [E]

At least the the extra leading space the left angle bracket is wrong.
Further some mail providers reject keys which consist of more than
just a plain mail address.  Using just a mail address is anyway the
new new suggested content for a user id.  With this patch the key
will be

  pub   rsa2048 2017-09-11 [SC]
        B302343C20EA6DECDB6A155135352F2520397080
  uid           [ultimate] foo@example.org
  sub   rsa2048 2017-09-11 [E]

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agoPost release updates
Werner Koch [Mon, 28 Aug 2017 09:57:17 +0000 (11:57 +0200)]
Post release updates

--

9 months agoRelease 2.2.0 gnupg-2.2.0
Werner Koch [Mon, 28 Aug 2017 09:18:26 +0000 (11:18 +0200)]
Release 2.2.0

9 months agopo: Auto update
Werner Koch [Mon, 28 Aug 2017 09:17:39 +0000 (11:17 +0200)]
po: Auto update

--

9 months agoscd: Convey the correct length for Le
Werner Koch [Sun, 27 Aug 2017 14:42:52 +0000 (16:42 +0200)]
scd: Convey the correct length for Le

* scd/app-openpgp.c (determine_rsa_response): Round bits up.
--

Co-authored-by: Arnaud Fontaine <arnaud.fontaine@ssi.gouv.fr>
Arnaud wrote:

  Actually, when the incorrect expected response length (i.e. Le
  field) is transmitted to the card, the card's answer is missing a
  byte (i.e. ...  6101) so an additional command has to be sent to the
  card to retrieve the last byte. Using the correct length avoids to
  send the additional command to retrieve the missing byte, when the
  computed length is wrong.

Note that an value of 65537 for E is pretty standard and thus we can
avoid the 6101 return code inmost cases.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpg: Fix memory leak while running --check-trustdb.
Werner Koch [Thu, 24 Aug 2017 20:06:59 +0000 (22:06 +0200)]
gpg: Fix memory leak while running --check-trustdb.

* g10/trustdb.c (update_min_ownertrust): Free PK.
--

This bug was revealed by the new trust-pgp-2.scm test.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpg: Fix memory leak in sig-check.
Werner Koch [Thu, 24 Aug 2017 18:26:19 +0000 (20:26 +0200)]
gpg: Fix memory leak in sig-check.

* g10/sig-check.c (check_signature_over_key_or_uid): Remove useless
condition.  Actually free when SIGNER was allocated by us.
--

SIGNER_ALLOCATED never received a value of -1 but that was tested.

IF SIGNER_ALLOCATED was 2 the memory was never freed:

  if (signer_allocated == 1)
    if (signer_allocated == 2)
      free()

Fixes-commit: 44cdb9d73f1a0b7d2c8483a119b9c4d6caabc1ec

This function needs to be audited more thoroughly.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agoindent: Change comment style on two functions
Werner Koch [Thu, 24 Aug 2017 17:19:23 +0000 (19:19 +0200)]
indent: Change comment style on two functions

--

This is to make those function better readable.

  if (foo)
     /* Comment */
     {

     }

is bad style because it requires extra time to notice the begin of the
block and vice versa when noticing the block it is not clear whether
this is an conditioned or unconditioned block.

Having asterisks on the left is better for view impaired people and
for b/w printouts.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agobuild: Remove obsolete option from autogen.rc
Werner Koch [Thu, 24 Aug 2017 15:44:02 +0000 (17:44 +0200)]
build: Remove obsolete option from autogen.rc

* autogen.rc: Remove --enable-gpg2-is-gpg.
--

This option is now the default.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpgconf: Swap "auto-key-retrieve" and "no-auto-key-retrieve".
Werner Koch [Wed, 23 Aug 2017 14:45:20 +0000 (16:45 +0200)]
gpgconf: Swap "auto-key-retrieve" and "no-auto-key-retrieve".

* g10/gpg.c (gpgconf_list): Announce "auto-key-retrieve".
(main): Simplify setting of KEYSERVER_AUTO_KEY_RETRIEVE.
* tools/gpgconf-comp.c: Make "no-auto-key-retrieve" invisible.  Make
"auto-key-retrieve" an expert option.
--

This basically reverts 9bb13a0e819334681caca38c9074bd7bfc04e45e
because --no-auto-key-retrieve is again the default.  Note that we
allow both options for the sake of profiles.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agotests: Do not run trust-pgp-4.scm
Werner Koch [Wed, 23 Aug 2017 13:16:52 +0000 (15:16 +0200)]
tests: Do not run trust-pgp-4.scm

* tests/openpgp/Makefile.am (XTESTS): Remove test.
(EXTRA_DIST): Add test file.
--

There are two problems with this test: First a syntax error in the
file name so that the test was not used at all.  Second the test
currently returns FAIL.

Fixes-commit: c23a69970ba38edae9d3b2603825d18fbb732423
Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agobuild: Change SWDB tag "gnupg21" to "gnupg22".
Werner Koch [Wed, 23 Aug 2017 12:50:03 +0000 (14:50 +0200)]
build: Change SWDB tag "gnupg21" to "gnupg22".

* configure.ac (GNUPG_SWDB_TAG): New ac_define.  Set it to "gnupg22".
* tools/gpgconf.c (query_swdb): Use it.
* build-aux/speedo.mk: Change tag "gnupg21" to "gnupg22".
* Makefile.am (distcheck-hook): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agopo: Update Norwegian translation
Åka Sikrom [Wed, 23 Aug 2017 12:19:01 +0000 (14:19 +0200)]
po: Update Norwegian translation

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agoagent: Fix string translation for Windows
Andre Heinecke [Wed, 23 Aug 2017 09:02:28 +0000 (11:02 +0200)]
agent: Fix string translation for Windows

* agent/agent.h (L_): Define agent_Lunderscore when simple
gettext is used.

--
This fixes a regression introduced by b3286af3 ENABLE_NLS
is not defined if we use simple gettext and not gettext.

GnuPG-Bug-Id: T3364
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
9 months agopo: Update Japanese translation
NIIBE Yutaka [Tue, 22 Aug 2017 02:24:31 +0000 (11:24 +0900)]
po: Update Japanese translation

9 months agotests: Add tests for the PGP trust model.
Damien Goutte-Gattat [Wed, 19 Jul 2017 20:17:29 +0000 (22:17 +0200)]
tests: Add tests for the PGP trust model.

* tests/openpgp/trust-pgp-1.scm: New file.
* tests/openpgp/trust-pgp-2.scm: New file.
* tests/openpgp/trust-pgp-3.scm: New file.
* tests/openpgp/trust-pgp-4.scm: New file.
* tests/openpgp/trust-pgp/common.scm: New file.
* tests/openpgp/trust-pgp/scenario1.asc: New file.
* tests/openpgp/trust-pgp/scenario2.asc: New file.
* tests/openpgp/trust-pgp/scenario3.asc: New file.
* tests/openpgp/trust-pgp/scenario4.asc: New file.
* tests/openpgp/trust-pgp/alice.sec.asc: New file.
* tests/openpgp/trust-pgp/bobby.sec.asc: New file.
* tests/openpgp/trust-pgp/carol.sec.asc: New file.
* tests/openpgp/trust-pgp/david.sec.asc: New file.
* tests/openpgp/trust-pgp/frank.sec.asc: New file.
* tests/openpgp/trust-pgp/grace.sec.asc: New file.
* tests/openpgp/trust-pgp/heidi.sec.asc: New file.
* tests/openpgp/Makefile.am (XTESTS): Add new tests.
(TEST_FILES): Add new files.
(EXTRA_DIST): Add new common file.

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
9 months agotests: Move some functions into a common module.
Damien Goutte-Gattat [Wed, 19 Jul 2017 20:17:28 +0000 (22:17 +0200)]
tests: Move some functions into a common module.

* tests/openpgp/tofu.scm (gettrust): Moved to the common defs.scm
module.
(checktrust): Likewise.
* tests/openpgp/defs.scm (gettrust): New function.
(checktrust): Likewise.
--

These functions will be re-used by the tests for the PGP trust
model.

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
9 months agogpgconf: Make WoT settings configurable by gpgconf.
Damien Goutte-Gattat [Mon, 21 Aug 2017 14:48:11 +0000 (16:48 +0200)]
gpgconf: Make WoT settings configurable by gpgconf.

* tools/gpgconf-comp.c (gc_options_gpg): Add max-cert-depth,
completes-needed, and marginals-needed options.
* g10/gpg.c (gpgconf_list): Likewise.
--

Some tests to come for the PGP trust model will need to manipulate
these parameters.

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
9 months agogpgscm: Fix -Wimplicit-fallthrough warnings.
Justus Winter [Mon, 21 Aug 2017 12:49:29 +0000 (14:49 +0200)]
gpgscm: Fix -Wimplicit-fallthrough warnings.

* tests/gpgscm/scheme.c (CASE): Rearrange so that the case statement
is at the front.
(Eval_Cycle): Improve fallthrough annotations.

Signed-off-by: Justus Winter <justus@g10code.com>
10 months agogpg: default to --no-auto-key-retrieve.
Daniel Kahn Gillmor [Fri, 11 Aug 2017 06:26:52 +0000 (02:26 -0400)]
gpg: default to --no-auto-key-retrieve.

* g10/gpg.c (main): remove KEYSERVER_AUTO_KEY_RETRIEVE from the
default keyserver options.
* doc/gpg.texi: document this change.
--

This is a partial reversion of
7e1fe791d188b078398bf83c9af992cb1bd2a4b3.  Werner and i discussed it
earlier today, and came to the conclusion that:

 * the risk of metadata leakage represented by a default
   --auto-key-retrieve, both in e-mail (as a "web bug") and in other
   contexts where GnuPG is used to verified signatures, is quite high.

 * the advantages of --auto-key-retrieve (in terms of signature
   verification) can sometimes be achieved in other ways, such as when
   a signed message includes a copy of its own key.

 * when those other ways are not useful, a graphical, user-facing
   application can still offer the user the opportunity to choose to
   fetch the key; or it can apply its own policy about when to set
   --auto-key-retrieve, without needing to affect the defaults.

Note that --auto-key-retrieve is specifically about signature
verification.  Decisions about how and whether to look up a key during
message encryption are governed by --auto-key-locate.  This change
does not touch the --auto-key-locate default of "local,wkd".  The user
deliberately asking gpg to encrypt to an e-mail address is a different
scenario than having an incoming e-mail trigger a potentially unique
network request.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 months agopo: Update Russian translation
Ineiev [Sat, 5 Aug 2017 12:27:44 +0000 (12:27 +0000)]
po: Update Russian translation

--

There was a small merge conflict.  I hope I did not mess it up. -wk

10 months agotests: Improve documentation.
Justus Winter [Thu, 10 Aug 2017 10:04:43 +0000 (12:04 +0200)]
tests: Improve documentation.

* tests/openpgp/README: Add quickstart instructions, how to use
shell.scm, remove no longer used MKDATA.

Signed-off-by: Justus Winter <justus@g10code.com>
10 months agog10: Write status error on error of --quick-revoke-uid.
Marcus Brinkmann [Wed, 9 Aug 2017 16:35:56 +0000 (18:35 +0200)]
g10: Write status error on error of --quick-revoke-uid.

* g10/keyedit.c (keyedit_quick_revuid): Write status error on error.

Signed-off-by: Marcus Brinkmann <mb@g10code.com>
GnuPG-bug-id: 2963

10 months agoPost release updates gnupg-2.2-base
Werner Koch [Wed, 9 Aug 2017 14:58:47 +0000 (16:58 +0200)]
Post release updates

--

10 months agoRelease 2.1.23 gnupg-2.1.23
Werner Koch [Wed, 9 Aug 2017 13:52:48 +0000 (15:52 +0200)]
Release 2.1.23

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agopo: Auto-update
Werner Koch [Wed, 9 Aug 2017 13:45:40 +0000 (15:45 +0200)]
po: Auto-update

--

10 months agopo: Update German translation
Werner Koch [Wed, 9 Aug 2017 10:50:44 +0000 (12:50 +0200)]
po: Update German translation

10 months agobuild: New configure option --enable-all-tests.
Werner Koch [Tue, 8 Aug 2017 15:28:25 +0000 (17:28 +0200)]
build: New configure option --enable-all-tests.

* configure.ac: New option --enable-all-tests.
* tests/gpgscm/ffi.c (ffi_init): New gloabl var *run-all-tests*.
* tests/openpgp/all-tests.scm (all-tests): Use that var instead
of *maintainer-mode*.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add --enable-all-tests.
--

It is better to have a separate option to run all tests than to put
this on top of --enable-maintainer-mode.  This way we can also make
sure to run all tests during "make distcheck".

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpgscm: Make the test summary stand out
Werner Koch [Tue, 8 Aug 2017 11:47:00 +0000 (13:47 +0200)]
gpgscm: Make the test summary stand out

* tests/gpgscm/tests.scm (test-pool): Add delimiter lines.
--

This is to make those summaries a bit more simlar to those from
automake.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agosm: Always print the keygrip in colon mode.
Werner Koch [Tue, 8 Aug 2017 11:04:12 +0000 (13:04 +0200)]
sm: Always print the keygrip in colon mode.

* sm/keylist.c (list_cert_colon): Always print the keygrip as
described in the manual.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: Add option '--disable-dirmngr'.
Justus Winter [Tue, 8 Aug 2017 09:43:22 +0000 (11:43 +0200)]
gpg: Add option '--disable-dirmngr'.

* doc/gpg.texi: Document new option.
* g10/call-dirmngr.c (create_context): Fail if option is given.
* g10/gpg.c (cmd_and_opt_values): New value.
(opts): New option.
(gpgconf_list): Add new option.
(main): Handle new option.
* g10/options.h (struct opt): New field 'disable_dirmngr'.
* tools/gpgconf-comp.c (gc_options_gpg): New option.

GnuPG-bug-id: 3334
Signed-off-by: Justus Winter <justus@g10code.com>
10 months agosystemd-user: Drop redundant After=*.socket.
Daniel Kahn Gillmor [Mon, 7 Aug 2017 08:14:02 +0000 (04:14 -0400)]
systemd-user: Drop redundant After=*.socket.

* doc/examples/systemd-user/*.service: Drop redundant After=*.socket
directive.

--

systemd.socket(5) says:

   Socket units will have a Before= dependency on the service which
   they trigger added implicitly.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 months agosystemd-user: Drop RefuseManualStart=true.
Daniel Kahn Gillmor [Mon, 7 Aug 2017 08:11:51 +0000 (04:11 -0400)]
systemd-user: Drop RefuseManualStart=true.

* doc/examples/systemd-user/*.service: drop RefuseManualStart=true

--

These user services can be safely started manually as long as at least
their primary sockets are available.  They'll just start with nothing
to do, which should be fine.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 months agotests: Do not run all tests unless in maintainer mode.
Justus Winter [Mon, 7 Aug 2017 09:15:56 +0000 (11:15 +0200)]
tests: Do not run all tests unless in maintainer mode.

* configure.ac: Leak the maintainer mode flag into 'config.h'.
* tests/gpgscm/ffi.c: Pass it into the scheme environment.
* tests/openpgp/all-tests.scm: Only run tests against non-default
configurations (keyring, extended-key-format) in maintainer mode.
--

Werner is concerned that the tests do take up too much time and asked
me to reduce the runtime of the tests for normal users.

Signed-off-by: Justus Winter <justus@g10code.com>
10 months agoFix spelling.
Daniel Kahn Gillmor [Mon, 7 Aug 2017 07:34:03 +0000 (03:34 -0400)]
Fix spelling.

* doc/gpg.texi: s/occured/occurred/

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 months agoSimple typo fix.
Daniel Kahn Gillmor [Mon, 7 Aug 2017 05:03:52 +0000 (01:03 -0400)]
Simple typo fix.

* agent/gpg-agent.c: Correct spelling in comment.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
10 months agogpg: Install gpg by default under the name gpg.
Werner Koch [Sat, 5 Aug 2017 12:39:32 +0000 (14:39 +0200)]
gpg: Install gpg by default under the name gpg.

* configure.ac: Remove option --enable-gpg2-is-gpg.  Add option
--enable-gpg-is-gpg2.
* build-aux/speedo.mk (speedo_pkg_gnupg_configure): Remove
--enable-gpg2-is-gpg.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: gpgconf needs to support the now default --auto-key-retrieve.
Werner Koch [Sat, 5 Aug 2017 12:26:22 +0000 (14:26 +0200)]
gpg: gpgconf needs to support the now default --auto-key-retrieve.

* tools/gpgconf-comp.c (gc_options_gpg): Re-add "auto-key_retrieve".
--

Although this option is invisible, it might be in use by gpgconf
profiles.  We don't want to break them.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: Fix memory leak in parse_auto_key_locate.
Werner Koch [Fri, 4 Aug 2017 20:46:40 +0000 (22:46 +0200)]
gpg: Fix memory leak in parse_auto_key_locate.

* g10/getkey.c (parse_auto_key_locate): Fix freeing of OPTIONS.
--

It was probably too late for me to hack.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agotests: Adjust tests for changed --auto-key-locate default.
Werner Koch [Fri, 4 Aug 2017 20:28:13 +0000 (22:28 +0200)]
tests: Adjust tests for changed --auto-key-locate default.

* tests/openpgp/defs.scm (create-gpghome): Disable new defaults.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: Make --no-auto-key-retrieve gpgconf-igurable.
Werner Koch [Fri, 4 Aug 2017 20:19:37 +0000 (22:19 +0200)]
gpg: Make --no-auto-key-retrieve gpgconf-igurable.

* g10/gpg.c (gpgconf_list): Print no-auto-key-retrieve instead of
auto-key-retrieve.
* tools/gpgconf-comp.c (gc_options_gpg): Replace auto-key-retrieve by
no-auto-key-retrieve and chnage level from invisible to advanced.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: Default to --auto-key-locate "local,wkd" and --auto-key-retrieve.
Werner Koch [Fri, 4 Aug 2017 19:58:46 +0000 (21:58 +0200)]
gpg: Default to --auto-key-locate "local,wkd" and --auto-key-retrieve.

* g10/gpg.c (main): Add KEYSERVER_AUTO_KEY_RETRIEVE to the default
keyserver options.  Set the default for --auto-key-locate to
"local,wkd".  Reset that default iff --auto-key-locate has been given
in the option file or in the commandline.
* g10/getkey.c (parse_auto_key_locate): Work on a copy of the arg.
--

GnuPG-bug-id: 3324
Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agoagent: Make --no-grab the default.
Werner Koch [Fri, 4 Aug 2017 16:34:03 +0000 (18:34 +0200)]
agent: Make --no-grab the default.

* agent/gpg-agent.c (oGrab): New const.
(opts): New option --grab.  Remove description for --no-grab.
(parse_rereadable_options): Make --no-grab the default.
(finalize_rereadable_options): Allow --grab to override --no-grab.
(main) <gpgconflist>: Add "grab".
* tools/gpgconf-comp.c (gc_options_gpg_agent): Add "grab".

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: Avoid double fingerprint printing with import-show.
Werner Koch [Fri, 4 Aug 2017 15:09:17 +0000 (17:09 +0200)]
gpg: Avoid double fingerprint printing with import-show.

* g10/import.c (import_one) <IMPORT_SHOW>: Take care of fingerprint
options.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpg: New import option show-only.
Werner Koch [Fri, 4 Aug 2017 15:03:03 +0000 (17:03 +0200)]
gpg: New import option show-only.

* g10/options.h (IMPORT_DRY_RUN): New.
* g10/import.c (parse_import_options): Add "show-only".
(import_one): use that as alternative to opt.dry_run.
--

This is just a convenience thing for

  --import-options import-show --dry-run

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agowks: Allow gpg-wks-client --supported with just the domain name
Werner Koch [Thu, 3 Aug 2017 19:16:22 +0000 (21:16 +0200)]
wks: Allow gpg-wks-client --supported with just the domain name

* tools/gpg-wks-client.c (command_supported): Hack for missing local
part.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agog10: Always save standard revocation certificate in file.
Marcus Brinkmann [Wed, 2 Aug 2017 13:19:04 +0000 (15:19 +0200)]
g10: Always save standard revocation certificate in file.

* g10/revoke.c (gen_standard_revocation): Set opt.outfile to NULL
temporarily to create certificate in right place.

Signed-off-by: Marcus Brinkmann <mb@g10code.com>
GnuPG-bug-id: 3015

10 months agoRevert "g10: Always save standard revocation certificate in file."
Marcus Brinkmann [Tue, 1 Aug 2017 17:08:16 +0000 (19:08 +0200)]
Revert "g10: Always save standard revocation certificate in file."

This reverts commit ebc65ff459e6c228fb7406e375819a9fe5637abe.