gnupg.git
10 days agogpg: Add stub function for encrypting AEAD. master
Werner Koch [Wed, 10 Jan 2018 16:33:50 +0000 (17:33 +0100)]
gpg: Add stub function for encrypting AEAD.

* g10/cipher.c (cipher_filter): Rename to cipher_filter_cfb.
* g10/cipher-aead.c: New.  Right now only with a stub function.
* g10/Makefile.am (gpg_sources): Add file.
* g10/encrypt.c (encrypt_simple): Push either cipher_filter_cfb or
cipher_filter_aead.
(encrypt_crypt): Ditto.
(encrypt_filter): Ditto.
* g10/sign.c (sign_symencrypt_file): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 days agogpg: New option --force-aead
Werner Koch [Wed, 10 Jan 2018 16:07:11 +0000 (17:07 +0100)]
gpg: New option --force-aead

* g10/dek.h (DEK): Turn fields use_mdc, algo_printed and symmetric
into single bit vars.  Make sure they are always set to 1 or 0.
(DEK): New field use_aead.
* g10/options.h (struct opt): New field force_aead.
* g10/pkclist.c (select_aead_from_pklist): New.
* g10/gpg.c (oForceAEAD): New const.
(opts): New options "--force-aead".
(main): Set new option.
* g10/encrypt.c (use_aead): New.
(encrypt_simple): Implement new flags DEK.use_aead.
(encrypt_crypt): Ditto.
(encrypt_filter): Ditto.
* g10/sign.c (sign_symencrypt_file): Ditto.
--

This patch should be enough to detect whether AEAD can be used.
Not tested.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 days agogpg: Add option and preference framework for AEAD.
Werner Koch [Wed, 10 Jan 2018 10:42:38 +0000 (11:42 +0100)]
gpg: Add option and preference framework for AEAD.

* common/openpgpdefs.h (aead_algo_t): New.
(SIGSUBPKT_PREF_AEAD): New.
* g10/gpg.c (oAEADAlgo, oPersonalAEADPreferences): New.
(opts): New options --aead-algo and --personal-aead-preferences.
(set_compliance_option): Clar aead algo.
(main): Parse and check the new options
* g10/options.h (struct opt): Add fields def_aead_algo and
personal_aead_prefs.
* g10/packet.h (PREFTYPE_AEAD): New enum value.
(PKT_user_id): Add field flags.aead.
(PKT_public_key): Add field flags.aead.
* g10/pkclist.c (select_algo_from_prefs): Support PREFTYPE_AEAD.
* g10/getkey.c (fixup_uidnode): Set AEAD flag.
(merge_selfsigs): Ditto.
* g10/kbnode.c (dump_kbnode): Show aead flag.
* g10/keyedit.c (show_prefs): Ditto.
(show_key_with_all_names_colon): Ditto.
* g10/keygen.c (aead_presf, n_aead_prefs): New vars.
(set_one_pref): Suppport PREFTYPE_AEAD.
(keygen_set_std_prefs): Parse AEAD preferences.
(keygen_get_std_prefs): Ditto.
(add_feature_aead): New.
(keygen_upd_std_prefs): Call that and build AEAD pref  packet.
* g10/main.h (DEFAULT_AEAD_ALGO): New const.
* g10/misc.c (openpgp_aead_test_algo): New.
(openpgp_aead_algo_name): New.
(string_to_aead_algo): New.
(default_aead_algo): New.
--

This is only used in --rfc4880bis mode and not really tested.

Signed-off-by: Werner Koch <wk@gnupg.org>
4 weeks agodoc: Include NEWS from 2.2.4
Werner Koch [Wed, 20 Dec 2017 09:25:16 +0000 (10:25 +0100)]
doc: Include NEWS from 2.2.4

--

4 weeks agoMerge branch 'STABLE-BRANCH-2-2' into master
Werner Koch [Mon, 18 Dec 2017 15:38:02 +0000 (16:38 +0100)]
Merge branch 'STABLE-BRANCH-2-2' into master

--

Signed-off-by: Werner Koch <wk@gnupg.org>
4 weeks agogpgconf: Show --compliance in expert mode.
Werner Koch [Mon, 18 Dec 2017 15:31:54 +0000 (16:31 +0100)]
gpgconf: Show --compliance in expert mode.

* tools/gpgconf-comp.c (gc_options_gpg): Set compliance to expert.
(gc_options_gpgsm): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
4 weeks agosm: Allow explicit setting of the default --compliance=gnupg
Werner Koch [Mon, 18 Dec 2017 11:05:02 +0000 (12:05 +0100)]
sm: Allow explicit setting of the default --compliance=gnupg

* sm/gpgsm.c (main): Allow setting of the default compliance.
* tools/gpgconf-comp.c (gc_options_gpgsm): Add "compliance".
--

This is required so that we can use this option in in gpgconf.conf.

Signed-off-by: Werner Koch <wk@gnupg.org>
4 weeks agopo: Update Japanese translation.
NIIBE Yutaka [Mon, 18 Dec 2017 05:09:53 +0000 (14:09 +0900)]
po: Update Japanese translation.

* po/ja.po: Fix message with no "%s".

--

Backport of master commit from: 77e2fcb4ffbad8577a2cf41f17bf92dec6a93ad8

The wrong message caused segmentation fault for key generation when
no expiration is specified.

GnuPG-bug-id: 3619
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
4 weeks agopo: Update Japanese translation.
NIIBE Yutaka [Mon, 18 Dec 2017 05:09:53 +0000 (14:09 +0900)]
po: Update Japanese translation.

* po/ja.po: Fix message with no "%s".

--

The wrong message caused segmentation fault for key generation when
no expiration is specified.

GnuPG-bug-id: 3619
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
5 weeks agogpg: Print a warning for too much data encrypted with 3DES et al.
Werner Koch [Wed, 13 Dec 2017 12:02:34 +0000 (13:02 +0100)]
gpg: Print a warning for too much data encrypted with 3DES et al.

* g10/filter.h (cipher_filter_context_t): Remove unused filed
'create_mdc'.  Turn field 'header' into a bit field.  Add new fields
'short_blklen_warn' and 'short_blklen_count'.
* g10/cipher.c (write_header): Print a warning if MDC is not used.
(cipher_filter): Print a warning for long messages encrypted with a
short block length algorithm.
--

Note that to test this warning in a reliable way compression needs to
be disabled.

Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agogpg: Simplify cipher:write_header.
Werner Koch [Wed, 13 Dec 2017 10:58:51 +0000 (11:58 +0100)]
gpg: Simplify cipher:write_header.

* g10/cipher.c (write_header): Use write_status_printf.

Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agoindent: Re-indent g10/cipher.c
Werner Koch [Wed, 13 Dec 2017 10:56:28 +0000 (11:56 +0100)]
indent: Re-indent g10/cipher.c

--

5 weeks agogpg: Simplify default_recipient().
Werner Koch [Wed, 13 Dec 2017 10:00:24 +0000 (11:00 +0100)]
gpg: Simplify default_recipient().

* g10/pkclist.c (default_recipient): Use hexfingerprint.
--

Note that on malloc failure this function now returns NULL instead of
terminating the process.  However, under memory pressure any function
called latter will very likely fail as well.

Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agogpg: Return an error from hexfingerprint on malloc error.
Werner Koch [Wed, 13 Dec 2017 09:52:34 +0000 (10:52 +0100)]
gpg: Return an error from hexfingerprint on malloc error.

* g10/keyid.c (hexfingerprint): Return NULL on malloc failure.  Chnage
all callers.

Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agogpg: Remove some xmallocs.
Werner Koch [Wed, 13 Dec 2017 09:06:37 +0000 (10:06 +0100)]
gpg: Remove some xmallocs.

* g10/getkey.c (get_pubkeys): Do not use xmalloc.
--

We eventually need to get rid of all xmallocs so that gpg won't fail
easily when we make more use of the s server mode.

Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agoindent: Re-indent get_pubkeys.
Werner Koch [Wed, 13 Dec 2017 08:54:39 +0000 (09:54 +0100)]
indent: Re-indent get_pubkeys.

--

5 weeks agogpg: default-preference-list: prefer SHA512.
Daniel Kahn Gillmor [Thu, 28 Sep 2017 12:32:26 +0000 (08:32 -0400)]
gpg: default-preference-list: prefer SHA512.

* g10/keygen.c (keygen_set_std_prefs): when producing default internal
personal-digest-preferences, keep the same order.  When publishing
external preferences, state preference for SHA512 first.

--

SHA-512 has a wider security margin than SHA-256.  It is also slightly
faster on most of the architectures on which GnuPG runs today.  New
keys should publish defaults that indicate we prefer the stronger,
more performant digest.

Specifically, this changes --default-preference-list from:

   SHA256 SHA384 SHA512 SHA224

to:

   SHA512 SHA384 SHA256 SHA224

This patch deliberately avoids touching --personal-digest-preferences
(which itself would affect the default of --digest-algo and
--cert-digest-algo), so that public-facing cleartext signatures and
identity certifications will continue to be made with SHA256 by
default.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
5 weeks agoChange backlog from 5 to 64 and provide option --listen-backlog.
Werner Koch [Tue, 12 Dec 2017 13:14:40 +0000 (14:14 +0100)]
Change backlog from 5 to 64 and provide option --listen-backlog.

* agent/gpg-agent.c (oListenBacklog): New const.
(opts): New option --listen-backlog.
(listen_backlog): New var.
(main): Parse new options.
(create_server_socket): Use var instead of 5.
* dirmngr/dirmngr.c: Likewise.
* scd/scdaemon.c: Likewise.
--

GnuPG-bug-id: 3473
Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agobuild: New configure option --enable-run-gnupg-user-socket.
Werner Koch [Tue, 12 Dec 2017 08:42:43 +0000 (09:42 +0100)]
build: New configure option --enable-run-gnupg-user-socket.

* configure.ac: (USE_RUN_GNUPG_USER_SOCKET): New ac_define.
* common/homedir.c (_gnupg_socketdir_internal): Add extra directories.
--

This allows to build GnuPG with an extra socketdir below /run.  See
https://lists.gnupg.org/pipermail/gnupg-devel/2017-November/033250.html
for a longer explanation why this is sometimes useful.

Suggested-by: Rainer Perske
Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agodirmngr: Check for WKD support at session end
Werner Koch [Tue, 14 Nov 2017 15:24:12 +0000 (16:24 +0100)]
dirmngr: Check for WKD support at session end

* dirmngr/domaininfo.c (insert_or_update): Copy the name.
* dirmngr/misc.c (copy_stream): Allow arg OUT to be NULL.
* dirmngr/server.c (set_error): Protect CTX.
(dirmngr_status): Protect against missing ASSUAN_CTX.
(dirmngr_status_help): Ditto.
(dirmngr_status_printf): Ditto.
(cmd_wkd_get): Factor code out to ...
(proc_wkd_get): new func.  Support silent operation with no CTX.
(task_check_wkd_support): New.
--

This finalizes the feature to efficiently cache WKD checks.  If a
standard WKD query returns no data, we queue a test to be run after
the end of the session (so that we do not delay the calling client).
This check tests whether the server responsible for the queried
address has WKD at all enabled.  The test is done by checking whether
the "policy" file exists.  We do not check the "submission-address"
file because that is not necessary for the web key operation.  The
policy file is now required.

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

5 weeks agodirmngr: Add a background task framework.
Werner Koch [Tue, 14 Nov 2017 12:42:18 +0000 (13:42 +0100)]
dirmngr: Add a background task framework.

* dirmngr/workqueue.c: New.
* dirmngr/Makefile.am (dirmngr_SOURCES): Add new file.
* dirmngr/server.c (server_local_s): New field session_id.
(cmd_wkd_get): Add a task.
(task_check_wkd_support): New stub function.
(cmd_getinfo): New sub-commands "session_id" and "workqueue".
(start_command_handler): Add arg session_id and store it in
SERVER_LOCAL.
(dirmngr_status_helpf): New.
* dirmngr/dirmngr.h (wqtask_t): New type.
* dirmngr/dirmngr.c (main): Pass 0 as session_id to
start_command_handler.
(start_connection_thread): Introduce a session_id and pass it to
start_command_handler.  Run post session tasks.
(housekeeping_thread): Run global workqueue tasks.
--

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

5 weeks agodirmngr: Limit the number of cached domains for WKD.
Werner Koch [Tue, 14 Nov 2017 07:37:27 +0000 (08:37 +0100)]
dirmngr: Limit the number of cached domains for WKD.

* dirmngr/domaininfo.c (MAX_DOMAINBUCKET_LEN): New.
(insert_or_update): Limit the length of a bucket chain.
(domaininfo_print_stats): Print just one summary line.

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

5 weeks agodirmngr: Keep track of domains used for WKD queries
Werner Koch [Mon, 13 Nov 2017 15:09:32 +0000 (16:09 +0100)]
dirmngr: Keep track of domains used for WKD queries

* dirmngr/domaininfo.c: New file.
* dirmngr/Makefile.am (dirmngr_SOURCES): Add file.
* dirmngr/server.c (cmd_wkd_get): Check whether the domain is already
known and tell domaininfo about the results.
--

This adds a registry for domain information to eventually avoid
useless queries for domains which do not support WKD.  The missing
part is a background task to check whether a queried domain supports
WKD at all and to expire old entries.

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

5 weeks agoMerge branch 'STABLE-BRANCH-2-2' into master
Werner Koch [Mon, 11 Dec 2017 09:42:38 +0000 (10:42 +0100)]
Merge branch 'STABLE-BRANCH-2-2' into master

5 weeks agoAdjust for changed macro names in libgpg-error master.
Werner Koch [Mon, 11 Dec 2017 09:37:30 +0000 (10:37 +0100)]
Adjust for changed macro names in libgpg-error 

* common/logging.h (GPGRT_LOGLVL_): New replacement macros for older
libgpg-error versions.

--

Updates-commit: b56dfdfc1865ceb7c3c025d79996e049faee7fdf
Signed-off-by: Werner Koch <wk@gnupg.org>
5 weeks agodoc: Typo fix
Werner Koch [Mon, 11 Dec 2017 09:17:59 +0000 (10:17 +0100)]
doc: Typo fix

--

6 weeks agodoc: Clarify C90 exceptions and add a new commit tag.
Werner Koch [Fri, 8 Dec 2017 12:44:24 +0000 (13:44 +0100)]
doc: Clarify C90 exceptions and add a new commit tag.

--

The variable definition inside a for statement require to use a c99
option for gcc which we do not want.  It has never been used and thus
we drop it.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 weeks agoRevert: build: Do not define logging.h constants for ...
Werner Koch [Fri, 8 Dec 2017 12:27:06 +0000 (13:27 +0100)]
Revert: build: Do not define logging.h constants for ...

---

This reverts commit 2fedf8583bcc493f587c90bc9632d25dfd10bd10.

We better solve this on the libgpg-error side.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 weeks agodoc: Fix Dijkstra
Werner Koch [Fri, 8 Dec 2017 06:38:18 +0000 (07:38 +0100)]
doc: Fix Dijkstra

--

Edsger Wybe Dijkstra (1930 --2002)
  - Dutch computer scientist

6 weeks agoagent: Fix description of shadow format.
NIIBE Yutaka [Fri, 8 Dec 2017 00:19:50 +0000 (09:19 +0900)]
agent: Fix description of shadow format.

* agent/keyformat.txt, agent/protect.c, agent/t-protect.c: Fix.

--

https://lists.gnupg.org/pipermail/gnupg-devel/2015-April/029680.html

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
6 weeks agospeedo,w32: Disable FLTK pinentry.
Werner Koch [Thu, 7 Dec 2017 15:29:29 +0000 (16:29 +0100)]
speedo,w32: Disable FLTK pinentry.

--

6 weeks agobuild: Do not define logging.h constants for libgpg-error dev versions.
Werner Koch [Thu, 7 Dec 2017 13:53:49 +0000 (14:53 +0100)]
build: Do not define logging.h constants for libgpg-error dev versions.

* common/logging.h [GPGRT_LOG_WITH_PREFIX]: Do not define the log
constants.
--

logging.h uses constants we plan to use for future versions of
libgpg-error.  My dev version already has the logging functions and
thus I run into a conflict.  This patch protects against this and make
the GnuPG work with later libgpg-error versions.

It was not the best idea to use constants from a planned libgpg-error
in the first place.  The actual problem are the enums, the macros
won't harm.

Signed-off-by: Werner Koch <wk@gnupg.org>
6 weeks agoagent: Change intialization of assuan socket system hooks.
NIIBE Yutaka [Thu, 7 Dec 2017 13:33:58 +0000 (14:33 +0100)]
agent: Change intialization of assuan socket system hooks.

* agent/gpg-agent.c (initialize_modules): Add hook again.
(main): Remove setting of the system houk but add scoket system hook
setting after assuan initialization.
--

Thread initialization is better to be deferred after fork (in case of
UNIX).  assuan_sock_init should be earlier.  Thus, we need to change
system hooks for assuan_sock_* interface.  Or else, on Windows, it may
cause hang on server.

Updates-commit: 1524ba9656f0205d8c6ef504f773b832a7a12ab9
GnuPG-bug-id: 3378
Signed-off-by: Werner Koch <wk@gnupg.org>
6 weeks agoagent: Set assuan system hooks before call of assuan_sock_init.
NIIBE Yutaka [Wed, 6 Dec 2017 02:20:51 +0000 (11:20 +0900)]
agent: Set assuan system hooks before call of assuan_sock_init.

* agent/gpg-agent.c (initialize_modules): Move assuan_set_system_hooks.
(main): ... here, just before assuan_sock_init.

--

In Assuan, global variable SOCK_CTX is used internally, which is
initialized by assuan_sock_init.  When initialized, system hooks
are copied into SOCK_CTX structure.  Thus, system hooks should
be set, before the call of assuan_sock_init.

GnuPG-bug-id: 3378
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
6 weeks agog10: Fix regexp sanitization.
NIIBE Yutaka [Thu, 9 Nov 2017 05:03:22 +0000 (14:03 +0900)]
g10: Fix regexp sanitization.

* g10/trustdb.c (sanitize_regexp): Only escape operators.

--

Backport from master commit:
ccf3ba92087e79abdeaa0208795829b431c6f201

To sanitize a regular expression, quoting by backslash should be only
done for defined characters.  POSIX defines 12 characters including
dot and backslash.

Quoting other characters is wrong, in two ways; It may build an
operator like: \b, \s, \w when using GNU library.  Case ignored match
doesn't work, because quoting lower letter means literally and no
much to upper letter.

GnuPG-bug-id: 2923
Co-authored-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
7 weeks agodoc: clarify that --encrypt refers to public key encryption
Daniel Kahn Gillmor [Fri, 17 Nov 2017 02:17:08 +0000 (10:17 +0800)]
doc: clarify that --encrypt refers to public key encryption

--

A simple read of gpg(1) is ambiguous about whether --encrypt could be
for either symmetric or pubkey encryption.  Closer inference suggests
that --encrypt is about pubkey encryption only.  Make that clearer on
a first read.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
7 weeks agodoc: Update copyright notices for common/exechelp*.
Werner Koch [Wed, 29 Nov 2017 10:32:42 +0000 (11:32 +0100)]
doc: Update copyright notices for common/exechelp*.

--

Verified that all authors are either g10 Code employees or
(in one case) a work for hire.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 weeks agoUse the gpgrt log functions if possible.
Werner Koch [Mon, 27 Nov 2017 14:00:25 +0000 (15:00 +0100)]
Use the gpgrt log functions if possible.

* common/logging.c: Do not build any code if we can use the gpgrt_log
functions.
(log_logv_with_prefix): Rename to log_logv_prefix and change order of
args so that this function matches its printf like counterpart
gpgrt_logv_prefix.  Change all callers.
(log_debug_with_string): Rename to log_debug_string. Change all
callers.
(log_printhex): Move first arg to end so that this function matches
its printf like counterpart gpgrt_log_printhex.  Change all callers.
* common/logging.h: Divert to gpgrt/libgpg-error if we can use the
gpgrt_log functions.
(bug_at): Add inline versions if we can use the gpgrt_log functions.
* configure.ac (GPGRT_ENABLE_LOG_MACROS): Add to AH_BOTTOM.
(mycflags): Add -Wno-format-zero-length.
--

This patch enables the use of the log function from libgpgrt (aka
libgpg-error).  Instead of checking a version number, we enable them
depending on macros set by recent gpg-error versions.  Eventually the
whole divert stuff can be removed.

The -Wno-format-zero-length is required because log_printhex can be
called with an empty format string.  Note that this is fully specified
standard C behaviour.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 weeks agogpg: Do not read from uninitialized memory with --list-packets.
Werner Koch [Sun, 26 Nov 2017 17:33:49 +0000 (18:33 +0100)]
gpg: Do not read from uninitialized memory with --list-packets.

* g10/parse-packet.c (parse_plaintext): Fill up the allocated NAME.
--

This actually does not harm because we merely display a buffer
allocated by ourselves.  However, we better tell Valgrind about it so
that we don't need to track this thing down ever again.

Test using a corrupted literal data packet:

  echo cb 0a 75 ff 59 ae 90 d5  74 65 73 74 | \
    undump |\
    valgrind gpg --list-packets >/dev/null

Reported-by: Sebastian Schinzel
Signed-off-by: Werner Koch <wk@gnupg.org>
8 weeks agoagent: New option --auto-expand-secmem.
Werner Koch [Fri, 24 Nov 2017 09:30:25 +0000 (10:30 +0100)]
agent: New option --auto-expand-secmem.

* agent/gpg-agent.c (oAutoExpandSecmem): New enum value.
(opts): New option --auto-expand-secmem.
(main): Implement that option.
--

Note that this option has an effect only if Libgcrypt >= 1.8.2 is
used.

GnuPG-bug-id: 3530

8 weeks agoMerge branch 'STABLE-BRANCH-2-2'
Werner Koch [Thu, 23 Nov 2017 14:12:45 +0000 (15:12 +0100)]
Merge branch 'STABLE-BRANCH-2-2'

--

Signed-off-by: Werner Koch <wk@gnupg.org>
8 weeks agobuild: Update distsigkey.gpg
Werner Koch [Wed, 22 Nov 2017 19:54:39 +0000 (20:54 +0100)]
build: Update distsigkey.gpg

--

8 weeks agogpg: Fix memory leaking for long inputs via --command-fd.
Werner Koch [Wed, 22 Nov 2017 19:54:07 +0000 (20:54 +0100)]
gpg: Fix memory leaking for long inputs via --command-fd.

* g10/cpr.c (do_get_from_fd): Free the old buffer.
--

If the received input is longer than 200 characters we used to leak
the previous allocated buffer.

GnuPG-bug-id: 3528
Signed-off-by: Werner Koch <wk@gnupg.org>
8 weeks agodoc: clarify that --encrypt refers to public key encryption
Daniel Kahn Gillmor [Fri, 17 Nov 2017 02:17:08 +0000 (10:17 +0800)]
doc: clarify that --encrypt refers to public key encryption

--

A simple read of gpg(1) is ambiguous about whether --encrypt could be
for either symmetric or pubkey encryption.  Closer inference suggests
that --encrypt is about pubkey encryption only.  Make that clearer on
a first read.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
8 weeks agoscd: Enable card removal check after select_application.
NIIBE Yutaka [Tue, 21 Nov 2017 02:52:54 +0000 (11:52 +0900)]
scd: Enable card removal check after select_application.

* scd/apdu.c (open_ccid_reader): Fix error handling of ccid_get_atr.
* scd/app.c (select_application): Always kick the loop if new APP.
* scd/ccid-driver.c (ccid_open_usb_reader): Don't setup at open.
(ccid_slot_status): Setup interrupt transfer when !ON_WIRE.

--

We can use the interrupt transfer to be notified about card status
change.  In this case, we don't need to issue PC_to_RDR_GetSlotStatus
command.  This change improve the setup the notification; it should be
done after registration of APP.

When the setup is done just after opening the USB connection (before
issuing PC_to_RDR_IccPowerOn), a reader might notifies about no card
availability (because of not yet powered on), even though the card is
ready to be powered on.

GnuPG-bug-id: 3508
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 months agoInclude NEWS from 2.2.3
Werner Koch [Mon, 20 Nov 2017 13:58:15 +0000 (14:58 +0100)]
Include NEWS from 2.2.3

--

2 months agoRevert "build: BSD make support for yat2m."
Werner Koch [Mon, 20 Nov 2017 13:55:02 +0000 (14:55 +0100)]
Revert "build: BSD make support for yat2m."

--
This reverts commit e1984969cac06a88c7e6f5e49e5c3104d10a847d
because that was 2.2 only.

2 months agoMerge branch 'STABLE-BRANCH-2-2' into master
Werner Koch [Mon, 20 Nov 2017 13:54:44 +0000 (14:54 +0100)]
Merge branch 'STABLE-BRANCH-2-2' into master

2 months agoPost release updates
Werner Koch [Mon, 20 Nov 2017 12:35:36 +0000 (13:35 +0100)]
Post release updates

--

2 months agoRelease 2.2.3 gnupg-2.2.3
Werner Koch [Mon, 20 Nov 2017 11:39:16 +0000 (12:39 +0100)]
Release 2.2.3

2 months agobuild: Use -Werror only for the check.
Werner Koch [Mon, 20 Nov 2017 11:32:31 +0000 (12:32 +0100)]
build: Use -Werror only for the check.

* configure.ac: Do not add -Werror to mycflags.
--

On Windows and possible also on other platforms we expect to a get a
few errors or warnins.  Thus we can't use -Werror by default.  This is
why we have a separate configure options --enable-werror ;-).

Fixes-commit: 3ecd1a41be7c880976987d13e88342c98f37e064
Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agogpg-agent: Avoid getting stuck in shutdown pending state.
Werner Koch [Mon, 13 Nov 2017 09:52:36 +0000 (10:52 +0100)]
gpg-agent: Avoid getting stuck in shutdown pending state.

* agent/gpg-agent.c (handle_connections): Always check inotify fds.
--

I noticed a gpg-agent processed, probably in shutdown_pending state,
which was selecting on only these two inotify fds.  The select
returned immediately but because we did not handle the fds in
shutdown_pending state they were not read and the next select call
returned one of them immediately again.  Actually that should not
hanppen because the

          if (active_connections == 0)
            break; /* ready */

should have terminated the loop.  For unknown reasons (maybe be just a
connection thread terminated in a gdb session) that did not happen.
By moving the check outside of the shutdown_pending condition and
closing the fd after they have been triggered the code should be more
robust.

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

2 months agoagent: Use clock or clock_gettime for calibration.
NIIBE Yutaka [Tue, 7 Nov 2017 01:49:36 +0000 (10:49 +0900)]
agent: Use clock or clock_gettime for calibration.

* agent/protect.c (calibrate_get_time): Use clock or clock_gettime.

--

For calibration, clock(3) is better than times(3) among UNIXen.
Tested on NetBSD 7.1 and FreeBSD 11.1, using QEMU.

Thanks to Damien Goutte-Gattat for the information of use of
CLOCKS_PER_SEC;  The old code with times(3) is not 100% correct,
in terms of POSIX.  It should have used sysconf (_SC_CLK_TCK) instead
of CLOCKS_PER_SEC.  CLOCKS_PER_SEC is specifically for clock(3).

GnuPG-bug-id: 3056, 3276, 3472
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
(cherry picked from commit 380bce13d94ff03c96e39ac1d834f382c5c730a1)

2 months agobuild: Check -Wlogical-op flag availability with -Werror.
NIIBE Yutaka [Mon, 20 Nov 2017 03:01:31 +0000 (12:01 +0900)]
build: Check -Wlogical-op flag availability with -Werror.

* configure.ac: Use -Werror.

--

Using clang, -Wlogical-op doesn't fail but generates warning.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 months agobuild: BSD make support for yat2m.
NIIBE Yutaka [Mon, 20 Nov 2017 02:33:26 +0000 (11:33 +0900)]
build: BSD make support for yat2m.

* configure.ac (YAT2M): Only define when found.
* doc/Makefile.am: Portability fix.

--

This is not intended to apply to master, but 2.2 branch only.  When
new libgpg-error is required, installation of yat2m can be assumed.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 months agodirmngr: Fix double free of a hash context in the error case.
Werner Koch [Fri, 17 Nov 2017 09:34:40 +0000 (10:34 +0100)]
dirmngr: Fix double free of a hash context in the error case.

* dirmngr/crlcache.c: Clearly document that this fucntions takes
ownership of MD.
(abort_sig_check): Allow NULL for MD.
(crl_parse_insert): Immediately set MD to NULL.  Remove check for md
before a calling abort_sig_check.
--

GnuPG-bug-id: 3510
Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agoassuan: Fix exponential decay for first second.
Werner Koch [Wed, 15 Nov 2017 14:30:21 +0000 (15:30 +0100)]
assuan: Fix exponential decay for first second.

* common/asshelp.c (wait_for_sock): Round SECSLEFT.
* dirmngr/dirmngr.c (main): Take care of --debug-wait also in dameon
mode.
* common/sysutils.c (gnupg_usleep) [HAVE_NANOSLEEP]: Fix nanosleep use.
--

Without the rounding we saw in verbose mose

 [...]to come up ... (5s)
 [...]to come up ... (4s)

immediately without the expected one second delay.  Waiting for the
next seconds did not work if nanosleep was used due to improper passed
parameters in gnupg_usleep.

Adding --debug-wait for dirmngr in daemon mode is required to test
this change.

GnuPG-bug-id: 3490
Fixes-commit: 149041b0b917f4298239fe18b5ebd5ead71584a6
Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agocommon: Change log_clock to printf style.
Werner Koch [Wed, 15 Nov 2017 13:46:14 +0000 (14:46 +0100)]
common: Change log_clock to printf style.

* common/logging.c (log_clock): Use do_logv.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agoi18n: Add an article to "agent" and lowercase "dirmngr" in one file.
Werner Koch [Wed, 15 Nov 2017 12:46:40 +0000 (13:46 +0100)]
i18n: Add an article to "agent" and lowercase "dirmngr" in one file.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agocommon: Tweak new code to keep already translated strings.
Werner Koch [Wed, 15 Nov 2017 12:47:48 +0000 (13:47 +0100)]
common: Tweak new code to keep already translated strings.

* common/asshelp.c (wait_for_sock): Replace NAME by WHICH and adjust
caller.  Revert to use the former strings.
--

Note that the second of these strings

  "waiting for the agent to come up ... (%ds)\n"
  "connection to agent established\n"

does not use a proper article.  This should be fixed but would
introduce a string change so that it is better done in a separate
commit.

Fixes-commit: 0471ff9d3bf8d6b9a359f3c426d70d0935066907
Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agoMerge T3490-proposal1 into master
Werner Koch [Wed, 15 Nov 2017 12:10:19 +0000 (13:10 +0100)]
Merge T3490-proposal1 into master

--

2 months agow32: Fix default registry path
Andre Heinecke [Wed, 15 Nov 2017 10:41:54 +0000 (11:41 +0100)]
w32: Fix default registry path

* configure.ac (GNUPG_REGISTRY_DIR): Remove leading backslash.

--
Windows does not like the leading backslash and won't read
the key.
Problem reported in the Gpg4win Message boards.

This bug was introduced by rev. 75ba215e

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2 months agogpg: Repurpose the ISO defined DO "sex" to "salutation".
Werner Koch [Wed, 15 Nov 2017 10:34:30 +0000 (11:34 +0100)]
gpg: Repurpose the ISO defined DO "sex" to "salutation".

* g10/card-util.c (current_card_status): String changes.
(change_sex): Description change.
(cmds): Add "salutation"; keep "sex" as an alias.
--

Note that we can't change the used values or tags but at least the UI
should show reflect the real purpose of the field.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agoMerge branch 'STABLE-BRANCH-2-2'
Werner Koch [Wed, 15 Nov 2017 10:01:10 +0000 (11:01 +0100)]
Merge branch 'STABLE-BRANCH-2-2'

--
Kept our AUTHORS and README

2 months agodoc: Add man page for gpgtar
Werner Koch [Wed, 15 Nov 2017 09:17:17 +0000 (10:17 +0100)]
doc: Add man page for gpgtar

--

This also removes the documentation for gpg-zip which is not
distributed anymore.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agogpgtar: Prefer --set-filename over implicit name
Andre Heinecke [Wed, 15 Nov 2017 08:54:05 +0000 (09:54 +0100)]
gpgtar: Prefer --set-filename over implicit name

* tools/gpgtar-extract.c: Prefer opt.filename over filename
for the directory prefix.

--
If you would extract from stdin (filename -) and use set-filename
to provide a real filename the "-" would be used for the directory
name. With this change an explicit filename is prefered.

GnuPG-Bug-Id: T3500
Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2 months agodoc: fix NEWSIG documentation
Will Thompson [Tue, 14 Nov 2017 15:34:34 +0000 (15:34 +0000)]
doc: fix NEWSIG documentation

--
08c82b1 introduced one optional argument for this status message. Due to
an apparent editing error, the sentence fragment "arguments are
currently defined." was left in the documentation.

Signed-off-by: Will Thompson <wjt@endlessm.com>
2 months agodoc: expand documentation of PROGRESS message
Will Thompson [Tue, 14 Nov 2017 15:30:34 +0000 (15:30 +0000)]
doc: expand documentation of PROGRESS message

--
This answers two questions that I was only able to answer by examining
each site where PROGRESS messages are emitted, and fixes a typo.

Signed-off-by: Will Thompson <wjt@endlessm.com>
2 months agogpg: Print AKL info only in verbose mode.
Werner Koch [Wed, 15 Nov 2017 07:47:32 +0000 (08:47 +0100)]
gpg: Print AKL info only in verbose mode.

* g10/getkey.c (get_pubkey_byname): Print info only in verbose mode.
--

GnuPG-bug-id: 3504
Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agodirmngr: Check for WKD support at session end
Werner Koch [Tue, 14 Nov 2017 15:24:12 +0000 (16:24 +0100)]
dirmngr: Check for WKD support at session end

* dirmngr/domaininfo.c (insert_or_update): Copy the name.
* dirmngr/misc.c (copy_stream): Allow arg OUT to be NULL.
* dirmngr/server.c (set_error): Protect CTX.
(dirmngr_status): Protect against missing ASSUAN_CTX.
(dirmngr_status_help): Ditto.
(dirmngr_status_printf): Ditto.
(cmd_wkd_get): Factor code out to ...
(proc_wkd_get): new func.  Support silent operation with no CTX.
(task_check_wkd_support): New.
--

This finalizes the feature to efficiently cache WKD checks.  If a
standard WKD query returns no data, we queue a test to be run after
the end of the session (so that we do not delay the calling client).
This check tests whether the server responsible for the queried
address has WKD at all enabled.  The test is done by checking whether
the "policy" file exists.  We do not check the "submission-address"
file because that is not necessary for the web key operation.  The
policy file is now required.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agodirmngr: Add a background task framework.
Werner Koch [Tue, 14 Nov 2017 12:42:18 +0000 (13:42 +0100)]
dirmngr: Add a background task framework.

* dirmngr/workqueue.c: New.
* dirmngr/Makefile.am (dirmngr_SOURCES): Add new file.
* dirmngr/server.c (server_local_s): New field session_id.
(cmd_wkd_get): Add a task.
(task_check_wkd_support): New stub function.
(cmd_getinfo): New sub-commands "session_id" and "workqueue".
(start_command_handler): Add arg session_id and store it in
SERVER_LOCAL.
(dirmngr_status_helpf): New.
* dirmngr/dirmngr.h (wqtask_t): New type.
* dirmngr/dirmngr.c (main): Pass 0 as session_id to
start_command_handler.
(start_connection_thread): Introduce a session_id and pass it to
start_command_handler.  Run post session tasks.
(housekeeping_thread): Run global workqueue tasks.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agosm, w32: Fix initial keybox creation
Andre Heinecke [Tue, 14 Nov 2017 11:24:52 +0000 (12:24 +0100)]
sm, w32: Fix initial keybox creation

* sm/keydb.c (maybe_create_keybox): Open new keybox in bin mode.

--
As the header contains a timestamp we will have the conversion
problems if the keybox is not opened in binary mode.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2 months agodirmngr: Limit the number of cached domains for WKD.
Werner Koch [Tue, 14 Nov 2017 07:37:27 +0000 (08:37 +0100)]
dirmngr: Limit the number of cached domains for WKD.

* dirmngr/domaininfo.c (MAX_DOMAINBUCKET_LEN): New.
(insert_or_update): Limit the length of a bucket chain.
(domaininfo_print_stats): Print just one summary line.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agodirmngr: Keep track of domains used for WKD queries
Werner Koch [Mon, 13 Nov 2017 15:09:32 +0000 (16:09 +0100)]
dirmngr: Keep track of domains used for WKD queries

* dirmngr/domaininfo.c: New file.
* dirmngr/Makefile.am (dirmngr_SOURCES): Add file.
* dirmngr/server.c (cmd_wkd_get): Check whether the domain is already
known and tell domaininfo about the results.
--

This adds a registry for domain information to eventually avoid
useless queries for domains which do not support WKD.  The missing
part is a background task to check whether a queried domain supports
WKD at all and to expire old entries.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agogpg-agent: Avoid getting stuck in shutdown pending state.
Werner Koch [Mon, 13 Nov 2017 09:52:36 +0000 (10:52 +0100)]
gpg-agent: Avoid getting stuck in shutdown pending state.

* agent/gpg-agent.c (handle_connections): Always check inotify fds.
--

I noticed a gpg-agent processed, probably in shutdown_pending state,
which was selecting on only these two inotify fds.  The select
returned immediately but because we did not handle the fds in
shutdown_pending state they were not read and the next select call
returned one of them immediately again.  Actually that should not
hanppen because the

          if (active_connections == 0)
            break; /* ready */

should have terminated the loop.  For unknown reasons (maybe be just a
connection thread terminated in a gdb session) that did not happen.
By moving the check outside of the shutdown_pending condition and
closing the fd after they have been triggered the code should be more
robust.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agotests: Handle the case with DISABLE_REGEX.
NIIBE Yutaka [Mon, 13 Nov 2017 09:50:30 +0000 (18:50 +0900)]
tests: Handle the case with DISABLE_REGEX.

* tests/openpgp/Makefile.am [DISABLE_REGEX] (EXTRA_DIST, XTESTS):
  Conditionalize.
* tests/openpgp/all-tests.scm (all-tests): Input file is Makefile.

--

The feature is only valid with !DISABLE_REGEX.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 months agotests: Run the trust-pgp-4 test again.
Damien Goutte-Gattat [Fri, 10 Nov 2017 10:38:32 +0000 (10:38 +0000)]
tests: Run the trust-pgp-4 test again.

* tests/openpgp/Makefile.am (XTESTS): Add trust-pgp-4.scm.
(EXTRA_DIST): Remove the test file from EXTRA_DIST.
--

Now that issue 2923 is fixed, the trust-pgp-4 test passes as
expected and we can enable it again. That should help prevent
a future regression on this issue.

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
2 months agopo/da: Fix Danish confusion between "compressed" and "compromised"
Daniel Kahn Gillmor [Sat, 11 Nov 2017 10:42:06 +0000 (18:42 +0800)]
po/da: Fix Danish confusion between "compressed" and "compromised"

--
In https://bugs.debian.org/881393 , Jonas Smedegaard reports:

> In option number 1, the word "komprimeret" means "compressed".
>
> I am pretty sure it should say "kompromitteret" instead, which means
> "compromised".

Debian-Bug-Id: 881393
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 months agopo/da: Fix Danish confusion between "compressed" and "compromised"
Daniel Kahn Gillmor [Sat, 11 Nov 2017 10:42:06 +0000 (18:42 +0800)]
po/da: Fix Danish confusion between "compressed" and "compromised"

--
In https://bugs.debian.org/881393 , Jonas Smedegaard reports:

> In option number 1, the word "komprimeret" means "compressed".
>
> I am pretty sure it should say "kompromitteret" instead, which means
> "compromised".

Debian-Bug-Id: 881393
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 months agog10: Fix regexp sanitization.
NIIBE Yutaka [Thu, 9 Nov 2017 05:03:22 +0000 (14:03 +0900)]
g10: Fix regexp sanitization.

* g10/trustdb.c (sanitize_regexp): Only escape operators.

--

To sanitize a regular expression, quoting by backslash should be only
done for defined characters.  POSIX defines 12 characters including
dot and backslash.

Quoting other characters is wrong, in two ways; It may build an
operator like: \b, \s, \w when using GNU library.  Case ignored match
doesn't work, because quoting lower letter means literally and no
much to upper letter.

GnuPG-bug-id: 2923
Co-authored-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 months agoassuan: Use exponential decay for first 1s of spinlock.
Daniel Kahn Gillmor [Wed, 8 Nov 2017 15:26:40 +0000 (16:26 +0100)]
assuan: Use exponential decay for first 1s of spinlock.

* common/asshelp.c (wait_for_sock): instead of checking the socket
every second, we check 10 times in the first second (with exponential
decay).
--

This cuts the wall clock time for the standard test suite roughly by
half.

GnuPG-bug-id: 3490
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 months agoassuan: Reorganize waiting for socket.
Daniel Kahn Gillmor [Wed, 8 Nov 2017 15:15:30 +0000 (16:15 +0100)]
assuan: Reorganize waiting for socket.

* common/asshelp.c (wait_for_sock): New function, collecting
codepaths from...
(start_new_gpg_agent) here and...
(start_new_dirmngr) here.
--

This has no functional change, but makes it easier to make this
function more efficient.

GnuPG-bug-id: 3490
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 months agodoc: Include NEWS from the 2.2.2 release
Werner Koch [Tue, 7 Nov 2017 10:20:00 +0000 (11:20 +0100)]
doc: Include NEWS from the 2.2.2 release

--

2 months agoPost release updates.
Werner Koch [Tue, 7 Nov 2017 10:04:44 +0000 (11:04 +0100)]
Post release updates.

--

2 months agoRelease 2.2.2 gnupg-2.2.2
Werner Koch [Tue, 7 Nov 2017 09:23:01 +0000 (10:23 +0100)]
Release 2.2.2

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agodirmngr: Reduce default LDAP timeout to 15 seconds.
Werner Koch [Tue, 7 Nov 2017 09:02:53 +0000 (10:02 +0100)]
dirmngr: Reduce default LDAP timeout to 15 seconds.

* dirmngr/dirmngr.c (DEFAULT_LDAP_TIMEOUT): Change to 15.
* dirmngr/dirmngr_ldap.c (DEFAULT_LDAP_TIMEOUT): Ditto.

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

2 months agodirmngr: Reduce default LDAP timeout to 15 seconds.
Werner Koch [Tue, 7 Nov 2017 09:02:53 +0000 (10:02 +0100)]
dirmngr: Reduce default LDAP timeout to 15 seconds.

* dirmngr/dirmngr.c (DEFAULT_LDAP_TIMEOUT): Change to 15.
* dirmngr/dirmngr_ldap.c (DEFAULT_LDAP_TIMEOUT): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agospeedo: Include software versions in the W32 README
Werner Koch [Tue, 7 Nov 2017 08:21:10 +0000 (09:21 +0100)]
speedo: Include software versions in the W32 README

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

2 months agopo: Update Russian translation
Ineiev [Tue, 7 Nov 2017 08:28:04 +0000 (09:28 +0100)]
po: Update Russian translation

2 months agospeedo: Include software versions in the W32 README
Werner Koch [Tue, 7 Nov 2017 08:21:10 +0000 (09:21 +0100)]
speedo: Include software versions in the W32 README

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agopo: Update Japanese translation
NIIBE Yutaka [Tue, 7 Nov 2017 02:16:02 +0000 (11:16 +0900)]
po: Update Japanese translation

2 months agoagent: Use clock or clock_gettime for calibration.
NIIBE Yutaka [Tue, 7 Nov 2017 01:49:36 +0000 (10:49 +0900)]
agent: Use clock or clock_gettime for calibration.

* agent/protect.c (calibrate_get_time): Use clock or clock_gettime.

--

For calibration, clock(3) is better than times(3) among UNIXen.
Tested on NetBSD 7.1 and FreeBSD 11.1, using QEMU.

Thanks to Damien Goutte-Gattat for the information of use of
CLOCKS_PER_SEC;  The old code with times(3) is not 100% correct,
in terms of POSIX.  It should have used sysconf (_SC_CLK_TCK) instead
of CLOCKS_PER_SEC.  CLOCKS_PER_SEC is specifically for clock(3).

GnuPG-bug-id: 3056, 3276, 3472
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 months agotests: Minor imporvement in agent invocation
Werner Koch [Mon, 6 Nov 2017 15:49:07 +0000 (16:49 +0100)]
tests: Minor imporvement in agent invocation

* tests/openpgp/defs.scm (create-gpghome): Add s2k-count.
--

My tests show only 2.5% improvement, but as we have that option now
let's use it.

real    9m12.604s
user    2m20.720s
sys     0m11.452s

real    8m3.815s
user    2m16.700s
sys     0m11.544s

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agoagent: New GETINFO sub-commands "s2k_count_cal" and "s2k_time".
Werner Koch [Mon, 6 Nov 2017 13:20:03 +0000 (14:20 +0100)]
agent: New GETINFO sub-commands "s2k_count_cal" and "s2k_time".

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

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

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

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

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

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

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

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

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agoagent: New option --s2k-count.
Werner Koch [Mon, 6 Nov 2017 12:57:30 +0000 (13:57 +0100)]
agent: New option --s2k-count.

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

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

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agog10: Unattended key generation "Key-Grip" and "Subkey-Grip".
NIIBE Yutaka [Wed, 1 Nov 2017 01:19:35 +0000 (10:19 +0900)]
g10: Unattended key generation "Key-Grip" and "Subkey-Grip".

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

--

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

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

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

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

--

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

This change simplify "factory-reset" as simple.

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

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

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