aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* python: Initialize GPGME for the user.Justus Winter2016-06-062-1/+6
| | | | | | | * lang/python/pyme/core.py: Call 'check_version' and explain why. * lang/python/tests/support.py (init_gpgme): Drop call here. Signed-off-by: Justus Winter <[email protected]>
* python: Drop obsolete VCS keywords.Justus Winter2016-06-0636-36/+0
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Fix test suite with GnuPG prior to 2.1.12.Justus Winter2016-06-011-1/+2
| | | | | | | * lang/python/tests/Makefile.am (gpg-agent.conf): Use 'allow-loopback-pinentry'. Signed-off-by: Justus Winter <[email protected]>
* python: Make Python detection more robust.Justus Winter2016-06-012-2/+11
| | | | | | | | | | Previously, missing Python development packages made configure fail instead of merely disabling the bindings. * configure.ac: Check for 'PYTHON_VERSION'. * m4/ax_python_devel.m4: Make test non-fatal. Signed-off-by: Justus Winter <[email protected]>
* python: Improve build system integration, fix warnings.Justus Winter2016-06-012-3/+7
| | | | | | | | * lang/python/Makefile.am: Pass CFLAGS to python build system. * lang/python/helpers.c (pyPassphraseCb): Use correct type for length. (pygpgme_data_new_from_cbs): Drop unused variable. Signed-off-by: Justus Winter <[email protected]>
* Cpp: Use whitelist for status messagesAndre Heinecke2016-06-011-12/+8
| | | | | | | | | * lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse): Use whitelist instead of blacklist. -- This should be more robust when new status messages are added. The whitelist is the same GPA uses. Fixes Qt's t-ownertrust.
* Qt: Fix debug output in t-ownertrustAndre Heinecke2016-06-011-1/+3
| | | | | * lang/qt/tests/t-ownertrust.cpp (testChangeOwnerTrust): Remove general debug of trust level. Add debug output for error.
* tests: Fix notation tests.Justus Winter2016-06-012-6/+5
| | | | | | | | | * 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-015-10/+60
| | | | | | | | | | | | | * 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.
* python: use GPG_ERROR_CONFIG variableTobias Mueller2016-05-311-1/+1
| | | | | | | | | | | instead of calling gpg-error-config. This is useful when configuring with --with-gpgerror-prefix because then GPG_ERROR_CONFIG contains the correct /path/to/bin/gpg-error-config whereas calling gpg-error-config directly would look in the user's PATH (and not in the prefix where gpg-error-config was installed). Signed-off-by: Justus Winter <[email protected]>
* python: Port more tests.Justus Winter2016-05-315-5/+280
| | | | | | | | | | * lang/python/gpgme.i: Hide length fields of notations. * lang/python/tests/Makefile.am (pytests): Add new tests. * lang/python/tests/t-decrypt-verify.py: New file. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-verify.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* build: Fix URL.Justus Winter2016-05-311-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Speedup closing of fds before exec.Werner Koch2016-05-271-7/+47
| | | | | | | | * src/posix-io.c [__linux__]: Include dirent.h. (get_max_fds) [__linux__]: Try to figure out the highest used fd. -- Signed-off-by: Werner Koch <[email protected]>
* python: Port more tests.Justus Winter2016-05-277-7/+155
| | | | | | | | | | | | | | * lang/python/pyme/core.py (Data._error_check): Add 'gpgme_data_get_file_name' to the list of functions not returning an error code. * lang/python/tests/Makefile.am (pytests): Add new tests. * lang/python/tests/support.py (verbose): New variable. * lang/python/tests/t-data.py: Test setting and getting the filename. * lang/python/tests/t-encrypt-large.py: New file. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* src: Fix typo.Justus Winter2016-05-271-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* tests: Fix test.Justus Winter2016-05-271-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Implement data callbacks.Justus Winter2016-05-276-21/+405
| | | | | | | | | | | | | | | | | | | | | | * lang/python/gpgme.i (object_to_gpgme_t): Set exception on error. * lang/python/helpers.c (pyDataReadCb): New function. (pyDataWriteCb): Likewise. (pyDataSeekCb): Likewise. (pyDataReleaseCb): Likewise. (pygpgme_data_new_from_cbs): Likewise. * lang/python/helpers.h (pygpgme_data_new_from_cbs): New prototype. * lang/python/pyme/core.py (Data.__init__): Fix docstring, fix read callbacks. (Data.__del__): Fix read callbacks. (Data._free_readcb): Drop function. (Data._free_datacbs): New function. (Data.new_from_cbs): Fix setting the callbacks. (Data.write): Raise stashed exceptions. (Data.read): Likewise. * lang/python/tests/t-callbacks.py: Test new functionality. * lang/python/tests/t-data.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Fix object deallocation.Justus Winter2016-05-272-14/+29
| | | | | | | | | | | | | | | | Handing a reference to the wrapper object created a non-trivial circular reference that Pythons garbage collector is unable to break. Explicitly break it by using a weak reference. * lang/python/helpers.c (pygpgme_stash_callback_exception): Retrieve object from weak reference. * lang/python/pyme/core.py (Context.__del__): Free status callback. (Context.set_passphrase_cb): Use a weak reference. (Context.set_progress_cb): Likewise. (Context.set_status_cb): Likewise. (Context.op_edit): Likewise. Signed-off-by: Justus Winter <[email protected]>
* Improve comments.Justus Winter2016-05-271-4/+6
| | | | | | | | * src/gpgme.h.in (gpgme_data_seek_cb_t, gpgme_data_seek): Clarify that these functions return the new offset. (gpgme_data_release_cb_t): Fix name of parameter. Signed-off-by: Justus Winter <[email protected]>
* python: Fix reading data from existing files.Justus Winter2016-05-272-16/+51
| | | | | | | | | | | | | * lang/python/pyme/core.py (Data.__init__): Add 'copy' kwargument, and pass it to functions supporting it. PEP8 fix. (Data.new_from_fd): PEP8 fix. (Data.new_from_file): Give a more helpful error message if copy is False. PEP8 fix. (Data.new_from_fd): Hand the file descriptor to 'gpgme_data_new_from_fd', not a stream. Fix docstring. * lang/python/tests/t-data.py: Add tests for this. Signed-off-by: Justus Winter <[email protected]>
* src: Fix trace string.Justus Winter2016-05-251-1/+1
| | | | | | * src/data-compat.c (gpgme_data_new_from_file): Fix trace string. Signed-off-by: Justus Winter <[email protected]>
* python: Improve and test Context.wait.Justus Winter2016-05-243-13/+50
| | | | | | | | | | * lang/python/pyme/core.py (Context.wait): Improve docstring. As the context passed to 'gpgme_wait' is never NULL, it is pointless to look at the returned context. Always raise exceptions. * lang/python/tests/Makefile.am (pytests): Add new test. * lang/python/tests/t-wait.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Make all GnuPG errors available.Justus Winter2016-05-243-5/+12
| | | | | | | | * lang/python/Makefile.am (errors.i): Generate file. * lang/python/gpgme.i: Include generated file. * lang/python/pyme/errors.py: Pull in all errors and error sources. Signed-off-by: Justus Winter <[email protected]>
* python: Move the base wrapper class.Justus Winter2016-05-242-79/+77
| | | | | | | * python/lang/pyme/util.py (GpgmeWrapper): Move... * python/lang/pyme/core.py: ... here. Signed-off-by: Justus Winter <[email protected]>
* python: Support status callbacks.Justus Winter2016-05-244-0/+134
| | | | | | | | | | | | | * lang/python/helpers.c (pyStatusCb): New function. (pygpgme_set_status_cb): Likewise. * lang/python/helpers.h (pygpgme_set_status_cb): New prototype. * lang/python/pyme/core.py (Context.__init__): Initialize 'last_statuscb'. (Context._free_statuscb): New function. (Context.set_status_cb): Likewise. * lang/python/tests/t-callbacks.py: Test status callbacks. Signed-off-by: Justus Winter <[email protected]>
* python: Improve docstring.Justus Winter2016-05-241-4/+9
| | | | | | | * lang/python/pyme/core.py (Context.set_progress_cb): Improve docstring. Signed-off-by: Justus Winter <[email protected]>
* Qt: Fix test build with clangAndre Heinecke2016-05-241-1/+1
| | | | | | | * lang/qt/tests/Makefile.am (LDADD): Explicitly add -lstdc++ -- g++ does not need that but clang does need it explicitly
* Cpp: Set -std=c++11 also if CXXCPP is already setAndre Heinecke2016-05-241-6/+2
| | | | | | | | | | | | * m4/ax_cxx_compile_stdxx.m4 (AX_CXX_COMPILE_STDCXX): Set CXXCPP if neccessary. -- This fixes the build with scan-build where CXXCPP is already set but does not include stdc++11. While this deviates from the autotools-archive version of the script it does not make sense to me first to check if stdc++11 needs to be set and then not set it.
* python: Improve support for edit callbacks.Justus Winter2016-05-245-7/+114
| | | | | | | | | | * lang/python/helpers.c (pyEditCb): Stash exceptions. * lang/python/pyme/core.py (Context.op_edit): Hand in 'self'. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/t-callbacks.py: Test edit callbacks. * lang/python/tests/t-edit.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Fix hook.Justus Winter2016-05-232-2/+3
| | | | | | | * lang/python/helpers.c (pyProgressCb): Fix getting hook data. * lang/python/tests/t-callbacks.py: Show that this works. Signed-off-by: Justus Winter <[email protected]>
* python: Move edit callback function.Justus Winter2016-05-233-45/+48
| | | | | | | | * lang/python/gpgme.i (pyEditCb): Move... * lang/python/helpers.c: ... here. * lang/python/helpers.h (pyEditCb): New prototype. Signed-off-by: Justus Winter <[email protected]>
* python: Port more tests.Justus Winter2016-05-235-2/+188
| | | | | | | | | | | | * lang/python/tests/Makefile.am (TESTS_ENVIRONMENT): Set LD_LIBRARY_PATH. (pytests): Add new tests. * lang/python/tests/t-callbacks.py: Trim imports. * lang/python/tests/t-encrypt-sign.py: New file. * lang/python/tests/t-export.py: Likewise. * lang/python/tests/t-signers.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Translate list of strings.Justus Winter2016-05-231-0/+34
| | | | | | * lang/python/gpgme.i: Add typemap translating list of strings. Signed-off-by: Justus Winter <[email protected]>
* api: Return Tofu info for signatures.Werner Koch2016-05-215-2/+306
| | | | | | | | | | | | | | | | | | | | * 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 context flag "raw-description".Werner Koch2016-05-213-2/+22
| | | | | | | * src/context.h (struct gpgme_context): Add field raw_description. * src/gpgme.c (gpgme_set_ctx_flag): New flag. Signed-off-by: Werner Koch <[email protected]>
* core: New functions to help parsing of status lines.Werner Koch2016-05-212-0/+56
| | | | | | | | * src/conversion.c (_gpgme_split_fields): New. (_gpgme_strtoul_field): New. -- Signed-off-by: Werner Koch <[email protected]>
* Qt: Add test for changeownertrustAndre Heinecke2016-05-202-3/+109
| | | | | | | | | * lang/qt/tests/t-ownertrust.cpp: New test. * lang/qt/tests/Makefile.am: Add test. -- This test would have catched the issue created by not handling GPGME_STATUS_KEY_CONSIDERED.
* Cpp: Ignore STATUS_KEY_CONSIDERED when editingAndre Heinecke2016-05-201-0/+1
| | | | | * lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse): Handle GPGME_STATUS_KEY_CONSIDERED.
* api: Add new function gpgme_set_ctx_flag.Werner Koch2016-05-1923-54/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* api: Remove arbitrary restriction from gpgme_op_verify.Werner Koch2016-05-191-2/+0
| | | | | | | | | | | | | * src/verify.c (verify_start): Do not return GPG_ERR_INV_VALUES when when SIGNED_TEXT is not given. -- The original idea behind this restriction probably was that it is useless to verify a non-detached signatures without also returning the signed text. However, it is sometimes useful to just check the signature, for example to see who signed it. Signed-off-by: Werner Koch <[email protected]>
* python: Improve progress callbacks.Justus Winter2016-05-193-6/+54
| | | | | | | | | * lang/python/helpers.c (pyProgressCb): Stash python errors, convert 'what' to Unicode object. * lang/python/pyme/core.py (Context.set_progress_cb): Hand in 'self'. * lang/python/tests/t-callbacks.py: Test progress callbacks. Signed-off-by: Justus Winter <[email protected]>
* python: Robust exception handling in callbacks.Justus Winter2016-05-196-13/+187
| | | | | | | | | | | | | | | | | | * lang/python/helpers.c (pygpgme_stash_callback_exception): New function. (pygpgme_raise_callback_exception): Likewise. (pyPassphraseCb): Stash python errors. * lang/python/helpers.h (pygpgme_raise_callback_exception): New prototype. * lang/python/pyme/core.py ({Context,Data}.__init__): Move common initialization to superclass. (Context.set_progress_cb): Hand in 'self'. * lang/python/pyme/util.py (GpgmeWrapper.__init__): New function. (GpgmeWrapper.__getattr__): Raise stashed exceptions. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/t-callbacks.py: New file. Signed-off-by: Justus Winter <[email protected]>
* Qt: Check for graphviz and set HAVE_DOT correctlyAndre Heinecke2016-05-192-1/+11
| | | | | * configure.ac: Check for graphviz and define HAVE_DOT. * lang/qt/doc/Doxyfile.in (HAVE_DOT): Use variable.
* python: Add more tests.Justus Winter2016-05-196-8/+157
| | | | | | | | | | | * lang/python/tests/Makefile.am (py_tests): Add new tests. * lang/python/tests/support.py (print_data): New function. * lang/python/tests/t-decrypt.py: Use new function. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-sign.py: New file. * lang/python/tests/t-encrypt-sym.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: More type conversion fixes.Justus Winter2016-05-191-2/+24
| | | | | | | | * lang/python/helpers.c (pyPassphraseCb): Cope with 'uid_hint' being NULL, convert it to an Unicode object, and cope with the callback returning both Unicode and bytes objects. Signed-off-by: Justus Winter <[email protected]>
* python: Fix import.Justus Winter2016-05-191-1/+4
| | | | | | | * lang/python/helpers.c (pygpgme_exception_init): Make module import relative. Signed-off-by: Justus Winter <[email protected]>
* Qt: Fix compilation of unit testsAndre Heinecke2016-05-191-1/+1
| | | | | | | | * lang/qt/tests/Makefile.am (AM_CPPFLAGS): Add -DBUILDING_QGPGME. -- Without building QGpgME the headers of gpgme++ are not included corretly and taken from an already installed gpgme++.
* python: Various fixes.Justus Winter2016-05-182-5/+4
| | | | | | | * configure.ac: Fix SWIG detection, bump required Python version. * lang/python/Makefile.am: Portability fix. Signed-off-by: Justus Winter <[email protected]>
* Fix typo in compatibility declarationAndre Heinecke2016-05-181-1/+1
| | | | | | | | * src/op-support.c (GPG_ERR_SUBKEYS_EXP_REV): Change to GPG_ERR_SUBKEYS_EXP_OR_REV. -- This fixes the build with libgpg-error < 1.23
* tests: New maintenance helper run-encrypt.Werner Koch2016-05-173-2/+220
| | | | | | * tests/run-encrypt.c: New. Signed-off-by: Werner Koch <[email protected]>