gnupg.git
3 years agogpg: New import option "import-export".
Werner Koch [Fri, 24 Jun 2016 11:11:37 +0000 (13:11 +0200)]
gpg: New import option "import-export".

* g10/import.c (parse_import_options): Add option "import-export".
(write_keyblock_to_output): New.
(import_one): Implement option.
--

We are now in the import export business.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: New import option "import-show".
Werner Koch [Thu, 23 Jun 2016 17:25:53 +0000 (19:25 +0200)]
gpg: New import option "import-show".

* g10/options.h (IMPORT_SHOW): New.
* g10/import.c (parse_import_options): Add "import-show".
(import_one): Implement that.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Do not print the validity after key generation.
Werner Koch [Thu, 23 Jun 2016 17:22:13 +0000 (19:22 +0200)]
gpg: Do not print the validity after key generation.

* g10/keylist.c (struct keylist_context): Add field NO_VALIDITY.
(list_keyblock_print): Take care of it.
(list_keyblock_direct): Add arg NO_VALIDITY.
* g10/keygen.c (do_generate_keypair): Merge keyblock and print w/o
validity.
--

It will always be ultimate and by not printing it we avoid a lot of
garbage output due to the trustdb re-calculation.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Fix possible small memory leak in b64dec.c.
Werner Koch [Thu, 23 Jun 2016 15:44:55 +0000 (17:44 +0200)]
common: Fix possible small memory leak in b64dec.c.

* common/b64dec.c (b64dec_finish): Always release TITLE.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests/openpgp: Fake the system time for the tofu test.
Justus Winter [Thu, 23 Jun 2016 15:24:23 +0000 (17:24 +0200)]
tests/openpgp: Fake the system time for the tofu test.

The keys in the tofu test are set to expire on 2016-09-17.  Fake the
system time for this test.

This commit includes changes to the old test as well, for those who
need to backport it.

* tests/openpgp/gpg-agent.conf.tmpl: Drop trailing newlines.
* tests/openpgp/tofu.scm: Fake system time.
* tests/openpgp/tofu.test: Likewise.

GnuPG-bug-id: 2393
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Handle exceptions in the transformation monad.
Justus Winter [Thu, 23 Jun 2016 15:18:13 +0000 (17:18 +0200)]
gpgscm: Handle exceptions in the transformation monad.

* tests/gpgscm/tests.scm (pipe:do): Raise errors.
(tr:spawn): Catch and return errors.
(tr:call-with-content): Likewise.
(tr:{open,write-to,pipe-do,assert-identity,assert-weak-identity}):
Adapt.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Improve tests.
Justus Winter [Thu, 23 Jun 2016 15:14:07 +0000 (17:14 +0200)]
tests/openpgp: Improve tests.

* tests/openpgp/multisig.scm: Simplify test.
* tests/openpgp/setup.scm (dearmor): Use pipe.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Add types for special objects.
Justus Winter [Thu, 23 Jun 2016 14:14:10 +0000 (16:14 +0200)]
gpgscm: Add types for special objects.

* tests/gpgscm/scheme.c (enum scheme_types): Add types for boolean,
nil, eof, and the sink object.
(type_to_string): Handle new types.
(scheme_init_custom_alloc): Give special objects a type.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Fix Scheme initialization.
Justus Winter [Thu, 23 Jun 2016 12:10:00 +0000 (14:10 +0200)]
gpgscm: Fix Scheme initialization.

This potentially causes a crash if the garbage collector marks an eof
object.

* tests/gpgscm/scheme.c (scheme_init_custom_alloc): Initialize
'EOF_OBJ'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Fix manual.
Justus Winter [Thu, 23 Jun 2016 11:18:25 +0000 (13:18 +0200)]
gpgscm: Fix manual.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agocommon: Add dedicated private key functions to name-value.c.
Werner Koch [Thu, 23 Jun 2016 11:17:25 +0000 (13:17 +0200)]
common: Add dedicated private key functions to name-value.c.

* common/name-value.c (struct name_value_container): Add field
'private_key_mode'.
(my_error): New.  Use instead of gpg_error.
(nvc_new_private_key): New.
(nve_release): Add arg 'private_key_mode'.
(nvc_release): Call nve_release with private_key_mode flag.
(nvc_delete): Ditto.
(_nvc_add): Do no special case "Key:" in non-private_key_mode.
(nvc_get_private_key): Return error in non-private_key_mode.
(nvc_set_private_key): Ditto.
(nvc_parse):  Factor all code out to ...
(do_nvc_parse): new.  Add arg 'for_private_key'.
(nvc_parse_private_key): New.
* agent/findkey.c (write_extended_private_key): Replace nvc_parse by
nvc_parse_private_key.
(read_key_file): Ditto.

* common/t-name-value.c (private_key_mode): New variable.
(my_nvc_new): New.  Replace all callers.
(test_key_extraction): Take mode in account.
(run_tests): Ditto.
(run_modification_tests): Ditto.
(parse): Ditto.
(main): Add option --parse and rename --parse to --parse-key.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Rename external symbols in name-value.c.
Werner Koch [Thu, 23 Jun 2016 10:12:50 +0000 (12:12 +0200)]
common: Rename external symbols in name-value.c.

* common/name-value.c, common/name-value.h: Rename symbol prefixes
from "pkc_" to "nvc_" and from "pke_" to "nve_".  Change all callers.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Rename private-keys.c to name-value.c
Werner Koch [Thu, 23 Jun 2016 09:55:46 +0000 (11:55 +0200)]
common: Rename private-keys.c to name-value.c

* common/private-keys.c: Rename to name-value.c.
* common/private-keys.h: Rename to name-value.h.  Chage all users.
* common/t-private-keys.c: Rename to t-name-value.c.
* common/Makefile.am: Adjust accordingly.
--

The module is cool enough to be used for other purposes as well.  Thus
we better change the name.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Change license of b64dec.c and b64enc.c to LGPLv2.1+
Werner Koch [Thu, 23 Jun 2016 07:21:45 +0000 (09:21 +0200)]
common: Change license of b64dec.c and b64enc.c to LGPLv2.1+

--

The code as solely been written by employees of g10 Code.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Add PGP armor decoding to b64dec.
Werner Koch [Thu, 23 Jun 2016 07:20:24 +0000 (09:20 +0200)]
common: Add PGP armor decoding to b64dec.

* common/b64dec.c (decoder_states): Add new states.
(b64dec_proc): Handle PGP armored format.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests: Add four more sample messages for the two new keys to the repo.
Werner Koch [Wed, 22 Jun 2016 16:40:35 +0000 (18:40 +0200)]
tests: Add four more sample messages for the two new keys to the repo.

--

These are uncompressed signed messages

3 years agog10: Fix regression of card-edit/fetch.
NIIBE Yutaka [Thu, 23 Jun 2016 03:12:43 +0000 (12:12 +0900)]
g10: Fix regression of card-edit/fetch.

* g10/card-util.c (fetch_url): Call keyserver_fetch instead of
keyserver_import_fprint.

--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agotests: Add a set of sample messages for the two new keys to the repo.
Werner Koch [Wed, 22 Jun 2016 09:21:50 +0000 (11:21 +0200)]
tests: Add a set of sample messages for the two new keys to the repo.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests: Add two more sample keys for OpenPGP.
Werner Koch [Wed, 22 Jun 2016 09:20:35 +0000 (11:20 +0200)]
tests: Add two more sample keys for OpenPGP.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests/migrations: Convert to Scheme and re-enable.
Justus Winter [Tue, 21 Jun 2016 16:10:18 +0000 (18:10 +0200)]
tests/migrations: Convert to Scheme and re-enable.

* configure.ac: Re-enable.
* tests/Makefile.am: Likewise.
* tests/migrations/Makefile.am (TESTS): Use Scheme tests.
* tests/migrations/common.scm: New file.
* tests/migrations/extended-private-key-format.scm: Likewise.
* tests/migrations/from-classic.scm: Likewise.
* tests/migrations/extended-private-key-format.test: Drop file.
* tests/migrations/from-classic.test: Drop file.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Add more file handling functions.
Justus Winter [Tue, 21 Jun 2016 16:12:03 +0000 (18:12 +0200)]
gpgscm: Add more file handling functions.

* tests/gpgscm/ffi.c (do_glob): New function.
(ffi_init): Define new function.
* tests/gpgscm/tests.scm (basename-suffix): New function.x

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/openpgp: Port the remaining tests to Scheme.
Justus Winter [Tue, 21 Jun 2016 11:20:29 +0000 (13:20 +0200)]
tests/openpgp: Port the remaining tests to Scheme.

* tests/openpgp/Makefile.am (TESTS): Add new tests.
* tests/openpgp/defs.scm (gpg-with-colons): New function.
(get-config): Use new function.
* tests/openpgp/export.scm: New file.
* tests/openpgp/tofu.scm: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Improve test framework.
Justus Winter [Tue, 21 Jun 2016 10:21:10 +0000 (12:21 +0200)]
gpgscm: Improve test framework.

* tests/gpgscm/lib.scm (echo): Move...
* tests/gpgscm/tests.scm (echo): ... here.
(info, error, skip): And use echo here.
(file-exists?): New function.
(tr:spawn): Check that source exists and if the sink has been created.
(tr:call-with-content): Hand in optional arguments.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Use native string searching functions.
Justus Winter [Tue, 21 Jun 2016 10:12:56 +0000 (12:12 +0200)]
gpgscm: Use native string searching functions.

* tests/gpgscm/ffi-private.h: Handle character arguments.
* tests/gpgscm/ffi.c (do_string_index): New function.
(do_string_rindex): Likewise.
(do_string_contains): Likewise.
(ffi_init): Define new functions.
* tests/gpgscm/ffi.scm (ffi-define): New macro.
* tests/gpgscm/lib.scm (string-index): Use native function,
demonstrate behavior.
(string-rindex): Likewise.
(string-contains?): Likewise.
Demonstrate behavior of various other functions.
(read-all): Rework so that it can handle large files.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Improve error reporting.
Justus Winter [Tue, 21 Jun 2016 14:09:49 +0000 (16:09 +0200)]
gpgscm: Improve error reporting.

* tests/gpgscm/scheme.c (type_to_string): New function.
(Eval_Cycle): Include actual type in error message.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agogpgscm: Make memory allocation failures fatal.
Justus Winter [Tue, 21 Jun 2016 10:19:07 +0000 (12:19 +0200)]
gpgscm: Make memory allocation failures fatal.

* tests/gpgscm/scheme.c (Eval_Cycle): Exit if we run out of memory.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agosm: Do not install cacert and other root certificates.
Werner Koch [Tue, 21 Jun 2016 07:47:49 +0000 (09:47 +0200)]
sm: Do not install cacert and other root certificates.

* doc/Makefile.am (dist_pkgdata_DATA): Move qualified.txt and
com-certs.pem to ...
(EXTRA_DIST): here.
--

With Let's Encrypt there is no more need to push CA Cert.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Add experimental support for an issuer fpr.
Werner Koch [Mon, 20 Jun 2016 21:58:16 +0000 (23:58 +0200)]
gpg: Add experimental support for an issuer fpr.

* common/openpgpdefs.h (SIGSUBPKT_ISSUER_FPR): New.
* g10/build-packet.c (build_sig_subpkt_from_sig): Add arg PKSK and
insert the issuer fpr if needed.
* g10/sign.c (write_signature_packets): Pass signing key.
(make_keysig_packet): Ditto.
(update_keysig_packet): Ditto.
* g10/parse-packet.c (dump_sig_subpkt): Print issuer fpr.
(parse_one_sig_subpkt): Detect issuer fpr.
(can_handle_critical): Add issuer fpr.
* g10/mainproc.c (check_sig_and_print): Try to get key via fingerprint.
* g10/gpgv.c (keyserver_import_fprint): New stub.
* g10/test-stubs.c (keyserver_import_fprint): New stub.
--

This support is enabled with the --rfc4880bis option and intended to
test to recently proposed issuer fpr.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: New option --rfc4880bis.
Werner Koch [Mon, 20 Jun 2016 20:19:23 +0000 (22:19 +0200)]
gpg: New option --rfc4880bis.

* g10/options.h (struct opt): Add field flags.rfc4880bis.
* g10/gpg.c (oRFC4880bis): new.
(opts): add --rfc4880bis.
(main): Implement that and print a warning.
--

This is option enables experimental features which may be dropped or
changed with the next release.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoscd: Reset nonnull_nad to zero for VENDOR_GEMPC.
Niibe Yutaka [Sun, 19 Jun 2016 02:24:50 +0000 (11:24 +0900)]
scd: Reset nonnull_nad to zero for VENDOR_GEMPC.

* (parse_ccid_descriptor): nonnull_nad = 0 for all GEMPC device.

--

We can't use the driver for 08E6:3438, while it works well under PC/SC
service.  I found that the library of ccid always uses the node
address = ZERO for all transactions.  So, we extend the same handling
for not only GEMPC_CT30, but also for all its devices.

Debian-bug-id: 814584
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agotests: Make make distcheck work again.
Werner Koch [Fri, 17 Jun 2016 19:16:37 +0000 (21:16 +0200)]
tests: Make make distcheck work again.

* Makefile.am (tests): Remove test code which would led to doubling
calls to for e.g. "make distclean".
* tests/Makefile.am: Typo fixes.
* tests/gpgscm/Makefile.am (EXTRA_DIST): Fix name of License file.
Add repl.scm.
(check): Replace by check-local because check is a standard automake
target.
* tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Replace gmake0sim by
automake generated macro.
(EXTRA_DIST): Add defs.scm

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpgscm: Silence compiler warnings.
Werner Koch [Fri, 17 Jun 2016 17:32:49 +0000 (19:32 +0200)]
gpgscm: Silence compiler warnings.

* tests/gpgscm/scheme.c (mk_integer): Rename arg NUM to N.
(fill_vector): Ditto.
(mark): Rename var NUM to N.
(set_slot_in_env): Mark SC as unused.
(is_any): Mark P as unused.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoAdd license notices for TinySCHEME.
Werner Koch [Fri, 17 Jun 2016 16:53:14 +0000 (18:53 +0200)]
Add license notices for TinySCHEME.

* tests/gpgscm/COPYING: Rename to ...
* tests/gpgscm/LICENSE.TinySCHEME: this.
* AUTHORS: Add a note about TinySCHEME.
* build-aux/speedo/w32/pkg-copyright.txt: Add TinySCHEME notice.
--

I renamed the file with the license terms to avoid confusion with the
standard name for the GPL.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agobuild: Ignore two build image files in doc/
Werner Koch [Fri, 17 Jun 2016 06:56:13 +0000 (08:56 +0200)]
build: Ignore two build image files in doc/

--

Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agotests/openpgp: Reimplement tests in Scheme.
Justus Winter [Thu, 7 Jan 2016 16:01:45 +0000 (17:01 +0100)]
tests/openpgp: Reimplement tests in Scheme.

* Makefile.am: Build the test infrastructure on Windows.
* tests/openpgp/Makefile.am (required_pgms): Add gpgscm.
(TESTS_ENVIRONMENT): Make sure gpgscm and the libraries are found.
(TESTS): Replace tests with the new Scheme implementations.
* tests/openpgp/4gb-packet.scm: New file.
* tests/openpgp/README: Likewise.
* tests/openpgp/armdetach.scm: Likewise.
* tests/openpgp/armdetachm.scm: Likewise.
* tests/openpgp/armencrypt.scm: Likewise.
* tests/openpgp/armencryptp.scm: Likewise.
* tests/openpgp/armor.scm: Likewise.
* tests/openpgp/armsignencrypt.scm: Likewise.
* tests/openpgp/armsigs.scm: Likewise.
* tests/openpgp/clearsig.scm: Likewise.
* tests/openpgp/conventional-mdc.scm: Likewise.
* tests/openpgp/conventional.scm: Likewise.
* tests/openpgp/decrypt-dsa.scm: Likewise.
* tests/openpgp/decrypt.scm: Likewise.
* tests/openpgp/default-key.scm: Likewise.
* tests/openpgp/defs.scm: Likewise.
* tests/openpgp/detach.scm: Likewise.
* tests/openpgp/detachm.scm: Likewise.
* tests/openpgp/ecc.scm: Likewise.
* tests/openpgp/encrypt-dsa.scm: Likewise.
* tests/openpgp/encrypt.scm: Likewise.
* tests/openpgp/encryptp.scm: Likewise.
* tests/openpgp/finish.scm: Likewise.
* tests/openpgp/genkey1024.scm: Likewise.
* tests/openpgp/gpgtar.scm: Likewise.
* tests/openpgp/import.scm: Likewise.
* tests/openpgp/mds.scm: Likewise.
* tests/openpgp/multisig.scm: Likewise.
* tests/openpgp/run-tests.scm: Likewise.
* tests/openpgp/seat.scm: Likewise.
* tests/openpgp/setup.scm: Likewise.
* tests/openpgp/signencrypt-dsa.scm: Likewise.
* tests/openpgp/signencrypt.scm: Likewise.
* tests/openpgp/sigs-dsa.scm: Likewise.
* tests/openpgp/sigs.scm: Likewise.
* tests/openpgp/use-exact-key.scm: Likewise.
* tests/openpgp/verify.scm: Likewise.
* tests/openpgp/version.scm: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Add a TinySCHEME-based test driver.
Justus Winter [Wed, 6 Jan 2016 10:55:25 +0000 (11:55 +0100)]
tests/gpgscm: Add a TinySCHEME-based test driver.

* configure.ac: Add new component.
* tests/Makefile.am: Likewise.
* tests/gpgscm/Makefile.am: New file.
* tests/gpgscm/ffi-private.h: Likewise.
* tests/gpgscm/ffi.c: Likewise.
* tests/gpgscm/ffi.h: Likewise.
* tests/gpgscm/ffi.scm: Likewise.
* tests/gpgscm/lib.scm: Likewise.
* tests/gpgscm/main.c: Likewise.
* tests/gpgscm/private.h: Likewise.
* tests/gpgscm/repl.scm: Likewise.
* tests/gpgscm/scheme-config.h: Likewise.
* tests/gpgscm/t-child.c: Likewise.
* tests/gpgscm/t-child.scm: Likewise.
* tests/gpgscm/tests.scm: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Foreign objects support for TinySCHEME.
Justus Winter [Thu, 31 Mar 2016 11:49:56 +0000 (13:49 +0200)]
tests/gpgscm: Foreign objects support for TinySCHEME.

* tests/gpgscm/scheme-private.h (struct cell): Add 'foreign_object'.
(is_foreign_object): New prototype.
(get_foreign_object_{vtable,data}): Likewise.
* tests/gpgscm/scheme.c (enum scheme_types): New type.
(is_foreign_object): New function.
(get_foreign_object_{vtable,data}): Likewise.
(mk_foreign_object): Likewise.
(finalize_cell): Free foreign objects.
(atom2str): Pretty-print foreign objects.
(vtbl): Add new functions.
* tests/gpgscm/scheme.h (struct foreign_object_vtable): New type.
(mk_foreign_object): New prototype.
(struct scheme_interface): Add new functions.

Patch from Thomas Munro,
https://sourceforge.net/p/tinyscheme/patches/13/

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Dynamically allocate string buffer.
Justus Winter [Thu, 31 Mar 2016 11:33:03 +0000 (13:33 +0200)]
tests/gpgscm: Dynamically allocate string buffer.

* tests/gpgscm/scheme-config.h (strbuff{,_size}): Make buffer dynamic.
* tests/gpgscm/scheme.c (expand_strbuff): New function.
(putcharacter): Adapt length test.
(readstrexp): Expand buffer if necessary.
(scheme_init_custom_alloc): Initialize buffer.
(scheme_deinit): Free buffer.

Patch from Thomas Munro,
https://sourceforge.net/p/tinyscheme/patches/11/

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Make exception value available.
Justus Winter [Mon, 22 Feb 2016 15:36:12 +0000 (16:36 +0100)]
tests/gpgscm: Make exception value available.

* tests/gpgscm/init.scm (throw): Hand exception value to the handler.
(catch): And bind it to *error*.

3 years agotests/gpgscm: Add package macro.
Justus Winter [Thu, 28 Jan 2016 17:19:07 +0000 (18:19 +0100)]
tests/gpgscm: Add package macro.

* tests/gpgscm/init.scm: Add package macro from manual.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Expose function to open streams as Scheme ports.
Justus Winter [Fri, 22 Jan 2016 10:15:20 +0000 (11:15 +0100)]
tests/gpgscm: Expose function to open streams as Scheme ports.

* tests/gpgscm/scheme.c (vtbl): Add 'port_from_file' to the vtable.
* tests/gpgscm/scheme.h (struct scheme_interface): New field
'mk_port_from_file'.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Nicer error message.
Justus Winter [Fri, 22 Jan 2016 10:13:14 +0000 (11:13 +0100)]
tests/gpgscm: Nicer error message.

* tests/gpgscm/scheme.c (opexe_0): Include the value that we tried to
evaluate as function-like in the error message.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Fix error hook.
Justus Winter [Thu, 7 Jan 2016 15:53:06 +0000 (16:53 +0100)]
tests/gpgscm: Fix error hook.

* tests/gpgscm/init.scm (*error-hook*): Fix error hook so that the
whole error message is displayed.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Handle unhandled enumeration values.
Justus Winter [Thu, 7 Jan 2016 13:07:20 +0000 (14:07 +0100)]
tests/gpgscm: Handle unhandled enumeration values.

* tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration
values in the opcode dispatching code.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agotests/gpgscm: Verbatim import of latest TinySCHEME.
Justus Winter [Wed, 6 Jan 2016 10:54:03 +0000 (11:54 +0100)]
tests/gpgscm: Verbatim import of latest TinySCHEME.

Revision 110 from svn://svn.code.sf.net/p/tinyscheme/code/trunk

* tests/gpgscm/COPYING: New file.
* tests/gpgscm/Manual.txt: Likewise.
* tests/gpgscm/init.scm: Likewise.
* tests/gpgscm/opdefines.h: Likewise.
* tests/gpgscm/scheme-private.h: Likewise.
* tests/gpgscm/scheme.c: Likewise.
* tests/gpgscm/scheme.h: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoscd: Make option --homedir work.
Werner Koch [Fri, 17 Jun 2016 06:36:07 +0000 (08:36 +0200)]
scd: Make option --homedir work.

* scd/scdaemon.c (opts): Add --homedir.
--

Without that entry the homedir setting won't work.

GnuPG-bug-id: 2386
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Add more strong hints towards --with-colons.
Werner Koch [Thu, 16 Jun 2016 17:53:14 +0000 (19:53 +0200)]
doc: Add more strong hints towards --with-colons.

--

3 years agospeedo: New target w32-release-offline
Werner Koch [Thu, 16 Jun 2016 17:12:00 +0000 (19:12 +0200)]
speedo: New target w32-release-offline

--

As long as a current swdb.lst is available and all directories below
~/b carry the appropriate tarballs this target can be used to build a
w32-installer w/0 any network access.

3 years agoMerge branch 'master' of git+ssh://playfair.gnupg.org/git/gnupg
Werner Koch [Thu, 16 Jun 2016 16:44:05 +0000 (18:44 +0200)]
Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gnupg

3 years agoPost release updates
Werner Koch [Thu, 16 Jun 2016 16:10:08 +0000 (18:10 +0200)]
Post release updates

--

3 years agoRelease 2.1.13 gnupg-2.1.13
Werner Koch [Thu, 16 Jun 2016 15:21:01 +0000 (17:21 +0200)]
Release 2.1.13

3 years agopo: Auto-update
Werner Koch [Thu, 16 Jun 2016 15:19:42 +0000 (17:19 +0200)]
po: Auto-update

--

3 years agopo: Update Ukrainian translation
Yuri Chornoivan [Tue, 10 May 2016 15:23:04 +0000 (18:23 +0300)]
po: Update Ukrainian translation

3 years agopo: Update Russian translation.
Ineiev [Sun, 8 May 2016 08:07:50 +0000 (08:07 +0000)]
po: Update Russian translation.

3 years agopo: Update German translation
Werner Koch [Thu, 16 Jun 2016 15:05:40 +0000 (17:05 +0200)]
po: Update German translation

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agospeedo,w32: Take gpg-preset-passphrase from libexec.
Werner Koch [Thu, 16 Jun 2016 14:59:15 +0000 (16:59 +0200)]
speedo,w32: Take gpg-preset-passphrase from libexec.

--

3 years agoAdd missing files so that make distcheck works again,
Werner Koch [Thu, 16 Jun 2016 14:56:42 +0000 (16:56 +0200)]
Add missing files so that make distcheck works again,

* tests/openpgp/Makefile.am (CLEANFILES): Add created file
"passphrases".
* tools/Makefile.am (EXTRA_DIST): Add no-libgcrypt.c.
--

dirmngr/Makefile uses a copy no-libgcrypt.c from tools/.  tools/ does
not anymore require no-libgcrypt.c but we keep it there in case we
eventually make use of it again.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotools: Fix typo in function name of symcryptrun.
Werner Koch [Thu, 16 Jun 2016 09:23:59 +0000 (11:23 +0200)]
tools: Fix typo in function name of symcryptrun.

* tools/symcryptrun.c (main): Fix typo.
--

Fixes-commit: 36550dde998fa1d497098050ca2d4e1a952ed6b6
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog10: Fix another race condition for trustdb access.
Niibe Yutaka [Tue, 14 Jun 2016 23:41:56 +0000 (08:41 +0900)]
g10: Fix another race condition for trustdb access.

* g10/tdbio.c (create_version_record): Call create_hashtable to always
make hashtable, together with the version record.
(get_trusthashrec): Remove call to create_hashtable.

--

GnuPG-bug-id: 1675
Thanks to Scott Moser for a reproducible script and patience.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agogpg: Print the subkey's curve and not the primary key curve.
Werner Koch [Tue, 14 Jun 2016 21:15:32 +0000 (23:15 +0200)]
gpg: Print the subkey's curve and not the primary key curve.

* g10/keylist.c (list_keyblock_colon): Use PK2 for the subkey's curve.
--

Reported-by: mantorix at vollbio punkt de
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoldap: Improve info output for v3 fallback
Werner Koch [Tue, 14 Jun 2016 18:51:22 +0000 (20:51 +0200)]
ldap: Improve info output for v3 fallback

* dirmngr/dirmngr_ldap.c (fetch_ldap): Do not use log_debug in an
unprotected section.  Replace log_debug by log_info in verbose mode.
--

GnuPG-bug-id: 2376

3 years agodirmngr: Try ldap protocol V3 as fallback
Andre Heinecke [Tue, 14 Jun 2016 17:22:52 +0000 (19:22 +0200)]
dirmngr: Try ldap protocol V3 as fallback

* dirmngr/dirmngr_ldap.c (fetch_ldap): Try V3 Protocol in case
default Protocol gives error.

--
Servers may have blocked V2 Protocol, in which case the
bind will result in a Protocol Error. In that case we try
again with v3 Protocol if the ldap libarary used to compile
dirmngr supports V3.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
3 years agodirmngr: Print ldap error if bind fails
Andre Heinecke [Tue, 14 Jun 2016 17:20:31 +0000 (19:20 +0200)]
dirmngr: Print ldap error if bind fails

* dirmngr/dirmngr_ldap.c (fetch_ldap): Use ldap_err2string on bind
return.

--
ldap_simple_bind_s does not set errno.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
3 years agogpgsm: Allow ciphers AES192 and SERPENT256
Werner Koch [Tue, 14 Jun 2016 13:57:57 +0000 (15:57 +0200)]
gpgsm: Allow ciphers AES192 and SERPENT256

* sm/gpgsm.c (main): Add AES192 cipher.  Allow SERPENT256.
--

Note that currently released Libcgrypt versions miss OIDs for Serpent
and thus Serpent can only be used with tye forthcoming Libgcrypt
1.7.1.

GnuPG-bug-id: 2273
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Add files and envvars to a new index.
Werner Koch [Tue, 14 Jun 2016 12:57:49 +0000 (14:57 +0200)]
doc: Add files and envvars to a new index.

* doc/gnupg.texi: Define new index "ef".
(Environment Index): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Avoid endless loop in a tofu error case.
Werner Koch [Tue, 14 Jun 2016 10:04:01 +0000 (12:04 +0200)]
gpg: Avoid endless loop in a tofu error case.

* g10/tofu.c (get_trust): Do not jump to out.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Split tofu's get_trust function into several smaller ones.
Werner Koch [Tue, 14 Jun 2016 10:02:22 +0000 (12:02 +0200)]
gpg: Split tofu's get_trust function into several smaller ones.

* g10/tofu.c (get_trust): Factor code out to ...
(format_conflict_msg_part1): new and to ...
(ask_about_binding): new.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Consistently use 'keyserver'.
Werner Koch [Tue, 14 Jun 2016 07:06:44 +0000 (09:06 +0200)]
doc: Consistently use 'keyserver'.

--
GnuPG-bug-id: 2383

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agospeedo,w32: Add gpg-preset-passphrase also to the uninstaller.
Werner Koch [Mon, 13 Jun 2016 09:34:16 +0000 (11:34 +0200)]
speedo,w32: Add gpg-preset-passphrase also to the uninstaller.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Un-deprecate option --auto-key-retrieve.
Werner Koch [Mon, 13 Jun 2016 09:32:38 +0000 (11:32 +0200)]
gpg: Un-deprecate option --auto-key-retrieve.

* g10/gpg.c (main): Remove deprecation warning.
--

Most options for the keyserver have been moved to dirmngr and thus it
does not make sense to favor "--keyserver-options auto-key-retrieve"
over the direct options --auto-key-retrieve and --no-auto-key-retrieve.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: New option --disable-signer-uid, create Signer's UID sub-packet.
Werner Koch [Mon, 13 Jun 2016 09:24:09 +0000 (11:24 +0200)]
gpg: New option --disable-signer-uid, create Signer's UID sub-packet.

* g10/gpg.c (oDisableSignerUID): New.
(opts): New option '--disable-signer-uid'.
(main): Set option.
* g10/options.h (opt): Add field flags.disable_signer_uid.
* g10/sign.c: Include mbox-util.h.
(mk_notation_policy_etc): Embed the signer's uid.
* g10/mainproc.c (check_sig_and_print): Do not use WKD for auto key
retrieval if --disable-signer-uid is used.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Try Signer's User ID sub-packet with --auto-key-retrieve.
Werner Koch [Mon, 13 Jun 2016 08:40:34 +0000 (10:40 +0200)]
gpg: Try Signer's User ID sub-packet with --auto-key-retrieve.

* g10/packet.h (PKT_signature): Add field 'signers_uid'.
* g10/parse-packet.c (parse_signature): Set this field.
* g10/free-packet.c (free_seckey_enc): Free field.
(copy_signature): Copy field.
* g10/mainproc.c (akl_has_wkd_method): New.
(check_sig_and_print): Extend NEWSIG status.  If WKD is enabled try to
locate a missing key via the signature's Signer's User ID sub-packet.
Do this right before trying a keyserver lookup.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg,indent: Re-indent and chnage var names in sign.c
Werner Koch [Mon, 13 Jun 2016 07:37:53 +0000 (09:37 +0200)]
gpg,indent: Re-indent and chnage var names in sign.c

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Fix bad printf format in t-stringhelp.c
Werner Koch [Sun, 12 Jun 2016 11:43:55 +0000 (13:43 +0200)]
common: Fix bad printf format in t-stringhelp.c

--

3 years agogpg: Remove C-99ism, re-indent, and simplify one function.
Werner Koch [Sat, 11 Jun 2016 18:42:28 +0000 (20:42 +0200)]
gpg: Remove C-99ism, re-indent, and simplify one function.

* g10/call-agent.c (struct keyinfo_data): Rename to
keyinfo_data_parm_s.
(agent_get_keyinfo): Replace C-99 style init.
(keyinfo_status_cb): Use new fucntion split_fields.
* g10/export.c (match_curve_skey_pk): Add missings returns error
cases.
(cleartext_secret_key_to_openpgp): Better clear PK->PKEY first.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: New function split_fields.
Werner Koch [Sat, 11 Jun 2016 10:09:48 +0000 (12:09 +0200)]
common: New function split_fields.

* common/stringhelp.c (split_fields): New.
* common/t-stringhelp.c: Include assert.h.
(test_split_fields): New.
(main): Call test.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agog10: Export cleartext keys as cleartext
Daniel Kahn Gillmor [Fri, 10 Jun 2016 20:15:36 +0000 (16:15 -0400)]
g10: Export cleartext keys as cleartext

* g10/export.c (do_export_stream): If a key is stored by the agent in
cleartext, then try to export it as cleartext.
* tests/openpgp/export.test: For secret keys that are stored in
cleartext, test should try to export without pinentry interaction.
--

This restores the behavior of GnuPG 2.0 and 1.4 when exporting
passphraseless secret keys, and fixes the test suite accordingly.

GnuPG-bug-id: 2070, 2324
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agog10: Allow receiving cleartext secret keys from agent
Daniel Kahn Gillmor [Fri, 10 Jun 2016 20:15:35 +0000 (16:15 -0400)]
g10: Allow receiving cleartext secret keys from agent

* g10/export.c (match_curve_skey_pk): New function, testing whether an
OpenPGP public key and an S-expression use the same curve.
* g10/export.c (cleartext_secret_key_to_openpgp): New function,
filling in the secret key parameters of a PKT_public_key object from
a corresponding cleartext S-expression.
* g10/export.c, g10/main.h (receive_seckey_from_agent): Add cleartext
parameter, enabling retrieval of the secret key, unlocked.
* g10/export.c (do_export_stream): Send cleartext as 0, keeping current
behavior.
* g10/keygen.c (card_store_key_with_backup): Use cleartext=0 to ensure
that smartcard backups are all passphrase-locked.
--

This sets up internal functionality to be capable of exporting
cleartext secret keys, but does not change any existing behavior.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agog10: Add openpgp_protected flag to agent secret key export functions
Daniel Kahn Gillmor [Fri, 10 Jun 2016 20:15:34 +0000 (16:15 -0400)]
g10: Add openpgp_protected flag to agent secret key export functions

* g10/call-agent.c, g10/call-agent.h (agent_export_key): Add
openpgp_protected flag.
* g10/export.c (receive_seckey_from_agent): Request openpgp_protected
secret keys from agent.
* agent/command.c (hlp_export_key): EXPORT_KEY help text: add a
brief description of the effect of --openpgp.
--

The --openpgp flag for gpg-agent's EXPORT_KEY actually forces
encryption in a certain (RFC 4880-compatible format).  This changeset
exposes that functionality in internal functions, and clarifies
functionality in the agent's help text.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agog10: report whether key in agent is passphrase-protected or not
Daniel Kahn Gillmor [Fri, 10 Jun 2016 20:15:33 +0000 (16:15 -0400)]
g10: report whether key in agent is passphrase-protected or not

* g10/call-agent.c, g10/call-agent.h (agent_get_keyinfo): add
  r_cleartext parameter to report whether a key is stored without
  passphrase protection.
* g10/gpgv.c, g10/test-stubs.c: augment dummy agent_get_keyinfo to
  match new API.
* g10/export.c, g10/keyedit.c, g10/keygen.c, g10/keylist.c,
  g10/sign.c: pass NULL to agent_get_keyinfo since we do not yet
  need to know whether agent is passphrase-protected.

--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3 years agospeedo,w32: Distribute gpg-preset-passphrase.
Werner Koch [Sat, 11 Jun 2016 09:08:30 +0000 (11:08 +0200)]
speedo,w32: Distribute gpg-preset-passphrase.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoExplicitly restrict socket permissions.
Werner Koch [Wed, 8 Jun 2016 14:18:02 +0000 (16:18 +0200)]
Explicitly restrict socket permissions.

* agent/gpg-agent.c (create_server_socket): Call chmod before listen.
* scd/scdaemon.c (create_server_socket): Ditto.
* dirmngr/dirmngr.c (main): Ditto.
--

This is just in case of a improperly set umask.  Note that a connect
requires a write permissions.

3 years agow32: Fix recent build regression.
Werner Koch [Wed, 8 Jun 2016 13:14:06 +0000 (15:14 +0200)]
w32: Fix recent build regression.

* common/homedir.c (_gnupg_socketdir_internal) [W32]: Add definition
for NAME.
* g10/gpg.c (main) [W32]:  Fix use og gnupg_homedir.

* agent/gpg-agent.c (remove_socket): Remove unused var P.
* scd/scdaemon.c (cleanup): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpgconf: New commands --create-socketdir and --remove-socketdir.
Werner Koch [Wed, 8 Jun 2016 12:04:47 +0000 (14:04 +0200)]
gpgconf: New commands --create-socketdir and --remove-socketdir.

* tools/gpgconf.c: Include unistd.h.
(aCreateSocketDir, aRemoveSocketDir): New.
(opts): Add --create-socketdir and --remove-socketdir.
(main): Implement them.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoImplement /run/user/UID/gnupg based sockets.
Werner Koch [Wed, 8 Jun 2016 08:12:32 +0000 (10:12 +0200)]
Implement /run/user/UID/gnupg based sockets.

* common/homedir.c: Include sys/stat.h and zb32.h.
(w32_portable_app, w32_bin_is_bin): Change type from int to byte.
(non_default_homedir): New.
(is_gnupg_default_homedir): New.
(default_homedir): Set non_default_homedir.
(gnupg_set_homedir): Set non_default_homedir and make
the_gnupg_homedir and absolute directory name.
(gnupg_homedir): Return an absolute directory name.
(_gnupg_socketdir_internal): New.
(gnupg_socketdir): Implement /run/user/ based sockets.
* tools/gpg-connect-agent.c (get_var_ext): Replace now obsolete
make_filename by xstrdup.
* tools/gpgconf.c (main): Sue gnupg_homedir for the "homedir:" output.
--

If a [/var]/run/user/$(id -u)/ directory exists, a gnupg subdir is
created as needed and the permissions of the directories are checked.
If that all matches that directory name is returned instead of the
homedir.

To cope with non standard homedirs (via GNUPGHOME or --homedir) the
SHA-1 hash of the homedir is computed, left truncated to 120 bits,
zBase-32 encoded, prefixed with "d.", and appended to
"[/var]/run/user/$(id -u)/gnupg/".  If that directory exists and has
proper permissions it is returned as socket dir - if not the homedir
is used.  Due to cleanup issues, this directory will not be
auto-created but needs to be created by the user in advance.

The required permissions are: directory owned by the user, group and
others bits not set.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpgconf: Add option --homedir
Werner Koch [Wed, 8 Jun 2016 07:54:09 +0000 (09:54 +0200)]
gpgconf: Add option --homedir

* tools/gpgconf.c (opts): Add --homedir.
(main): Set homedir.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoDo not use no-libgcrypt dummy for tools
Werner Koch [Wed, 8 Jun 2016 07:17:49 +0000 (09:17 +0200)]
Do not use no-libgcrypt dummy for tools

* tools/Makefile.am (gpgconf_SOURCES): Remove no-libgcrypt.c.
(gpgconf_LDADD): Add LIBGCRYPT_LIBS.
(gpg_connect_agent_LDADD): Ditto.
(gpgtar_LDADD): Ditto.
* dirmngr/Makefile.am (dirmngr_client_LDADD): Ditto.
(t_common_ldadd): Ditto.  Remove no-libgcrypt.o.
--

We need this change so that a future code in common/ can use Libgcrypt
functions; in particular hashing.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoDo not try to remove the enclosing directory of sockets.
Werner Koch [Wed, 8 Jun 2016 07:04:29 +0000 (09:04 +0200)]
Do not try to remove the enclosing directory of sockets.

* agent/gpg-agent.c (remove_socket): Do not remove the enclosing
directory.
* scd/scdaemon.c (cleanup): Ditto.

--

The socket directory is now below /run or at ~/.gnupg.  Thus we should
not try to remove the directory of the socket.  The auto-removal was
introduced at a time we used a temporary directory for the sockets.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: New function gnupg_socketdir.
Werner Koch [Tue, 7 Jun 2016 11:48:46 +0000 (13:48 +0200)]
common: New function gnupg_socketdir.

* common/homedir.c (gnupg_socketdir): New.
* agent/gpg-agent.c (create_socket_name): Use new function instead of
gnupg_homedir.
(check_own_socket): Ditto.
(check_for_running_agent): Ditto.
* agent/preset-passphrase.c (main): Ditto.
* common/asshelp.c (start_new_gpg_agent): Ditto.
* scd/scdaemon.c (create_socket_name): Ditto.
* tools/gpgconf.c (main): Ditto.
* tools/symcryptrun.c (main): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocommon: Remove homedir arg from start_new_{dirmngr,gpg_agent}.
Werner Koch [Tue, 7 Jun 2016 11:09:00 +0000 (13:09 +0200)]
common: Remove homedir arg from start_new_{dirmngr,gpg_agent}.

* common/asshelp.c (start_new_gpg_agent): Remove arg 'homedir' in
favor of gnupg_homedir ().  Change all callers.
(start_new_dirmngr): Ditto.
* common/get-passphrase.c (gnupg_prepare_get_passphrase): Remove arg
'homedir'.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoReplace use of opt.homedir by accessor functions.
Werner Koch [Tue, 7 Jun 2016 08:59:46 +0000 (10:59 +0200)]
Replace use of opt.homedir by accessor functions.

* common/homedir.c (the_gnupg_homedir): New var.
(gnupg_set_homedir): New.
(gnupg_homedir): New.
* g10/options.h (struct opt): Remove 'homedir' and replace all users
by the new accessor functions.
* g13/g13-common.h (struct opt): Ditto.
* scd/scdaemon.h (struct opt): Ditto.
* sm/gpgsm.h (struct opt): Ditto.
* dirmngr/dirmngr.h (struct opt): Ditto.
* agent/preset-passphrase.c (opt_homedir): Ditto.
* agent/protect-tool.c (opt_homedir): Ditto.
--

This will make detection of a non-default homedir easier.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agopo: Update Japanese translation.
NIIBE Yutaka [Tue, 7 Jun 2016 05:27:41 +0000 (14:27 +0900)]
po: Update Japanese translation.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agogpg: Fix command line parsing of --quick-addkey and --quick-gen-key.
NIIBE Yutaka [Tue, 7 Jun 2016 05:16:32 +0000 (14:16 +0900)]
gpg: Fix command line parsing of --quick-addkey and --quick-gen-key.

* g10/gpg.c (main): Compose a block by curly braces.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 years agogpg: Use --keyid-format=none by default.
Werner Koch [Mon, 6 Jun 2016 15:03:47 +0000 (17:03 +0200)]
gpg: Use --keyid-format=none by default.

* g10/gpg.c (main): Init keyid_format to KF_NONE.
* g10/keyid.c (format_keyid): Ditto.
(keystrlen): Ditto.
--

GnuPG-bug-id: 2379
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Add option --with-subkey-fingerprint.
Werner Koch [Mon, 6 Jun 2016 14:55:03 +0000 (16:55 +0200)]
gpg: Add option --with-subkey-fingerprint.

* g10/gpg.c (oWithSubkeyFingerprint): New.
(opts): Add --with-subkey-fingerprint[s].
(main): Set that option.
* g10/options.h (struct opt): Add 'with_subkey_fingerprint'.
* g10/keylist.c (list_keyblock_print): Print subkey fingerprint.
(print_fingerprint): Tweak printing to use compact format if
desirable.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Implement --keyid-format=none.
Werner Koch [Mon, 6 Jun 2016 14:00:50 +0000 (16:00 +0200)]
gpg: Implement --keyid-format=none.

* g10/gpg.c (main): Add option "none" to --keyid-format.
* g10/options.h (KF_NONE): New.
* g10/keyid.c (format_keyid): Implement that.
(keystr): Use format "long" is KF_NONE is in use.
(keystr_with_sub): Ditto.
* g10/keylist.c (list_keyblock_print): Adjust indentaion for KF_NONE.
Factor some code out to ...
(print_key_line): new.
(print_fingerprint): Add mode 20.
* g10/mainproc.c (list_node): Use print_key_line.  Replace MAINKEY by
flags.primary in the PK.  Fix putting a " revoked..." string into the
colons format.
* g10/pkclist.c (do_edit_ownertrust): Use print_key_line.  This
slightly changes the putput format.
* g10/revoke.c (gen_standard_revoke): Use print_key_line.  This may
also put "expires: " into the output.
--

Due to user experience problems with the keyid and we better allow to
show the fingerprint instead.  Note that we do not support v3 keys
anymore and thus there is no technical need for a user to know the
keyid.

GnuPG-bug-id: 2379
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoindent: Wrap strings in debug messages.
Werner Koch [Mon, 6 Jun 2016 10:24:53 +0000 (12:24 +0200)]
indent: Wrap strings in debug messages.

--

3 years agow32: Require --enable-build-timestamp for the BUILD_HOSTNAME.
Werner Koch [Sat, 4 Jun 2016 16:45:37 +0000 (18:45 +0200)]
w32: Require --enable-build-timestamp for the BUILD_HOSTNAME.

* configure.ac (BUILD_HOSTNAME): Set to "<anon>" bey default.
* build-aux/speedo.mk (speedo_pkg_gnupg_configure): Add
  --enable-build-timestamp.
--

Debian-bug-id: 826309
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Add the fingerprint to KEY_CREATED for subkeys.
Werner Koch [Thu, 2 Jun 2016 20:01:51 +0000 (22:01 +0200)]
gpg: Add the fingerprint to KEY_CREATED for subkeys.

* g10/keygen.c (print_status_key_created): Make more robust by
allowing a NULL for PK.
(generate_subkeypair): Use print_status_key_created.
(generate_card_subkeypair): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agogpg: Try to use the passphrase from the primary for --quick-addkey.
Werner Koch [Thu, 2 Jun 2016 19:21:08 +0000 (21:21 +0200)]
gpg: Try to use the passphrase from the primary for --quick-addkey.

* agent/command.c (cmd_genkey): Add option --passwd-nonce.
(cmd_passwd): Return a PASSWD_NONCE in verify mode.
* g10/call-agent.c (agent_genkey): Add arg 'passwd_nonce_addr' and do
not send a RESET if given.
(agent_passwd): Add arg 'verify'.
* g10/keygen.c (common_gen): Add optional arg 'passwd_nonce_addr'.
(gen_elg, gen_dsa, gen_ecc, gen_rsa, do_create): Ditto.
(generate_subkeypair): Use sepeare hexgrip var for the to be created
for hexgrip feature.  Verify primary key first.  Make use of the
passwd nonce.  Allow for a static passphrase.

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