aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* tests/gpgscm: Fix use of pointer.NIIBE Yutaka2016-09-152-4/+4
| | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct scheme): Use (void *) for alloc_seg. * tests/gpgscm/scheme.c (alloc_cellseg): Use (void *) for cp. Use (void *) for coercion of address calculation. -- In old C language, (char *) means an address. In modern C, it's specifically an address with alignment=1. It's good to use (void *) for an address, because newer compiler emits warnings. Note: in this particular case, it is just a warning and the code is safe against invalid alignment, though. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Simplify tofu test.Justus Winter2016-09-121-66/+64
| | | | | | | * tests/openpgp/tofu.scm: Simplify now that we only have one db format. Signed-off-by: Justus Winter <[email protected]>
* tests: Don't use --tofu-db-format.Neal H. Walfield2016-09-071-33/+30
| | | | | | | | * tests/openpgp/tofu.scm: Remove use of --tofu-db-format, which is deprecated. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpgscm: Fix detection of unbalanced parenthesis.Justus Winter2016-09-062-0/+9
| | | | | | | | * tests/gpgscm/main.c (load): Print error message. * tests/gpgscm/scheme.c (opexe_0): Correctly report nesting level when loading files. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix test.Justus Winter2016-09-061-1/+1
| | | | | | * tests/openpgp/multisig.scm: Add missing parenthesis. Signed-off-by: Justus Winter <[email protected]>
* tests: Speed up the test suite.Justus Winter2016-09-052-126/+150
| | | | | | | | | | | | | * tests/openpgp/run-tests.scm (test::run-sync): Pass additional arguments to the test. (test::run-sync-quiet): Likewise. (test::run-async): Likewise. (run-tests-{parallel,sequential}-isolated): Create a tarball of the gnupghome, then extract it for each test. * tests/openpgp/setup.scm: Refactor into functions, add an interface to tar-up the created environment, and untar it multiple times. Signed-off-by: Justus Winter <[email protected]>
* tests: Update README.Justus Winter2016-09-051-8/+22
| | | | | | * tests/openpgp/README: Update. Signed-off-by: Justus Winter <[email protected]>
* tests: Pass flags to test driver.Justus Winter2016-09-051-1/+1
| | | | | | * tests/openpgp/Makefile.am (xcheck): Pass flags to 'run-tests.scm'. Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix false negatives in Ed25519 signature verification.Werner Koch2016-08-251-0/+73
| | | | | | | | | | | | | | * g10/pkglue.c (pk_verify): Fix Ed25519 signatrue values. * tests/openpgp/verify.scm (msg_ed25519_rshort): New (msg_ed25519_sshort): New. ("Checking that a valid Ed25519 signature is verified as such"): New. -- About one out of 256 signature won't verify due to stripped zero bytes. See the source comment for details. Reported-by: Andre Heinecke Signed-off-by: Werner Koch <[email protected]>
* gpg: New option --with-tofu-info.Werner Koch2016-08-251-3/+3
| | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oWithTofuInfo): New. (opts): Add --with-tofu-info. (main): Set opt.with_tofu_info. * g10/options.h (struct opt): Add field WITH_TOFU_INFO. * g10/tofu.c (show_statistics): Add optional arg OUTFP and enter special mode if not NULL. Change all callers. (tofu_write_tfs_record): New. * g10/keylist.c (list_keyblock_colon): Do not print the tofu policy as part of the "uid" record. Print a new "tfs" record if the new option is set. * tests/openpgp/tofu.scm (getpolicy): Change from UID to TFS record. -- A separate option is required to avoid slowing down key listings. Foer example the current code takes for a keylisting in tofu+pgp mode 17 seconds while it takes more than 5 minutes if the option is used. Signed-off-by: Werner Koch <[email protected]>
* Call log_set_prefix() with human-readable labels.Daniel Kahn Gillmor2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | * agent/preset-passphrase.c, agent/protect-tool.c, dirmngr/dirmngr.c * dirmngr/t-http.c, g10/gpg.c, g10/gpgv.c, g13/g13-syshelp.c * g13/g13.c, kbx/kbxutil.c, scd/scdaemon.c, sm/gpgsm.c * tests/gpgscm/main.c, tools/gpg-check-pattern.c * tools/gpg-connect-agent.c, tools/gpgconf.c, tools/gpgtar.c * tools/symcryptrun.c: Invoke log_set_prefix() with human-readable labels. -- Some invocations of log_set_prefix() were done with raw numeric values instead of values that humans can understand. Use symbolic representations instead of numeric for better readability. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* 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-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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-102-0/+40
| | | | | | | | | | | | * 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]>
* 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]>
* 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]>
* 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]>
* Fix spelling and grammar.Daniel Kahn Gillmor2016-08-032-2/+2
| | | | | | | | | | | | | | * 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]>
* 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]>
* common: Fix iobuf_peek corner case.Justus Winter2016-07-265-8/+43
| | | | | | | | | | | | | | | 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]>
* g10: Fix key import statistics.Justus Winter2016-07-253-0/+91
| | | | | | | | | | | | | | | | | '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-224-2/+375
| | | | | | | | | | | | | * 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]>
* gpgscm: Make assert macro more accurate.Justus Winter2016-07-211-1/+2
| | | | | | | * tests/gpgscm/lib.scm (assert): Print the representation of the failed expression. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make error message more useful.Justus Winter2016-07-211-1/+1
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Include names of missing function parameters in the error message. Signed-off-by: Justus Winter <[email protected]>
* agent: Add known keys to sshcontrol.Justus Winter2016-07-191-0/+12
| | | | | | | | | * agent/command-ssh.c (ssh_identity_register): Add a key to sshcontrol even if it is already in the private key store. * tests/openpgp/ssh.scm: Test this. GnuPG-bug-id: 2316 Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for ssh support.Justus Winter2016-07-199-6/+127
| | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (path-expand): New function. * tests/openpgp/Makefile.am (TESTS): Add new test. (sample_keys): Add new keys. (CLEANFILES): Clean ssh socket and control file. * tests/openpgp/fake-pinentry.c (main): Add a default passphrase. * tests/openpgp/gpg-agent.conf.tmpl: Enable ssh support. * tests/openpgp/samplekeys/ssh-dsa.key: New file. * tests/openpgp/samplekeys/ssh-ecdsa.key: Likewise. * tests/openpgp/samplekeys/ssh-ed25519.key: Likewise. * tests/openpgp/samplekeys/ssh-rsa.key: Likewise. * tests/openpgp/ssh.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* agent: Fix passphrase cache lookups.Justus Winter2016-07-182-0/+30
| | | | | | | | | | | | | | CACHE_MODE_ANY is supposed to match any cache mode except CACHE_MODE_IGNORE, but the code used '==' to compare cache modes. * agent/cache.c (cache_mode_equal): New function. (agent_set_cache): Use the new function to compare cache modes. (agent_get_cache): Likewise. * tests/openpgp/Makefile.am (TESTS): Add new test. * tests/openpgp/issue2015.scm: New file. GnuPG-bug-id: 2015 Signed-off-by: Justus Winter <[email protected]>
* build: Always build gpgtar.Justus Winter2016-07-151-1/+2
| | | | | | | | | | | | | We use gpgtar to unpack test data, hence we always build it. If the user opts out, we simply don't install it. * configure.ac: Add comment. * tests/migrations/Makefile.am (required_pgms): Make sure gpgtar is built. * tools/Makefile.am: Always build gpgtar, but do not install it if the user used '--disable-gpgtar'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix linking.Justus Winter2016-07-151-1/+1
| | | | | | * tests/gpgscm/Makefile.am: Add -lintl. Signed-off-by: Justus Winter <[email protected]>
* tests: Check for gpgtar.Justus Winter2016-07-153-2/+8
| | | | | | | | * tests/migrations/extended-pkf.scm: Skip test if gpgtar is not built. * tests/migrations/from-classic.scm: Likewise. * tests/openpgp/gpgtar.scm: Fix check for gpgtar. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use kludge to avoid improper use of ffi_schemify_name.Werner Koch2016-07-141-3/+7
| | | | | | | * tests/gpgscm/ffi.c (ffi_schemify_name): Use xstrdup instead of strdup for now. Signed-off-by: Werner Koch <[email protected]>
* tests: 3 more sample messagesWerner Koch2016-07-133-0/+70
| | | | --
* gpgscm: Capture output of spawned processes.Justus Winter2016-07-072-6/+8
| | | | | | | | | * tests/gpgscm/tests.scm (call-check): Capture stdout and stderr, and return stdout if the child exited successfully, or include stderr in the error. * tests/openpgp/version.scm: Demonstrate this by checking the stdout. Signed-off-by: Justus Winter <[email protected]>
* gpg: New options --recipient-file and --hidden-recipient-file.Werner Koch2016-07-063-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oRecipientFile, oHiddenRecipientFile): New. (opts): Add options --recipient-file and --hidden-recipient-file. (main): Implement them. Also remove duplicate code from similar options. * g10/keydb.h (PK_LIST_FROM_FILE): New. (PK_LIST_SHIFT): Bump up. * g10/pkclist.c (expand_group): Take care of PK_LIST_FROM_FILE. (find_and_check_key): Add and implement arg FROM_FILE. (build_pk_list): Pass new value for new arg. * g10/getkey.c (get_pubkey_fromfile): New. * g10/gpgv.c (read_key_from_file): New stub. * g10/test-stubs.c (read_key_from_file): New stub. * g10/server.c (cmd_recipient): Add flag --file. * g10/import.c (read_key_from_file): New. * tests/openpgp/defs.scm (key-file1): New. (key-file2): New. * tests/openpgp/setup.scm: Add their private keys and import the key-file1. * tests/openpgp/encrypt.scm: Add new test. -- Signed-off-by: Werner Koch <[email protected]>
* tests: Honor environment variable 'TMP'.Justus Winter2016-07-053-4/+22
| | | | | | | | | | | | | | This fixes problems with long socket names, e.g. when doing distcheck. * tests/gpgscm/tests.scm (path-join): New function. (with-temporary-working-directory): Honor 'TMP'. (make-temporary-file): Likewise. * tests/migrations/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. * tests/openpgp/Makefile.am (TMP): Default to '/tmp'. (TESTS_ENVIRONMENT): Set 'TMP'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Improve robustness and compatibility.Justus Winter2016-07-051-2/+8
| | | | | | | * tests/gpgscm/ffi.c (do_getenv): Avoid gccism. (do_mkdtemp): Handle errors. Signed-off-by: Justus Winter <[email protected]>
* tests/migrations: Fix distcheck.Justus Winter2016-07-0514-324/+442
| | | | | | | | | | | | | | | | | * tests/migrations/Makefile.am (TESTS): Rename test. (TEST_FILES): Update list. (EXTRA_DIST): Add common.scm. * tests/migrations/common.scm (GPGTAR): New variable. (dearmor): Rename and untar archive. * tests/migrations/extended-private-key-format.scm: Rename. (setup): Update. * tests/migrations/extended-pkf.tar.asc: New file. * tests/migrations/extended-private-key-format.gpghome: Delete. * tests/migrations/from-classic.gpghome: Likewise. * tests/migrations/from-classic.scm (setup): Update. * tests/migrations/from-classic.tar.asc: New file. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Provide --create and --extract.Justus Winter2016-07-051-8/+12
| | | | | | | | | * tools/gpgtar.c (cmd_and_opt_values): New values. (opts): New actions. (parse_arguments): Handle new actions. * tests/openpgp/gpgtar.scm: Test new interface. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix reallocating string ports.Justus Winter2016-06-301-1/+2
| | | | | | | * tests/gpgscm/scheme.c (realloc_port_string): Use memcpy because Scheme strings may contain 0s. Signed-off-by: Justus Winter <[email protected]>