aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* python: Do not depend on access to internal data structures.Justus Winter2016-07-112-45/+76
| | | | | | | | * lang/python/gpgme.i (gpgme_data_t): Rework so that it works without access to the definition of 'struct gpgme_data'. * lang/python/helpers.c (object_to_gpgme_data_t): Add assertion. Signed-off-by: Justus Winter <[email protected]>
* python: Make result wrapping backwards compatible.Justus Winter2016-07-111-5/+4
| | | | | | * lang/python/pyme/results.py (Result.__init__): Skip missing fields. Signed-off-by: Justus Winter <[email protected]>
* Qt: Fix memleaks in testsAndre Heinecke2016-07-113-0/+20
| | | | | | | | | | * lang/qt/tests/t-keylist.cpp(cleanupTestCase): Ensure that posted events are handled for autodeletion. (testSingleKeylistSync): delete job. * lang/qt/tests/t-ownertrust.cpp(cleanupTestCase): Ditto * lang/qt/tests/t-ownertrust.cpp(testChangeOwnerTrust): Delete keylistjobs. * lang/qt/tests/t-keylocate.cpp(cleanupTestCase): Ditto
* Qt: Add some general Protocol documentationAndre Heinecke2016-07-111-0/+35
| | | | | | | * lang/qt/src/protocol.h (Protocol): Add doc. -- This explicitly documents that syncs run with exec need deletion.
* Qt: Disable t-tofuinfo testsAndre Heinecke2016-07-111-5/+1
| | | | | | | | | * lang/qt/tests/t-tofuinfo.cpp: Disable tests. -- Even with the wait this test could fail and anyway the delay was not nice. So we remove the wait hack and just wait for the bug (2405) to be fixed in GnuPG or GpgME core.
* src: Fix error handling.Justus Winter2016-07-081-2/+7
| | | | | | | * src/encrypt.c (encrypt_status_handler): Fix error handling, || conflates errors. Signed-off-by: Justus Winter <[email protected]>
* python: Fix raising stashed exceptions.Justus Winter2016-07-081-1/+7
| | | | | | | | | Fixes an issue with newer versions of Python. * lang/python/helpers.c (pygpgme_raise_callback_exception): Be more careful when restoring the exception. Signed-off-by: Justus Winter <[email protected]>
* python: Fix distcheck.Justus Winter2016-07-075-23/+68
| | | | | | | | | | | | | | * lang/python/INSTALL: Drop obsolete file. * lang/python/Makefile.am (EXTRA_DIST): Add missing files. (CLEANFILES): Remove generated files. (clean-local): Fix permissions of copied files. * lang/python/tests/Makefile.am (TESTS): Use our own setup and teardown scripts. (EXTRA_DIST): Add missing files. * lang/python/tests/final.py: New file. * lang/python/tests/initial.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* qt: Fix distcheck.Justus Winter2016-07-072-2/+6
| | | | | | | | * lang/qt/src/Makefile.am (qgpgme_headers): Add missing file. (CLEANFILES): Add generated file. * lang/qt/tests/Makefile.am (clean-local): Remove private keys. Signed-off-by: Justus Winter <[email protected]>
* cpp: Fix distcheck.Justus Winter2016-07-071-0/+2
| | | | | | * lang/cpp/src/Makefile.am (CLEANFILES): Remove generated file. Signed-off-by: Justus Winter <[email protected]>
* Qt: Add test for publicKeyAlgorithmAsStringAndre Heinecke2016-07-061-0/+22
| | | | * lang/qt/tests/t-keylist.cpp (testPubkeyAlgoAsString): New.
* Cpp: Expose gpgme_pubkey_algo_nameAndre Heinecke2016-07-062-1/+15
| | | | | | | * lang/cpp/src/key.cpp (Subkey::publicKeyAlgorithmAsString): New static variant. * lang/cpp/src/key.h: Declare function. Clarify comment about name mismatch.
* Qt: Add check for pubkeyAlgo in t-keylistAndre Heinecke2016-07-061-0/+4
| | | | | * lang/qt/tests/t-keylist.cpp (testSingleKeyListSync): Check pubkeyAlgo.
* Cpp: Add PubkeyAlgo enumAndre Heinecke2016-07-062-3/+19
| | | | | | * lang/cpp/src/key.h (Subkey::PubkeyAlgo): New enum. (Subkey::publicKeyAlgorithm): Change return type. * lang/cpp/src/key.cpp (Subkey::publicKeyAlgorithm): Use enum.
* Qt: Fix include order when buildin testAndre Heinecke2016-07-061-4/+4
| | | | | | | | | * lang/qt/tests/Makefile.am (AM_CPPFLAGS): Include cpp before gpgme src directory. -- This fixes a problem where context.h would be picked up from gpgme/src instead of including the context.h from gpgme++.
* Revert "Qt: More robust lookup of Cpp's context.h"Andre Heinecke2016-07-061-1/+1
| | | | | | | | | | * lang/qt/src/threadedjobmixin.h: Revert using full path for context.h -- This reverts commit 47bfbc9026b49b9918359af5fcc1621aab0d1065 as it causes problems depending on the include path. The proper fix will be to ensure that cpp/src is included before gpgme/src.
* Qt: Fix test build with Qt < 5.4.0Andre Heinecke2016-07-053-4/+4
| | | | | | | * lang/qt/tests/t-keylist.cpp, lang/qt/tests/t-keylocate.cpp, lang/qt/tests/t-ownertrust.cpp: Use old style SIGNAl syntax for QSignalSpy
* Qt: More robust lookup of Cpp's context.hAndre Heinecke2016-07-051-1/+1
| | | | | | | | | * lang/qt/src/threadedjobmixin.h: When building qgpgme look for context.h in the full cpp subdirectory. -- Gpgme core also contains a context.h that can lead to confusion otherwise.
* w32: Fallback to 2.1 reg key for gpgconf searchAndre Heinecke2016-07-051-3/+14
| | | | | | | | | * src/w32-util.c (_gpgme_get_gpgconf_path): Fallback to 2.1 installer registry key. -- Finding gpgconf is utterly important so we should be as compatible as possible.
* Doc: Document pinentry modeAndre Heinecke2016-07-041-0/+56
| | | | | | | * doc/gpgme.texi (Passphrase Callback): Document as context attribute. (gpgme_set_passphrase_cb): Note that this requires LOOPBACK mode with GnuPG 2.1.
* Qt: Add testTofuSignCountAndre Heinecke2016-07-041-1/+83
| | | | | | | | | * src/lang/qt/tests/t-tofuinfo.cpp(testTofuSignCount): New. (initTestCase): Set gpg-agent loopback pinentry config. (signAndVerify): Helper for tofuTestSignCount. -- Also needs the wait code because of GnuPG-Bug-Id: 2405
* Qt: Add test passphrase providerAndre Heinecke2016-07-042-1/+48
| | | | | * lang/qt/tests/t-support.h (TestPassphraseProvider): New. * lang/qt/tests/Makefile.am (t_tofuinfo_SOURCES): Add t-support.h
* Cpp: Add support for TOFU_CONFLICT sigsumAndre Heinecke2016-07-042-1/+6
| | | | | | * lang/cpp/src/verificationresult.cpp (GpgME::Signature::Summary): Handle TOFU_CONFLICT. * lang/cpp/src/verificationresult.h (Summary): Add TofuConflict.
* Cpp: Add support for pinentry_modeAndre Heinecke2016-07-042-0/+50
| | | | | | * lang/cpp/src/context.cpp (Context::pinentryMode): Return mode. (Context::setPinentryMode): Set mode. * lang/cpp/src/context.h (PinentryMode): Add enum.
* Qt: Add test for TofuInfoAndre Heinecke2016-07-012-3/+167
| | | | | | | | * lang/qt/tests/t-tofuinfo.cpp: New. * lang/qt/tests/Makefile.am: Update accordingly. -- The test currently contains a workaround for GnuPG-Bug-Id 2405
* Cpp: Add TofuInfo to signaturesAndre Heinecke2016-07-016-3/+339
| | | | | | | | | | | | * lang/cpp/src/tofuinfo.cpp, lang/cpp/src/tofuinfo.h: New class. * lang/cpp/src/verificationresult.cpp (Signature::tofuInfo): New. (VerificationResult::Private): Handle tofu info. (GpgME::operator<<(std::ostream &os, const Signature &sig)): Include TofuInfo in dump. * lang/cpp/src/verificationresult.h (Signature::tofuInfo): New. * lang/cpp/src/Makefile.am (main_sources, gpgmepp_headers): Add new files. * configure.ac (LIBGPGMEPP_LT_REVISION): Bump for new API.
* core: Clarify documentation of tofu_stats addressAndre Heinecke2016-07-011-1/+6
| | | | | | | | * src/gpgme.h.in: Mention that Address is not always in addr-spec. -- The old comment made it look like you could always expect the address to be parsable as a mailbox address.
* core: Fix identify for armored detached sigsAndre Heinecke2016-07-011-1/+1
| | | | | | | | | | | | | * src/data-identify.c (basic_detection): Return signature for signature. -- This causes identify to return signature for both binary and ascii armored detached signatures where previously it would have returned signed for armored signatures and signature for binary signatures. GnuPG-Bug-Id: 2314
* tests: Fix trivial memory leaks.Justus Winter2016-06-278-10/+22
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* Cpp: Expose new data_identify valuesAndre Heinecke2016-06-272-1/+5
| | | | | | * lang/cpp/src/data.cpp (GpgME::Data::type): Handle PGP Encrypted and Signature. * lang/cpp/src/data.h: Add values accordingly.
* Cpp: Do not treat KEYEXPIRED as errorAndre Heinecke2016-06-271-2/+0
| | | | | | | | | * lang/cpp/src/editinteractor.cpp (status_to_error): No error for KEYEXPIRED. -- As keyexpired status is sent even if a subkey is expired we can not treat it as a global error.
* 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.
* core: Add closer inspection of "PGP MESSAGE".Werner Koch2016-06-231-2/+27
| | | | | | | * src/data-identify.c (inspect_pgp_message): New. (basic_detection): Un-const arg DATA. Call inspect_pgp_message. Signed-off-by: Werner Koch <[email protected]>
* core: Add a base 64 decoder.Werner Koch2016-06-233-1/+272
| | | | | | | | | | | | | | * src/b64dec.c: New. Taken from gnupg. Prefix function names with _gpgme_ and change to use standard C malloc functions. * src/util.h.h (struct b64state): New. * src/Makefile.am (main_sources): Add file. -- The file b64dec.c has been taken from gnupg commit e430ff6ad0b7dcfcebd92b825dd5168205447ff3 Signed-off-by: Werner Koch <[email protected]>
* core: Detect compressed signed OpenPGP data.Werner Koch2016-06-221-9/+18
| | | | | | | | * src/data-identify.c (next_openpgp_packet): Allow partial encoding. (pgp_binary_detection): Handle compressed packets. -- Signed-off-by: Werner Koch <[email protected]>
* tests: Add new test tool run-identify.Werner Koch2016-06-213-1/+132
| | | | | | | | * 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]>
* core: Enhance gpgme_data_identify to detect binary PGP messages.Werner Koch2016-06-213-1/+233
| | | | | | | | | | | | | | * src/gpgme.h.in (GPGME_DATA_TYPE_PGP_ENCRYPTED): New. (GPGME_DATA_TYPE_PGP_SIGNATURE): New. * src/data-identify.c: Add enum for OpenPGP packet types. (buf32_to_ulong): New. (next_openpgp_packet): New. Based on the gnupg/kbx/keybox-openpgp.c implementation and relicensed to LGPL by g10 Code. (pgp_binary_detection): New. (basic_detection): Call pgp_binary_detection instead of returning unknown. Signed-off-by: Werner Koch <[email protected]>
* python: Improve autmatically generated docstrings.Justus Winter2016-06-162-10/+23
| | | | | | | | * lang/python/gpgme.i: Add comment. * lang/python/pyme/core.py (__getattr__): Rewrite automatically generated doctrings for the wrapper methods. Signed-off-by: Justus Winter <[email protected]>
* python: Make result objects more robust.Justus Winter2016-06-164-4/+224
| | | | | | | | | | | | | | | | Results returned by the GPGME are fragile, i.e. they are only valid until the next operation is performed in the context. We cannot arbitrarily constrain the lifetime of Python objects, we therefore create deep copies of the results. * lang/python/gpgme.i (gpgme_tofu_info_t): Turn these into a list. (gpgme_*_result_t): Create deep copies of these objects. * lang/python/helpers.c (pygpgme_wrap_fragile_result): New function. * lang/python/helpers.h (pygpgme_wrap_fragile_result): New prototype. * lang/python/pyme/results.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Avoid creating SWIG proxy classes.Justus Winter2016-06-162-2/+2
| | | | | | | | * lang/python/Makefile.am (gpgme_wrap.c): Use '-builtin' to make SWIG generate builtin types for c types. * lang/python/gpgme.i (pygpgme_wrap_gpgme_data_t): Adapt slightly. Signed-off-by: Justus Winter <[email protected]>
* python: Simplify wrapping glue.Justus Winter2016-06-162-23/+22
| | | | | | | | * lang/python/pyme/core.py: Rename '_getctype' to '_ctype' and turn it into a string. Likewise rename '_getnameprepend' to '_cprefix'. * lang/python/helpers.c: Adapt accordingly. Signed-off-by: Justus Winter <[email protected]>
* python: Rework callbacks.Justus Winter2016-06-164-89/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | Simplify how the lifetime of callback arguments is managed. * lang/python/gpgme.i (gpgme_edit_cb_t): Check arguments. (PyObject_p_p, void_p_p): Drop rather dangerous interface. (pygpgme_unwrap_gpgme_ctx_t): New function. * lang/python/helpers.c (pygpgme_clear_generic_cb): Drop dangerous function. (pyPassphraseCb): Assert contract. (pygpgme_set_passphrase_cb): Use Python's calling convention so that we can raise exceptions. Hand in 'self', get the wrapped object, and simply store the hook data as attribute of the wrapper object. (pyProgressCb, pygpgme_set_progress_cb): Likewise. (pygpgme_set_status_cb): Likewise. (pygpgme_data_new_from_cbs): Likewise. * lang/python/helpers.h (pygpgme_clear_generic_cb): Drop prototype. (pygpgme_set_passphrase_cb): Update prototype. (pygpgme_set_progress_cb): Likewise. (pygpgme_set_status_cb): Likewise. (pygpgme_data_new_from_cbs): Likewise. (pygpgme_unwrap_gpgme_ctx_t): New prottotype. * lang/python/pyme/core.py (Context, Data): Update callsites. Signed-off-by: Justus Winter <[email protected]>
* python: Wrap objects implementing the buffer protocol.Justus Winter2016-06-165-63/+179
| | | | | | | | | | | | | | | | | * lang/python/Makefile.am: Add the toplevel source directory to CFLAGS when compiling the bindings so that we can use private header files. * lang/python/gpgme.i (gpgme_data_t): Rework the object wrapping. Do not create a Python wrapper object, merely a gpgme_data_t object, and keep references to buffer objects, if any. If necessary, update the buffer after the function call. (pygpgme_wrap_gpgme_data_t): New function. * lang/python/helpers.c (object_to_gpgme_data_t): Rework object wrapping. Also wrap objects implementing the buffer protocol. * lang/python/helpers.h (object_to_gpgme_data_t): Update prototype. (pygpgme_wrap_gpgme_data_t): New prototype. * lang/python/tests/t-idiomatic.py: Demonstrate this. Signed-off-by: Justus Winter <[email protected]>
* python: Add properties to wrapped object.Justus Winter2016-06-161-6/+82
| | | | | | | | | | | | | | | | | * lang/python/pyme/core.py (GpgmeWrapper.__repr__): Saner representation. (GpgmeWrapper.__str__): Construct a nicer human readable string. (GpgmeWrapper._boolean_properties): New field. (GpgmeWrapper.__wrap_boolean_property): New function. (GpgmeWrapper.__getattr__): Wrap functions using properties. (GpgmeWrapper.__setattr__): New method. Likewise wrap functions. (Context.signers): New property. (Context.pinentry_mode): Likewise. (Context._boolean_properties): List boolean properties. (Context.__init__): Add keyword arguments for properties and apply them. Signed-off-by: Justus Winter <[email protected]>
* python: Improve the documentation.Justus Winter2016-06-165-102/+148
| | | | | | | | | | * lang/python/Makefile.am: Copy the README file. * lang/python/README: Rename, convert to org, and update. * lang/python/pyme/__init__.py: Move license out of the docstring, update docstring. * lang/python/pyme/core.py: Add and update docstrings. Signed-off-by: Justus Winter <[email protected]>
* python: Get version information from the build system.Justus Winter2016-06-165-59/+76
| | | | | | | | | | | * configure.ac: Generate 'setup.py' and 'version.py'. * lang/python/Makefile.am: Use generated setup script. * lang/python/pyme/version.py: Turn it into a template, and get version information from the build system. Also drop some variables. * lang/python/setup.py: Likewise. This way we can avoid importing the version module, which is frowned upon and actually caused a problem. Signed-off-by: Justus Winter <[email protected]>
* python: Fix exception leak.Justus Winter2016-06-161-0/+1
| | | | | | * lang/python/helpers.c (pygpgme_stash_callback_exception): Fix leak. Signed-off-by: Justus Winter <[email protected]>
* python: Fix license.Justus Winter2016-06-161-3/+3
| | | | | | | | Other parts of the build system are also LGPLed. * lang/python/Makefile.am: Fix license. Signed-off-by: Justus Winter <[email protected]>
* core: Make sure FD_SET is not used with an out of range fd.Werner Koch2016-06-141-0/+12
| | | | | | | * src/posix-io.c (_gpgme_io_select): Check for FD out of range. -- Signed-off-by: Werner Koch <[email protected]>
* python: Improve error handling.Justus Winter2016-06-081-6/+23
| | | | | | | * lang/python/helpers.c (pyPassphraseCb): Handle write errors. (pyEditCb): Likewise. Signed-off-by: Justus Winter <[email protected]>