aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix distcheck.Justus Winter2016-08-101-0/+4
| | | | | | * tests/openpgp/issue2417.scm: Copy configuration. Signed-off-by: Justus Winter <[email protected]>
* gpg: Remove tofu database format "split".Werner Koch2016-08-1011-771/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/options.h (struct opt): Remove field tofu_db_format. * g10/gpg.h (server_control_s): Add fields tofu.batch_update_ref and tofu.batch_update_started. * g10/gpg.c (parse_tofu_db_format): Remove. (main): Make option --tofu-db-format obsolete. * g10/tofu.c: Major rework. Remove the pretty complicated and slower split format and with that all the caching. Use the dbs struct directly. Move global vars for batch update into CTRL. Change calling conventions of some function to take CTRL or DBS pointers instead of the former low-level database pointer. -- The split database format might have been nice for use with Unison but it bypasses the concept of a relational database by doing parts of this itself and also risking deadlocks. Working with the Tofu database for debugging or experiments is also not possible with parts of the database logic implemented in gpg. The Tofu support is quite new and we can assume that it is not in real use now. Thus we better remove that now so that we do not need to maintain it for all future. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix opening of trust database.Justus Winter2016-08-103-2/+42
| | | | | | | | | | | | * g10/tdbio.c (tdbio_set_dbname): This function explicitly checks for the file size, but handled the case of a zero-sized file incorrectly by returning success. Fix this by initializing the database in that case. * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/issue2417.scm: New file. GnuPG-bug-id: 2417 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix distcheck.Justus Winter2016-08-101-1/+2
| | | | | | | | * tests/openpgp/Makefile.am (EXTRA_DIST): Explicitly add setup and teardown scripts now that they no longer are included in the list of tests. Signed-off-by: Justus Winter <[email protected]>
* tests: Improve temporary directory handling.Justus Winter2016-08-103-5/+14
| | | | | | | | | | | | * tests/gpgscm/ffi.c (ffi_init): Rename 'mkdtemp'. * tests/gpgscm/tests.scm (mkdtemp): New function that uses a sensible location and template if no arguments are given. (with-temporary-working-directory): Simplify accordingly. (make-temporary-file): Likewise. * tests/openpgp/run-tests.scm (run-tests-parallel-isolated): Likewise. (run-tests-sequential-isolated): Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make the name of foreign functions more unique.Justus Winter2016-08-101-1/+1
| | | | | | | * tests/gpgscm/ffi-private.h (ffi_define_function_name): Add another underscore. Signed-off-by: Justus Winter <[email protected]>
* tests: Run each test in a clean environment.Justus Winter2016-08-102-9/+19
| | | | | | | | | | | | | | * tests/openpgp/Makefile.am (TESTS_ENVIRONMENT): Drop obsolete variables, add 'srcdir', use absolute paths. (TESTS): Rename to 'XTESTS' to avoid emitting the automake test runner. Drop 'setup.scm' and 'finish.scm'. (xcheck): New target that runs 'run-tests.scm', our Scheme test suite runner. It will run each test in a clean environment, isolated from the other tests. (EXTRA_DIST): Adapt accordingly. * tests/openpgp/README: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Make ssh test more robust.Justus Winter2016-08-101-5/+5
| | | | | | | * tests/openpgp/ssh.scm: Drop the 'MD5:' which was not printed by previous ssh versions. Signed-off-by: Justus Winter <[email protected]>
* agent: SSH support fix.NIIBE Yutaka2016-08-101-1/+3
| | | | | | | | | * agent/command-ssh.c (ssh_handler_request_identities): Keep error message same. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Fix regression in recent ssh changes.Werner Koch2016-08-091-3/+9
| | | | | | | | | | | | * agent/command-ssh.c (sexp_key_construct): Lowercase the algo name. -- We need to use a lowercase version of the algo in S-expression. Unfortunately Libgcrypt has no function for this, thus we need to malloc and first. Fixes-commit: ebf24e3 Signed-off-by: Werner Koch <[email protected]>
* gpg: Extend the PROGRESS line to give the used unit.Werner Koch2016-08-092-4/+16
| | | | | | * g10/progress.c (write_status_progress): Print the units parameter. Signed-off-by: Werner Koch <[email protected]>
* Cleanup initialization of libgcrypt.Ben Kibbey2016-08-0914-75/+10
| | | | | | | | | | | | * common/init.c (init_common_subsystems): Initialize libgcrypt. * dirmngr/Makefile.am (dirmngr_ldap): Link with libgcrypt. -- Most other modules already call gcry_check_version() after init_common_subsystems() so may as well move initialization of libgcrypt to here. Also fixes a warning in the system log from gpgconf --homedir. Signed-off-by: Ben Kibbey <[email protected]>
* agent: SSH support improvement.NIIBE Yutaka2016-08-092-2/+2
| | | | | | | | | | | | | | | | | | | * agent/command-ssh.c (ssh_handler_request_identities): Skip a key with error, not giving up to handle the request itself. * agent/cvt-openpgp.c (extract_private_key): Support "ecdsa" key. -- Note that "ecdsa" key is still in use by old versions of gpg-agent through its SSH handling (until 2.1.14). With old versions of gpg-agent, adding ECDSA key by ssh-add command, "ecdsa" key will be created. So, "ecdsa" key should be supported. For g10/gpg, "ecdsa" and "ecdh" was only used in some experimental versions of libgcrypt, with parameters. We now use "ecc" for all cases in released versions. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Cleanup of dek_to_passphrase function (part 2).Werner Koch2016-08-087-204/+46
| | | | | | | | | | | * g10/passphrase.c (passphrase_get): Remove arg KEYID. Change arg MODE to NOCACHE. (passphrase_to_dek): Remove args KEYID and PUBKEY_ALGO. Split arg MODE into CREATE and NOCACHE. Change all callers and adjust stubs. (passphrase_clear_cache): Remove args KEYID and ALGO. They are not used. Change caller. Signed-off-by: Werner Koch <[email protected]>
* gpg: Cleanup of dek_to_passphrase function (part 1).Werner Koch2016-08-081-31/+11
| | | | | | | | | | | | * g10/passphrase.c (passphrase_to_dek_ext): Remove args CUSTDESC and CUSTPROMPT. Merge into the passphrase_to_dek wrapper. (passphrase_get): Remove args CUSTOM_DESCRIPTION and CUSTOM_PROMPT. -- The function is nowadays only used for symmetric encryption. Thus we do not need all the former advanced stuff. Signed-off-by: Werner Koch <[email protected]>
* agent: More clean up of SSH support.NIIBE Yutaka2016-08-084-95/+80
| | | | | | | | | | | | | | | | | | | | | * common/util.h (get_pk_algo_from_key): New. * common/sexputil.c (get_pk_algo_from_key): The implementation. * agent/gpg-agent.c: Remove include of openpgpdefs.h. * agent/command-ssh.c (struct ssh_key_type_spec): Use integer ALGO. (ssh_key_types): Update with GCRY_PK_*. (make_cstring, sexp_extract_identifier): Remove. (sexp_key_construct): Use gcry_pk_algo_name to get ALGO string. (ssh_key_to_blob): Use cadr to get value list. (ssh_key_type_lookup): Lookup with integer ALGO. (ssh_receive_key): Follow the change of ssh_key_type_lookup. (ssh_send_key_public): Likewise. Use get_pk_algo_from_key to get ALGO. -- This fixes the regresson introduced by the commit 894789c3299dc47a8c1ccaaa7070382f0fae0262. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Add openpgp/gpgv-forged-keyring.scm.NIIBE Yutaka2016-08-084-0/+70
| | | | | | | | | | | | * tests/openpgp/gpgv-forged-keyring.scm: New. * tests/openpgp/forged-keyring.gpg: New. * tests/openpgp/Makefile.am (TESTS): Add gpgv-forged-keyring.scm. * tests/openpgp/defs.scm (tools): Add GPGV. (GPGV): New. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Fix long standing regression tracking the connection count.Werner Koch2016-08-063-0/+22
| | | | | | | | | | | | | | | * agent/gpg-agent.c (get_agent_active_connection_count): New. (do_start_connection_thread, start_connection_thread_ssh): Bump ACTIVE_CONNECTIONS up and down. * agent/command.c (cmd_getinfo): Add subcommand "connections". -- The variable ACTIVE_CONNECTIONS is used to shutdown gpg-agent in a friendly way. Before we switched to nPth a Pth provided count of threads was used for this. During the migration to nPth ACTIVE_CONNECTIONS was introduced and checked but never set. Signed-off-by: Werner Koch <[email protected]>
* agent: Clean up SSH support.NIIBE Yutaka2016-08-061-127/+11
| | | | | | | | | * agent/command-ssh.c (file_to_buffer): Remove. (ssh_handler_request_identities): Use agent_public_key_from_file. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Avoid publishing the GnuPG version by defaultDaniel Kahn Gillmor2016-08-052-3/+3
| | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (main): initialize opt.emit_version to 0 * doc/gpg.texi: document different default for --emit-version -- The version of GnuPG in use is not particularly helpful. It is not cryptographically verifiable, and it doesn't distinguish between significant version differences like 2.0.x and 2.1.x. Additionally, it leaks metadata that can be used to distinguish users from one another, and can potentially be used to target specific attacks if there are known behaviors that differ between major versions. It's probably better to take the more parsimonious approach to metadata production by default. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Make sure that keygrips are printed for each subkey.Werner Koch2016-08-041-6/+14
| | | | | | | * g10/keylist.c (list_keyblock_colon): Print an emprty grip in case of an error. Signed-off-by: Werner Koch <[email protected]>
* gpg: Always print the fingerprint in colons mode.Werner Koch2016-08-042-21/+14
| | | | | | | | | | * g10/keylist.c (list_keyblock_colon): Remove arg FPR. Always print fingerprint records. For secret keys always print keygrip records. -- The fingerprint should always be used thus we should always print it. Signed-off-by: Werner Koch <[email protected]>
* tests: Use gpgconf to set the ssh socket envvar.Werner Koch2016-08-041-1/+3
| | | | | | * tests/openpgp/ssh.scm ("SSH_AUTH_SOCK"): Use gpgconf. Signed-off-by: Werner Koch <[email protected]>
* gpgconf: Add limited support for -0.Werner Koch2016-08-042-1/+8
| | | | | | | | | | | | * tools/gpgconf.h (opt): Add field 'null'. * tools/gpgconf.c: Add option --null/-0. (list_dirs): Use it here. -- This option changes the delimites for --list-dir with arguments from LF to Nul. Signed-off-by: Werner Koch <[email protected]>
* tests: Update list of tests in Scheme test runner.Justus Winter2016-08-041-1/+7
| | | | | | * tests/openpgp/run-tests.scm: Add missing tests. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix path to fake-pinentry.Justus Winter2016-08-041-2/+3
| | | | | | * tests/openpgp/defs.scm: Correctly compute the path to fake-pinentry. Signed-off-by: Justus Winter <[email protected]>
* po: Update Japanese translation.NIIBE Yutaka2016-08-041-341/+379
|
* po: update Japanese translation.NIIBE Yutaka2016-08-041-386/+342
|
* g10: Fix checking key for signature validation.NIIBE Yutaka2016-08-041-2/+2
| | | | | | | | | | | | * g10/sig-check.c (check_signature2): Not only subkey, but also primary key should have flags.valid=1. -- The tweak of gpgv in e32c575e0f3704e7563048eea6d26844bdfc494b only makes sense with this change. Signed-off-by: NIIBE Yutaka <[email protected]>
* Reword feature description.Justus Winter2016-08-032-4/+4
| | | | | | -- Suggested-by: Peter Gutmann Signed-off-by: Justus Winter <[email protected]>
* kbx: Add missing header file.Justus Winter2016-08-031-0/+1
| | | | | | * kbx/keybox-update.c: Add missing header file. Signed-off-by: Justus Winter <[email protected]>
* More cleanup of "allow to".Daniel Kahn Gillmor2016-08-0356-88/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | * README, agent/command.c, agent/keyformat.txt, common/i18n.c, common/iobuf.c, common/keyserver.h, dirmngr/cdblib.c, dirmngr/ldap-wrapper.c, doc/DETAILS, doc/TRANSLATE, doc/announce-2.1.txt, doc/gpg.texi, doc/gpgsm.texi, doc/scdaemon.texi, doc/tools.texi, doc/whats-new-in-2.1.txt, g10/export.c, g10/getkey.c, g10/import.c, g10/keyedit.c, m4/ksba.m4, m4/libgcrypt.m4, m4/ntbtls.m4, po/ca.po, po/cs.po, po/da.po, po/de.po, po/el.po, po/eo.po, po/es.po, po/et.po, po/fi.po, po/fr.po, po/gl.po, po/hu.po, po/id.po, po/it.po, po/ja.po, po/nb.po, po/pl.po, po/pt.po, po/ro.po, po/ru.po, po/sk.po, po/sv.po, po/tr.po, po/uk.po, po/zh_CN.po, po/zh_TW.po, scd/app-p15.c, scd/ccid-driver.c, scd/command.c, sm/gpgsm.c, sm/sign.c, tools/gpgconf-comp.c, tools/gpgtar.h: replace "Allow to" with clearer text. In standard English, the normal construction is "${XXX} allows ${YYY} to" -- that is, the subject (${XXX}) of the sentence is allowing the object (${YYY}) to do something. When the object is missing, the phrasing sounds awkward, even if the object is implied by context. There's almost always a better construction that isn't as awkward. These changes should make the language a bit clearer. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Emit correct spelling of "superseded".Daniel Kahn Gillmor2016-08-032-2/+2
| | | | | | | | | | | * dirmngr/crlcache.c (list_one_crl_entry): Spell superseded correctly. * dirmngr/ocsp.c (ocsp_invalid): Likewise. This might break some tools which parse the existing output and expect misspellings, but i'm not sure there are many such tools, and we should use standardized orthography going forward. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Fix spelling and grammar.Daniel Kahn Gillmor2016-08-0310-24/+24
| | | | | | | | | | | | | | * agent/learncard.c: s/coccured/occurred/ * doc/dirmngr.texi: s/ommitted/omitted/, s/orginally/originally/, s/reponses/responses/i * doc/gpg-agent.texi, doc/dirmngr.texi, doc/gpg.texi: Fix "allows to" to more conventional english usage. * doc/tools.texi, g10/gpgcommpose.c, tests/openpgp/armor.scm, tests/openpgp/armor.test: s/occured/occurred/ * tools/gpgsplit.c: s/calcualting/calculating/ * sm/server.c: s/formated/formatted/ Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpg,gpgsm: Block signals during keyring/keybox update.Werner Koch2016-08-034-55/+90
| | | | | | | | | | | | | | * kbx/keybox-util.c (keybox_file_rename): Add arg BLOCK_SIGNALS. * kbx/keybox-update.c (rename_tmp_file): Block all signals when doing a double rename. * g10/keyring.c (rename_tmp_file): Block all signals during the double rename. -- This might fix Debian-bug-id: 831510 Signed-off-by: Werner Koch <[email protected]>
* common: New file utilproto.cWerner Koch2016-08-034-7/+47
| | | | | | | | * common/util.h: Factor prototypes from signal.c out to ... * common/utilproto.h: new. * common/Makefile.am (common_sources): Add new file. Signed-off-by: Werner Koch <[email protected]>
* gpgsm: Fix machine-readable key listing.Justus Winter2016-08-011-1/+0
| | | | | | | * sm/keylist.c (list_cert_colon): Drop superfluous colon. GnuPG-bug-id: 2432 Signed-off-by: Justus Winter <[email protected]>
* tests: Distribute standalone test runner.Justus Winter2016-08-011-1/+1
| | | | | | | | * tests/openpgp/Makefile.am (EXTRA_DIST): Add missing file 'run-tests.scm'. GnuPG-bug-id: 2431 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix distcheck.Justus Winter2016-07-281-1/+3
| | | | | | | * tests/openpgp/Makefile.am (sample_msgs): New variable. (EXTRA_DIST): Also ship the sample msgs. Signed-off-by: Justus Winter <[email protected]>
* build: Fix check for Android.Fredrik Fornwall2016-07-271-1/+1
| | | | | | * configure.ac: Match other Android targets as well. Signed-off-by: Justus Winter <[email protected]>
* common: Fix iobuf_peek corner case.Justus Winter2016-07-266-11/+58
| | | | | | | | | | | | | | | Previously, iobuf_peek on a file smaller than 'buflen' would hang. * common/iobuf.c (underflow): Generalize by adding a target parameter. (iobuf_peek): Use this to prevent looping here. * tests/openpgp/Makefile.am (TESTS): Add new test. * tests/openpgp/setup.scm (dearmor): Move function... * tests/openpgp/defs.scm (dearmor): ... here. * tests/openpgp/issue2419.scm: New file. * tests/openpgp/samplemsgs/issue2419.asc: Likewise. GnuPG-bug-id: 2419 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Do not shadow common function name in catch macro.Justus Winter2016-07-261-2/+2
| | | | | | * tests/gpgscm/init.scm (catch): Do not shadow 'exit'. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix distcheck.Justus Winter2016-07-261-1/+2
| | | | | | | * tests/openpgp/Makefile.am (samplekeys): Add missing key. Fixes-commit: 4ba11251 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make the verbose setting more useful.Justus Winter2016-07-264-5/+39
| | | | | | | | | | | | | * tests/gpgscm/ffi.c (do_get_verbose): New function. (do_set_verbose): Likewise. (ffi_init): Turn *verbose* into a function, add *set-verbose!*. * tests/gpgscm/tests.scm (call): Adapt accordingly. (call-with-io): Dump output if *verbose* is high. (pipe-do): Adapt accordingly. * tests/openpgp/defs.scm: Set verbosity according to environment. * tests/openpgp/run-tests.scm (test): Adapt accordingly. Signed-off-by: Justus Winter <[email protected]>
* common: Avoid excessive stack use.Justus Winter2016-07-261-14/+39
| | | | | | | * common/exectool.c (copy_buffer_shred): Make passing NULL a nop. (gnupg_exec_tool_stream): Allocate copy buffers from the heap. Signed-off-by: Justus Winter <[email protected]>
* common: Rework resource cleanup when handling errors.Justus Winter2016-07-261-9/+10
| | | | | | * common/exectool.c (gnupg_exec_tool_stream): Rework error handling. Signed-off-by: Justus Winter <[email protected]>
* common: Add unit test for exectool.Justus Winter2016-07-262-1/+225
| | | | | | | * common/Makefile.am: Build new test. * common/t-exectool.c: New file. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix key import statistics.Justus Winter2016-07-254-4/+104
| | | | | | | | | | | | | | | | | 'transfer_secret_keys' collects statistics on a subkey-basis, while the other code does not. This leads to inflated numbers when importing secret keys. E.g. 'count' is incremented by the main parsing loop in 'import', and again in 'transfer_secret_keys', leading to a total of 3 if one key with two secret subkeys is imported. * g10/import.c (import_secret_one): Adjust to the fact that 'transfer_secret_keys' collects subkey statistics. * tests/openpgp/Makefile.am (TESTS): Add new test. * tests/openpgp/issue2346.scm: New file. * tests/openpgp/samplekeys/issue2346.gpg: Likewise. GnuPG-bug-id: 2346 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make function more general.Justus Winter2016-07-221-2/+2
| | | | | | * tests/gpgscm/tests.scm (in-srcdir): Accept more path fragments. Signed-off-by: Justus Winter <[email protected]>
* g10: Properly ignore legacy keys in the keyring cache.Justus Winter2016-07-225-6/+376
| | | | | | | | | | | | | * g10/keyring.c (keyring_rebuild_cache): Properly ignore legacy keys in the keyring cache. * tests/migrations/Makefile.am (TESTS): Add new test. * tests/migrations/common.scm (GPG-no-batch): New variable. (run-test): New function. * tests/migrations/issue2276.scm: New file. * tests/migrations/issue2276.tar.asc: Likewise. GnuPG-bug-id: 2276 Signed-off-by: Justus Winter <[email protected]>