aboutsummaryrefslogtreecommitdiffstats
path: root/lang (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-07-08python: idiomatic interface prototypejustus/idiomatic-py-0Justus Winter19-81/+756
Signed-off-by: Justus Winter <[email protected]>
2016-07-08python: Port more tests.Justus Winter2-0/+77
* lang/python/tests/Makefile.am (pytests): Add new file. * lang/python/tests/t-import.py: New file. Signed-off-by: Justus Winter <[email protected]>
2016-07-08python: Fix raising stashed exceptions.Justus Winter1-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]>
2016-07-07python: Fix distcheck.Justus Winter5-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]>
2016-07-07qt: Fix distcheck.Justus Winter2-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]>
2016-07-07cpp: Fix distcheck.Justus Winter1-0/+2
* lang/cpp/src/Makefile.am (CLEANFILES): Remove generated file. Signed-off-by: Justus Winter <[email protected]>
2016-07-06Qt: Add test for publicKeyAlgorithmAsStringAndre Heinecke1-0/+22
* lang/qt/tests/t-keylist.cpp (testPubkeyAlgoAsString): New.
2016-07-06Cpp: Expose gpgme_pubkey_algo_nameAndre Heinecke2-1/+15
* lang/cpp/src/key.cpp (Subkey::publicKeyAlgorithmAsString): New static variant. * lang/cpp/src/key.h: Declare function. Clarify comment about name mismatch.
2016-07-06Qt: Add check for pubkeyAlgo in t-keylistAndre Heinecke1-0/+4
* lang/qt/tests/t-keylist.cpp (testSingleKeyListSync): Check pubkeyAlgo.
2016-07-06Cpp: Add PubkeyAlgo enumAndre Heinecke2-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.
2016-07-06Qt: Fix include order when buildin testAndre Heinecke1-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++.
2016-07-06Revert "Qt: More robust lookup of Cpp's context.h"Andre Heinecke1-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.
2016-07-05Qt: Fix test build with Qt < 5.4.0Andre Heinecke3-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
2016-07-05Qt: More robust lookup of Cpp's context.hAndre Heinecke1-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.
2016-07-04Qt: Add testTofuSignCountAndre Heinecke1-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
2016-07-04Qt: Add test passphrase providerAndre Heinecke2-1/+48
* lang/qt/tests/t-support.h (TestPassphraseProvider): New. * lang/qt/tests/Makefile.am (t_tofuinfo_SOURCES): Add t-support.h
2016-07-04Cpp: Add support for TOFU_CONFLICT sigsumAndre Heinecke2-1/+6
* lang/cpp/src/verificationresult.cpp (GpgME::Signature::Summary): Handle TOFU_CONFLICT. * lang/cpp/src/verificationresult.h (Summary): Add TofuConflict.
2016-07-04Cpp: Add support for pinentry_modeAndre Heinecke2-0/+50
* lang/cpp/src/context.cpp (Context::pinentryMode): Return mode. (Context::setPinentryMode): Set mode. * lang/cpp/src/context.h (PinentryMode): Add enum.
2016-07-01Qt: Add test for TofuInfoAndre Heinecke2-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
2016-07-01Cpp: Add TofuInfo to signaturesAndre Heinecke5-2/+338
* 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.
2016-06-27Cpp: Expose new data_identify valuesAndre Heinecke2-1/+5
* lang/cpp/src/data.cpp (GpgME::Data::type): Handle PGP Encrypted and Signature. * lang/cpp/src/data.h: Add values accordingly.
2016-06-27Cpp: Do not treat KEYEXPIRED as errorAndre Heinecke1-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.
2016-06-16python: Improve autmatically generated docstrings.Justus Winter2-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]>
2016-06-16python: Make result objects more robust.Justus Winter4-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]>
2016-06-16python: Avoid creating SWIG proxy classes.Justus Winter2-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]>
2016-06-16python: Simplify wrapping glue.Justus Winter2-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]>
2016-06-16python: Rework callbacks.Justus Winter4-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]>
2016-06-16python: Wrap objects implementing the buffer protocol.Justus Winter5-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]>
2016-06-16python: Add properties to wrapped object.Justus Winter1-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]>
2016-06-16python: Improve the documentation.Justus Winter5-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]>
2016-06-16python: Get version information from the build system.Justus Winter4-58/+72
* 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]>
2016-06-16python: Fix exception leak.Justus Winter1-0/+1
* lang/python/helpers.c (pygpgme_stash_callback_exception): Fix leak. Signed-off-by: Justus Winter <[email protected]>
2016-06-16python: Fix license.Justus Winter1-3/+3
Other parts of the build system are also LGPLed. * lang/python/Makefile.am: Fix license. Signed-off-by: Justus Winter <[email protected]>
2016-06-08python: Improve error handling.Justus Winter1-6/+23
* lang/python/helpers.c (pyPassphraseCb): Handle write errors. (pyEditCb): Likewise. Signed-off-by: Justus Winter <[email protected]>
2016-06-08python: Add function to raise exceptions from c.Justus Winter1-0/+20
* lang/python/helpers.c (pygpgme_raise_exception): New function. Signed-off-by: Justus Winter <[email protected]>
2016-06-08python: Fix stripping deprecated functionality.Justus Winter2-3/+8
* lang/python/Makefile.am (gpgme.h): Add script as input. * lang/python/gpgme-h-clean.py (deprec_func): Also match struct members. (line_break): Fix matching on struct members. Signed-off-by: Justus Winter <[email protected]>
2016-06-08python: Fix type.Justus Winter1-2/+12
* lang/python/gpgme.i: Use correct Python type for size. Signed-off-by: Justus Winter <[email protected]>
2016-06-08python: Implement the context manager protocol.Justus Winter2-7/+29
* lang/python/pyme/core.py (Context.__del__): Make function idemptotent. (Context.{__enter__,__exit__}): Implement the context manager protocol. (Data.__del__): Make function idemptotent, drop debug print. (Data.{__enter__,__exit__}): Implement the context manager protocol. * lang/python/tests/t-idiomatic.py: Demonstrate this. Signed-off-by: Justus Winter <[email protected]>
2016-06-07python: Fix error handling.Justus Winter1-3/+4
* lang/python/gpgme.i: Fix freeing an uninitialized pointer in the error handling of generated wrapper functions by explicitly storing the pointer in a local variable which can be initialized. Signed-off-by: Justus Winter <[email protected]>
2016-06-06python: Wrap file-like objects on demand.Justus Winter5-3/+127
* lang/python/gpgme.i (gpgme_data_t): Use new function to create wrapper objects if necessary, and deallocate them after the function call. * lang/python/helpers.c (object_to_gpgme_data_t): New function. * lang/python/helpers.h (object_to_gpgme_data_t): New prototype. * lang/python/tests/Makefile.am (pytests): Add new test. * lang/python/tests/t-idiomatic.py: New file. Signed-off-by: Justus Winter <[email protected]>
2016-06-06python: Move helper function.Justus Winter3-31/+38
* lang/python/gpgme.i (object_to_gpgme_t): Move... * lang/python/helpers.c: ... here. * lang/python/helpers.h (object_to_gpgme_t): New prototype. Signed-off-by: Justus Winter <[email protected]>
2016-06-06python: Fix error handling.Justus Winter1-8/+1
* lang/python/gpgme.i (object_to_gpgme_t): Properly propagate exceptions. Signed-off-by: Justus Winter <[email protected]>
2016-06-06python: Initialize GPGME for the user.Justus Winter2-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]>
2016-06-06python: Drop obsolete VCS keywords.Justus Winter36-36/+0
-- Signed-off-by: Justus Winter <[email protected]>
2016-06-01python: Fix test suite with GnuPG prior to 2.1.12.Justus Winter1-1/+2
* lang/python/tests/Makefile.am (gpg-agent.conf): Use 'allow-loopback-pinentry'. Signed-off-by: Justus Winter <[email protected]>
2016-06-01python: Improve build system integration, fix warnings.Justus Winter2-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]>
2016-06-01Cpp: Use whitelist for status messagesAndre Heinecke1-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.
2016-06-01Qt: Fix debug output in t-ownertrustAndre Heinecke1-1/+3
* lang/qt/tests/t-ownertrust.cpp (testChangeOwnerTrust): Remove general debug of trust level. Add debug output for error.
2016-06-01tests: Fix notation tests.Justus Winter1-3/+2
* 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]>
2016-05-31python: use GPG_ERROR_CONFIG variableTobias Mueller1-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]>