aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Fix additional memleaks in thread testsAndre Heinecke2016-11-102-2/+10
| | | | | | | * tests/gpg/t-thread-keylist-verify.c (start_verify): Release data. (start_keylist): Unref keys. * tests/gpg/t-thread-keylist.c (start_keylist): Unref keys.
* tests: Improve new thread testsAndre Heinecke2016-11-102-0/+14
| | | | | | | | | | * tests/gpg/t-thread-keylist-verify.c (start_keylist): Mark arg as unused. Release context. (start_verify): Ditto. (main): Mark args as unused. * tests/gpg/t-thread-keylist.c (start_keylist): Mark arg as unused. Release context. (main): Mark args as unused.
* core: Use gpgrt locking for thread safenessAndre Heinecke2016-11-103-3/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Require libgpg-error 1.17. No longer check for pthread. * doc/gpgme.texi: Document removed neccessity for thread safe gpgme flavours. * src/sema.h (DEFINE_GLOBAL_LOCK), (DEFINE_STATIC_LOCK, INIT_LOCK, DECLARE_LOCK) (DESTROY_LOCK, LOCK, UNLOCK): Change to gpgrt equivalents. * src/posix-sema.c, src/w32-sema.c: Removed. * src/Makefile.am: Remove libpthread and Update accordingly. * src/ath.c, src/ath.h (ath_mutex_init) (ath_mutex_destroy, ath_mutex_lock, ath_mutex_unlock): Removed. * src/ath.h (ATH_MUTEX_INITIALIZER): Removed. * src/version.c (do_subsystem_inits): sema_subsystem_init is no longer required. * tests/gpg/Makefile.am: Add new threading tests. (t_thread1_LDADD, t_cancel_LDADD): Use just gpgme. * tests/gpg/t-thread-keylist-verify.c, tests/gpg/t-thread-keylist.c: New. * src/gpgme-config.in: Use -lgpgme for thread-model pthread. -- Using gpgrt locks instead of pthread locks removes the neccessity to link pthread directly to gpgme and have a different, thread safe flavor of gpgme. Now gpgme is thread-safe if the conditions mentioned in the doc are met. As the cpp bindings linked against libgpgme and not libgpgme-pthread this fixes threading problems with them. libgpgme-pthread is removed but gpgme-config still supports --thread=pthread for compatibility with find scripts.
* core: Add gpgme_op_query_swdb and helper.Werner Koch2016-11-032-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_query_swdb_result_t): New. (gpgme_op_query_swdb): New. (gpgme_op_query_swdb_result): New. * src/libgpgme.vers, src/gpgme.def: Add the two new functions. * src/queryswdb.c: New. * src/Makefile.am (main_sources): Add new file. * src/context.h (OPDATA_QUERY_SWDB): New. * src/engine-backend.h (struct engine_ops): Add field 'query_swdb'. Adjust all initializer. * src/engine.c (_gpgme_engine_op_query_swdb): New. * src/engine-gpgconf.c (parse_swdb_line): New. (gpgconf_query_swdb): New. (_gpgme_engine_ops_gpgconf): Register that function. * src/util.h (GPG_ERR_TOO_OLD): Define for older libgpg-error. (GPG_ERR_ENGINE_TOO_OLD): Ditto. * tests/run-swdb.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add new debug tool. Signed-off-by: Werner Koch <[email protected]>
* core: New API functions gpgme_set_sender, gpgme_get_sender.Werner Koch2016-10-253-0/+81
| | | | | | | | | | | | | | | | | | | | | | | * src/context.h (struct gpgme_context): Add field 'sender'. * src/gpgme.c: Include mbox-util.h. (gpgme_release): Free SENDER. (gpgme_set_sender): New. (gpgme_get_sender): New. * src/gpgme.def, src/libgpgme.vers: Add new functions. * src/engine-gpg.c (append_args_from_sender): New. (gpg_encrypt_sign, gpg_sign): Call append_args_from_sender. (gpg_verify): Add arg CTX. Call append_args_from_sender/ * src/engine-gpgsm.c (gpgsm_verify): Add dummy arg CTX. * src/engine-uiserver.c (uiserver_verify): Ditto. * src/engine.c (_gpgme_engine_op_verify): Add arg CTX. * src/verify.c (verify_start): Pass CTX to engine function. * tests/gpg/t-verify.c (main): Add some checks for new functions. * tests/run-sign.c (main): Add option --sender. * tests/run-verify.c (main): Ditto. Signed-off-by: Werner Koch <[email protected]>
* tests: Make t-cancel more portable.Werner Koch2016-10-141-1/+7
| | | | | | * tests/gpg/t-cancel.c: Include sys/time.h and protect sys/select.h. Signed-off-by: Werner Koch <[email protected]>
* Add missing includes.Justus Winter2016-10-061-0/+1
| | | | | | | | * lang/cpp/src/key.cpp: Include <strings.h> for 'strcasecmp'. * tests/gpg/t-cancel.c: Include <sys/select.h> for 'fd_set' and friends. Signed-off-by: Justus Winter <[email protected]>
* tests: Fix blunder.Justus Winter2016-09-271-1/+1
| | | | | | -- Fixes-commit: a423603f Signed-off-by: Justus Winter <[email protected]>
* tests: Fix check for gpg versions not reporting the critical flag.Justus Winter2016-09-271-0/+1
| | | | | | | * lang/python/tests/t-sig-notation.py: Also blacklist 2.0.x. * tests/gpg/t-sig-notation.c: Likewise. Signed-off-by: Justus Winter <[email protected]>
* move some file encodings to UTF-8Daniel Kahn Gillmor2016-09-232-5/+5
| | | | | | | | | | | | | | | * THANKS, doc/ChangeLog-2011, tests/ChangeLog-2011, tests/gpg/geheim.txt: convert from iso 8859-1 to utf-8. * lang/qt/src/dataprovider.cpp, lang/qt/src/qgpgmerefreshkeysjob.cpp, lang/qt/src/qgpgmesecretkeyexportjob.cpp: replace U+FFFD REPLACEMENT CHARACTER with proper U+00E4 LATIN SMALL LETTER A WITH DIAERESIS. -- Note that src/versioninfo.rc.in is still ISO-8859-1. I don't know whether Windows will properly handle UTF-8 in this file or not, so i have not touched it. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* tests: Check data after decryptionAndre Heinecke2016-09-231-2/+12
| | | | | * tests/gpgsm/t-decrypt.c (main): Check data matches expected. Only print result if it does not.
* tests: Add test for cancellationDaiki Ueno2016-09-223-2/+276
| | | | | | | | | | * tests/gpg/t-cancel.c: New file. * tests/gpg/Makefile.am (tests_skipped): New variable, default to t-genkey and t-cancel. (noinst_PROGRAMS): Add $(tests_skipped). * tests/gpg/.gitignore: Add t-cancel. Signed-off-by: Daiki Ueno <[email protected]>
* tests: Fix select usage in t-eventloopDaiki Ueno2016-09-221-1/+5
| | | | | | * tests/gpg/t-eventloop.c (do_select): Supply timeout value to select. Signed-off-by: Daiki Ueno <[email protected]>
* tests: Use --batch for gpg import.Werner Koch2016-09-201-3/+3
| | | | | | | | | * lang/python/tests/Makefile.am (./pubring-stamp): Use --batch with GPG to avoid Pinentries during import when using GnuPG >= 2.1. Replace touch by echo. * tests/gpg/Makefile.am (./pubring-stamp): Ditto. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_interact, deprecate gpgme_op_edit.Werner Koch2016-09-151-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_interact_cb_t): New. (GPGME_INTERACT_CARD): New. (gpgme_op_interact_start, gpgme_op_interact): New. * src/libgpgme.vers, src/gpgme.def: Add new functions. * src/edit.c (op_data_t): Rename fnc to fnc_old and change users. Add fnc. (edit_status_handler): Call old or new callback. (command_handler): Ditto. (interact_start): New. (gpgme_op_interact_start, gpgme_op_interact_start): New. * src/status-table.c (_gpgme_status_to_string): New. * tests/gpg/t-edit.c (edit_fnc): Rename to interact_fnc and change type of STATUS. Use gpgme_io_writen. (main): s/gpgme_op_edit/gpgme_op_interact/. -- This change will eventually allow us to remove all those status codes from gpgme.h. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_tofu_policyWerner Koch2016-09-142-1/+179
| | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_tofu_policy_start): New function. (gpgme_op_tofu_policy): New function. * src/libgpgme.vers, src/gpgme.def: Add new functions. * src/tofupolicy.c: New. * src/Makefile.am (main_sources): Add that file. * src/context.h (ctx_op_data_id_t): Add OPDATA_TOFU_POLICY. * src/engine.c (_gpgme_engine_op_tofu_policy): New. * src/engine-backend.h (engine_ops): Add funcptr 'tofu_policy'. Adjust all engine initializations. * src/engine-gpg.c (gpg_tofu_policy): New. (_gpgme_engine_ops_gpg): Register this function. * tests/run-tofu.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add it. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_keysign.Werner Koch2016-09-142-1/+263
| | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_op_keysign_start, gpgme_op_keysign): New. (GPGME_KEYSIGN_LOCAL): New. (GPGME_KEYSIGN_LFSEP): New. (GPGME_KEYSIGN_NOEXPIRE): New. * src/context.h (ctx_op_data_id_t): Add OPDATA_KEYSIGN. * src/keysign.c: New. * src/Makefile.am (main_sources): Add keysig. * src/libgpgme.vers, src/gpgme.def: Add gpgme_op_keysign_start. * src/engine.c (_gpgme_engine_op_keysign): New. * src/engine-backend.h (engine_ops): Add 'keysign' and adjust all engine initializers. * src/engine-gpg.c (_add_arg): Add args PREFIX and ARGLEN and change callers to set them. (add_arg_pfx): New. (add_arg_len): New. (gpg_keysign): New. (_gpgme_engine_ops_gpg): Set keysign to gpg_keysign. * tests/run-keysign.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add run-keysign. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_revuid.Werner Koch2016-09-141-2/+24
| | | | | | | | | | | | | * src/engine.h (GENKEY_EXTRAFLAG_REVOKE): New. * src/genkey.c (adduid_start): Rename to addrevuid_start. Add arg REVOKE and pass it as extraflags. Remove useless ARMOR extraflag. Adjust callers. (gpgme_op_revuid_start, gpgme_op_revuid): New. * src/gpgme.def, src/libgpgme.vers: Add them. * tests/run-genkey.c: Add option --revuid. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_adduid.Werner Koch2016-09-141-17/+55
| | | | | | | | | | | | | * src/genkey.c: Replace most error codes GPG_ERR_INV_VALUE by GPG_ERR_INV_ARG. (struct op_data_t): Add field UIDMODE. (genkey_status_handler): Use UIDMODE. (adduid_start): New. (gpgme_op_adduid_start, gpgme_op_adduid): New. * src/gpgme.def, src/libgpgme.vers: Add them. * tests/run-genkey.c: Add option --adduid. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_createsubkey.Werner Koch2016-09-141-5/+36
| | | | | | | | | | | | * src/genkey.c (createsubkey_start): New. (gpgme_op_createsubkey_start, gpgme_op_createsubkey): New. * src/gpgme.def, src/libgpgme.vers: Add them. * src/engine-gpg.c (gpg_createkey): Factor some code out to ... (gpg_add_algo_usage_expire): new. (gpg_addkey): Implement. * tests/run-genkey.c: Add option --addkey. Signed-off-by: Werner Koch <[email protected]>
* tests: Mark lots of unused vars and fix const mismatches.Werner Koch2016-09-1336-216/+289
| | | | Signed-off-by: Werner Koch <[email protected]>
* tests: Use gpgme_io_write in passhrase callbacks.Werner Koch2016-09-133-20/+21
| | | | | | | | * tests/gpg/t-support.h (passphrase_cb): Use gpgme_io_write. * tests/gpgsm/t-support.h (passphrase_cb): Ditto. * tests/run-support.h (passphrase_cb): Ditto. Signed-off-by: Werner Koch <[email protected]>
* core: New function gpgme_op_create_key.Werner Koch2016-09-132-1/+349
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/engine-backend.h (engine_ops): Change prototype of genkey. * src/engine-gpgsm.c (gpgsm_genkey): Change accordingly. * src/engine-gpg.c (gpg_genkey): Change it to a dispatcher. (gpg_createkey_from_param): New for the old functionality. (gpg_createkey_legacy): New. Stub for now. (gpg_createkey): New. (gpg_addkey): New. Stub for now. (gpg_adduid): New. Stub for now. * src/engine.c (_gpgme_engine_op_genkey): Add new args. * src/genkey.c (op_data_t): Add field ERROR_CODE. (parse_error): New. (genkey_status_handler): Parse ERROR status line. (genkey_start): Use NULL/0 for the new args. (createkey_start): New. (gpgme_op_createkey_start, gpgme_op_createkey): New. * src/gpgme.def, src/libgpgme.vers: Add gpgme_op_createkey_start and gpgme_op_createkey. * src/gpgme.h.in (_gpgme_op_genkey_result): Add fields PUBKEY and SECKEY. (GPGME_CREATE_SIGN): New. (GPGME_CREATE_ENCR): New. (GPGME_CREATE_CERT): New. (GPGME_CREATE_AUTH): New. (GPGME_CREATE_NOPASSWD): New. (GPGME_CREATE_SELFSIGNED): New. (GPGME_CREATE_NOSTORE): New. (GPGME_CREATE_WANTPUB): New. (GPGME_CREATE_WANTSEC): New. (GPGME_CREATE_FORCE): New. * tests/run-genkey.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add it. -- This function uses the new --quick-gen-key API of gpg. A limited compatibility mode to use older gpg versions and gpgsm will eventually be provided. Not all flags are currently implemented. ./run-genkey --unprotected --force [email protected] Create a new standard key with the given user id. --force is used to allow creating more than one key with that user id in the keyring. ./run-genkey --unprotected --force \ [email protected] default default 2145826800 Creates a new standard key with an expiration date of 2037-12-31. ./run-genkey --unprotected --force \ [email protected] future-default default 2145826800 Create a standard key using the fugure default algorithms. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix version comparison.Justus Winter2016-09-121-2/+2
| | | | | | | * tests/gpg/t-sig-notation.c: Fix version comparison. Fixes-commit: a0263ad2 Signed-off-by: Justus Winter <[email protected]>
* tests: Make signature notation test compatible with older GnuPGs.Justus Winter2016-09-121-2/+30
| | | | | | | | | * lang/python/tests/t-sig-notation.py: Only check the critical flag when GnuPG >= 2.1.13 is used. * tests/gpg/t-sig-notation.c: Likewise. Fixes-commit: c88c9ef3 Signed-off-by: Justus Winter <[email protected]>
* core,cpp: Extend the TOFU information.Werner Koch2016-09-072-5/+10
| | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpeme_tofu_info): Rename FIRSTSEEN to SIGNFIRST and LASTSEEN to SIGNLAST. Add ENCRFIST and ENCRLAST. * src/keylist.c (parse_tfs_record): Parse to ENCRFIRST and ENCRLAST. * src/verify.c (parse_tofu_stats): Ditto. * tests/run-keylist.c (main): Adjust and print encrypt stats. * tests/run-verify.c (print_result): Ditto. * lang/cpp/src/tofuinfo.h (TofuInfo): Rename firstSeen to signFirst and lastSeen to signLast. Add encrCount, encrFirst and encrLast. * lang/cpp/src/tofuinfo.cpp (encrCount, encrFirst, encrLast): New. -- The latest GnuPG commits have the needed changes but we also allow the use of currently released GnuPG version. Signed-off-by: Werner Koch <[email protected]>
* tests: Set passphrase cb in t-encrypt-mixedAndre Heinecke2016-09-061-0/+2
| | | | | | | | * tests/gpg/t-encrypt-mixed.c (main): Set passphrase cb. -- This fixes the test when run without an agent and our faked pinentry program.
* core: Add GPGME_KEYLIST_MODE_WITH_TOFU.Werner Koch2016-08-252-9/+76
| | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_KEYLIST_MODE_WITH_TOFU): New. * src/engine-gpg.c (gpg_keylist_build_options): Use that. * src/keylist.c: Include limits.h. (parse_tfs_record): New. (keylist_colon_handler): Support TFS record. * tests/run-keylist.c: Include time.h. (isotimestr): New. (main): Add option --tofu. Print TOFU info. * tests/run-verify.c: Include time.h. (isotimestr): New. (print_result): Use isotimestr for TOFU dates. Signed-off-by: Werner Koch <[email protected]>
* core: Change the way TOFU information are represented.Werner Koch2016-08-232-23/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_signature): Remove field 'tofu'. Add field 'key'. (struct _gpgme_key): Add field 'fpr'. (struct _gpgme_user_id): Add field 'tofu'. (struct _gpgme_tofu_info): Remove fields 'address' and 'fpr'. * src/key.c (gpgme_key_unref): Release TOFU and FPR. * src/keylist.c (keylist_colon_handler): Store the fingerprint of the first subkey also in KEY. * src/verify.c (release_tofu_info): Remove. (release_op_data): Release KEY. (parse_tofu_user): Rewrite for new data structure. (parse_tofu_stats): Ditto. (parse_tofu_stats_long): Ditto. * tests/run-verify.c (print_result): Ditto. * tests/run-keylist.c (main): Print more fields. -- TOFU information are now associated with the user ID and not with a separate object. Note that this breaks code relying on the former non-released TOFU feature. The C++ bindings won't work right now. Signed-off-by: Werner Koch <[email protected]>
* core: Add new items for gpgme_get_dirinfo.Werner Koch2016-08-221-2/+14
| | | | | | | | | | | | | * src/dirinfo.c (WANT_SYSCONFDIR, WANT_LIBEXECDIR, WANT_LIBDIR): New. (WANT_DATADIR, WANT_LCOALEDIR, WANT_AGENT_SSH_SOCKET): New (WANT_DIRMNGR_SOCKET): New. (dirinfo): Add fields 'sysconfdir', 'bindir', 'libexecdir', 'libdir', 'datadir', 'localedir', 'agent_ssh_socket', and 'dirmngr_socket'. (parse_output): Set these fields. (get_gpgconf_item): Return them. (gpgme_get_dirinfo): Likewise. Signed-off-by: Werner Koch <[email protected]>
* core: New global flag "require-gnupg".Werner Koch2016-08-161-1/+9
| | | | | | | | | | | * src/gpgme.c (gpgme_set_global_flag): Add flag. * src/engine.c (engine_minimal_version): New variable. (_gpgme_set_engine_minimal_version): New function. (gpgme_get_engine_info): Check that flag. * tests/run-keylist.c (main): New option --require-gnupg. Signed-off-by: Werner Koch <[email protected]>
* core: Make use of the "size-hint" in engine-gpg.Werner Koch2016-08-121-2/+67
| | | | | | | | | | | | | | * src/engine-gpg.c: Include data.h. (add_input_size_hint): New. (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, gpg_sign) (gpg_verify): Call new function, * tests/run-encrypt.c (status_cb): Print to stderr. (progress_cb): New.o (main): Add option --progress. Print full-status lines. Provide a size for the input data. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix memory leak.Justus Winter2016-08-101-0/+1
| | | | | | * tests/gpg/t-encrypt-mixed.c (main): Free 'text2'. Signed-off-by: Justus Winter <[email protected]>
* core: Add support for mixed symmetric and asym encAndre Heinecke2016-08-093-3/+139
| | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_encrypt_flags_t): New flag GPGME_ENCRYPT_SYMMETRIC. * src/engine-gpg.c (gpg_encrypt): Also add --symmetric if the flag is given. * NEWS: Mention new flag. * tests/run-encrypt.c (show_usage): Extend for --symmetric. (main): Handle --symmetric. (main): Set passphrase_cb in loopback mode. (main): Fix encrypt call if no recipients are given. * tests/gpg/t-encrypt-mixed.c: New. * tests/gpg/Makefile.am (c_tests): Add new test. * doc/gpgme.texi: Document new flag.
* core: Extend gpgme_subkey_t to carry the keygrip.Werner Koch2016-08-041-3/+38
| | | | | | | | | | | | * src/gpgme.h.in (struct _gpgme_subkey): Add file 'keygrip'. * src/key.c (gpgme_key_unref): Free KEYGRIP. * src/keylist.c (keylist_colon_handler): Parse GRP records. * src/engine-gpg.c (gpg_keylist_build_options): Do not use --with-fingerprint options for gpg versions >= 2.1.15. * tests/run-keylist.c (main): Print subkeys and keygrips. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix trivial memory leaks.Justus Winter2016-06-278-10/+22
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* tests: Add new test tool run-decryptAndre Heinecke2016-06-242-1/+190
| | | | | * tests/run-decrypt.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add run-decrypt.
* tests: Add new test tool run-identify.Werner Koch2016-06-212-1/+130
| | | | | | | | * src/gpgme-tool.c (gt_identify): Add new strings. * tests/run-identify.c: New. * tests/Makefile.am (noinst_PROGRAMS): Add run-identify. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix notation tests.Justus Winter2016-06-011-3/+3
| | | | | | | | | * lang/python/tests/t-sig-notation.py (check_result): Check critical flag. * tests/gpg/t-sig-notation.c (check_result): Likewise. Fixes-commit: 1cacd7d0 Signed-off-by: Justus Winter <[email protected]>
* core: Set notation flags for verify.Werner Koch2016-06-011-2/+15
| | | | | | | | | | | | | * src/gpgme.h.in (GPGME_STATUS_NOTATION_FLAGS): New. * src/status-table.c (status_table): Add new status. * src/verify.c (parse_notation): Handle flags. Also fix NOTATION_DATA in case gpg would not percent-escape spaces. (_gpgme_verify_status_handler): Handle flags. * tests/run-verify.c (print_result): Print notaion data. -- Note that this does only work with the soon to be released GnuPG 2.1.13.
* tests: Fix test.Justus Winter2016-05-271-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* api: Return Tofu info for signatures.Werner Koch2016-05-211-0/+39
| | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_tofu_policy_t): New. (gpgme_status_code_t): Add status codes for TOFU. (struct _gpgme_tofu_info, gpgme_tofu_info_t): New. (struct _gpgme_signature): Add field 'tofu'. * src/status-table.c (status_table): Add new codes. * src/verify.c: Include limits.h. (release_tofu_info): New. (release_op_data): Call that. (parse_tofu_user): New. (parse_tofu_stats): New. (parse_tofu_stats_long): New. (_gpgme_verify_status_handler): Handle TOFU status lines. * tests/run-verify.c (print_description): New. (print_result): print tofu info. Signed-off-by: Werner Koch <[email protected]>
* api: Add new function gpgme_set_ctx_flag.Werner Koch2016-05-191-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_set_ctx_flag): New prototype. * src/gpgme.c (gpgme_set_ctx_flag): New. * src/gpgme.def, src/libgpgme.vers: Add new function. * src/context.h (struct gpgme_context): Add FULL_STATUS. * src/decrypt.c (_gpgme_decrypt_status_handler): Do not call the status callback if FULL_STATUS is set. * src/genkey.c (genkey_status_handler): Ditto. * src/passphrase.c (_gpgme_passphrase_status_handler): Ditto. * src/sign.c (_gpgme_sign_status_handler): Ditto. * src/engine-backend.h (struct engine_ops): Add SET_STATUS_CB and add adjust all definitions of that variable. * src/engine.c (_gpgme_engine_set_status_cb): New. * src/op-support.c (_gpgme_op_reset): Call this function. * src/engine-gpg.c (struct engine_gpg): Add fields MON_CB and MON_CB_VALUE. (gpg_set_status_cb): New. (_gpgme_engine_ops_gpg): Register that function. (read_status): Call the monitor callback. * src/engine-gpgsm.c (struct engine_gpgsm): Add fields MON_CB and MON_CB_VALUE. (_gpgme_engine_ops_gpgsm): Register that function. (gpgsm_assuan_simple_command): Change first arg to be an engine context and adjust call callers. Call the monitor callback. * src/engine-uiserver.c (struct engine_uiserver): Add fields MON_CB and MON_CB_VALUE. (_gpgme_engine_ops_uiserver): Register that function. (uiserver_assuan_simple_command): Change first arg to be an engine context and adjust call callers. Call the monitor callback. * tests/run-verify.c (status_cb): New. (print_result): Print algo names. (main): Add option --status. -- This new feature is mainly intended for bug tracking. Having access to the raw status lines might also be useful for applications, though. Signed-off-by: Werner Koch <[email protected]>
* tests: New maintenance helper run-encrypt.Werner Koch2016-05-172-1/+219
| | | | | | * tests/run-encrypt.c: New. Signed-off-by: Werner Koch <[email protected]>
* Trailing white space cleanup for 2 files in tests/.Werner Koch2016-05-172-26/+25
| | | | --
* Fix typos found by codespell.Justus Winter2015-12-021-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* tests: Build test programs in tests/ without wrappers.Werner Koch2015-08-251-0/+1
| | | | --
* tests: Allow using run-sign to test loopback pinentry problems.Werner Koch2015-08-251-0/+26
| | | | * tests/run-sign.c: Add options --status and --loopback.
* Add an export secret key feature.Werner Koch2015-08-241-4/+37
| | | | | | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET): New. (GPGME_EXPORT_MODE_RAW): New. (GPGME_EXPORT_MODE_PKCS12): New. * src/export.c (export_start, export_ext_start): Allow new flags. * src/engine-gpg.c (export_common): Support secret key export. * src/engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto. * src/gpgme-tool.c (cmd_export): Add options --secret, --raw, and --pkcs12. * tests/run-export.c (main): Likewise. -- Note that exporting secret X.509 keys requires GnuPG 2.1.8. Signed-off-by: Werner Koch <[email protected]>
* Add offline mode support for CMS keylistingAndre Heinecke2015-07-311-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/gpgme.texi: Document offline mode. * src/context.h (gpgme_context): Add offline. * src/engine-backend.h (keylist, keylist_ext): Add engine_flags. * src/engine.c, src/engine.h (_gpgme_engine_op_keylist): Ditto. (_gpgme_engine_op_keylist_ext): Ditto. * src/engine.h (GPGME_ENGINE_FLAG_OFFLINE): New. * src/engine-gpg.c (gpg_keylist, gpg_keylist_ext): Ditto. * src/engine-gpgsm.c (gpgsm_keylist): Handle engine_flags. (gpgsm_keylist_ext): Ditto. * src/gpgme.c (gpgme_set_offline, gpgme_get_offline): New. * src/gpgme.def (gpgme_set_offline, gpgme_get_offline): New. * src/gpgme.h.in (gpgme_set_offline, gpgme_get_offline): New. * src/libgpgme.vers (gpgme_set_offline, gpgme_get_offline): New. * src/keylist.c (gpgme_op_keylist_start): Set offline flag. (gpgme_op_keylist_ext_start): Ditto. * tests/run-keylist.c (show_usage, main): Add offline argument. -- The offline engine option was introduced with gpgsm 2.1.6 it is mainly useful for a full keylisting that includes the certificate validation but does not depend on external information that could take an indefinite amount of time to collect. Signed-off-by: Andre Heinecke <[email protected]>