aboutsummaryrefslogtreecommitdiffstats
path: root/g10/t-keydb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Add option --assert-pubkey_algo.Werner Koch2024-02-101-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keyid.c (parse_one_algo_string): New. (compare_pubkey_string_part): New. (compare_pubkey_string): New. * g10/verify.c (check_assert_signer_list): New. * g10/mainproc.c (check_sig_and_print): Call check_assert_pubkey_algo. * g10/options.h (opt): Add field assert_pubkey_algos. * g10/gpg.c (oAssertPubkeyAlgo): New. (opts): Add "--assert-pubkey_algo". (assert_pubkey_algo_false): New. (main): Parse option. (g10_exit): Reorder RC modifications. Check assert_pubkey_algo_false. * common/status.h (ASSERT_PUBKEY_ALGOS): new. * common/t-support.h (LEAN_T_SUPPORT): Use a simplified version if this macro is set. * g10/gpgv.c (oAssertPubkeyAlgo): New. (opts): Add "--assert-pubkey_algo". (assert_pubkey_algo_false): New. (main): Parse option. (g10_exit): Check assert_pubkey_algo_false. * g10/t-keyid.c: New. * g10/Makefile.am: Add t-keyid. * g10/test-stubs.c: Add assert_pubkey_algos and assert_signer_list and remove from other tests. (check_assert_signer_list): Ditto. (check_assert_pubkey_algo): Ditto. -- GnuPG-bug-id: 6946
* gpg: New option --assert-signer.Werner Koch2023-04-051-0/+10
| | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (enum cmd_and_opt_values): Add oAssertSigner. (opts): Add "assert-signer". (main): Set option. (assert_signer_true): New var. (g10_exit): Evaluate new var. * g10/main.h (assert_signer_true): Declare new var. * common/status.h (STATUS_ASSERT_SIGNER): New. * g10/options.h (opt): Add field assert_signer_list. * g10/verify.c (is_fingerprint): New. (check_assert_signer_list): New. * g10/mainproc.c (check_sig_and_print): Call that function. Clear assert_signer_true on a warning. * g10/gpgv.c: Add dummy function and vars. * g10/t-keydb-get-keyblock.c: Ditto. * g10/t-keydb.c: Ditto. * g10/t-stutter.c: Ditto. --
* gpg: New option --use-keyboxd.Werner Koch2019-09-091-2/+5
| | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (oUseKeyboxd,oKeyboxdProgram): New consts. (opts): New options --use-keyboxd and --keyboxd-program. (main): Implement them. * g10/keydb.c: Move some defs out to ... * g10/keydb-private.h: new file. * g10/keydb.c: prefix function names with "internal" and move original functions to ... * g10/call-keyboxd.c: new file. Divert to the internal fucntion if --use-keyboxd is used. Add a CTRL arg to most fucntions and change all callers. * g10/Makefile.am (common_source): Add new files. (noinst_PROGRAMS): Do bot build gpgcompose. -- Note that this is just the framework with only a basic implementation of searching via keyboxd. Signed-off-by: Werner Koch <[email protected]>
* Change all http://www.gnu.org in license notices to https://Werner Koch2016-11-051-1/+1
| | | | --
* g10: Fix memory leaks.Justus Winter2016-06-281-9/+16
| | | | | | | | * g10/keydb.c (keydb_get_keyblock): Free 'sigstatus' and 'iobuf'. * g10/t-keydb-get-keyblock.c: Fix trivial memory leaks. * g10/t-keydb.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpg: Take care of keydb_new returning NULL.Werner Koch2015-12-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (keydb_new): Print an error message if needed. Also use xtrycalloc because we return an error anyway. * g10/delkey.c (do_delete_key): Handle error retruned by keydb_new. * g10/export.c (do_export_stream): Ditto. * g10/getkey.c (get_pubkey): Ditto. (get_pubkey_fast): Ditto. (get_pubkeyblock): Ditto. (get_seckey): Ditto. (key_byname): Ditto. (get_pubkey_byfprint): Ditto. (get_pubkey_byfprint_fast): Ditto. (parse_def_secret_key): Ditto. (have_secret_key_with_kid): Ditto. * g10/import.c (import_one): Ditto. (import_revoke_cert): Ditto. * g10/keyedit.c (keyedit_quick_adduid): Ditto. * g10/keygen.c (quick_generate_keypair): Ditto. (do_generate_keypair): Ditto. * g10/trustdb.c (validate_keys): Ditto. * g10/keyserver.c (keyidlist): Ditto. * g10/revoke.c (gen_desig_revoke): Ditto. (gen_revoke): Ditto. * g10/gpg.c (check_user_ids): Ditto. (main): Do not print an error message for keydb_new error. * g10/keylist.c (list_all): Use actual error code returned by keydb_new. * g10/t-keydb-get-keyblock.c (do_test): Abort on keydb_new error. * g10/t-keydb.c (do_test): Ditto. * g10/keyring.c (keyring_new): Actually return an error so that the existing keydb_new error checking makes sense for a keyring resource. (keyring_rebuild_cache): Take care of keyring_new returning an error. -- Commit 04a6b903 changed keydb_new to return an error. However the error was not checked at most places which we fix with this patch. To make things easier keydb_new prints an error message itself. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix make distcheck problem.Werner Koch2015-09-101-1/+4
| | | | | | | | | | | | | | | | * g10/test.c: Include string.h. (prepend_srcdir): New. Taken from Libgcrypt. (test_free): New. * g10/t-keydb.c (do_test): Malloc the filename. * g10/Makefile.am (AM_CPPFLAGS): Remove -DSOURCE_DIR (EXTRA_DIST): Add t-keydb-keyring.kbx. -- Using SOURCE_DIR should in general work but we have seen problems when doing this in Libgcrypt. Using the srcdir variable gives us anyway more flexibility and aligns with the way we do it in tests/openpgp. Signed-off-by: Werner Koch <[email protected]>
* g10: Improve portability of the new test driver.Werner Koch2015-09-101-2/+5
| | | | | | | | | | | | | | | | | | | | * g10/test.c: Include stdio.h and stdlib.h. (verbose): New. (print_results): Rename to exit_tests. (main): Remove atexit and call exit_tests. Set verbose. (ASSERT, ABORT): Call exit_tests instead of exit. -- Calling exit from an exit handler is undefined behaviour. It works on Linux but other systems will hit an endless loop. That is indeed unfortunate but we can't do anything about it. Calling _exit() would be possible but that may lead to other problems. Thus we change to call a custom exit function :-(. Using "make check verbose=1" is supported by tests/openpgp and thus we add the same mechanism here. Signed-off-by: Werner Koch <[email protected]>
* g10: Add test for keydb as well as new testing infrastructure.Neal H. Walfield2015-09-021-0/+87
* g10/Makefile.am (EXTRA_DIST): Add test.c. (AM_CPPFLAGS): Add -DSOURCE_DIR="\"$(srcdir)\"". (module_tests): Add t-keydb. (t_keydb_SOURCES): New variable. (t_keydb_LDADD): Likewise. * g10/t-keydb.c: New file. * g10/t-keydb-keyring.kbx: New file. * g10/test-stubs.c: New file. * g10/test.c: New file. -- Signed-off-by: Neal H. Walfield <[email protected]>.