gnupg.git
2 years agogpg: Reorder signatures, if appropriate. neal/issue2236
Neal H. Walfield [Tue, 16 Feb 2016 14:47:30 +0000 (15:47 +0100)]
gpg: Reorder signatures, if appropriate.

XXX

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

2 years agogpg: Make ASCII armor decoding more robust to encoding errors.
Neal H. Walfield [Sun, 14 Feb 2016 15:00:10 +0000 (16:00 +0100)]
gpg: Make ASCII armor decoding more robust to encoding errors.

* g10/armor.c (radix64_read): If the = is followed by the string "3D",
check if the following four characters are valid radix 64 and are
followed by a new line.  If so, warn and ignore the '3D'.

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

2 years agodoc: Add a gnupg-module-overview picture.
Werner Koch [Tue, 16 Feb 2016 11:58:53 +0000 (12:58 +0100)]
doc: Add a gnupg-module-overview picture.

* doc/gnupg-module-overview.svg: New.
* doc/debugging.texi (Component interaction): New.
* doc/Makefile.am (EXTRA_DIST): Add PNG and PDF versions of
gnupg-module-overview.svg.  Remove two eps files.
(BUILT_SOURCES): Add gnupg-module-overview.pdf and .png.  Remove
gnupg-card-architecture.epsl
(gnupg_TEXINFOS): Add gnupg-module-overview.svg
(gnupg.dvi): New.
(DISTCLEANFILES): Remove build eps files.
--

Many thanks to Emanuel Sch├╝tze for helping with the redesign of the
module overview.  The original file has been used by mere for years in
talks but was never a proper part of GnuPG.

The EPS files have been removed due to their size.  Thus to build the
"dvi" target the convert tool is required.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon, g10: Fix indentation to silence GCC-6.
NIIBE Yutaka [Mon, 15 Feb 2016 02:05:29 +0000 (11:05 +0900)]
common, g10: Fix indentation to silence GCC-6.

* common/iobuf.c (iobuf_ioctl): Fix.
* g10/encrypt.c (encrypt_filter): Likewise.
* g10/keyring.c (prepare_search): Likewise.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agodirmngr: fix for memory alignment.
NIIBE Yutaka [Mon, 15 Feb 2016 01:55:34 +0000 (10:55 +0900)]
dirmngr: fix for memory alignment.

* dirmngr/dns-stuff.c (get_dns_cert): Cast through void *.
(getsrv, get_dns_cname): Make sure it's aligned for HEADER.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agoPut asterisks in front of two function descriptions.
Werner Koch [Sun, 14 Feb 2016 15:11:06 +0000 (16:11 +0100)]
Put asterisks in front of two function descriptions.

--

This helps visual impaired hackers to easier read comments and also
helps use when looking at a printout.

2 years agogpg: Add hidden key-edit subcommand "change-usage".
Werner Koch [Sun, 14 Feb 2016 14:50:12 +0000 (15:50 +0100)]
gpg: Add hidden key-edit subcommand "change-usage".

* g10/keyedit.c (cmdCHANGEUSAGE): New.
(cmds): Add command "change-usage".
(keyedit_menu): Handle that command.
(menu_changeusage): New.
* g10/keygen.c (keygen_add_key_flags): New.
(ask_key_flags): Add optional arg current.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Improve API documentation.
Neal H. Walfield [Wed, 3 Feb 2016 13:23:51 +0000 (14:23 +0100)]
gpg: Improve API documentation.

* g10/seskey.c (make_session_key): Improve documentation.
(encode_session_key): Improve documentation.
* g10/encrypt.c (encrypt_seskey): Remove gratuitous initialization.
* g10/dek.h (DEK): Improve documenation.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
2 years agogpg: Fix calc_header_length when LEN is 0 and improve documentation.
Neal H. Walfield [Tue, 2 Feb 2016 19:05:45 +0000 (20:05 +0100)]
gpg: Fix calc_header_length when LEN is 0 and improve documentation.

* g10/build-packet.c (calc_header_length): Return the correct haeder
size when LEN is 0.  Fix documentation.

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

2 years agogpg: Fix format_keyid when dynamically allocating the buffer.
Neal H. Walfield [Sun, 7 Feb 2016 23:31:35 +0000 (00:31 +0100)]
gpg: Fix format_keyid when dynamically allocating the buffer.

* g10/keyid.c (format_keyid): Return a char *, not a const char *.  If
BUFFER is NULL, then set LEN to the static buffer's size.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
2 years agocommon: Fix comment.
Neal H. Walfield [Sun, 7 Feb 2016 23:30:10 +0000 (00:30 +0100)]
common: Fix comment.

* common/iobuf.c (iobuf_flush_temp): Fix comment.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
2 years agog13: Require a confirmation before g13 is used for DM-Crypt.
Werner Koch [Sat, 13 Feb 2016 16:30:14 +0000 (17:30 +0100)]
g13: Require a confirmation before g13 is used for DM-Crypt.

* g13/g13-syshelp.c (g13_syshelp_i_know_what_i_am_doing):
* g13/sh-dmcrypt.c (sh_dmcrypt_create_container): Call it.
(sh_dmcrypt_mount_container): Call it.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Second chunk of code to support dm-crypt.
Werner Koch [Sat, 13 Feb 2016 16:01:45 +0000 (17:01 +0100)]
g13: Second chunk of code to support dm-crypt.

* g13/be-dmcrypt.c, g13/be-dmcrypt.h: New.
* g13/Makefile.am (g13_SOURCES): Add them.
* g13/backend.c: Include be-dmcrypt.h and call-syshelp.h.
(no_such_backend): Rename to _no_such_backend and provide replacement
macro.
(be_is_supported_conttype): Support DM-Crypt.
(be_take_lock_for_create): Call set_segvice for DM-Crypt.
(be_create_new_keys): Make it a dummy for DM-Crypt.
(be_create_container): Call be_dmcrypt_create_container.
(be_mount_container): call be_dmcrypt_mount_container.
* g13/g13-syshelp.c (main): Enable verbose mode.
* g13/g13tuple.c (get_tupledesc_data): New.
* g13/g13tuple.h (unref_tupledesc): New.
* g13/g13.h (server_control_): Add field "recipients".
* g13/g13.c (main): Fix setting of recipients via cmdline.
(g13_deinit_default_ctrl): Release recipients list.
(g13_request_shutdown): New.  Replace all direct update of
shutdown_pending by calls this function.
* g13/server.c (server_local_s): Remove field recipients which is now
part of CTRL.
(reset_notify, cmd_recipient, cmd_create): Adjust for this change.
* g13/create.c (encrypt_keyblob): Rename to g13_encrypt_keyblob.
(g13_create_container): Support DM-Crypt.
* g13/mount.c (parse_header): Allow for meta data copies.
(g13_mount_container): Support DM-Crypt.
* g13/sh-cmd.c (cmd_create): Make it work.
(cmd_mount): New.
* g13/sh-dmcrypt.c (sh_dmcrypt_create_container): Make it work.
(sh_dmcrypt_mount_container): New.
--

With this patch we can now create an encrypted partition and partly
mount it (i.e. setup keys and create the mapped device). We do not yet
create a file system or mount that file system

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Improve dump_keyblob.
Werner Koch [Thu, 11 Feb 2016 12:57:35 +0000 (13:57 +0100)]
g13: Improve dump_keyblob.

* g13/g13tuple.c: Include keyblob.h.
(find_tuple_uint): Factor code out to ...
(convert_uint): new.
(all_printable): New.
* g13/mount.c (dump_keyblob: Move and rename to ...
* g13/g13tuple.c (dump_tupledesc): here.  Revamp and pretyy print uint
values.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Define 3 new tags.
Werner Koch [Thu, 11 Feb 2016 12:59:19 +0000 (13:59 +0100)]
g13: Define 3 new tags.

* g13/keyblob.h (KEYBLOB_TAG_CONT_NSEC): New.
(KEYBLOB_TAG_ENC_NSEC): New.
(KEYBLOB_TAG_ENC_OFF): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Rename utils.c to g13tuple.c
Werner Koch [Thu, 11 Feb 2016 12:32:30 +0000 (13:32 +0100)]
g13: Rename utils.c to g13tuple.c

* g13/utils.c: Rename to g13tuple.c.
* g13/utils.h: Rename to g13tuple.h.  Change all users.
* g13/Makefile.am: Adjust accordingly
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Add functions to handle uint in a keyblob.
Werner Koch [Wed, 10 Feb 2016 19:44:19 +0000 (20:44 +0100)]
g13: Add functions to handle uint in a keyblob.

* g13/utils.c (append_tuple_uint): New.
(find_tuple_uint): New.
* g13/t-utils.c: New.
* g13/Makefile.am (noinst_PROGRAMS, TESTS): New.
(module_tests, t_common_ldadd): New.
(t_utils_SOURCES, t_utils_LDADD): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Re-factor high level create code.
Werner Koch [Tue, 2 Feb 2016 08:03:37 +0000 (09:03 +0100)]
g13: Re-factor high level create code.

* g13/create.c (g13_create_container): Factor some code out to ...
* g13/backend.c (be_take_lock_for_create): new.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Return an error for non-existing device.
Werner Koch [Tue, 2 Feb 2016 17:18:31 +0000 (18:18 +0100)]
g13: Return an error for non-existing device.

* g13/sh-cmd.c (cmd_device): Set ERR.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Fix releasing of a syshelp context.
Werner Koch [Mon, 14 Dec 2015 09:42:27 +0000 (10:42 +0100)]
g13: Fix releasing of a syshelp context.

* g13/call-syshelp.c (call_syshelp_release): Allow a NULL arg.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: Switch over to common/exectool.c.
Werner Koch [Mon, 14 Dec 2015 09:16:46 +0000 (10:16 +0100)]
g13: Switch over to common/exectool.c.

* g13/sh-exectool.c: Remove.  It has been replaced by common/exectool.c.
* g13/Makefile.am (g13_syshelp_SOURCES): Remove sh-exectool.c
* g13/sh-blockdev.c: Include exectool.h.  Change sh_exec_tool to
gnupg_exec-tool.
* g13/sh-dmcrypt.c: Ditto.
--

With commit 2ae07f826aa551db8adf714158fce962790a6b54 the exectool code
was moved from a g13 feature branch to common/ so that it could be
used by gpgtar.  With this patch we finally remove the original code
and use the one in common/.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: Make gnupg_exec_tool conform to spec.
Werner Koch [Tue, 2 Feb 2016 17:18:31 +0000 (18:18 +0100)]
common: Make gnupg_exec_tool conform to spec.

* common/exectool.c (gnupg_exec_tool): Allocate extra byte.  Allow
zero length read.  Append hidden byte.  Release memory on error.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog13: First chunk of code to support dm-crypt.
Werner Koch [Wed, 21 Oct 2015 06:38:10 +0000 (08:38 +0200)]
g13: First chunk of code to support dm-crypt.

* g13/call-syshelp.c, g13/call-syshelp.h: New.
* g13/g13-syshelp.c, g13/g13-syshelp.h: New.
* g13/sh-cmd.c: New.
* g13/sh-blockdev.c: New.
* g13/sh-exectool.c: New.
* g13/sh-dmcrypt.c: New.
* g13/Makefile.am (sbin_PROGRAMS): Add g13-syshelp.c
(g13_syshelp_SOURCES): New.
(g13_syshelp_LDADD): New.

* g13/g13.c (opts): Add option --type.
(g13_deinit_default_ctrl): New.
(main): Implement that option.  Call g13_deinit_default_ctrl.
* g13/g13.h (struct call_syshelp_s): New declaration.
(server_control_s): Add field syshelp_local.
* g13/keyblob.h (KEYBLOB_TAG_CREATED): New.
(KEYBLOB_TAG_ALGOSTR): New.
(KEYBLOB_TAG_HDRCOPY): New.
* g13/backend.c (be_parse_conttype_name): New.
(be_get_detached_name): Add CONTTYPE_DM_CRYPT.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agotests: Remove some harmless warnings in regression tests.
Werner Koch [Mon, 1 Feb 2016 16:58:19 +0000 (17:58 +0100)]
tests: Remove some harmless warnings in regression tests.

* tests/openpgp/gpg-agent.conf.tmpl: Remove --use-standard-socket.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: Change simple_query to ignore status messages.
Neal H. Walfield [Fri, 12 Feb 2016 21:12:21 +0000 (22:12 +0100)]
common: Change simple_query to ignore status messages.

* common/simple-pwquery.c (simple_query): Ignore status messages.

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

2 years agog10: Make sure to have the directory for trustdb.
NIIBE Yutaka [Fri, 12 Feb 2016 01:10:33 +0000 (10:10 +0900)]
g10: Make sure to have the directory for trustdb.

* g10/tdbio.c (tdbio_set_dbname): Return earlier if !CREATE.  Check
the directory and create it if none before calling take_write_lock.

--

Thanks to Marc Deslauriers for the bug report and his patch.

GnuPG-bug-id: 2246

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agodoc: Note that rngd can also be used to quickly generate insecure keys.
Neal H. Walfield [Tue, 2 Feb 2016 10:50:08 +0000 (11:50 +0100)]
doc: Note that rngd can also be used to quickly generate insecure keys.

* doc/gpg-agent.texi (Agent Options): Add comment to the description
of --debug-quick-random that rngd can also be used to quickly generate
key.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
2 years agoscd: Fix size_t/int mismatch in libusb
Werner Koch [Wed, 27 Jan 2016 13:31:13 +0000 (14:31 +0100)]
scd: Fix size_t/int mismatch in libusb

* scd/ccid-driver.c (bulk_in, abort_cmd, ccid_poll): Change msglen to
int.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoscd: Fix detection of libusb.
Werner Koch [Wed, 27 Jan 2016 13:23:19 +0000 (14:23 +0100)]
scd: Fix detection of libusb.

* configure.ac (HAVE_LIBUSB): Clear if no header file was found.
(LIBUSB_LIBS): Ditto.
--

This allows to use commit d0d9708 when libusb is installed without the
header files.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Shorten the --tofu-policy help text
Werner Koch [Wed, 27 Jan 2016 12:58:20 +0000 (13:58 +0100)]
gpg: Shorten the --tofu-policy help text

--

Using "help" as value lists the options.  Not having the current
options in the help text also makes it easier to keep translations
clean.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodirmngr: Build fix for FreeBSD (EAI macros)
Werner Koch [Wed, 27 Jan 2016 12:55:31 +0000 (13:55 +0100)]
dirmngr: Build fix for FreeBSD (EAI macros)

* dirmngr/dns-stuff.c (map_eai_to_gpg_error): Map EAI_NODATA and
EAI_ADDRFAMILY only if defined.
--

Reported-by: Christoph Moench-Tegeder <cmt@burggraben.net>
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodoc: Typo fixes
Ineiev [Wed, 27 Jan 2016 09:42:16 +0000 (10:42 +0100)]
doc: Typo fixes

--

2 years agoscd: Migrate to new API of libusb 1.0.
NIIBE Yutaka [Wed, 27 Jan 2016 03:24:05 +0000 (12:24 +0900)]
scd: Migrate to new API of libusb 1.0.

* configure.ac (LIBUSB_CPPFLAGS): New.
* scd/Makefile.am (AM_CPPFLAGS): Add LIBUSB_CPPFLAGS.
* scd/ccid-driver.c: Use libusb 1.0 API.
--

Changes are straightforward, not use any new features.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agoPost release updates
Werner Koch [Tue, 26 Jan 2016 13:14:24 +0000 (14:14 +0100)]
Post release updates

--

2 years agoRelease 2.1.11 gnupg-2.1.11
Werner Koch [Tue, 26 Jan 2016 12:49:59 +0000 (13:49 +0100)]
Release 2.1.11

2 years agopo: Auto-update
Werner Koch [Tue, 26 Jan 2016 12:48:26 +0000 (13:48 +0100)]
po: Auto-update

--

2 years agopo: Update Czech translation
Petr Pisar [Tue, 26 Jan 2016 12:45:41 +0000 (13:45 +0100)]
po: Update Czech translation

--

2 years agoUpdate copyright years.
Werner Koch [Tue, 26 Jan 2016 12:20:59 +0000 (13:20 +0100)]
Update copyright years.

--

2 years agopo: Update German translation
Werner Koch [Tue, 26 Jan 2016 12:19:34 +0000 (13:19 +0100)]
po: Update German translation

--

2 years agogpgtar,w32: Fix gpgtar 8 bit encoding handling on W32
Andre Heinecke [Tue, 26 Jan 2016 08:53:42 +0000 (09:53 +0100)]
gpgtar,w32: Fix gpgtar 8 bit encoding handling on W32

* common/utf8conv.c (wchar_to_utf8): Factor code out to ...
(wchar_to_cp): new.
(utf8_to_wchar): Factor code out to ...
(cp_to_wchar): new.
(wchar_to_native): New.
(native_to_wchar): New.
* tools/gpgtar-create.c (fillup_entry_w32): Use native_to_wchar.
(scan_directory): Use wchar_to_native.
--

Gpgtar needs to handle filenames in the local 8 bit encoding on
Windows as it uses the 8 bit file io functions.

GnuPG-bug-id: 1624, 1746

Patch from bug 1624 modified to fit into GnuPG 2.1 by wk.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog10: Fix segfault on unsupported curve.
NIIBE Yutaka [Tue, 26 Jan 2016 02:12:33 +0000 (11:12 +0900)]
g10: Fix segfault on unsupported curve.

* g10/call-agent.c (learn_status_cb): Don't use NULL for strcmp.
--

With libgcrypt not supporting cv25519, gpg segfaults.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agosm: small fix for GCC 6.
NIIBE Yutaka [Tue, 26 Jan 2016 02:00:53 +0000 (11:00 +0900)]
sm: small fix for GCC 6.

* sm/export.c (insert_duptable): Use unsigned 0.

--

We can silence message with -Wshift-negative-value.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agogpg: Print PROGRESS status lines during key generation.
Werner Koch [Mon, 25 Jan 2016 10:34:49 +0000 (11:34 +0100)]
gpg: Print PROGRESS status lines during key generation.

* g10/call-agent.c (cache_nonce_status_cb): Rewrite by using
has_leading_keyword.  Handle PROGRESS lines.
--

GnuPG-bug-id: 1415
Co-authored-by: Daiki Ueno <ueno@gnu.org>
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoagent: Send PROGRESS status lines to the client.
Werner Koch [Mon, 25 Jan 2016 10:20:23 +0000 (11:20 +0100)]
agent: Send PROGRESS status lines to the client.

* agent/gpg-agent.c (struct progress_dispatch_s): New.
(progress_dispatch_list): New.
(main): Register libgcrypt pogress handler.
(agent_libgcrypt_progress_cb): New.
(agent_set_progress_cb): New.
(unregister_progress_cb): New.
(agent_deinit_default_ctrl): Call unregister.
* agent/command.c (progress_cb): New.
(start_command_handler): Register progress callback.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agospeedo: Allow use of SHA-256 checksums
Werner Koch [Mon, 25 Jan 2016 08:03:50 +0000 (09:03 +0100)]
speedo: Allow use of SHA-256 checksums

* build-aux/getswdb.sh: Add option --find-sha256sum.
* build-aux/speedo.mk (libgpg_error_sha2): New var.  Also for all
other packages.
(SHA2SUM): New.
(SETVARS, SETVARS_W64): Prefer sha256sum over sha1sum.
(installer-from-source): Create swdb fragment.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodirmngr: Indicate that serial numbers are hexadecimal.
Werner Koch [Fri, 22 Jan 2016 11:54:02 +0000 (12:54 +0100)]
dirmngr: Indicate that serial numbers are hexadecimal.

* dirmngr/misc.c (hexify_data): Add arg with_prefix.  Adjust all
callers.
* dirmngr/crlcache.c (cache_isvalid): Print "0x" in front of the S/N.
--

GnuPG-bug-id: 1147
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodirmngr: Provide the keyserver pool name even if there is no CNAME.
Werner Koch [Fri, 22 Jan 2016 11:34:50 +0000 (12:34 +0100)]
dirmngr: Provide the keyserver pool name even if there is no CNAME.

* dirmngr/ks-engine-hkp.c (map_host): Fix setting of r_poolname.
--

map_host is intended to return the name of the pool as an additional
information.  However this broke some time ago and a pool name was
only retrained if the pool name was retrieved from a DNS CNAME.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodirmngr: Use sks-keyservers CA by default for the hkps pool.
Daniel Kahn Gillmor [Tue, 20 Oct 2015 03:48:30 +0000 (23:48 -0400)]
dirmngr: Use sks-keyservers CA by default for the hkps pool.

* dirmngr/Makefile.am (dist_pkgdata_DATA): Add sks-keyservers.netCA.pem.
* dirmngr/http.c (http_session_new): Add optional arg
intended_hostname and set a default cert.
* dirmngr/ks-engine-hkp.c (send_request): Pass httphost to
http_session_new.
--

Ship the certificate for the sks-keyservers hkps pool.  If the user
has specified that they want to use
hkps://hkps.pool.sks-keyservers.net, and they have not specified any
hkp-cacert explicitly, then initialize the trust path with this
specific trust anchor.

Co-authored-by: wk@gnupg.org
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Rework gpg-conf.skel
Werner Koch [Fri, 22 Jan 2016 09:54:10 +0000 (10:54 +0100)]
gpg: Rework gpg-conf.skel

--

Some of the options are too rarley used to deserve an entry in the
skeleton config file.  Some are even the default for many years.
Added auto-key-locate because that is a very useful option.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Allow new user ids with only the mail address.
Werner Koch [Fri, 22 Jan 2016 09:35:19 +0000 (10:35 +0100)]
gpg: Allow new user ids with only the mail address.

* g10/keygen.c (ask_user_id): Allow empty name.
--

The --quick-gen-key command allows this and further some mail
providers require that a key has only the mail address to allow for
anonymous accounts.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Improve header text of the auto-created revocations.
Werner Koch [Thu, 21 Jan 2016 17:30:51 +0000 (18:30 +0100)]
gpg: Improve header text of the auto-created revocations.

* g10/revoke.c (gen_standard_revoke): Improve header text for the
file.  Add info output.
--

GnuPG-bug-id: 1724
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Make --auto-key-retrieve work with dirmngr configured server.
Werner Koch [Thu, 21 Jan 2016 10:49:27 +0000 (11:49 +0100)]
gpg: Make --auto-key-retrieve work with dirmngr configured server.

* g10/call-dirmngr.c (gpg_dirmngr_ks_list): Make R_KEYSERVER optional.
* g10/keyserver.c (keyserver_any_configured): New.
(keyserver_put): Remove arg keyserver because this will always receive
opt.keyserver which is anyway used when connecting dirmngr.  Do not
check opt.keyserver.
(keyserver_import_cert): Replace opt.keyserver by
keyserver_any_configured.
* g10/mainproc.c (check_sig_and_print): Ditto.
* g10/import.c (revocation_present): Ditto.
* g10/getkey.c (get_pubkey_byname): Ditto.
* g10/gpgv.c (keyserver_any_configured): Add stub.
* g10/test-stubs.c (keyserver_any_configured): Add stub.
--

The keyserver should be configured in dirmngr.conf and thus we can't
use opt.keyserver in gpg to decide whether a keyserver has been
configured.

GnuPG-bug-id: 2147
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Silence message about ignoring revoked user ids.
Werner Koch [Wed, 20 Jan 2016 14:51:18 +0000 (15:51 +0100)]
gpg: Silence message about ignoring revoked user ids.

* g10/trustdb.c (tdb_get_validity_core): Print message only in debug
mode.
--

This makes only sense for debugging.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoagent: New option --pinentry-timeout
Werner Koch [Wed, 20 Jan 2016 10:22:44 +0000 (11:22 +0100)]
agent: New option --pinentry-timeout

* agent/gpg-agent.c (oPinentryTimeout): New.
(opts): Add new option.
(parse_rereadable_options): PArse that option.
(main): Tell gpgconf about this option.
* agent/call-pinentry.c (start_pinentry): Send option to Pinentry.
* tools/gpgconf-comp.c (gc_options_gpg_agent): Add Option.
--

GnuPG-bug-id: 2222
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodoc: Typo fix.
Werner Koch [Wed, 20 Jan 2016 09:48:50 +0000 (10:48 +0100)]
doc: Typo fix.

--

2 years agopo: Update German translation
Werner Koch [Tue, 19 Jan 2016 15:30:39 +0000 (16:30 +0100)]
po: Update German translation

--

These are mainly new strings for the TOFU module,

2 years agogpg: Streamline use of error messages in tofu.c
Werner Koch [Tue, 19 Jan 2016 15:29:27 +0000 (16:29 +0100)]
gpg: Streamline use of error messages in tofu.c

* g10/tofu.c: Make use of print_further_info to reduce the number of
different error messages to be translated.  Also streamline some
messages.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: Add substitute code for libgpg-error < 1.22.
Werner Koch [Tue, 19 Jan 2016 15:26:28 +0000 (16:26 +0100)]
common: Add substitute code for libgpg-error < 1.22.

* common/util.h (GPG_ERR_DB_CORRUPTED): New.

2 years agogpg: Add function print_further_info.
Werner Koch [Tue, 19 Jan 2016 15:25:31 +0000 (16:25 +0100)]
gpg: Add function print_further_info.

* g10/misc.c (print_further_info): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agog10: Improve strings printed by tofu.c.
Werner Koch [Mon, 18 Jan 2016 17:54:46 +0000 (18:54 +0100)]
g10: Improve strings printed by tofu.c.

* g10/tofu.c: Include ttyio.h.  Change many strings to help
translating.  Make use of ngettext wehere needed.
(CONTROL_L): New.
(TIME_AGO_UNIT_SMALL_NAME): Remove this and all similar *_NAME macros.
(time_ago_unit): Remove.
(get_trust): Use tty_prints and cpr_get only for the actual prompt.
Add Ctrl-L hack.
(show_statistics): Use two English strings for singular and plural.

* po/POTFILES.in: Add tofu.c.
--

These changes are required for proper translation.  More to changes
may be needed, though.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Minor string changes.
Werner Koch [Mon, 18 Jan 2016 11:15:09 +0000 (12:15 +0100)]
gpg: Minor string changes.

--

2 years agogpg: Use "days" in "...newer than..." diagnostics.
Werner Koch [Mon, 18 Jan 2016 10:35:26 +0000 (11:35 +0100)]
gpg: Use "days" in "...newer than..." diagnostics.

* g10/sig-check.c (check_signature_metadata_validity): Use days if
useful.
--

Using days instead of a high number of seconds is for the majority of
users a better measurement.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoUse ngettext for some strings.
Werner Koch [Mon, 18 Jan 2016 10:20:15 +0000 (11:20 +0100)]
Use ngettext for some strings.

* scd/app-openpgp.c (build_enter_admin_pin_prompt): Use ngettext for
some diagnostics.
(do_genkey): Ditto.
* g10/keyedit.c (check_all_keysigs, menu_delsig, menu_clean): Ditto.
* g10/keylist.c (print_signature_stats): Ditto.
* g10/keyserver.c (keyserver_refresh): Ditto.
* g10/sig-check.c (check_signature_metadata_validity): Ditto.
* g10/sign.c (do_sign): Ditto.
* g10/trustdb.c (reset_trust_records): Ditto.
(validate_keys): Use a table like diagnostic output.
--

Suggested-by: Ineiev <ineiev@gnu.org>
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodoc: Fix description of --s2k-* options to match gpg 2.1.
Werner Koch [Mon, 18 Jan 2016 07:33:55 +0000 (08:33 +0100)]
doc: Fix description of --s2k-* options to match gpg 2.1.

--

GnuPG-bug-id: 2220

2 years agokbx,w32: Use shorter retry intervals for keybox_file_rename.
Werner Koch [Fri, 15 Jan 2016 07:15:40 +0000 (08:15 +0100)]
kbx,w32: Use shorter retry intervals for keybox_file_rename.

* kbx/keybox-util.c (keybox_file_rename): Restart retry intervals
after 800ms.
--

The common use case is that the process waiting for a rename does an
import while another process does a key listing with only short lock
periods.  Thus it does not make sense to set the final backoff time to
8s.  It would actually be okay to retry every 100ms but that would
spill the console with "waiting..." messages.  This change prints the
waiting message only every 1.5s.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agow32: Fix deadlock introduced by keybox_file_rename.
Werner Koch [Thu, 14 Jan 2016 19:45:33 +0000 (20:45 +0100)]
w32: Fix deadlock introduced by keybox_file_rename.

* g10/keyring.c (keyring_lock) [W32]: Flush the close cache before
locking.
* kbx/keybox-init.c (keybox_lock) [W32]: Close the file before
locking.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Detect race between pubring.gpg and pubring.kbx use.
Werner Koch [Thu, 14 Jan 2016 17:29:26 +0000 (18:29 +0100)]
gpg: Detect race between pubring.gpg and pubring.kbx use.

* g10/keydb.c (maybe_create_keyring_or_box): Detect race condition.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agokbx: New function keybox_file_rename to replace rename.
Werner Koch [Thu, 14 Jan 2016 15:50:15 +0000 (16:50 +0100)]
kbx: New function keybox_file_rename to replace rename.

* kbx/keybox-util.c: Include windows.h.
(keybox_file_rename): New.
* kbx/keybox-update.c (rename_tmp_file): Replace remove+rename by
keybox_file_rename.
* g10/keyring.c (rename_tmp_file): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agokbx: Add function keybox_tmp_names to avoid code duplication.
Werner Koch [Thu, 14 Jan 2016 15:29:45 +0000 (16:29 +0100)]
kbx: Add function keybox_tmp_names to avoid code duplication.

* kbx/keybox-update.c (create_tmp_file): Move some code to...
* kbx/keybox-util.c (keybox_tmp_names): new.
* g10/keyring.c: Include keybox.h.
(create_tmp_file): Replace parts by keybox_tmp_names.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Make --list-options show-usage the default.
Werner Koch [Thu, 14 Jan 2016 11:22:33 +0000 (12:22 +0100)]
gpg: Make --list-options show-usage the default.

* g10/gpg.c (main): Add LIST_SHOW_USAGE.
--

The usage flags are often useful and they don't take away much space
in a key listing.  Thus it is better to have them enabled by default.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agodoc: Update whats-new-in-2.1 from gnupg-doc.
Werner Koch [Thu, 14 Jan 2016 10:01:14 +0000 (11:01 +0100)]
doc: Update whats-new-in-2.1 from gnupg-doc.

--

2 years agokbx: Change return type of search functions to gpg_error_t.
Werner Koch [Wed, 13 Jan 2016 14:08:42 +0000 (15:08 +0100)]
kbx: Change return type of search functions to gpg_error_t.

* kbx/keybox-search.c (keybox_search_reset): Change return type to
gpg_error_t.
(keybox_search): Ditto.  Also handle GPG_ERR_EOF.
* sm/keydb.c (keydb_search_reset): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Improve error code from lock_all.
Werner Koch [Wed, 13 Jan 2016 13:48:02 +0000 (14:48 +0100)]
gpg: Improve error code from lock_all.

* g10/keydb.c (lock_all): Do not clobber RC during failur cleanup.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agokbx: Improve and fix keybox_lock.
Werner Koch [Wed, 13 Jan 2016 13:47:06 +0000 (14:47 +0100)]
kbx: Improve and fix keybox_lock.

* kbx/keybox-init.c (keybox_lock): Make sure ERR is initialized.  Get
error codes from dotlock functions.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: Make sure dotlock functions set a proper ERRNO.
Werner Koch [Wed, 13 Jan 2016 13:42:12 +0000 (14:42 +0100)]
common: Make sure dotlock functions set a proper ERRNO.

* common/dotlock.c (map_w32_to_errno): New.
(read_lockfile): Return a proper ERRNO.
(dotlock_create_unix): Do not let log functions clobber ERRNO.
(dotlock_take_unix): Ditto.
(dotlock_release_unix): Ditto.
(dotlock_create_w32): Set proper ERRNO.
(dotlock_take_w32): Ditto.
(dotlock_release_w32): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agokbx: Implement keybox_lock for use by gpg.
Werner Koch [Wed, 13 Jan 2016 09:16:27 +0000 (10:16 +0100)]
kbx: Implement keybox_lock for use by gpg.

* kbx/keybox-defs.h: Include dotlock.h and logging.h.
(CONST_KB_NAME): Remove.  Replace usage by KB_NAME.
(struct keybox_name): Add field "lockhd".
* kbx/keybox-init.c (keybox_register_file): Init LOCKHD.
(keybox_lock): Chnage to return gpg_error_t.  Implement locking.
--

The keybox locking for gpg was not implemented - This needs to be
fixed of course.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Make sure to mark a duplicate registered keybox as primary.
Werner Koch [Wed, 13 Jan 2016 08:29:39 +0000 (09:29 +0100)]
gpg: Make sure to mark a duplicate registered keybox as primary.

* kbx/keybox-init.c (keybox_register_file): Change interface to return
the token even if the file has already been registered.
* g10/keydb.c (primary_keyring): Rename to primary_keydb.
(maybe_create_keyring_or_box): Change return type to gpg_error_t.
(keydb_add_resource): Ditto. s/rc/err/.
(keydb_add_resource): Mark an already registered as primary.
* sm/keydb.c (maybe_create_keybox): Change return type to gpg_error_t.
(keydb_add_resource): Ditto. s/rc/err/.
(keydb_add_resource): Adjust for changed keybox_register_file.
--

This change aligns the registering of keyboxes with those of
keyrings.  This fixes a potential bug:

  gpg --keyring foo.kbx --keyring bar.gpg --keyring foo.kbx

would have marked bar.gpg as primary resource and thus inserting new
keys there.  The correct and now fixed behavior is to insert to
foo.kbx.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoFix to support git worktree.
NIIBE Yutaka [Wed, 13 Jan 2016 08:22:37 +0000 (17:22 +0900)]
Fix to support git worktree.

* autogen.sh, Makefile.am, doc/Makefile.am: Use -e for testing .git.

--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agossh: Accept OpenSSH *cert-v01 key variants.
Werner Koch [Tue, 12 Jan 2016 18:12:02 +0000 (19:12 +0100)]
ssh: Accept OpenSSH *cert-v01 key variants.

* agent/command-ssh.c (SPEC_FLAG_WITH_CERT): New.
(ssh_key_types): Add OpenSSH cert types.
(stream_read_string): Allow a dummy read.
(ssh_receive_mpint_list): Pass SPEC by reference.
(ssh_receive_mpint_list): New arg CERT and use it.
(ssh_receive_key): Read certificate into an estream object and modify
parser to make use of that object.
--

This is a first step to support certificate via the agent.  The only
effect of this change is the removal of an error message parsing the
certificate.  Note that ssh-add sends the private key anyway first and
only then follows with the certificate+private key.

What we need to implement next is a way to store the certificate in
the agent and return it on request.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Re-indent check_key_signature2.
Werner Koch [Tue, 12 Jan 2016 09:41:07 +0000 (10:41 +0100)]
gpg: Re-indent check_key_signature2.

--

I am considering some changes and thus better start off by switching
to standard GNU indentation.  This patch also changes comment lines
like

      if (foo)
        /* Comment on foo.  */
        {

to

      if (foo)
        { /* Comment on foo.  */

or

      if (foo) /* Comment on foo.  */
        {

to make the brace of the opening block stand out immediately.

Further stars on the left are added to longer comments because that
makes the code easier to read by disabled hackers, when reading
without font locking, and for reading black-white printouts.

2 years agocommon: Fix iobuf API of filter function for alignment.
NIIBE Yutaka [Tue, 12 Jan 2016 02:45:31 +0000 (11:45 +0900)]
common: Fix iobuf API of filter function for alignment.

* common/iobuf.h: Fix comment.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agocommon: Fix iobuf API of filter function for alignment.
NIIBE Yutaka [Tue, 12 Jan 2016 01:32:20 +0000 (10:32 +0900)]
common: Fix iobuf API of filter function for alignment.

* common/iobuf.h (IOBUFCTRL_DESC): Change the call semantics.
* common/iobuf.c (iobuf_desc): Add the second argument DESC.
(print_chain, iobuf_close, do_open, iobuf_sockopen, iobuf_ioctl)
(iobuf_push_filter2, pop_filter, iobuf_write_temp): Change calls
of iobuf_desc.
(file_filter, file_es_filter, sock_filter, block_filter): Fill the
description.
* common/t-iobuf.c (every_other_filter, double_filter): Likewise.
* g10/armor.c, g10/cipher.c, g10/compress-bz2.c, g10/compress.c,
g10/decrypt-data.c, g10/encrypt.c, g10/mdfilter.c, g10/progress.c,
g10/textfilter.c: Likewise.

--

Newer GCC warns against possible alignment difference of pointers.
This change can silence those warnings.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agogpg: Move documentation from keydb.h to keydb.c and getkey.c.
Werner Koch [Mon, 11 Jan 2016 10:41:49 +0000 (11:41 +0100)]
gpg: Move documentation from keydb.h to keydb.c and getkey.c.

--

When using tags (e.g. GNU global) to navigate the source code it is
way easier to have the documentation close to the function we are
looking at.  Having the documentation in the header file would require
an extra manual lookup to understand the function.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Fix NULL de-ref for ambiguous key check in --export-ssh-keys.
Werner Koch [Mon, 11 Jan 2016 09:59:13 +0000 (10:59 +0100)]
gpg: Fix NULL de-ref for ambiguous key check in --export-ssh-keys.

* g10/getkey.c: Allow arg RET_KEYBLOCK to be NULL.
--

This change adds the expected behavior for the getkey_next function
to fix this NULL de-ref.

GnuPG-bug-id: 2212
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agotools: Remove gpgkey2ssh.
Werner Koch [Sat, 9 Jan 2016 10:28:42 +0000 (11:28 +0100)]
tools: Remove gpgkey2ssh.

* tools/gpgkey2ssh.c: Remove.
* tools/Makefile.am (bin_PROGRAMS): Ditto.
--

Also remove it form the docs.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Support ECDSA keys with --export-ssh-key.
Werner Koch [Fri, 8 Jan 2016 19:37:25 +0000 (20:37 +0100)]
gpg: Support ECDSA keys with --export-ssh-key.

* g10/export.c (key_to_sshblob): Add hack for ECDSA.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: New command --export-ssh-key
Werner Koch [Fri, 8 Jan 2016 16:22:32 +0000 (17:22 +0100)]
gpg: New command --export-ssh-key

* g10/export.c: Include membuf.h and host2net.h.
(key_to_sshblob): New.
(export_ssh_key): New.
* g10/gpg.c (aExportSshKey): New.
(opts): Add command.
(main): Implement that command.
--

GnuPG-bug-id: 2212

I have done only a few tests rights now and the ECDSA curves do not
yet work.  However ssh-keygen -l accept RSA and ed25519 keys exported
using this command.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Add an exact search flag to the PK struct.
Werner Koch [Fri, 8 Jan 2016 14:16:12 +0000 (15:16 +0100)]
gpg: Add an exact search flag to the PK struct.

* g10/getkey.c (merge_selfsigs_subkey): Clear exact flag.
(finish_lookup): Set exact flag.
* g10/packet.h (PKT_public_key): Add field flags.exact.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoPrint warnings if old daemon versions are used.
Werner Koch [Fri, 8 Jan 2016 09:33:19 +0000 (10:33 +0100)]
Print warnings if old daemon versions are used.

* common/status.h (STATUS_WARNING): New.
* g10/call-agent.c (warn_version_mismatch): New.
(start_agent): Call warn function.
* g10/call-dirmngr.c: Include status.h.
(warn_version_mismatch): New.
(create_context): Call warn function.
* sm/call-agent.c (warn_version_mismatch): New.
(start_agent): Call warn function.
(gpgsm_agent_learn): Call warn function.
* sm/call-dirmngr.c (warn_version_mismatch): New.
(prepare_dirmngr): Call warn function.
--

We have seen too often bug reports which are due to still running old
versions of the daemons.  To catch this problematic use we now print
warning messages and also provide the warning via the status
interface.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: New function compare_version_strings.
Werner Koch [Fri, 8 Jan 2016 07:58:21 +0000 (08:58 +0100)]
common: New function compare_version_strings.

* common/stringhelp.c (parse_version_number): New.
(parse_version_string): New.
(compare_version_strings): New.
* common/t-stringhelp.c (test_compare_version_strings): New.
(main): Call test.  Return ERRCOUNT instead of 0.
--

The code for that function is based on code from libgcrypt.  Similar
code is in all GnuPG related libraries this function is
a candidates for inclusion in libgpg-error.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: New function get_assuan_server_version.
Werner Koch [Fri, 8 Jan 2016 05:42:29 +0000 (06:42 +0100)]
common: New function get_assuan_server_version.

* common/asshelp.c: Include membuf.h.
(get_assuan_server_version): New.
* g10/call-agent.c (agent_get_version): Use new function.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: New put_membuf_cb to replace static membuf_data_cb.
Werner Koch [Fri, 8 Jan 2016 05:33:27 +0000 (06:33 +0100)]
common: New put_membuf_cb to replace static membuf_data_cb.

* common/membuf.c (put_membuf_cb): New.
* agent/call-scd.c (membuf_data_cb): Remove.  Change callers to use
put_membuf_cb.
* common/get-passphrase.c (membuf_data_cb): Ditto.
* g10/call-agent.c (membuf_data_cb): Ditto.
* sm/call-agent.c (membuf_data_cb): Ditto.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Return an error code from keygrip_from_pk.
Werner Koch [Thu, 7 Jan 2016 18:07:59 +0000 (19:07 +0100)]
gpg: Return an error code from keygrip_from_pk.

* g10/keyid.c (keygrip_from_pk): Return an error code.
--

The error was show but the function did not return it.  This change
should improve error messages for unknown algorithms.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Avoid warnings about possible NULL deref.
Werner Koch [Thu, 7 Jan 2016 18:05:35 +0000 (19:05 +0100)]
gpg: Avoid warnings about possible NULL deref.

* g10/getkey.c (cache_public_key): Protect deref of CE which actually
can't happen.
* g10/keygen.c (quickgen_set_para): s/sprintf/snprintf/.
* g10/tofu.c (end_transaction, rollback_transaction): Allow NULL for
DB.
* g10/trustdb.c (update_min_ownertrust): Remove useless clearling of
ERR.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Fix warnings about useless assignments.
Werner Koch [Thu, 7 Jan 2016 18:01:18 +0000 (19:01 +0100)]
gpg: Fix warnings about useless assignments.

* g10/armor.c (parse_hash_header): Remove duplicate var assignment.
* g10/getkey.c (cache_user_id): Ditto.
* g10/keygen.c (ask_curve): Ditto.  This also fixes a small memory
leak.

* g10/keygen.c (proc_parameter_file): Remove useless assignment or
pointer increment.
(generate_keypair): Ditto.
* g10/getkey.c (finish_lookup, lookup): Ditto.
* g10/card-util.c (change_pin): Ditto.
* g10/gpg.c (main) <aVerify>: Ditto.
* g10/import.c (import): Ditto.
(print_import_check): Ditto
* g10/keyring.c (do_copy): Ditto.
* g10/tdbio.c (tdbio_read_record): Ditto.
* g10/trustdb.c (tdb_update_ownertrust): Ditto.
(update_validity): Ditto.

* g10/server.c (cmd_passwd): Remove useless call to skip_options.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agosm: Avoid warnings about useless assignments.
Werner Koch [Wed, 6 Jan 2016 16:51:58 +0000 (17:51 +0100)]
sm: Avoid warnings about useless assignments.

* sm/call-dirmngr.c (prepare_dirmngr): Remove setting of ERR.
(unhexify_fpr): Remove useless computation on N.
* sm/certchain.c (do_validate_chain): Remove clearing of RC.  Remove
useless setting of RC.
* sm/fingerprint.c (gpgsm_get_keygrip): Remove setting of RC.
* sm/gpgsm.c (build_list): Replace final stpcpy by strcpy.
* sm/keydb.c (keydb_clear_some_cert_flags): Remove clearing of RC.
* sm/server.c (cmd_getauditlog): Comment unused skip_options.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agokbx: Avoid warnings about useless assignments.
Werner Koch [Wed, 6 Jan 2016 16:46:44 +0000 (17:46 +0100)]
kbx: Avoid warnings about useless assignments.

* kbx/keybox-dump.c (_keybox_dump_blob): Remove setting of IN_RANGE
and the last increment of P.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Fix DNS cert lookup returning an URL.
Werner Koch [Wed, 6 Jan 2016 15:39:04 +0000 (16:39 +0100)]
gpg: Fix DNS cert lookup returning an URL.

* g10/call-dirmngr.c (dns_cert_status_cb): Store URL status in the URL
param.  The old code was entirely buggy (c+p error).
--

Fixes-commit: 154f3ed2
Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoFix keystrlen to work when OPT.KEYID_FORMAT is KF_DEFAULT.
Daniel Kahn Gillmor [Wed, 9 Dec 2015 18:01:04 +0000 (13:01 -0500)]
Fix keystrlen to work when OPT.KEYID_FORMAT is KF_DEFAULT.

* g10/keyid.c (keystrlen): If opt.keyid_format is KF_DEFAULT unset,
default to KF_SHORT.
(format_keyid): Default to KF_SHORT, not KF_0xLONG.

--
Without this fix, gpgv2 fails with:

gpgv: Ohhhh jeeee: ... this is a bug (keyid.c:342:keystrlen)

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Signed-off-by: Neal H. Walfield <neal@g10code.com>
2 years agogpg: Silence some regression tests.
Werner Koch [Wed, 6 Jan 2016 07:49:45 +0000 (08:49 +0100)]
gpg: Silence some regression tests.

* g10/test.c (TEST): Print diagnostics only in verbose mode.

Signed-off-by: Werner Koch <wk@gnupg.org>