gnupg.git
3 years agogpg: Prettify a 2 octet hex output.
Werner Koch [Fri, 26 Feb 2016 10:41:18 +0000 (11:41 +0100)]
gpg: Prettify a 2 octet hex output.

* g10/sig-check.c (check_key_signature2): Wrap line and use %02x.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Show debugging info if a sig with an unsupported sig class is used.
Neal H. Walfield [Thu, 25 Feb 2016 20:22:55 +0000 (21:22 +0100)]
gpg: Show debugging info if a sig with an unsupported sig class is used.

* g10/sig-check.c (check_key_signature2): If SIG->CLASS is
unsupported, show some debugging information.  Don't use BUG to fail.
Just return GPG_ERR_BAD_SIGNATURE.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: More carefully encode a packet's length.
Neal H. Walfield [Thu, 25 Feb 2016 20:20:32 +0000 (21:20 +0100)]
gpg: More carefully encode a packet's length.

* g10/build-packet.c (write_header2): Make sure the length bits are
cleared.  Fail if HDRLEN is set and the specified length can't be
encoded in the available space.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Avoid directly twiddling bits.
Neal H. Walfield [Thu, 25 Feb 2016 20:16:41 +0000 (21:16 +0100)]
gpg: Avoid directly twiddling bits.

* g10/build-packet.c (do_plaintext): Use ctb_new_format_p to check the
packet's format.
(write_header2): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Improve documentation and comments related to OpenPGP packets.
Neal H. Walfield [Thu, 25 Feb 2016 20:08:56 +0000 (21:08 +0100)]
gpg: Improve documentation and comments related to OpenPGP packets.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Add some asserts.
Neal H. Walfield [Thu, 25 Feb 2016 14:19:04 +0000 (15:19 +0100)]
gpg: Add some asserts.

* g10/build-packet.c (ctb_new_format_p): New function.
(ctb_pkttype): New function.
(do_user_id): Add some asserts.
(do_key): Likewise.
(do_symkey_enc): Likewise.
(do_pubkey_enc): Likewise.
(do_plaintext): Likewise.
(do_encrypted): Likewise.
(do_encrypted_mdc): Likewise.
(do_compressed): Likewise.
(do_signature): Likewise.
(do_signature): Likewise.
(write_header2): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Avoid an unnecessary copy.
Neal H. Walfield [Thu, 25 Feb 2016 13:51:55 +0000 (14:51 +0100)]
gpg: Avoid an unnecessary copy.

* g10/build-packet.c (sig_to_notation): Avoid an unnecessary copy of
the data: the size of the packet is fixed.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Reduce buffer size.
Neal H. Walfield [Tue, 23 Feb 2016 21:39:58 +0000 (22:39 +0100)]
common: Reduce buffer size.

* common/iobuf.c (iobuf_copy): Change buffer size from 1 MB to 32 KB.

--
Change suggested by Werner based on the observation that other buffers
are of a similar size.

Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Improve a function's documentation and comments.
Neal H. Walfield [Tue, 23 Feb 2016 20:28:24 +0000 (21:28 +0100)]
common: Improve a function's documentation and comments.

* common/iobuf.c (iobuf_set_partial_body_length_mode): Fix
documentation and comment.  Add an assert.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Add log_assert.
Neal H. Walfield [Tue, 23 Feb 2016 20:14:21 +0000 (21:14 +0100)]
common: Add log_assert.

* common/logging.h (log_assert): New macro.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Use higher-level functions.
Neal H. Walfield [Tue, 23 Feb 2016 20:07:09 +0000 (21:07 +0100)]
gpg: Use higher-level functions.

* g10/build-packet.c (do_symkey_enc): Use iobuf_write instead of
iobuf_put in a loop.  Use iobuf_copy instead of iobuf_read and
iobuf_write in a loop.  Move the memory wiping from here...
* common/iobuf.c (iobuf_copy): ... to here.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: Check for an error before reading.
Neal H. Walfield [Tue, 23 Feb 2016 20:04:29 +0000 (21:04 +0100)]
common: Check for an error before reading.

* common/iobuf.c (iobuf_copy): If DEST has a pending error, don't
start copying.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agocommon: More accurately name function.
Neal H. Walfield [Tue, 23 Feb 2016 19:36:07 +0000 (20:36 +0100)]
common: More accurately name function.

* common/iobuf.c (iobuf_set_partial_block_mode): Rename from this...
(iobuf_set_partial_body_length_mode): ... to this.  Update callers.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agog13: Add commands --suspend and --remove.
Werner Koch [Tue, 23 Feb 2016 13:32:46 +0000 (14:32 +0100)]
g13: Add commands --suspend and --remove.

* g13/g13.c (aSuspend, aResume): New.
(opts): Add commands --suspend and --resume.
(main): Implement dummy command aUmount.  Implement commands aResume
and aSuspend.
* g13/sh-cmd.c (cmd_suspend): New.
(cmd_resume): New.
(register_commands): Add commands RESUME and SUSPEND.
* g13/server.c (cmd_suspend): New.
(cmd_resume): New.
(register_commands): Add commands RESUME and SUSPEND.
* g13/be-dmcrypt.c (be_dmcrypt_suspend_container): New.
(be_dmcrypt_resume_container): New.
* g13/backend.c (be_suspend_container): New.
(be_resume_container): New.
* g13/suspend.c, g13/suspend.h: New.
* g13/mount.c (parse_header, read_keyblob_prefix, read_keyblob)
(decrypt_keyblob, g13_is_container): Move to ...
* g13/keyblob.c: new file.
(keyblob_read): Rename to g13_keyblob_read and make global.
(keyblob_decrypt): Rename to g13_keyblob_decrypt and make global.
* g13/sh-dmcrypt.c (check_blockdev): Add arg expect_busy.
(sh_dmcrypt_suspend_container): New.
(sh_dmcrypt_resume_container): New.
* g13/call-syshelp.c (call_syshelp_run_suspend): New.
(call_syshelp_run_resume): New.
--

The --suspend command can be used before a hibernate operation to make
the encrypted partition inaccessible and wipe the key from the memory.
Before --suspend is called a sync(1) should be run to make sure that
their are no dirty buffers (dmsetup, as called by g13, actually does
this for you but it does not harm to do it anyway.  After the
partition has been suspended a

  echo 3 >proc/sys/vm/drop_caches

required to flush all caches which may still have content from the
encrypted partition.

The --resume command reverses the effect of the suspend but to do this
it needs to decrypt again.  Now, if the .gnupg directory lives on the
encrypted partition this will be problematic because due to the
suspend all processes accessing data on the encrypted partition will
be put into an uninterruptible sleep (ps(1) shows a state of 'D').
This needs to be avoided.  A workaround is to have a separate GnuPG
home directory (say, "~/.gnupg-fallback") with only the public keys
required to decrypt the partition along with a properly setup
conf files.  A

  GNUPGHOME=$(pwd)/.gnupg-fallback g13 --resume

should then be able to resume the encrypted partition using the
private key stored on a smartcard.

The implementation is pretty basic right now but useful to me.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog13: Run mount after dmsetup.
Werner Koch [Mon, 22 Feb 2016 09:56:27 +0000 (10:56 +0100)]
g13: Run mount after dmsetup.

* g13/g13-syshelp.c (main): Reject userids with a slash.
* g13/sh-dmcrypt.c (sh_dmcrypt_mount_container): Run mount if a
mountpoint is known.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests/openpgp: Qualify executables with extension.
Justus Winter [Tue, 12 Jan 2016 10:43:06 +0000 (11:43 +0100)]
tests/openpgp: Qualify executables with extension.

* tests/openpgp/Makefile.am (required_pgms): Qualify executables with
'$EXEEXT'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Reimplement 'pinentry.sh' in c.
Justus Winter [Fri, 22 Jan 2016 10:47:58 +0000 (11:47 +0100)]
tests/openpgp: Reimplement 'pinentry.sh' in c.

* tests/openpgp/Makefile.am: Build new program.
* tests/openpgp/defs.inc: Use the new program.
* tests/openpgp/fake-pinentry.c: New file.
--
Building an executable that does not require an interpreter makes it
easier to use on Windows.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Avoid dependency on source files.
Justus Winter [Fri, 22 Jan 2016 11:10:57 +0000 (12:10 +0100)]
tests/openpgp: Avoid dependency on source files.

* tests/openpgp/plain-largeo.asc: New file.
* tests/openpgp/version.test: Dearmor the new file instead of relying
on the source being present.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Fix file removal.
Justus Winter [Fri, 22 Jan 2016 11:06:06 +0000 (12:06 +0100)]
tests/openpgp: Fix file removal.

* tests/openpgp/version.test: Fix file removal.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Provide a way to wait for multiple processes.
Justus Winter [Thu, 14 Jan 2016 17:20:14 +0000 (18:20 +0100)]
common/exechelp: Provide a way to wait for multiple processes.

* common/exechelp-posix.c (gnupg_wait_process): Generalize to
'gnupg_wait_processes'.
* common/exechelp-w32.c (gnupg_wait_process): Likewise.
* common/exechelp-w32ce.c (gnupg_wait_process): New function stub.
* common/exechelp.h (gnupg_wait_process): New prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Add general pipe function.
Justus Winter [Thu, 14 Jan 2016 13:14:25 +0000 (14:14 +0100)]
common/exechelp: Add general pipe function.

* common/exechelp-posix.c (gnupg_create_pipe): New function.
* common/exechelp-w32.c (INHERIT_{READ,WRITE,BOTH}): New macros.
(create_inheritable_pipe): Generalize so that both ends can be
inherited.
(do_create_pipe): Rename argument accordingly.
(gnupg_create_{in,out}bound_pipe): Use new flags.
(gnupg_create_pipe): New function.
(gnupg_spawn_process): Use new flags.
* common/exechelp-w32ce.c (gnupg_create_pipe): New stub.
* common/exechelp.h (gnupg_create_pipe): New prototype.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Mute the Windows version.
Justus Winter [Thu, 4 Feb 2016 16:03:48 +0000 (17:03 +0100)]
common/exechelp: Mute the Windows version.

* common/exechelp-w32.c (gnupg_wait_process): Do not print an error if
the exit code can be returned.  This makes the Windows version behave
like the POSIX version.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Avoid magic numbers.
Justus Winter [Mon, 25 Jan 2016 16:45:19 +0000 (17:45 +0100)]
common/exechelp: Avoid magic numbers.

* common/exechelp-w32.c (do_create_pipe): Use symbolic names.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Disable debugging by default.
Justus Winter [Tue, 26 Jan 2016 11:43:40 +0000 (12:43 +0100)]
common/exechelp: Disable debugging by default.

* common/exechelp-w32.c (DEBUG_W32_SPAWN): Set to 0.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix handle leak.
Justus Winter [Fri, 22 Jan 2016 10:11:55 +0000 (11:11 +0100)]
common/exechelp: Fix handle leak.

* common/exechelp-w32.c (gnupg_spawn_process_detached): Close process
handle.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix opening the 'nul' device.
Justus Winter [Wed, 20 Jan 2016 11:13:35 +0000 (12:13 +0100)]
common/exechelp: Fix opening the 'nul' device.

* common/exechelp-w32.c (gnupg_spawn_process): Fix opening the 'nul'
device.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix error handling.
Justus Winter [Tue, 19 Jan 2016 12:09:06 +0000 (13:09 +0100)]
common/exechelp: Fix error handling.

* common/exechelp-w32.c (gnupg_spawn_process): Close the right handle.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon/exechelp: Fix pipe creation.
Justus Winter [Tue, 19 Jan 2016 11:45:04 +0000 (12:45 +0100)]
common/exechelp: Fix pipe creation.

* common/exechelp-w32.c (gnupg_spawn_process): Fix the creation of the
input pipe.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotools/mk-tdata: Fix data generation on Windows.
Justus Winter [Fri, 22 Jan 2016 10:45:00 +0000 (11:45 +0100)]
tools/mk-tdata: Fix data generation on Windows.

* tools/mk-tdata.c (main): Set stdout to binary mode to avoid newline
conversion.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpg: Systematically detect and fix signatures that are out of order.
Neal H. Walfield [Fri, 19 Feb 2016 14:52:08 +0000 (15:52 +0100)]
gpg: Systematically detect and fix signatures that are out of order.

* g10/keyedit.c (sig_comparison): New function.
(fix_key_signature_order): Merge functionality into...
(check_all_keysigs): ... this function.  Rewrite to eliminate
duplicates and use a systematic approach to detecting and moving
signatures that are out of order instead of a heuristic.
(fix_keyblock): Don't call fix_key_signature_order.  Call
check_all_keysigs instead after collapsing the uids.

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

3 years agogpg: Split check_key_signature2.
Neal H. Walfield [Fri, 19 Feb 2016 14:30:03 +0000 (15:30 +0100)]
gpg: Split check_key_signature2.

* g10/sig-check.c (hash_uid_node): Rename from this...
(hash_uid_packet): ... to this.  Take a PKT_user_id instead of a
KBNODE.
(check_key_signature2): Split the basic signature checking
functionality into...
(check_signature_over_key_or_uid): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Split print_and_check_one_sig.
Neal H. Walfield [Fri, 19 Feb 2016 14:13:22 +0000 (15:13 +0100)]
gpg: Split print_and_check_one_sig.

* g10/keyedit.c (print_and_check_one_sig): Split the print
functionality into...
(print_one_sig): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Split the function check_signature_end.
Neal H. Walfield [Fri, 19 Feb 2016 13:10:09 +0000 (14:10 +0100)]
gpg: Split the function check_signature_end.

* g10/sig-check.c (check_signature_end): Break the basic signature
check into...
(check_signature_end_simple): ... this new function.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Use format_keyid rather than manually formatting the keyid.
Neal H. Walfield [Fri, 19 Feb 2016 13:59:19 +0000 (14:59 +0100)]
gpg: Use format_keyid rather than manually formatting the keyid.

* g10/keyedit.c (menu_addrevoker): Use format_keyid rather than
manually formatting the keyid.
* g10/keygen.c (card_write_key_to_backup_file): Likewise.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Initialize the primary key when generating a key.
Neal H. Walfield [Fri, 19 Feb 2016 13:53:29 +0000 (14:53 +0100)]
gpg: Initialize the primary key when generating a key.

* g10/keygen.c (do_generate_keypair): Initialize
pri_psk->flags.primary, pri_psk->keyid and pri_psk->main_keyid.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
3 years agogpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.
Neal H. Walfield [Fri, 19 Feb 2016 13:48:56 +0000 (14:48 +0100)]
gpg: Add accessor & utility functions for pk->keyid and pk->main_keyid.

* g10/keydb.h (keyid_cmp): New function.
* g10/keyid.c (pk_keyid): New function.
(pk_main_keyid): New function.
(keyid_copy): New function.
(pk_keyid_str): New function.
* g10/packet.h (PKT_public_key): Update comments for main_keyid and
keyid.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>
Before accessing pk->keyid, it is necessary to call keyid_from_pk (pk,
NULL) to ensure that pk->keyid is valid.  Because it is easy to forget
to do this, these accessor functions take care of it.

3 years agogpgparsemail: Allow weirdly-mixed pkcs7 signatures.
Daniel Kahn Gillmor [Mon, 8 Feb 2016 20:44:07 +0000 (15:44 -0500)]
gpgparsemail: Allow weirdly-mixed pkcs7 signatures.

* tools/gpgparsemail.c: Add and check info->signing_protocol_2.

--
Some mailers in the wild will generate messages that have the a weird
structure where they use the x- prefix in one part and drop it in
another.

For example, the main MIME part as a whole has:

Content-Type: multipart/signed;
   protocol="application/x-pkcs7-signature"

but the signature sub-part has:

  Content-Type: application/pkcs7-signature

(or vice versa, where the x- prefix is in the sub-part but not the
protocol= section on the main MIME object)

This change also avoids allocating strings for these comparisons,
since the const strings in question are already available in the built
executable, and no dynamic labels are needed.

===
- 2 lines reformatted to keep them below 90 cols. - wk

3 years agogpg: Clean up dangling agent_open and agent_closed declarations.
Daniel Kahn Gillmor [Thu, 11 Feb 2016 12:08:55 +0000 (07:08 -0500)]
gpg: Clean up dangling agent_open and agent_closed declarations.

* g10/keydb.h: Remove agent_open, agent_close declarations/
* g10/migrate.c: #include <unistd.h> for access()

--
agent_open() is only defined statically in common/simple-pw-query.c,
it is neither used nor referenced anywhere else.  agent_close doesn't
exist anywhere.  The removal of these declarations removes an
unecessary inclusion of libassuan.h.

migrate.c was relying on keydb.h -> libassuan.h -> unistd.h for the
declaration of access(), so we now handle that explicitly instead.

3 years agow32: Make scdaemon build again due to libusb problem.
Werner Koch [Tue, 16 Feb 2016 15:47:22 +0000 (16:47 +0100)]
w32: Make scdaemon build again due to libusb problem.

* configure.ac: Add hack to disable libusb for Windows.  Also use
$host instead of $target in the switch
 --

The new test for libusb does not support cross-compiling.  As a quick
workaround we disable libusb for Windows because we can't use it anyway.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Do not error out if gpgconf is not installed.
Werner Koch [Tue, 16 Feb 2016 15:07:44 +0000 (16:07 +0100)]
w32: Do not error out if gpgconf is not installed.

* common/homedir.c (check_portable_app): Remove error message.
--

It is sometimes useful to install just gpgv and no other parts.  Our
test for a portable application returned an error if gpgconf is not
installed.  That error is not required but was merely a debug aid.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 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

3 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>
3 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>
3 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>
3 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.

3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 years agodoc: Typo fixes
Ineiev [Wed, 27 Jan 2016 09:42:16 +0000 (10:42 +0100)]
doc: Typo fixes

--

3 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>
3 years agoPost release updates
Werner Koch [Tue, 26 Jan 2016 13:14:24 +0000 (14:14 +0100)]
Post release updates

--

3 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

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

--

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

--

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

--

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

--

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 years agodoc: Typo fix.
Werner Koch [Wed, 20 Jan 2016 09:48:50 +0000 (10:48 +0100)]
doc: Typo fix.

--

3 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,

3 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>
3 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.

3 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>
3 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>
3 years agogpg: Minor string changes.
Werner Koch [Mon, 18 Jan 2016 11:15:09 +0000 (12:15 +0100)]
gpg: Minor string changes.

--