aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* gpgscm: Free memory backing string ports.Justus Winter2016-06-301-0/+2
| | | | | | | * tests/gpgscm/scheme.c (finalize_cell): Free memory backing string ports. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Use the allocator from libgcrypt.Justus Winter2016-06-301-1/+2
| | | | | | * tests/gpgscm/main.c (main): Use the allocator from libgcrypt. Signed-off-by: Justus Winter <[email protected]>
* g10: Implement gpg --quick-revuidDaniel Kahn Gillmor2016-06-301-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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 <[email protected]> - 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 <[email protected]>
* gpgscm: Fix memory leaks.Justus Winter2016-06-283-14/+32
| | | | | | | | | | | | | * 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 <[email protected]>
* gpgscm: Free file names.Justus Winter2016-06-281-0/+5
| | | | | | * tests/gpgscm/scheme.c (scheme_load_named_file): Free file name. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix buffer overflow.Justus Winter2016-06-281-1/+2
| | | | | | | * tests/gpgscm/scheme.c (store_string): Avoid writing past allocated buffer. Signed-off-by: Justus Winter <[email protected]>
* Add another collection of sample keysWerner Koch2016-06-283-2/+125
| | | | --
* tests/openpgp: Fake the system time for the tofu test.Justus Winter2016-06-233-3/+6
| | | | | | | | | | | | | | | 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 <[email protected]>
* gpgscm: Handle exceptions in the transformation monad.Justus Winter2016-06-231-13/+23
| | | | | | | | | | * 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 <[email protected]>
* tests/openpgp: Improve tests.Justus Winter2016-06-232-15/+14
| | | | | | | * tests/openpgp/multisig.scm: Simplify test. * tests/openpgp/setup.scm (dearmor): Use pipe. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Add types for special objects.Justus Winter2016-06-231-6/+14
| | | | | | | | | * 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 <[email protected]>
* gpgscm: Fix Scheme initialization.Justus Winter2016-06-231-0/+3
| | | | | | | | | | 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 <[email protected]>
* gpgscm: Fix manual.Justus Winter2016-06-231-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* tests: Add four more sample messages for the two new keys to the repo.Werner Koch2016-06-234-0/+0
| | | | | | -- These are uncompressed signed messages
* tests: Add a set of sample messages for the two new keys to the repo.Werner Koch2016-06-2242-0/+421
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* tests: Add two more sample keys for OpenPGP.Werner Koch2016-06-229-4/+144
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* tests/migrations: Convert to Scheme and re-enable.Justus Winter2016-06-217-138/+167
| | | | | | | | | | | | | * 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 <[email protected]>
* gpgscm: Add more file handling functions.Justus Winter2016-06-212-0/+44
| | | | | | | | * 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 <[email protected]>
* tests/openpgp: Port the remaining tests to Scheme.Justus Winter2016-06-214-13/+272
| | | | | | | | | | * 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 <[email protected]>