aboutsummaryrefslogtreecommitdiffstats
path: root/tests/openpgp/quick-key-manipulation.scm (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Look up user ID to mark as primary by UID hashIngo Klöcker2022-08-081-1/+3
| | | | | | | | | | | | | | | | * g10/keyedit.c (find_userid_by_namehash, find_userid): Add argument want_valid. Skip invalid user IDs if valid is wanted. (keyedit_quick_revuid): Ask find_userid() for any matching user ID. (keyedit_quick_set_primary): Use find_userid() to find the user ID to mark as primary. * tests/openpgp/quick-key-manipulation.scm: Change second call of the quick-set-primary-uid test to specify the user ID by its hash. -- This makes it possible to specify the user ID to mark as primary via its UID hash when calling --quick-set-primary-uid. GnuPG-bug-id: 6126
* gpg: Look up user ID to revoke by UID hashIngo Klöcker2022-04-261-0/+6
| | | | | | | | | | | | | | * g10/keyedit.c (find_userid_by_namehash, find_userid): New. (keyedit_quick_revuid): Use find_userid() instead of iterating over the nodes of the keyblock. * tests/openpgp/quick-key-manipulation.scm: Add test for revoking a user ID specified by its hash. -- This makes it possible to specify the user ID to revoke as UID hash when calling --quick-revoke-uid. GnuPG-bug-id: 5936
* tests: Fix a test which specifies expiration date.NIIBE Yutaka2017-09-081-4/+4
| | | | | | | | | | | | | | | | | | | | | * tests/openpgp/quick-key-manipulation.scm: Fix expiration time comparison. -- This is a bug fix for Amelia Earhart who is probably in UTC-12. When expiration date is specified, GnuPG interprets it as noon of the date in local time. Before this fix, the test compared the value by 2145916800 which is 2038-01-01 00:00:00 in UTC with allowance of 1 day. When the test was ran in UTC-12 timezone, it failed because of noon in the timezone is midnight of the next day in UTC. GnuPG-bug-id: 3393 Reported-by: Daniel Kahn Gillmor Signed-off-by: NIIBE Yutaka <[email protected]>
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-281-2/+2
| | | | | | | | | | -- In addition, fix trailing spaces in tests/inittests. GnuPG-bug-id: 3121 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Locate resources and scripts relative to top source dir.Justus Winter2017-04-241-1/+1
| | | | | | | | | | | | -- Locate every resource and every script used in the tests using a path relative to the top of the source tree. This is a purely mechanical change, mostly done using regular expressions, with a few manual fixups here and there. Signed-off-by: Justus Winter <[email protected]>
* tests: Test '--quick-set-primary-uid'.Justus Winter2017-03-211-0/+11
| | | | | | | * tests/openpgp/quick-key-manipulation.scm: Test '--quick-set-primary-uid'. Signed-off-by: Justus Winter <[email protected]>
* gpg: Do not allow the user to revoke the last valid UID.Justus Winter2017-03-071-0/+5
| | | | | | | | | | | * g10/keyedit.c (keyedit_quick_revuid): Merge self signatures, then make sure that we do not revoke the last valid UID. (menu_revuid): Make sure that we do not revoke the last valid UID. * tests/openpgp/quick-key-manipulation.scm: Demonstrate that '--quick-revoke-uid' can not be used to revoke the last valid UID. GnuPG-bug-id: 2960 Signed-off-by: Justus Winter <[email protected]>
* tests: Avoid overflowing signed 32 bit time_t.Justus Winter2017-03-071-4/+11
| | | | | | | | | | * tests/openpgp/quick-key-manipulation.scm: Use expiration times in the year 2038 instead of 2105 to avoid overflowing 32 bit time_t. time_t is used internally to parse the expiraton time from the iso timestamp. GnuPG-bug-id: 2988 Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix (quick) key generation with --always-trust.Justus Winter2017-03-021-4/+0
| | | | | | | | | | | * g10/keygen.c (do_generate_keypair): Only update the ownertrust if we do have a trust database. * g10/trustdb.c (have_trustdb): New function. * g10/trustdb.h (have_trustdb): New prototype. * tests/openpgp/quick-key-manipulation.scm: Remove workaround. GnuPG-bug-id: 2695 Signed-off-by: Justus Winter <[email protected]>
* g10: Signal an error when trying to revoke non-existant UID.Justus Winter2017-03-021-0/+6
| | | | | | | | | * g10/keyedit.c (keyedit_quick_revuid): Signal an error when trying to revoke non-existant UID. * tests/openpgp/quick-key-manipulation.scm: Test that. GnuPG-bug-id: 2962 Signed-off-by: Justus Winter <[email protected]>
* tests: Test and document other ways to create keys.Justus Winter2017-02-151-0/+33
| | | | | | | | * doc/gpg.texi: Clarify usage and expiration arguments for key generation. * tests/openpgp/quick-key-manipulation.scm: Test all variants. Signed-off-by: Justus Winter <[email protected]>
* tests: Check expiration times of created keys.Justus Winter2017-02-151-7/+17
| | | | | | | | | | | | * tests/gpgscm/ffi.c (do_get_time): New function. (ffi_init): Expose new function. * tests/gpgscm/ffi.scm (get-time): Document new function. * tests/gpgscm/time.scm: New file. * tests/openpgp/quick-key-manipulation.scm: Use the new facilities to check the expiration times of created keys. * tests/openpgp/tofu.scm: Use the new module. Signed-off-by: Justus Winter <[email protected]>
* tests: New test for --delete-[secret-]keys.Justus Winter2016-12-191-7/+0
| | | | | | | | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/defs.scm (keys): New variable. (have-public-key?): New function. (have-secret-key?): Likewise. (have-secret-key-file?): Likewise. * tests/openpgp/delete-keys.scm: New file. * tests/openpgp/quick-key-manipulation.scm: Move the accessors to 'defs.scm'. Signed-off-by: Justus Winter <[email protected]>
* g10: Rework the --quick-* interface.Justus Winter2016-12-151-4/+4
| | | | | | | | | | | | * g10/gpg.c (opts): Rename options. (main): Update errors. * doc/gpg.texi: Update accordingly. -- I decided not to keep the old versions as aliases in the documentation because the interface is a fairly recent addition. GnuPG-bug-id: 2700 Signed-off-by: Justus Winter <[email protected]>
* g10: Create expiring keys in quick key generation mode.Justus Winter2016-12-131-17/+14
| | | | | | | | | * doc/gpg.texi: Document that fact. * g10/keygen.c (quick_generate_keypair): Use a default value. * tests/openpgp/quick-key-manipulation.scm: Test that fact. GnuPG-bug-id: 2701 Signed-off-by: Justus Winter <[email protected]>
* tests: Add a test for '--quick-addkey'.Justus Winter2016-12-091-0/+65
| | | | | | * tests/openpgp/quick-key-manipulation.scm: Test '--quick-addkey'. Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for '--quick-set-expire'.Justus Winter2016-12-071-0/+22
| | | | | | * tests/openpgp/quick-key-manipulation.scm: Test '--quick-set-expire'. Signed-off-by: Justus Winter <[email protected]>
* tests: Improve quick key manipulation test.Justus Winter2016-12-071-7/+1
| | | | | | | * tests/openpgp/quick-key-manipulation.scm: Do not update the trust database, rather be more specific when filtering the user ids. Signed-off-by: Justus Winter <[email protected]>
* tests: Move environment creation and teardown into each test.Justus Winter2016-11-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/tests.scm (log): New function. * tests/openpgp/run-tests.scm (run-tests-parallel): Do not run the startup and teardown scripts. (run-tests-sequential): Likewise. * tests/openpgp/setup.scm: Move all functions... * tests/openpgp/defs.scm: ... here and make them less verbose. (setup-environment): New function. (setup-legacy-environment): Likewise. (start-agent): Make less verbose, run 'stop-agent' at interpreter exit. (stop-agent): Make less verbose. * tests/openpgp/finish.scm: Drop file. * tests/openpgp/Makefile.am (EXTRA_DIST): Drop removed file. * tests/openpgp/4gb-packet.scm: Use 'setup-environment' or 'setup-legacy-environment' as appropriate. * 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/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/export.scm: Likewise. * tests/openpgp/finish.scm: Likewise. * tests/openpgp/genkey1024.scm: Likewise. * tests/openpgp/gpgtar.scm: Likewise. * tests/openpgp/gpgv-forged-keyring.scm: Likewise. * tests/openpgp/import.scm: Likewise. * tests/openpgp/issue2015.scm: Likewise. * tests/openpgp/issue2417.scm: Likewise. * tests/openpgp/issue2419.scm: Likewise. * tests/openpgp/key-selection.scm: Likewise. * tests/openpgp/mds.scm: Likewise. * tests/openpgp/multisig.scm: Likewise. * tests/openpgp/quick-key-manipulation.scm: Likewise. * tests/openpgp/seat.scm: Likewise. * tests/openpgp/shell.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/ssh.scm: Likewise. * tests/openpgp/tofu.scm: Likewise. * tests/openpgp/use-exact-key.scm: Likewise. * tests/openpgp/verify.scm: Likewise. * tests/openpgp/version.scm: Likewise. * tests/openpgp/issue2346.scm: Likewise and simplify. -- The previous Bourne Shell-based test suite created the environment before running all tests, and tore it down after executing them. When we created the Scheme-based test suite, we kept this design at first, but introduced a way to run each test in its own environment to prevent tests from interfering with each other. Nevertheless, every test started out with the same environment. Move the creation of the test environment into each test. This gives us finer control over the environment each test is run in. It also makes it possible to run each test by simply executing it using gpgscm without the use of the runner. Furthermore, it has the neat side-effect of speeding up the test suite if run in parallel. Signed-off-by: Justus Winter <[email protected]>
* tests: Simplify test.Justus Winter2016-10-201-36/+31
| | | | | | | * tests/openpgp/quick-key-manipulation.scm: Avoid creating a temporary home directory, just make the uids unique. Signed-off-by: Justus Winter <[email protected]>
* g10: When adding a user id, make sure the keyblock has been prepared.Neal H. Walfield2016-09-221-1/+22
| | | | | | | | | | | | * g10/keyedit.c (keyedit_quick_adduid): Call merge_keys_and_selfsig on KEYBLOCK before adding the user id. * tests/openpgp/quick-key-manipulation.scm: Make sure that the key capabilities don't change when adding a user id. (key-data): New function. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2697
* tests: Port the quick key manipulation test to Scheme.Justus Winter2016-09-201-0/+66
* tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/quick-key-manipulation.scm: New file. Signed-off-by: Justus Winter <[email protected]>