aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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]>
* gpgscm: Improve test framework.Justus Winter2016-06-212-13/+19
| | | | | | | | | | | * 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 <[email protected]>
* gpgscm: Use native string searching functions.Justus Winter2016-06-214-43/+118
| | | | | | | | | | | | | | | | | * 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 <[email protected]>
* gpgscm: Improve error reporting.Justus Winter2016-06-211-2/+27
| | | | | | | * tests/gpgscm/scheme.c (type_to_string): New function. (Eval_Cycle): Include actual type in error message. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make memory allocation failures fatal.Justus Winter2016-06-211-1/+1
| | | | | | * tests/gpgscm/scheme.c (Eval_Cycle): Exit if we run out of memory. Signed-off-by: Justus Winter <[email protected]>
* tests: Make make distcheck work again.Werner Koch2016-06-173-10/+13
| | | | | | | | | | | | | | | * 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 <[email protected]>
* gpgscm: Silence compiler warnings.Werner Koch2016-06-171-7/+12
| | | | | | | | | | | * 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 <[email protected]>
* Add license notices for TinySCHEME.Werner Koch2016-06-171-0/+0
| | | | | | | | | | | | | * 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 <[email protected]>
* tests/openpgp: Reimplement tests in Scheme.Justus Winter2016-06-1739-17/+3473
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* tests/gpgscm: Add a TinySCHEME-based test driver.Justus Winter2016-06-1714-1/+2549
| | | | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* tests/gpgscm: Foreign objects support for TinySCHEME.Justus Winter2016-06-173-1/+45
| | | | | | | | | | | | | | | | | | | | | * 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 <[email protected]>
* tests/gpgscm: Dynamically allocate string buffer.Justus Winter2016-06-172-4/+34
| | | | | | | | | | | | | | * 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 <[email protected]>
* tests/gpgscm: Make exception value available.Justus Winter2016-06-171-4/+5
| | | | | * tests/gpgscm/init.scm (throw): Hand exception value to the handler. (catch): And bind it to *error*.
* tests/gpgscm: Add package macro.Justus Winter2016-06-171-0/+5
| | | | | | * tests/gpgscm/init.scm: Add package macro from manual. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Expose function to open streams as Scheme ports.Justus Winter2016-06-172-1/+3
| | | | | | | | * 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 <[email protected]>
* tests/gpgscm: Nicer error message.Justus Winter2016-06-171-1/+1
| | | | | | | * 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 <[email protected]>
* tests/gpgscm: Fix error hook.Justus Winter2016-06-171-1/+2
| | | | | | | * tests/gpgscm/init.scm (*error-hook*): Fix error hook so that the whole error message is displayed. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Handle unhandled enumeration values.Justus Winter2016-06-171-0/+6
| | | | | | | * tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration values in the opcode dispatching code. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Verbatim import of latest TinySCHEME.Justus Winter2016-06-177-0/+6917
| | | | | | | | | | | | | | 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 <[email protected]>
* Add missing files so that make distcheck works again,Werner Koch2016-06-161-1/+2
| | | | | | | | | | | | | * 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 <[email protected]>
* g10: Export cleartext keys as cleartextDaniel Kahn Gillmor2016-06-111-24/+4
| | | | | | | | | | | | | | * g10/export.c (do_export_stream): If a key is stored by the agent in cleartext, then try to export it as cleartext. * tests/openpgp/export.test: For secret keys that are stored in cleartext, test should try to export without pinentry interaction. -- This restores the behavior of GnuPG 2.0 and 1.4 when exporting passphraseless secret keys, and fixes the test suite accordingly. GnuPG-bug-id: 2070, 2324 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* tests: Test the pinentry interactions when exporting keys.Justus Winter2016-05-231-5/+67
| | | | | | * tests/openpgp/export.test: Test pinentry interactions. Signed-off-by: Justus Winter <[email protected]>
* tests: Add support for a passphrase queue to fake pinentry.Justus Winter2016-05-231-2/+94
| | | | | | | * tests/openpgp/fake-pinentry.c (get_passphrase): New function. (main): Add option --passphrasefile and read passphrases from it. Signed-off-by: Justus Winter <[email protected]>
* tests: Add logging to fake pinentry.Justus Winter2016-05-231-14/+108
| | | | | | | | | * tests/openpgp/fake-pinentry.c (log_stream): New variable. (reply): New function. (spacep,skip_options,option_value): Copy from common. (main): Parse arguments, add --logfile option, write logfile. Signed-off-by: Justus Winter <[email protected]>
* tests: Add export test.Justus Winter2016-05-232-0/+69
| | | | | | | * tests/openpgp/Makefile.am (TESTS): Add new file. * tests/openpgp/export.test: New file. Signed-off-by: Justus Winter <[email protected]>
* tests: Disable the migrations testsWerner Koch2016-05-041-1/+1
| | | | | | | | | | | | * tests/Makefile.am (SUBDIRS): Remove migrations. * configure.ac (AC_CONFIG_FILES): Remove migrations Makefile. -- The tests introduced with commit defbc70b require some non-portable tools like mktemp and basename. They further fail with "make distcheck". Removed for now. Signed-off-by: Werner Koch <[email protected]>
* tests: Silence output of some tests.Werner Koch2016-05-033-3/+3
| | | | | | | | | | | | | | * common/t-exechelp.c (print_open_fds): Silence non-verbose output. (test_close_all_fds): Ditto. * common/t-session-env.c (show_stdnames): Indent output. * g10/test.c (TEST): Silence non-verbose okay output. (exit_tests): Ditto. * tools/gpg-zip.in (tar_verbose_opt): Add option --quiet. * tests/openpgp/gpgtar.test (GPGZIP): Pass option --quiet. * tests/openpgp/mds.test: Indent MD5 notice. * tests/openpgp/version.test: Indent --version output. Signed-off-by: Werner Koch <[email protected]>
* common: Add support for the new extended private key format.Justus Winter2016-04-217-2/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/findkey.c (write_extended_private_key): New function. (agent_write_private_key): Detect if an existing file is in extended format and update the key within if it is. (read_key_file): Handle the new format. * agent/keyformat.txt: Document the new format. * common/Makefile.am: Add the new files. * common/private-keys.c: New file. * common/private-keys.h: Likewise. * common/t-private-keys.c: Likewise. * common/util.h (alphap, alnump): New macros. * tests/migrations: Add test demonstrating that we can cope with the new format. -- GnuPG 2.3+ will use a new format to store private keys that is both more flexible and easier to read and edit by human beings. The new format stores name,value-pairs using the common mail and http header convention. This patch adds the parser and support code and prepares GnuPG 2.1 for the new format. Signed-off-by: Justus Winter <[email protected]>
* tests: Make migration test more robust and silent.Justus Winter2016-04-211-8/+18
| | | | | | | * tests/migrations/from-classic.test: Fix in-tree build, silence test. Fixes-commit: defbc70b Signed-off-by: Justus Winter <[email protected]>
* agent: Sanitize permissions of the private key directory.Justus Winter2016-04-201-0/+15
| | | | | | | | | | | | | * agent/gpg-agent.c (create_private_keys_directory): Set permissions. * common/sysutils.c (modestr_to_mode): New function. (gnupg_mkdir): Use new function. (gnupg_chmod): New function. * common/sysutils.h (gnupg_chmod): New prototype. * tests/migrations/from-classic.test: Test migration with existing directory. GnuPG-bug-id: 2312 Signed-off-by: Justus Winter <[email protected]>
* tests: Test the migration from a classic GnuPG home directory.Justus Winter2016-04-206-1/+257
| | | | | | | | | | | | * configure.ac: Add new directory. * tests/Makefile.am (SUBDIRS): Likewise. * tests/migrations/Makefile.am: New file. * tests/migrations/from-classic.gpghome/pubring.gpg.asc: Likewise. * tests/migrations/from-classic.gpghome/secring.gpg.asc: Likewise. * tests/migrations/from-classic.gpghome/trustdb.gpg.asc: Likewise. * tests/migrations/from-classic.test: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests: Set fake-pinentry's stdout and stdin to _IOLBF.Werner Koch2016-04-141-2/+19
| | | | | | | | * tests/openpgp/fake-pinentry.c (main): Call setvbuf. Show passphrase at startup. Increase buffer. -- Signed-off-by: Werner Koch <[email protected]>