gnupg.git
2 years agog10: Fix memory leak.
Justus Winter [Thu, 30 Jun 2016 11:41:10 +0000 (13:41 +0200)]
g10: Fix memory leak.

* g10/mainproc.c (release_list): Do not exit early if list is NULL,
there are other resources that must be released.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agogpgscm: Fix reallocating string ports.
Justus Winter [Thu, 30 Jun 2016 10:45:15 +0000 (12:45 +0200)]
gpgscm: Fix reallocating string ports.

* tests/gpgscm/scheme.c (realloc_port_string): Use memcpy because
Scheme strings may contain 0s.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agogpgscm: Free memory backing string ports.
Justus Winter [Thu, 30 Jun 2016 10:35:27 +0000 (12:35 +0200)]
gpgscm: Free memory backing string ports.

* tests/gpgscm/scheme.c (finalize_cell): Free memory backing string
ports.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agogpgscm: Use the allocator from libgcrypt.
Justus Winter [Thu, 30 Jun 2016 09:46:38 +0000 (11:46 +0200)]
gpgscm: Use the allocator from libgcrypt.

* tests/gpgscm/main.c (main): Use the allocator from libgcrypt.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agow32: Fix build.
Justus Winter [Thu, 30 Jun 2016 13:28:42 +0000 (15:28 +0200)]
w32: Fix build.

* g10/keyedit.c (keyedit_quick_revuid): Fix call to
'check_trustdb_stale'.

Fixes-commit: 55d112ee
Signed-off-by: Justus Winter <justus@g10code.com>
2 years agog10: Implement gpg --quick-revuid
Daniel Kahn Gillmor [Thu, 16 Jun 2016 22:05:57 +0000 (18:05 -0400)]
g10: Implement gpg --quick-revuid

* g10/revoke.c (get_default_uid_revocation_reason): New.
* g10/keyedit.c (menu_revuid): Break out creation of uid revocation
into new function core_revuid.
* g10/keyedit.c (keyedit_quick_revuid): New. Selects key and
uid, invokes core_revuid.
* g10/gpg.c (main): Handle --quick-revuid argument.
* doc/gpg.texi: Document --quick-revuid.

--

This functionality is a counterpart to --quick-adduid, and will be
useful for projects that depend programmatically on gpg to revoke user
IDs (one such example is "monkeysphere-host revoke-servicename").

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
- Minor re-indentation work.
- Changed a "0 == memcmp" to "!memcmp"
- Removed tests/openpgp/quick-key-manipulation.test from the
  Makefile.  This test needs to be converted to gpgscm.
- Removed example from whats-new-in-2.1.txt because that is generated.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agotools: Add gpg-wks-client and gpg-wks-server.
Werner Koch [Wed, 29 Jun 2016 10:00:22 +0000 (12:00 +0200)]
tools: Add gpg-wks-client and gpg-wks-server.

* configure.ac: Add option --enable-wks-tools
* tools/gpg-wks-client.c: New.
* tools/gpg-wks-server.c: New.
* tools/gpg-wks.h: new.
* tools/wks-receive.c: New.
* tools/call-dirmngr.c, tools/call-dirmngr.h: New.
--

Note that this is just a starting point and not a finished
implementation.  Here is how to test the system using
foo@test.gnupg.org as example.

Prepare:

  mkdir /var/lib/gnupg/wks
  chmod o-rwx /var/lib/gnupg/wks
  mkdir /var/lib/gnupg/wks/test.gnupg.org

Run the protocol:

  ./gpg-wks-client -v  --send FPR USERID >x
  ./gpg-wks-server -v --receive  <x >y
  ./gpg-wks-client --receive <y >z
  ./gpg-wks-server -v --receive  <z

You should also setup a cron job to rsync
/var/lib/gnupg/wks/test.gnupg.org/hu/* to the webserver.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agobuild: Improve GNUPG_BUILD_PROGRAM macro.
Werner Koch [Wed, 29 Jun 2016 09:39:49 +0000 (11:39 +0200)]
build: Improve GNUPG_BUILD_PROGRAM macro.

* acinclude.m4 (GNUPG_BUILD_PROGRAM): Allow for dash in options.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agotools: Add modules for MIME parsing and creating.
Werner Koch [Wed, 29 Jun 2016 09:02:36 +0000 (11:02 +0200)]
tools: Add modules for MIME parsing and creating.

* tools/mime-maker.c: New.
* tools/mime-maker.h: New.
* tools/mime-parser.c: New.
* tools/mime-parser.h: New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpgscm: Fix memory leaks.
Justus Winter [Tue, 28 Jun 2016 16:13:40 +0000 (18:13 +0200)]
gpgscm: Fix memory leaks.

* tests/gpgscm/ffi-private.h (ffi_schemify_name): Fix prototype.
(ffi_define_function_name): Free schemified name.
(ffi_define_function): Likewise.
(ffi_define_constant): Likewise.
(ffi_define_variable_pointer): Likewise.
* tests/gpgscm/ffi.c (do_wait_processes): Free arrays.
(ffi_schemify_name): Fix type.
* tests/gpgscm/main.c (main): Free 'sc'.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agogpgscm: Free file names.
Justus Winter [Tue, 28 Jun 2016 16:10:01 +0000 (18:10 +0200)]
gpgscm: Free file names.

* tests/gpgscm/scheme.c (scheme_load_named_file): Free file name.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agogpgscm: Fix buffer overflow.
Justus Winter [Tue, 28 Jun 2016 16:08:01 +0000 (18:08 +0200)]
gpgscm: Fix buffer overflow.

* tests/gpgscm/scheme.c (store_string): Avoid writing past allocated
buffer.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agog10: Fix memory leaks.
Justus Winter [Tue, 28 Jun 2016 16:02:10 +0000 (18:02 +0200)]
g10: Fix memory leaks.

* g10/keydb.c (keydb_get_keyblock): Free 'sigstatus' and 'iobuf'.
* g10/t-keydb-get-keyblock.c: Fix trivial memory leaks.
* g10/t-keydb.c: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agocommon: Fix memory leaks.
Justus Winter [Tue, 28 Jun 2016 15:59:17 +0000 (17:59 +0200)]
common: Fix memory leaks.

* common/ccparray.c (ccparray_put): Free old array.
* common/stringhelp.c (do_make_filename): Free 'home'.
* common/t-convert.c: Fix trivial memory leaks.
* common/t-iobuf.c: Likewise.
* common/t-mbox-util.c: Likewise.
* common/t-name-value.c: Likewise.
* common/t-stringhelp.c: Likewise.
* common/t-strlist.c: Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agodirmngr: add option to retrieve extra WKS info.
Werner Koch [Tue, 28 Jun 2016 13:50:38 +0000 (15:50 +0200)]
dirmngr: add option to retrieve extra WKS info.

* dirmngr/server.c (cmd_wkd_get): Add option --submission-address.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agogpg: Add hack to --quick-gen-key to create Curve25519 keys.
Werner Koch [Tue, 28 Jun 2016 13:49:11 +0000 (15:49 +0200)]
gpg: Add hack to --quick-gen-key to create Curve25519 keys.

* g10/keygen.c (quick_generate_keypair): Add special algo string
"test-default".
--

Well, this is a hack to quickly create keys with the algorithms we
will eventually use as defaults.  Usage:

  gpg -v --quick-gen-key --passphrase '' --batch USERID test-default

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: New function rfctimestamp.
Werner Koch [Tue, 28 Jun 2016 13:45:53 +0000 (15:45 +0200)]
common: New function rfctimestamp.

* common/gettime.c (rfctimestamp): New.
--

It is surprisingly hard to create an RFC-2822 compliant Date value.
The problem is that strftime uses the current locale but the RFC
requires that the English names are used.  This code is pretty simply
and avoid the extra problem of figuring out the correct timezone;
instead UTC is used.  For the planned use case this is anyway better.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agocommon: Add missing header file for clarity.
Werner Koch [Tue, 28 Jun 2016 13:42:58 +0000 (15:42 +0200)]
common: Add missing header file for clarity.

* common/zb32.c: Include zb32.h.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoAdd another collection of sample keys
Werner Koch [Tue, 28 Jun 2016 07:40:35 +0000 (09:40 +0200)]
Add another collection of sample keys

--

2 years agotools/gpgtar: Fix handling of '-'.
Justus Winter [Tue, 28 Jun 2016 13:03:07 +0000 (15:03 +0200)]
tools/gpgtar: Fix handling of '-'.

* tools/gpgtar-extract.c (gpgtar_extract): Use stdin if file is '-'.
* tools/gpgtar-list.c (gpgtar_list): Likewise.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agocommon: Close input stream.
Justus Winter [Tue, 28 Jun 2016 13:01:57 +0000 (15:01 +0200)]
common: Close input stream.

* common/exechelp-posix.c (gnupg_spawn_process): Also close the input
stream in the child.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agocommon: Fix copying data from the spawned child.
Justus Winter [Tue, 28 Jun 2016 12:38:35 +0000 (14:38 +0200)]
common: Fix copying data from the spawned child.

Fixes intermittent gpgtar failures.

* common/exectool.c (copy_buffer_do_copy): Initialize 'nwritten'.
(gnupg_exec_tool_stream): Loop until all data is copied.

Signed-off-by: Justus Winter <justus@g10code.com>
2 years agog10: Fix --list-packets.
NIIBE Yutaka [Tue, 28 Jun 2016 06:56:48 +0000 (15:56 +0900)]
g10: Fix --list-packets.

* g10/gpg.c (main): Call set_packet_list_mode after assignment of
opt.list_packets.
* g10/mainproc.c (do_proc_packets): Don't stop processing with
--list-packets as the comment says.
* g10/options.h (list_packets): Fix the comment.
* g10/parse-packet.c: Fix the condition for opt.list_packets.

--

Debian-bug-id: 828109
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 years agobuild: Add aclocal macro from pkg-config.
Werner Koch [Sat, 25 Jun 2016 15:39:38 +0000 (17:39 +0200)]
build: Add aclocal macro from pkg-config.

* m4/pkg.m4: New.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoyat2m: Silence lint warnings and fix a printf format bug.
Werner Koch [Sat, 25 Jun 2016 08:41:21 +0000 (10:41 +0200)]
yat2m: Silence lint warnings and fix a printf format bug.

* doc/yat2m.c (ATTR_PRINTF, ATTR_NR_PRINTF, ATTR_MALLOC): New.
(die, err, inf, xmalloc, xcalloc): New prototypes with attributes.
(get_section_buffer): Take care of !N_SECTIONS.
(proc_texi_cmd): Cast precision format arg.
(proc_texi_buffer): Do not set IN_CMD when not used afterwards.
--

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

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