gnupg.git
3 years agoagent: Improve error handling.
Justus Winter [Fri, 11 Dec 2015 10:05:52 +0000 (11:05 +0100)]
agent: Improve error handling.

* agent/pksign.c (agent_pksign_do): Improve error handling.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoagent: Fix typo.
Justus Winter [Fri, 11 Dec 2015 10:03:16 +0000 (11:03 +0100)]
agent: Fix typo.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoFix required libgpg-error version.
Justus Winter [Thu, 10 Dec 2015 09:47:09 +0000 (10:47 +0100)]
Fix required libgpg-error version.

* configure.ac (NEED_GPG_ERROR_VERSION): We need version 1.21 for the
poll interface.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Don't error out if a key occurs multiple times in the keyring.
Neal H. Walfield [Fri, 11 Dec 2015 10:12:46 +0000 (11:12 +0100)]
gpg: Don't error out if a key occurs multiple times in the keyring.

* g10/gpg.c (check_user_ids): Don't error out if a key occurs multiple
times in the keyring.  Instead, print a warning.  When printing out
fingerprint prints, use format_hexfingerprint to format them.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agoscd: Fix removal of unplugged usb readers on Windows.
Daniel Hoffend [Sun, 6 Dec 2015 23:13:59 +0000 (00:13 +0100)]
scd: Fix removal of unplugged usb readers on Windows.

* scd/apdu.c (pcsc_error_to_sw): map PCSC_E_NO_SERVICE and
PCSC_E_SERVICE_STOPPED to the internal SW_HOST_NO_READER error code.

--

Signed-off-by: Daniel Hoffend <dh@dotlan.net>
GnuPG-bug-id: 2167

In Windows 8 (and later), PC/SC service only runs when reader/token is
plugged in.  After its removal, it returns PCSC_E_NO_SERVICE error.
This error should be handled as no reader.  This comment is by gniibe.

3 years agotests: Add some more gpgtar tests.
Justus Winter [Mon, 7 Dec 2015 11:53:57 +0000 (12:53 +0100)]
tests: Add some more gpgtar tests.

* tests/openpgp/gpgtar.test: Add more tests.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agopo: Update Russion translation
Ineiev [Mon, 7 Dec 2015 11:04:25 +0000 (12:04 +0100)]
po: Update Russion translation

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Initialize http status code.
Justus Winter [Mon, 7 Dec 2015 10:21:47 +0000 (11:21 +0100)]
dirmngr: Initialize http status code.

* dirmngr/ks-action.c (ks_action_search): Initialize 'http_status' as
it is unused if LDAP is used to search for keys.
--
This amends 6ac57a48.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Write ERROR status on delete-key cancellation
Daiki Ueno [Mon, 9 Nov 2015 04:20:13 +0000 (13:20 +0900)]
gpg: Write ERROR status on delete-key cancellation

* g10/delkey.c (do_delete_key): Write ERROR status code with the error
location "delete_key.secret", when the user cancelled the operation on
Pinentry.
--

I changed the original patch to emit the full gpg_error_t code. -wk

3 years agodirmngr: Stricter handling of http error codes.
Justus Winter [Fri, 4 Dec 2015 11:32:20 +0000 (12:32 +0100)]
dirmngr: Stricter handling of http error codes.

* dirmngr/ks-action.c (ks_action_search): Only retry if the keyserver
responded with a '404 Not Found'.
* dirmngr/ks-engine-hkp.c (send_request): Return http status code.
(ks_hkp_search): Likewise.
(ks_hkp_{get,put}): Adapt call to 'send_request'.
* dirmngr/ks-engine.h (ks_hkp_search): Update prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Really search all keyservers for patterns.
Justus Winter [Thu, 3 Dec 2015 15:54:06 +0000 (16:54 +0100)]
dirmngr: Really search all keyservers for patterns.

* dirmngr/ks-action.c (ks_action_search): Search all configured
keyservers for the given patterns.

Signed-off-by: Justus Winter <justus@g10code.com>
GnuPG-bug-id: 1038

3 years agodirmngr: Handle http status '501 Not Implemented'.
Justus Winter [Fri, 4 Dec 2015 11:08:37 +0000 (12:08 +0100)]
dirmngr: Handle http status '501 Not Implemented'.

* dirmngr/ks-engine-hkp.c (send_request): Handle status 501 and return
GPG_ERR_NOT_IMPLEMENTED.

Signed-off-by: Justus Winter <justus@g10code.com>
GnuPG-bug-id: 1221

3 years agotools/gpgtar: Implement symmetric encryption.
Justus Winter [Tue, 1 Dec 2015 11:01:12 +0000 (12:01 +0100)]
tools/gpgtar: Implement symmetric encryption.

* tests/openpgp/gpgtar.test: Add test case.
* tools/gpgtar-create.c (gpgtar_create): Pass '--symmetric' flag to
gpg.
* tools/gpgtar.c (parse_arguments): We do handle the argument now.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Implement signing.
Justus Winter [Mon, 30 Nov 2015 17:39:00 +0000 (18:39 +0100)]
tools/gpgtar: Implement signing.

* tests/openpgp/gpgtar.test: Test signing.
* tools/gpgtar-create.c (gpgtar_create): Add 'sign' option, add the
appropriate gpg arguments to implement signing and selecting the local
user.
* tools/gpgtar.c (parse_options): We do handle '--local-user' now.
(main): Handle signing, encrypting, and doing both when creating an
archive.
* tools/gpgtar.h (gpgtar_create): Update prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Use the new exectool helper.
Justus Winter [Mon, 30 Nov 2015 15:21:22 +0000 (16:21 +0100)]
tools/gpgtar: Use the new exectool helper.

* tools/Makefile.am: gpgtar now requires neither npth nor libassuan.
* tools/gpgtar-create.c (gpgtar_create): Use the new 'sh-exectool'
helper.
* tools/gpgtar-extract.c (gpgtar_extract): Likewise.
* tools/gpgtar-list.c (gpgtar_list): Likewise.
* tools/gpgtar.c (main): Set default gpg program.  Drop the
initialization of npth and libassuan.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Add a stream interface to 'sh-exectool'.
Justus Winter [Mon, 30 Nov 2015 13:23:02 +0000 (14:23 +0100)]
common: Add a stream interface to 'sh-exectool'.

* common/sh-exectool.c (struct copy_buffer): Add infrastructure for
copying between streams.
(copy_buffer_{init,shred,do_copy,flush}): New functions.
(sh_exec_tool_stream): Rework 'sh_exec_tool' to operate on streams.
(nop_free): New function.
(sh_exec_tool): Express this in terms of 'sh_exec_tool_stream'.
* common/sh-exectool.h (sh_exec_tool_stream): New prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Add header file and build the new code.
Justus Winter [Mon, 30 Nov 2015 12:00:11 +0000 (13:00 +0100)]
common: Add header file and build the new code.

* common/Makefile.am (common_sources): Add new files.
* common/sh-exectool.h: New file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Add code to execute a helper.
Werner Koch [Mon, 30 Nov 2015 11:53:57 +0000 (12:53 +0100)]
common: Add code to execute a helper.

* common/sh-exectool.c: New file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoMerge branch 'STABLE-BRANCH-2-2' into wk-master
Werner Koch [Fri, 4 Dec 2015 11:11:56 +0000 (12:11 +0100)]
Merge branch 'STABLE-BRANCH-2-2' into wk-master

--

I forgot to merge the updated Japanese translation into the release
branch thus we need to fix it up here.

3 years agoPost release updates.
Werner Koch [Fri, 4 Dec 2015 11:00:05 +0000 (12:00 +0100)]
Post release updates.

--

3 years agoRelease 2.1.10 gnupg-2.1.10
Werner Koch [Fri, 4 Dec 2015 09:50:51 +0000 (10:50 +0100)]
Release 2.1.10

3 years agopo: Update Ukrainian translation
Yuri Chornoivan [Fri, 23 Oct 2015 17:04:34 +0000 (20:04 +0300)]
po: Update Ukrainian translation

--

Merged with current POT - wk

3 years agopo: Update Russian translation
Ineiev [Fri, 4 Dec 2015 09:23:39 +0000 (10:23 +0100)]
po: Update Russian translation

--

Signed-off-by: Werner Koch <wk@gnupg.org>
The patch was from October 12 and thus 6 strings could not be applied
due to chnaged original strings.

3 years agopo: Japanese translation.
NIIBE Yutaka [Fri, 4 Dec 2015 09:16:15 +0000 (18:16 +0900)]
po: Japanese translation.

3 years agospeedo,w32: Improve installer.
Werner Koch [Fri, 4 Dec 2015 08:11:11 +0000 (09:11 +0100)]
speedo,w32: Improve installer.

* build-aux/speedo/w32/inst.nsi (SEC_gnupg): Install dirmngr.conf and
distsigkey.gpg.
(un.gnupglast): Stop dirmngr.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Do not pre-check keys given on the command line.
Werner Koch [Fri, 4 Dec 2015 07:56:02 +0000 (08:56 +0100)]
gpg: Do not pre-check keys given on the command line.

* g10/keydb.h (PK_LIST_ENCRYPT_TO, PK_LIST_HIDDEN, PK_LIST_CONFIG)
(PK_LIST_SHIFT): New.
* g10/pkclist.c (build_pk_list): Use them here.
* g10/gpg.c (check_user_ids, main): Ditto.

* g10/gpg.c (main): Set PK_LIST_CONFIG for REMUSR and LOCUSR.
(check_user_ids): Skip check for command line specified options.
--

If a key has been given on the command line and it has not been
given by one of the encrypt-to options, we now skip the checks.  The
reason is that the actual key selection code does its own checks and
provides proper status message to the caller to detect the wrong keys.
Without this we would break most frontends because they expect for
example STATUS_INV_RECP.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Add command to print the resolver version.
Werner Koch [Thu, 3 Dec 2015 17:05:32 +0000 (18:05 +0100)]
dirmngr: Add command to print the resolver version.

* dirmngr/server.c (cmd_getinfo): Add sub-command "dnsinfo".

3 years agopo: Auto-update.
Werner Koch [Thu, 3 Dec 2015 16:28:20 +0000 (17:28 +0100)]
po: Auto-update.

--

3 years agopo: Update German translation.
Werner Koch [Thu, 3 Dec 2015 16:27:46 +0000 (17:27 +0100)]
po: Update German translation.

--

3 years agogpg: Allow "help" as value for --tofu-policy.
Werner Koch [Thu, 3 Dec 2015 15:19:35 +0000 (16:19 +0100)]
gpg: Allow "help" as value for --tofu-policy.

* g10/gpg.c (parse_tofu_policy): Add keyword "help".
(parse_tofu_db_format): Ditto.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoDo not translate messages printed with log_debug.
Werner Koch [Thu, 3 Dec 2015 14:38:25 +0000 (15:38 +0100)]
Do not translate messages printed with log_debug.

* common/asshelp.c (start_new_gpg_agent): Do not i18n string.
(start_new_dirmngr): Ditto.
* g10/mainproc.c (proc_encrypted): Ditto.  Print only if debug is
enabled.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoscd: Fix for removing the prefix.
NIIBE Yutaka [Fri, 4 Dec 2015 05:37:05 +0000 (14:37 +0900)]
scd: Fix for removing the prefix.

* scd/app-openopg.c (do_decipher): Fix the condition.

3 years agoscd: Simplify saving application context.
NIIBE Yutaka [Fri, 4 Dec 2015 05:13:23 +0000 (14:13 +0900)]
scd: Simplify saving application context.

* scd/app.c (lock_table): Remove LAST_APP field.
(lock_reader, app_dump_state, application_notify_card_reset)
(release_application): Follow the change.
(check_conflict): New.
(check_application_conflict): Lock the slot and call check_conflict.
(select_application): Call check_conflict and not use LAST_APP.

--

We don't need LAST_APP field but just keep the application context by
APP field.  Since we have a reference counter, it is possible if we
can deallocate or not.

3 years agoscd: More fix for Curve25519 prefix handling.
NIIBE Yutaka [Fri, 4 Dec 2015 05:02:48 +0000 (14:02 +0900)]
scd: More fix for Curve25519 prefix handling.

* scd/app-openpgp.c (do_decipher): Handle trancated cipher text.
Also fix xfree bug introduced.

--

In old format with no prefix, cipher text can be trancated when it
is parsed as MPI.  Recover the value adding back zeros.

Fixes-commit: 11b2691eddc42e91651e4f95dd2731255a3e9211

3 years agoscd: Another fix for Curve25519 prefix handling.
Werner Koch [Thu, 3 Dec 2015 12:46:03 +0000 (13:46 +0100)]
scd: Another fix for Curve25519 prefix handling.

* scd/app-openpgp.c (do_decipher): Check 0x02 also for 16+1 byte long
INDATA.
(do_decipher): Fix integer arithmetic in void pointer.
(do_decipher): Add missing memcpy.
--

I have not tested this fix but it is obvious.

Fixes-commit: 11b2691eddc42e91651e4f95dd2731255a3e9211
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agobuild: Avoid dependecy problems in "make distcheck".
Werner Koch [Thu, 3 Dec 2015 12:28:28 +0000 (13:28 +0100)]
build: Avoid dependecy problems in "make distcheck".

* doc/Makefile.am (gnupg.texi): Depend on defs.inc.
--

Reported-by: Justus Winter
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agobuild: Change how caller provided CFLAGS are used by configure.
Werner Koch [Thu, 3 Dec 2015 11:51:52 +0000 (12:51 +0100)]
build: Change how caller provided CFLAGS are used by configure.

* configure.ac: Append instead of prepend caller provided CFLAGS.
--

Suggested-by: Justus Winter
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Additional comment on commit a28ac99e.
Werner Koch [Thu, 3 Dec 2015 11:37:56 +0000 (12:37 +0100)]
gpg: Additional comment on commit a28ac99e.

--

My statement that commit 04a6b903 changed the semantics of keydb_new
was plainly wrong.  Not Neal broke it but me when I initially wrote
that function or copied it from gpgsm.

Sorry.

3 years agogpg: Add variant of 'key "%s" not found: %s' error message.
Werner Koch [Thu, 3 Dec 2015 11:25:37 +0000 (12:25 +0100)]
gpg: Add variant of 'key "%s" not found: %s' error message.

* g10/gpg.c (check_user_ids): Change error message.
* g10/delkey.c (do_delete_key): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Make keyidlist more robust in case of errors.
Werner Koch [Thu, 3 Dec 2015 11:19:30 +0000 (12:19 +0100)]
gpg: Make keyidlist more robust in case of errors.

* g10/keyserver.c (keyidlist): Clear *KLIST on error.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Take care of keydb_new returning NULL.
Werner Koch [Thu, 3 Dec 2015 11:18:32 +0000 (12:18 +0100)]
gpg: Take care of keydb_new returning NULL.

* g10/keydb.c (keydb_new): Print an error message if needed.  Also use
xtrycalloc because we return an error anyway.
* g10/delkey.c (do_delete_key): Handle error retruned by keydb_new.
* g10/export.c (do_export_stream): Ditto.
* g10/getkey.c (get_pubkey): Ditto.
(get_pubkey_fast): Ditto.
(get_pubkeyblock): Ditto.
(get_seckey): Ditto.
(key_byname): Ditto.
(get_pubkey_byfprint): Ditto.
(get_pubkey_byfprint_fast): Ditto.
(parse_def_secret_key): Ditto.
(have_secret_key_with_kid): Ditto.
* g10/import.c (import_one): Ditto.
(import_revoke_cert): Ditto.
* g10/keyedit.c (keyedit_quick_adduid): Ditto.
* g10/keygen.c (quick_generate_keypair): Ditto.
(do_generate_keypair): Ditto.
* g10/trustdb.c (validate_keys): Ditto.
* g10/keyserver.c (keyidlist): Ditto.
* g10/revoke.c (gen_desig_revoke): Ditto.
(gen_revoke): Ditto.
* g10/gpg.c (check_user_ids): Ditto.
(main): Do not print an error message for keydb_new error.
* g10/keylist.c (list_all): Use actual error code returned by
keydb_new.

* g10/t-keydb-get-keyblock.c (do_test): Abort on keydb_new error.
* g10/t-keydb.c (do_test): Ditto.

* g10/keyring.c (keyring_new): Actually return an error so that the
existing keydb_new error checking makes sense for a keyring resource.
(keyring_rebuild_cache): Take care of keyring_new returning an error.
--

Commit 04a6b903 changed keydb_new to return an error.  However the
error was not checked at most places which we fix with this patch.  To
make things easier keydb_new prints an error message itself.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Change some error messages.
Werner Koch [Thu, 3 Dec 2015 09:39:29 +0000 (10:39 +0100)]
gpg: Change some error messages.

* g10/getkey.c (parse_def_secret_key): Change error message.  Replace
log_debug by log_info.
* g10/gpg.c (check_user_ids): Make function static.  Change error
messages.
(main): Change error messages.
* g10/revoke.c (gen_revoke): Ditto.
--

There are other smaller changes not described above.

This change tries to avoid new error messages so not to increase the
the number of translated strings or break too many existing
translations.  It also tries to use existing strings and changes the
quoting to the most common style used in gpg.

Key specifications should in general use double quotes.  Other values
should use single quotes.  However. sometimes it is not easy to
distinguish between values given on the command line and key
specifications.  According to old GNU coding standards diagnostics
should not start capitalized - whether this is a good idea is a
different thing but we used this rules for most strings.  However,
strings which are used interactively should be properly capitalized
and end with a dot.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoscd: Fix "Conflicting usage" bug.
NIIBE Yutaka [Thu, 3 Dec 2015 02:26:24 +0000 (11:26 +0900)]
scd: Fix "Conflicting usage" bug.

* scd/apdu.c (apdu_close_reader): Call CLOSE_READER method even if we
  got an error from apdu_disconnect.
* scd/app-common.h (no_reuse): Remove.
* scd/app.c (application_notify_card_reset): Deallocate APP here.
(select_application, release_application): Don't use NO_REUSE.

--

Reproducible scenario: Invoke gpg --card-edit session from a terminal.
Invoke another gpg --card-edit session from another.  Remove a token.
Insert a token again.  Type RET on both terminals.  One of terminal
answers "Conflicting usage".

Perhaps, having NO_REUSE field was to avoid race conditions.  Now,
APP can be safely deallocated by application_notify_card_reset.

Thanks to the2nd.

3 years agoscd: Fix for Curve25519 prefix handling.
NIIBE Yutaka [Wed, 2 Dec 2015 23:48:51 +0000 (08:48 +0900)]
scd: Fix for Curve25519 prefix handling.

* scd/app-openpgp.c (do_decipher): More condition for AES decipher.
  Handle the prefix in cipher text.  Always add the prefix in result.

3 years agogpg: Use the matching key if the search description is exact.
Neal H. Walfield [Wed, 2 Dec 2015 19:51:52 +0000 (20:51 +0100)]
gpg: Use the matching key if the search description is exact.

* g10/gpg.c (check_user_ids): If the search description is for an
exact match (a keyid or fingerprint that ends in '!'), then use the
matching key, not the primary key.
* tests/openpgp/Makefile.am (TESTS): Add use-exact-key.test.
(priv_keys): Add privkeys/00FE67F28A52A8AA08FFAED20AF832DA916D1985.asc,
privkeys/1DF48228FEFF3EC2481B106E0ACA8C465C662CC5.asc,
privkeys/A2832820DC9F40751BDCD375BB0945BA33EC6B4C.asc,
privkeys/ADE710D74409777B7729A7653373D820F67892E0.asc and
privkeys/CEFC51AF91F68A2904FBFF62C4F075A4785B803F.asc.
(sample_keys): Add
samplekeys/E657FB607BB4F21C90BB6651BC067AF28BC90111.asc.
* tests/openpgp/privkeys/00FE67F28A52A8AA08FFAED20AF832DA916D1985.asc:
New file.
* tests/openpgp/privkeys/1DF48228FEFF3EC2481B106E0ACA8C465C662CC5.asc:
New file.
* tests/openpgp/privkeys/A2832820DC9F40751BDCD375BB0945BA33EC6B4C.asc:
New file.
* tests/openpgp/privkeys/ADE710D74409777B7729A7653373D820F67892E0.asc:
New file.
* tests/openpgp/privkeys/CEFC51AF91F68A2904FBFF62C4F075A4785B803F.asc:
New file.
* tests/openpgp/samplekeys/E657FB607BB4F21C90BB6651BC067AF28BC90111.asc:
New file.
* tests/openpgp/use-exact-key.test: New file.
* tests/openpgp/version.test: Install the new private keys.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Reported-by: Reported-by: Kristian Fiskerstrand
  <kristian.fiskerstrand@sumptuouscapital.com>
Fixes-commit: 10cca02

3 years agobuild: Require at least Libassuan 2.4.1.
Werner Koch [Wed, 2 Dec 2015 17:47:50 +0000 (18:47 +0100)]
build: Require at least Libassuan 2.4.1.

* configure.ac (NEED_LIBASSUAN_VERSION): Set to 2.4.1.
* agent/gpg-agent.c (create_server_socket): Remove check for
libassuan >= 2.3.0 and >= 2.1.4.
(main): Remove check for libassuan >= 2.1.4.
* scd/scdaemon.c (create_server_socket): Remove check for
libassuan >= 2.1.4.
* dirmngr/dirmngr.c (set_tor_mode): Remove check for
libassuan >= 2.3.0.
* dirmngr/http.c (http_raw_connect, send_request): Remove checks for
libassuan >= 2.3.0.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Improve documentation.
Neal H. Walfield [Wed, 2 Dec 2015 14:21:20 +0000 (15:21 +0100)]
gpg: Improve documentation.

* g10/tofu.c (initdb): Improve documentation.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Fix type mismatch resulting in a buffer overflow.
Neal H. Walfield [Wed, 2 Dec 2015 14:20:18 +0000 (15:20 +0100)]
gpg: Fix type mismatch resulting in a buffer overflow.

* g10/tofu.c (record_binding): Change policy_old's type from an enum
tofu_policy to a long: this variable is passed by reference and a long
is expected.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Reported-by: Justus Winter <justus@g10code.com>
Fixes-commit: f77913e

3 years agodirmngr: Switch to an onion address if Tor is running.
Werner Koch [Wed, 2 Dec 2015 10:49:41 +0000 (11:49 +0100)]
dirmngr: Switch to an onion address if Tor is running.

* dirmngr/dirmngr.h (opt): Turn field 'keyserver' into an strlist.
* dirmngr/dirmngr.c (parse_rereadable_options): Allow multiple
--keyserver options.
* dirmngr/server.c (server_local_s): Add field 'tor_state'.
(release_uri_item_list): New.
(release_ctrl_keyservers): Use it.
(start_command_handler): Release list of keyservers.
(is_tor_running): New.
(cmd_getinfo): Re-implement "tor" subcommand using new fucntion.
(ensure_keyserver): Rewrite.
* g10/dirmngr-conf.skel: Add two keyserver options.
--

This feature is independent of --use-tor and automagically uses Tor if
available.  The dirmngr.conf file needs to specify two keyservers to
make this work.  For new installations this is done using the skeleton
file.  This feature requires the Libassuan 2.4.2 to work.

This patch also fixes a memory leak of opt.keyserver en passant.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agohttp: Enhance parser to detect .onion addresses.
Werner Koch [Wed, 2 Dec 2015 09:12:32 +0000 (10:12 +0100)]
http: Enhance parser to detect .onion addresses.

* dirmngr/http.h (parsed_uri_s): Add flag 'onion'.
* dirmngr/http.c (do_parse_uri): Set that flag.
* dirmngr/t-http.c (main): Print flags.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon,gpg: Fix processing of search descriptions ending in '!'.
Neal H. Walfield [Wed, 2 Dec 2015 10:07:05 +0000 (11:07 +0100)]
common,gpg: Fix processing of search descriptions ending in '!'.

* g10/gpg.c (check_user_ids): If the search description describes a
keyid or fingerprint and ends in a '!', include the '!' in the
rewritten description.
* common/userids.c (classify_user_id): Accept keyids and fingerprints
ending in '!'.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Reported-by: Kristian Fiskerstrand
  <kristian.fiskerstrand@sumptuouscapital.com>
Fixes-commit: f99830b7
Fixes-commit: e8c53fca

3 years agodirmngr: Improve error handling.
Justus Winter [Tue, 1 Dec 2015 12:24:38 +0000 (13:24 +0100)]
dirmngr: Improve error handling.

* dirmngr/dns-stuff.c (getsrv): Avoid looking at 'header' before
checking for errors, but silently ignore errors when looking up SRV
records.
--
This is a follow-up to 946faaff.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoUpdate NEWS file
Werner Koch [Tue, 1 Dec 2015 07:45:03 +0000 (08:45 +0100)]
Update NEWS file

--

3 years agobuild: Let configure show the the status of Tor support
Werner Koch [Tue, 1 Dec 2015 07:04:49 +0000 (08:04 +0100)]
build: Let configure show the the status of Tor support

* configure.ac (show_tor_support): New

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Clarify dirmngr's --keyserver option.
Werner Koch [Mon, 30 Nov 2015 15:01:07 +0000 (16:01 +0100)]
doc: Clarify dirmngr's --keyserver option.

--
GnuPG-bug-id: 2165

3 years agodoc: Typo fix.
Werner Koch [Mon, 30 Nov 2015 10:47:23 +0000 (11:47 +0100)]
doc: Typo fix.

--

3 years agodoc: Make make distcheck work again.
Werner Koch [Mon, 30 Nov 2015 10:45:28 +0000 (11:45 +0100)]
doc: Make make distcheck work again.

* doc/Makefile.am (DISTCLEANFILES): Add gpgkey2ssh.1

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoyat2m: Add keyword @url.
Werner Koch [Mon, 30 Nov 2015 10:32:00 +0000 (11:32 +0100)]
yat2m: Add keyword @url.

* doc/yat2m.c (proc_texi_cmd): Add keyword @url.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Build man pages with the same date as the info files.
Werner Koch [Mon, 30 Nov 2015 10:27:30 +0000 (11:27 +0100)]
doc: Build man pages with the same date as the info files.

* doc/Makefile.am (yat2m-stamp): Use option --date.
--

This changes allows reproducible builds.

Debian-bug-id: 806494

3 years agoyat2m: New option --date.
Werner Koch [Mon, 30 Nov 2015 10:25:37 +0000 (11:25 +0100)]
yat2m: New option --date.

* doc/yat2m.c (opt_date): new.
(isodatestring): Use it if set.
(main): New option --date.

3 years agogpg: Avoid extra translation strings.
Werner Koch [Fri, 27 Nov 2015 17:23:33 +0000 (18:23 +0100)]
gpg: Avoid extra translation strings.

* g10/keyedit.c (menu_expire): Use only one prompt.
--

The old code was anyway not fully i18n because it did not used
ngettext.  Further we ran into const char*/char* conflicts on Windows
where we use a different gettext implementation.

FWIW: A better pattern in the case of a static and a malloced string
w/o error return on malloc failure would be:

  const char *s;
  char *s_buf;
  s_buf = xtryasprintf ("%d foo", n);
  if (!s_buf)
    s = "several foo";
  else
    s = s_buf;
  bar (s);
  xfree (s_buf);

3 years agokbx: Include gpg-error prior to mischelp.h.
Werner Koch [Fri, 27 Nov 2015 17:10:31 +0000 (18:10 +0100)]
kbx: Include gpg-error prior to mischelp.h.

* kbx/keybox-init.c: Change order of includes.
--

This is to avoid redefintion warnings about GPGRT_ATTR_PRINTF.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg,w32: Fix a format string error.
Werner Koch [Fri, 27 Nov 2015 16:59:52 +0000 (17:59 +0100)]
gpg,w32: Fix a format string error.

* g10/keyring.c (keyring_search): Fix format string for off_t.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoSilence compiler warnings related to not using assuan_fd_t.
Werner Koch [Fri, 27 Nov 2015 16:58:51 +0000 (17:58 +0100)]
Silence compiler warnings related to not using assuan_fd_t.

* common/call-gpg.c (start_gpg): Use assuan_fd_t.  Note that the
declaration was already fixed by a previous change.
* dirmngr/server.c (cmd_getinfo): Use assuan_fd_t.
--

Note that this matters only for Windows and it does not harm as long
as we can only build for 32 bit Windows withsizeof(int)==sizeof(void*).

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoSilence unused variable or parameter warnings.
Werner Koch [Fri, 27 Nov 2015 16:53:52 +0000 (17:53 +0100)]
Silence unused variable or parameter warnings.

--

3 years agoAvoid incompatible pointer assignment warnings on Windows.
Werner Koch [Fri, 27 Nov 2015 17:30:14 +0000 (18:30 +0100)]
Avoid incompatible pointer assignment warnings on Windows.

* common/logging.c (fun_writer): Use gpgrt_ssize_t instead of ssize_t.
* dirmngr/server.c (data_line_cookie_write): Ditto.
* sm/certdump.c (format_name_writer): Ditto.
* sm/server.c (data_line_cookie_write): Ditto.
* dirmngr/http.c (cookie_read, cookie_write): Ditto.
--

See the release notes of libgpg-error 1.15 for background info on
gpgrt_ssize_t.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Avoid a declarations after statements.
Werner Koch [Fri, 27 Nov 2015 16:12:56 +0000 (17:12 +0100)]
dirmngr: Avoid a declarations after statements.

* tools/gpgtar.c (parse_arguments): Use a block for a local varibale
definition.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Avoid casting away a const from an char**.
Werner Koch [Fri, 27 Nov 2015 16:10:59 +0000 (17:10 +0100)]
dirmngr: Avoid casting away a const from an char**.

* dirmngr/ldap.c (start_cert_fetch_ldap): Do not use pointers from
global variables.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Allow testing for a running Tor via "getinfo tor".
Werner Koch [Fri, 27 Nov 2015 11:21:45 +0000 (12:21 +0100)]
dirmngr: Allow testing for a running Tor via "getinfo tor".

* dirmngr/server.c (cmd_getinfo): Print an S line if Tor is not
running.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Fix commit 1a045b13.
Werner Koch [Thu, 26 Nov 2015 17:10:05 +0000 (18:10 +0100)]
g13: Fix commit 1a045b13.

* g13/g13.c (main): Use existsing function.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Fix off-by-one access in the new format_text.
Werner Koch [Thu, 26 Nov 2015 17:04:54 +0000 (18:04 +0100)]
common: Fix off-by-one access in the new format_text.

* common/stringhelp.c (format_text): Use existsing fucntion to trim
trailing spaces.  Fix off-by-one access.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Improve output of "getinfo tor".
Werner Koch [Thu, 26 Nov 2015 16:35:56 +0000 (17:35 +0100)]
dirmngr: Improve output of "getinfo tor".

* dirmngr/server.c (cmd_getinfo): Print a message along with OK.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodirmngr: Let Libassuan employ nPth wrappers for connect.
Werner Koch [Thu, 26 Nov 2015 16:15:08 +0000 (17:15 +0100)]
dirmngr: Let Libassuan employ nPth wrappers for connect.

* dirmngr/http.c (my_unprotect, my_protect): Remove.
(connect_server): Do not use these wrappers.
--

Since Libassuan version 2.4.2 the macro ASSUAN_SYSTEM_NPTH_IMPL
protects the low-level connect calls with npth_unprotect and
npth_protect.  This is better than the high-level kludge we used here.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotools/gpgtar: Add '--dry-run'.
Justus Winter [Thu, 26 Nov 2015 16:05:12 +0000 (17:05 +0100)]
tools/gpgtar: Add '--dry-run'.

* tools/gpgtar-extract.c (extract_{regular,directory}): Honor
'--dry-run'.
* tools/gpgtar.c (enum cmd_and_opt_values): New value.
(opts): Add '--dry-run'.
(parse_arguments): Handle '--dry-run'.
* tools/gpgtar.h (opt): Add field 'dry_run'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Handle '--gpg-args'.
Justus Winter [Thu, 26 Nov 2015 14:36:52 +0000 (15:36 +0100)]
tools/gpgtar: Handle '--gpg-args'.

* tools/gpgtar-create.c (gpgtar_create): Use given arguments.
* tools/gpgtar-extract.c (gpgtar_extract): Likewise.
* tools/gpgtar-list.c (gpgtar_list): Likewise.
* tools/gpgtar.c (enum cmd_and_opt_values): New value.
(opts): Add 'gpg-args'.
(parse_arguments): Handle arguments.
* tools/gpgtar.h (opt): Add field 'gpg_arguments'.
* tests/openpgp/gpgtar.test: Simplify accordingly.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Make the GPG arguments configurable in call-gpg.
Justus Winter [Thu, 26 Nov 2015 14:01:40 +0000 (15:01 +0100)]
common: Make the GPG arguments configurable in call-gpg.

* common/call-gpg.c (start_gpg): Add parameter 'gpg_arguments'.
(_gpg_encrypt, gpg_encrypt_blob, gpg_encrypt_stream): Likewise.
(_gpg_decrypt, gpg_decrypt_blob, gpg_decrypt_stream): Likewise.
* common/call-gpg.h: Adapt prototypes.
* g13/create.c (encrypt_keyblob): Adapt callsite.
* g13/g13-common.h (opt): Add field 'gpg_arguments'.
* g13/g13.c (main): Construct default arguments.
* g13/mount.c (decrypt_keyblob): Adapt callsite.
* tools/gpgtar-create.c (gpgtar_create): Likewise.
* tools/gpgtar-extract.c (gpgtar_extract): Likewise.
* tools/gpgtar-list.c (gpgtar_list): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Handle '--tar-args' for compatibility with gpg-zip.
Justus Winter [Thu, 26 Nov 2015 13:08:48 +0000 (14:08 +0100)]
tools/gpgtar: Handle '--tar-args' for compatibility with gpg-zip.

* tools/gpgtar.c (enum cmd_and_opt_values): New value.
(opts): Add new group for tar options, rearrange a little, add
'--tar-args'.
(tar_opts): New variable.
(shell_parse_stringlist): New function.
(shell_parse_argv): Likewise.
(parse_arguments): Add option argument, handle '--tar-args'.
(main): Fix invokation of 'parse_arguments'.
* tests/openpgp/gpgtar.test: Simplify decryption.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Rework argument parsing.
Justus Winter [Thu, 26 Nov 2015 10:46:35 +0000 (11:46 +0100)]
tools/gpgtar: Rework argument parsing.

* tools/gpgtar.c (main): Move argument parsing into its own function.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests: Add tests for gpgtar and gpg-zip.
Justus Winter [Wed, 25 Nov 2015 17:32:09 +0000 (18:32 +0100)]
tests: Add tests for gpgtar and gpg-zip.

* tests/openpgp/Makefile.am (TESTS): Add new file.
* tests/openpgp/gpgtar.test: New file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Handle '--directory' argument.
Justus Winter [Wed, 25 Nov 2015 17:29:22 +0000 (18:29 +0100)]
tools/gpgtar: Handle '--directory' argument.

* tools/gpgtar-extract.c (gpgtar_extract): Only generate a directory
name if none is given via arguments.
* tools/gpgtar.c (enum cmd_and_opt_values): New constant.
(opts): Add argument.
(main): Parse argument.
* tools/gpgtar.h (opt): New field 'directory'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Handle '--gpg' argument.
Justus Winter [Wed, 25 Nov 2015 13:57:14 +0000 (14:57 +0100)]
tools/gpgtar: Handle '--gpg' argument.

* tools/gpgtar-create.c (gpgtar_create): Use given gpg program.
* tools/gpgtar-extract.c (gpgtar_extract): Likewise.
* tools/gpgtar-list.c (gpgtar_list): Likewise.
* tools/gpgtar.c (enum cmd_and_opt_values): New constant.
(opts): Add argument.
(main): Handle argument.
* tools/gpgtar.h (opt): Add field 'gpg_program'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/gpgtar: Improve error handling.
Justus Winter [Wed, 25 Nov 2015 12:39:50 +0000 (13:39 +0100)]
tools/gpgtar: Improve error handling.

* tools/gpgtar-create.c (gpgtar_create): Return an error code, fix
error handling.
* tools/gpgtar-extract.c (gpgtar_extract): Likewise.
* tools/gpgtar-list.c (read_header): Return an error code.
(gpgtar_list): Return an error code, fix error handling.
(gpgtar_read_header): Return an error code.
* tools/gpgtar.c: Add missing include.
(main): Print an generic error message if a command failed and no
error has been printed yet.
* tools/gpgtar.h (gpgtar_{create,extract,list,read_header}): Fix the
prototypes accordingly.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools: Add encryption and decryption support to gpgtar.
Justus Winter [Tue, 24 Nov 2015 17:39:30 +0000 (18:39 +0100)]
tools: Add encryption and decryption support to gpgtar.

* tools/Makefile.am: Amend CFLAGS and LDADD.
* tools/gpgtar-create.c (gpgtar_create): Add encrypt flag and encrypt
stream if requested.
* tools/gpgtar-extract.c (gpgtar_extract): Likewise for decryption.
* tools/gpgtar-list.c (gpgtar_list): Likewise.
* tools/gpgtar.c (main): Initialize npth and assuan.  Parse recipient
and local user, and note which flags are currently ignored.  Adapt
calls to gpgtar_list and friends.
(tar_and_encrypt): Drop stub function and prototype.
(decrypt_and_untar): Likewise.
(decrypt_and_list): Likewise.
* tools/gpgtar.h (gpgtar_{create,extract,list}): Add encryption or
decryption argument.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Add stream interface to call-pgp.
Justus Winter [Tue, 24 Nov 2015 17:31:14 +0000 (18:31 +0100)]
common: Add stream interface to call-pgp.

* common/call-gpg.c (struct writer_thread_parms): Add field 'stream'.
(writer_thread_main): Support reading from a stream.
(start_writer): Add stream argument.
(struct reader_thread_parms): Add field 'stream'.
(reader_thread_main): Support writing to a stream.
(start_reader): Add stream argument.
(_gpg_encrypt): Add stream api.
(gpg_encrypt_blob): Adapt accordingly.
(gpg_encrypt_stream): New function.
(_gpg_decrypt): Add stream api.
(gpg_decrypt_blob): Adapt accordingly.
(gpg_decrypt_stream): New function.
* common/call-gpg.h (gpg_encrypt_stream): New prototype.
(gpg_decrypt_stream): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Refactor the call-gpg code.
Justus Winter [Tue, 24 Nov 2015 13:58:31 +0000 (14:58 +0100)]
common: Refactor the call-gpg code.

* common/call-gpg.c (gpg_{en,de}crypt_blob): Move most of the code
into two new functions, _gpg_encrypt and _gpg_decrypt.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agog13: Move 'call-gpg.c' to common.
Justus Winter [Tue, 24 Nov 2015 12:40:56 +0000 (13:40 +0100)]
g13: Move 'call-gpg.c' to common.

* common/Makefile.am (common_sources): Add files.
* g13/call-gpg.c: Move to 'common' and adapt slightly.  Add a
parameter to let callees override the gpg program to execute.
* g13/call-gpg.h: Likewise.
* g13/Makefile.am (g13_SOURCES): Drop files.
* g13/create.c (encrypt_keyblob): Hand in the gpg program to execute.
* g13/mount.c (decrypt_keyblob): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: When comparing keyids, use the keyid, not the fingerprint's suffix.
Neal H. Walfield [Tue, 24 Nov 2015 12:03:24 +0000 (13:03 +0100)]
gpg: When comparing keyids, use the keyid, not the fingerprint's suffix.

* g10/keyedit.c (menu_select_key): Use spacep and hexdigitp instead of
inline tests.  Don't compare P to the suffix of the fingerprint.  If P
appears to be a keyid, do an exact compare against the keyid.  If it
appears to be a fingerprint, do an exact compare against the
fingerprint.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Reflow long texts.
Neal H. Walfield [Mon, 23 Nov 2015 21:20:28 +0000 (22:20 +0100)]
gpg: Reflow long texts.

* common/stringhelp.c (format_text): New function.
* common/t-stringhelp.c (stresc): New function.
(test_format_text): New function.  Test format_text.
* g10/tofu.c (get_trust): Use format_text to reflow long texts.
(show_statistics): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Extend utf8_charcount to include the string's length.
Neal H. Walfield [Mon, 23 Nov 2015 21:13:56 +0000 (22:13 +0100)]
common: Extend utf8_charcount to include the string's length.

* common/stringhelp.c (utf8_charcount): Take additional parameter,
len.  Process at most LEN bytes.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agodirmngr: Fix http lookups when libadns is used.
Justus Winter [Mon, 23 Nov 2015 14:41:36 +0000 (15:41 +0100)]
dirmngr: Fix http lookups when libadns is used.

* dirmngr/dns-stuff.c (resolve_name_adns): Fill in the port.
--
Previously, sin_port was set to zero, making connect fail.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Fix SRV record lookups when using the system resolver.
Justus Winter [Mon, 23 Nov 2015 14:46:33 +0000 (15:46 +0100)]
dirmngr: Fix SRV record lookups when using the system resolver.

* dirmngr/dns-stuff.c (getsrv): Fix error handling.
--
This fixes hkp server pools not using SRV records.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Honor ports specified in SRV records.
Justus Winter [Thu, 19 Nov 2015 14:03:30 +0000 (15:03 +0100)]
dirmngr: Honor ports specified in SRV records.

* dirmngr/ks-engine-hkp.c (struct hostinfo_s): New field 'port'.
(create_new_hostinfo): Initialize 'port'.
(add_host): Add host parameter and update the hosttable entry.
(map_host): Return port if known, adjust calls to 'add_host'.
(make_host_part): Let 'map_host' specify the port if known.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Support hkp server pools using SRV records.
Justus Winter [Thu, 19 Nov 2015 13:29:36 +0000 (14:29 +0100)]
dirmngr: Support hkp server pools using SRV records.

* dirmngr/ks-engine-hkp.c (map_host): Handle SRV records.
--
Signed-off-by: Justus Winter <justus@g10code.com>
GnuPG-bug-id: 1788

3 years agodirmngr: Refactor 'map_host'.
Justus Winter [Thu, 19 Nov 2015 12:00:59 +0000 (13:00 +0100)]
dirmngr: Refactor 'map_host'.

* dirmngr/ks-engine-hkp.c (add_host): New function.
(map_host): Use the new function.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Fix pool detection.
Justus Winter [Mon, 23 Nov 2015 12:59:01 +0000 (13:59 +0100)]
dirmngr: Fix pool detection.

* dirmngr/ks-engine-hkp (arecords_is_pool): Fix counting IP addresses.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Refactor 'map_host'.
Justus Winter [Thu, 19 Nov 2015 11:43:23 +0000 (12:43 +0100)]
dirmngr: Refactor 'map_host'.

* dirmngr/ks-engine-hkp.c (arecords_is_pool): New function.
(map_host): Use the new function.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agodirmngr: Start dirmngr on demand.
Justus Winter [Mon, 23 Nov 2015 10:44:50 +0000 (11:44 +0100)]
dirmngr: Start dirmngr on demand.

* common/asshelp.h: Include 'util.h'.
* dirmngr/dirmngr-client.c (main): Use 'start_new_dirmngr' to connect
to the dirmngr.
(start_dirmngr): Drop now unused declaration and function.
--
Signed-off-by: Justus Winter <justus@g10code.com>
GnuPG-bug-id: 1843

3 years agogpg: If sqlite is not available, don't build things depending on it.
Neal H. Walfield [Mon, 23 Nov 2015 11:39:22 +0000 (12:39 +0100)]
gpg: If sqlite is not available, don't build things depending on it.

* configure.ac: Define the automake conditional SQLITE3.
* tests/openpgp/Makefile.am (TESTS): Move the sqlite3 dependent tests
to...
(sqlite3_dependent_tests): ... this new variable.  If SQLITE3 is not
defined, then clear this variable.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Allow updating the expiration time of multiple subkeys at once.
Neal H. Walfield [Mon, 23 Nov 2015 11:16:33 +0000 (12:16 +0100)]
gpg: Allow updating the expiration time of multiple subkeys at once.

* g10/keyedit.c (menu_expire): Allow updating the expiration time of
multiple subkeys at once.

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

3 years agogpg: Don't crash if key is not passed an argument.
Neal H. Walfield [Mon, 23 Nov 2015 10:21:24 +0000 (11:21 +0100)]
gpg: Don't crash if key is not passed an argument.

* g10/keyedit.c (menu_select_key): Don't crash if P is NULL.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>