aboutsummaryrefslogtreecommitdiffstats
path: root/lang (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* python: Support quick subkey creation.Justus Winter2017-02-163-1/+195
| | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.create_subkey): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/t-quick-subkey-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick key creation.Justus Winter2017-02-166-5/+275
| | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/constants/__init__.py: Import new file. * lang/python/gpg/constants/create.py: New file. * lang/python/gpg/core.py (Context.create_key): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/support.py (TemporaryDirectory): New class. * lang/python/tests/t-quick-key-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Fix passphrase callback wrapping.Justus Winter2017-02-161-1/+15
| | | | | | | * lang/python/helpers.c (pyPassphraseCb): Cope with 'passphrase_info' being NULL. Signed-off-by: Justus Winter <[email protected]>
* python: Fix error handling.Justus Winter2017-02-161-1/+6
| | | | | | | * lang/python/gpgme.i (typemap gpgme_key_t[]): Set an error if a non-key element is discovered. Signed-off-by: Justus Winter <[email protected]>
* python: Fix build system integration.Justus Winter2017-02-152-19/+20
| | | | | | | | | | | | | * lang/python/Makefile.am (copystamp): Also copy the setup script, and link the header files. (all-local): Use local setup script. (sdist): Fix Python source distribution creation. (CLEANFILES): Remove now obsolete files. (install-exec-local): Use local setup script. * lang/python/setup.py.in: Adjust relative paths to in-tree files. Fixes-commit: fe65a26ab584bd70fad45c7c4d44330e30a748a4 Signed-off-by: Justus Winter <[email protected]>
* python: Update lists of functions returning gpgme_error_t.Justus Winter2017-02-151-6/+18
| | | | | | | | | * lang/python/gpg/core.py (Context._errorcheck): Add instructions how to update the list. Update list. (Data._errorcheck): Likewise. (Context.set_engine_info): Simplify. Signed-off-by: Justus Winter <[email protected]>
* python: Wrap utility functions.Justus Winter2017-02-142-0/+51
| | | | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (pubkey_algo_string): New function. (pubkey_algo_name): Add docstring. (hash_algo_name): Likewise. (get_protocol_name): Likewise. (addrspec_from_uid): New function. * lang/python/gpgme.i (gpgme_pubkey_algo_string): Result must be freed. (gpgme_addrspec_from_uid): Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Use the correct function to free buffers.Justus Winter2017-02-141-1/+1
| | | | | | * lang/python/gpgme.i (char *): Free using 'gpgme_free'. Signed-off-by: Justus Winter <[email protected]>
* python: Add keylist mode parameter.Justus Winter2017-02-141-2/+5
| | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.keylist): Add 'mode' parameter. Signed-off-by: Justus Winter <[email protected]>
* python: Nicer repr for user ids.Justus Winter2017-02-141-0/+4
| | | | | | | * lang/python/gpgme.i (_gpgme_user_id): Provide a nicer repr() for user ids. Signed-off-by: Justus Winter <[email protected]>
* python: Add convenience functions for the home directory.Justus Winter2017-02-141-2/+12
| | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.__init__): Add 'home_dir' argument. (__repr__): Include 'home_dir'. (Context.home_dir): New property. Signed-off-by: Justus Winter <[email protected]>
* qt: Make sure to remove the tofu.db on clean.Justus Winter2017-02-141-1/+1
| | | | | | * lang/qt/tests/Makefile.am (CLEANFILES): Add 'tofu.db'. Signed-off-by: Justus Winter <[email protected]>
* python: Extend SWIG gpgme_{sub,}key with a __repr__ method.Tobias Mueller2017-02-141-0/+27
| | | | | | | | | | | | | | | | | | | * lang/python/gpgme.i: Added a genericrepr macro and use it for gpgme_key, gpgme_subkey, and gpgme_key_sig. -- To look nicer in Python's REPL. We define a generic __repr__ as a SWIG macro and use that to extend some defined SWIG objects. The alternative would have been to write a custom __repr__ function for each class but that would need to be changed everytime the object's structure changes. The bindings should be easy to maintain, I guess. This comes at the expense that the reprs are now relatively long and contain, for example, both keyid and fingerprint. Signed-off-by: Tobias Mueller <[email protected]>
* python: Remove the -builtin flag for SWIG.Tobias Mueller2017-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/setup.py.in: Call SWIG without the builtin flag. -- The SWIG documentation <http://www.swig.org/Doc2.0/Python.html#Python_nn28> leaves the impression that -builtin is solely for increasing performance: New in SWIG version 2.0.4: The use of Python proxy classes has performance implications that may be unacceptable for a high- performance library. The new -builtin option instructs SWIG to forego the use of proxy classes, and instead create wrapped types as new built-in Python types. When this option is used, the following section ("Proxy classes") does not apply. Details on the use of the -builtin option are in the Built-in Types section. While not wasting CPU cycles is good, it also prevents Python code being written in the wrapper itself. That, however, may be useful to make it easier to extend the wrapper. Partially reverts: 856bcfe2934237011984fab0bc69800a7c25c34b Signed-off-by: Tobias Mueller <[email protected]>
* python: Call SWIG_NewPointerObj rather than SWIG_Python_NewPointerObj.Tobias Mueller2017-02-141-1/+11
| | | | | | | | | | | | | | | | | | | | * lang/python/gpgme.i (pygpgme_wrap_gpgme_data_t): Provide a "self" variable for SWIG_NewPointerObj and call SWIG_NewPointerObj rather than SWIG_Python_NewPointerObj. -- SWIG_Python_NewPointerObj seems to be an implementation detail, because SWIG's documentation does not mention that function at all. In fact, SWIG_NewPointerObj is a call to SWIG_Python_NewPointerObj with the first parameter being either NULL or the "self" variable, depending on whether SWIG is called with the -builtin flag. So far, the first parameter was hard-coded to NULL. This change also hard-codes it to NULL but makes it more explicit. The benefit is that the documented function is being used and that compilation works regardless of the -builtin flag. Partially reverts: 856bcfe2934237011984fab0bc69800a7c25c34b Signed-off-by: Tobias Mueller <[email protected]>
* python: Conditionally provide py3 argument to SWIGTobias Mueller2017-02-141-2/+3
| | | | | | | | | | | | | | | * lang/python/setup.py.in: Only call with -py3 when we run under python3 or higher. -- If we ever remove the -builtin flag and leave the the -py3 flag, SWIG will generate Python code which will be incompatible with Python 2, because the py3 flag generates python3 code which is incompatible with python2. So we conditionally generate SWIG bindings with -py3. Signed-off-by: Tobias Mueller <[email protected]>
* python: Use one copy of the source tree per Python version.Justus Winter2017-02-132-17/+24
| | | | | | | | | | | | | | | | | | | | * lang/python/Makefile.am (copystamp): Create one copy per Python version. (all-local): Adapt. (clean-local): Likewise. (install-exec-local): Likewise. * lang/python/tests/run-tests.py: Likewise. -- Currently, we use one copy of the Python module's source to build for all Python versions. This is problematic, because SWIG writes a wrapper file into the source tree. Currently, this file works with both Python 2 and 3, but this is purely by chance. Improve the situation by creating one copy per Python version so that SWIG can write version-specific code into each copy. Signed-off-by: Justus Winter <[email protected]>
* qt: Add missing #include <functional>Igor Gnatenko2017-02-132-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * lang/qt/src/qgpgmenewcryptoconfig.cpp, lang/qt/src/threadedjobmixin.h: Include functional. -- With GCC 7.0, functional is not included transitively and we get: In file included from qgpgmedeletejob.h:39:0, from qgpgmedeletejob.cpp:38: threadedjobmixin.h:98:33: error: 'function' in namespace 'std' does not name a template type void setFunction(const std::function<T_result()> &function) ^~~~~~~~ std::{function,bind,placeholders,mem_fn} are defined in functional. References: https://bugzilla.redhat.com/show_bug.cgi?id=1417383 Signed-off-by: Igor Gnatenko <[email protected]> GnuPG-Bug-Id: 2955 Commit Message amended by Andre Heinecke Signed-off-by: Andre Heinecke <[email protected]>
* qt: Don't rely on implicit include in t-verifyAndre Heinecke2017-02-071-0/+1
| | | | | | | * lang/qt/tests/t-various.cpp: Include QTemporaryDir -- This fixes build with some Qt Versions
* qt: Add test for tofu conflictAndre Heinecke2017-02-021-0/+133
| | | | * lang/qt/tests/t-tofuinfo.cpp (TofuInfoTest::testTofuConflict): New.
* qt: Increase timeout when waiting for signals.Justus Winter2017-01-316-13/+17
| | | | | | | | | | | | | | | * lang/qt/tests/t-support.h (QSIGNALSPY_TIMEOUT): New macro. * lang/qt/tests/t-encrypt.cpp: Use the new macro as timeout when waiting for signals. * lang/qt/tests/t-keylist.cpp: Likewise. * lang/qt/tests/t-keylocate.cpp: Likewise. * lang/qt/tests/t-ownertrust.cpp: Likewise. * lang/qt/tests/t-wkspublish.cpp: Likewise. -- Increase the timeout when waiting for signals from 5 seconds to 60. This addresses intermittent test failures on slow machines. Signed-off-by: Justus Winter <[email protected]>
* python: Ensure quick-random is used if gpg is gpg2Andre Heinecke2017-01-261-0/+2
| | | | | * lang/python/tests/Makefile.am (gpg.conf): Configure agent-program accordingly.
* python: default op_keylist_start parameters.Tobias Mueller2017-01-252-0/+21
| | | | | | | | | | | | | | * lang/python/gpgme.i: Added gpgme_op_keylist_start with defaults * lang/python/tests/t-keylist.py: Added tests for default parameters -- To increase the ease of use, op_keylist_start parameters default to sensible values. The empty string matches all keys. We assume that the user wants to retrieve public keys most of the time, so we default to public keys rather than secret keys. Signed-off-by: Tobias Mueller <[email protected]>
* qt: Use QVERIFY instead of Q_ASSERT in conf testAndre Heinecke2017-01-161-3/+3
| | | | * lang/qt/tests/t-config.cpp: Use QVERIFY instead of Q_ASSERT.
* qt: Add test for CryptoConfigAndre Heinecke2017-01-162-3/+98
| | | | | * lang/qt/tests/t-config.cpp: New. * lang/qt/tests/Makefile.am: Update accordingly.
* qt: Add support for stringValueList in CryptoConfAndre Heinecke2017-01-125-1/+68
| | | | | | | | | | | | | | | | * lang/qt/src/Makefile.am (qgpgme_sources): Add cryptoconfig.cpp * lang/qt/src/cryptoconfig.cpp: New. * lang/qt/src/cryptoconfig.h (CryptoConfigEntry::stringValueList): New. * lang/qt/src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigEntry::stringValueList): New. * lang/qt/src/qgpgmenewcryptoconfig.h: Update accordingly. -- This is a pardigm change in cryptoconfig.h to avoid ABI breaks with each new config value we support it now has an implementation that is directly related to qgpgmenewcryptoconfig, which is now the only one.
* qt: Don't use qstrdup in test passphrase cbAndre Heinecke2017-01-121-1/+5
| | | | | | | | | | * lang/qt/tests/t-support.h (TestPassphraseProvider::getPassphrase): Use gpgrt_asprintf instead of strdup. -- To avoid problems on MacOS we want to avoid strdup so that qgpgme can be built without extensions. But qstrdup allocates with new and not with malloc, so use gpgrt_asprintf instead.
* qt: Clean up test dirs on failureAndre Heinecke2017-01-118-174/+174
| | | | | | | | | | | * t-encrypt.cpp, t-keylist.cpp, t-keylocate.cpp, t-ownertrust.cpp, t-tofuinfo.cpp, t-various.cpp, t-verify.cpp, t-wkspublish.cpp: Use QVERIFY instead of Q_ASSERT
* qt: Add test for uid functionsAndre Heinecke2017-01-112-3/+131
| | | | | * lang/qt/tests/t-various.cpp: New. * lang/qt/tests/Makefile.am: Update accordingly.
* cpp: Add revuid and adduid supportAndre Heinecke2017-01-114-0/+76
| | | | | | | | | | | * lang/cpp/src/context.cpp (Context::revUid, Context::startRevUid), (Context::addUid, Context::startAddUid): New. * lang/cpp/src/context.h: Declare new functions. * lang/cpp/src/key.cpp (Key::UserID::revoke) (Key::addUid): Idomatic helpers. lang/cpp/src/key.h: Declare new functions. * NEWS: Update accordingly.
* Fix Qgpgme build for macosAndre Heinecke2017-01-112-2/+4
| | | | | | * lang/qt/src/dn.cpp: Include string.h (parse_dn_part): Use qstrdup. * lang/qt/tests/t-support.h (getPassphrase): Use qstrdup.
* Fix cmake configuration files for MacOSAndre Heinecke2017-01-114-2/+16
| | | | | | | | | | | | * configure.ac: Set HAVE_MACOS_SYSTEM conditional. * lang/qt/src/Makefile.am, lang/cpp/src/Makefile.am, lang/qt/src/QGpgmeConfig.cmake.in.in, lang/cpp/src/GpgmeConfig.cmake.in.in: Use libsuffix again to distinguish between macos .dylib -- GnuPG-Bug-Id: 2884
* python: Improve compatibility with Scheme tests.Justus Winter2017-01-031-0/+2
| | | | | | * lang/python/tests/run-tests.py: Add stub --parallel option. Signed-off-by: Justus Winter <[email protected]>
* python: Add a switch '--quiet' to the test runner.Justus Winter2017-01-031-5/+12
| | | | | | | | * lang/python/tests/run-tests.py: Add and honor a switch '--quiet'. This way we can use this script to run Python tests one by one without the noise, and the script will setup the necessary environment for us. Signed-off-by: Justus Winter <[email protected]>
* qt: Update config sync doc / commentAndre Heinecke2017-01-022-12/+6
| | | | | | | | * lang/qt/src/cryptoconfig.h (CryptoConfig::sync): Document that runtime option is always set. * lang/qt/Src/qgpgmenewcryptoconfig.cpp (QGpgMENewCryptoConfigComponent::sync): Remove outdated comment and warn on error.
* cpp: Ensure that hasSecret is correct after updateAndre Heinecke2016-12-161-1/+6
| | | | | | | | | | | * lang/cpp/src/key.cpp (Key::update): Check for a secret key first before listing public keys. -- This is a performance delay but the update should only be called in a non gui thread anyway. The information if we have the secret key for this key is important to provide after update.
* cpp: Fix addrSpec for keys without emailAndre Heinecke2016-12-151-1/+6
| | | | | | | | | | | * lang/cpp/src/key.cpp (UserID::addrSpec): Use uid->address instead of normalizing again. (&operator<<(std::ostream &, const UserID &): Print it. -- This saves a normalization and fixes the case where a user id is just a mail address without name, in that case gpgme sets "address" but not email. Because the email is then the name.
* cpp: Fix update of partial key in verifyresultAndre Heinecke2016-12-151-1/+2
| | | | | | | | | | | * lang/cpp/src/verificationresult.cpp (Signature::key(bool,bool)): Don't update the returned copy but the actual key of the signature. -- The whole point of the update is to change the partial key from the signature (e.g. only fingerprint and one uid as we would have from tofu) to a fully keylisted one.
* python: Try to be more helpful when given a string to encrypt().Tobias Mueller2016-12-052-2/+19
| | | | | | | | | | | | | * lang/python/helpers.c (_gpg_obj2gpgme_data_t): Extended error message. * lang/python/tests/t-encrypt.py: Test for "encode" in error message. -- The motivation is to help the user when encrypting fails. I claim that it is not obvious to not being able to encrypt a string directly. To nudge the user into encoding it to bytes, the error message is a bit extended. Signed-off-by: Tobias Mueller <[email protected]>
* python: Define a macro for wrapping fragile result objects.Tobias Mueller2016-12-051-57/+12
| | | | | | | | | | * lang/python/gpgme.i (wrapresult): New Macro. -- This reduces the amount of copy and pasted code at the expense of a slightly more complicated logic with a macro. Signed-off-by: Tobias Mueller <[email protected]>
* python: Check "buffer" when writing to sys.stdout for python2 compat.Tobias Mueller2016-12-011-1/+5
| | | | | | | | | | | * lang/python/tests/support.py (print_data): Add check for buffer. -- When running with something like make -C lang/python check verbose=2 the test would fail under python2, because the file objects do not have a buffer property. Signed-off-by: Tobias Mueller <[email protected]>
* python: Make Context have a repr method.Tobias Mueller2016-12-011-0/+8
| | | | | | | | | * lang/python/gpg/core.py (Context.__repr__): New function. -- This makes Context objects look nicer in a REPL. Signed-off-by: Tobias Mueller <[email protected]>
* python: Make Results have a nicer __repr__.Tobias Mueller2016-12-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/gpg/results.py (Result.__str__): Renamed to '__repr__' ... * lang/python/gpg/results.py (Result.__repr__): ... and added fields. -- So that it looks a bit nicer in the Python REPL. It looked like this before: In [2]: gpg.core.get_engine_info()[0] Out[2]: <gpg.results.EngineInfo at 0x7fb23509a240> Now the output is In [2]: gpg.core.get_engine_info()[0] Out[2]: EngineInfo(file_name='/usr/bin/gpg2', home_dir=None, protocol=0, req_version='1.4.0', version='2.1.11') This also applies to other results, e.g. the ImportResult. Note that the format now changed from "<Class >" to "Class()". The Python documentation on repr states: "For many object types, including most builtins, eval(repr(obj)) == obj." Signed-off-by: Tobias Mueller <[email protected]>
* python: Fix removing the TOFU database.Justus Winter2016-11-252-2/+2
| | | | | | | | * lang/python/Makefile.am (CLEANFILES): Move 'tofu.db'... * lang/python/tests/Makefile.am (CLEANFILES): ... here. Fixes-commit: 9b22f82afc5518961e4bea1fc516b79800e379a2 Signed-off-by: Justus Winter <[email protected]>
* tests: Remove tofu.db.Justus Winter2016-11-251-1/+1
| | | | | | | * lang/python/Makefile.am (CLEANFILES): Add 'tofu.db'. * tests/gpg/Makefile.am (CLEANFILES): Likewise. Signed-off-by: Justus Winter <[email protected]>
* Remove a forgotten instance of @libsuffix@Heiko Becker2016-11-171-1/+1
| | | | | | | | | | | * lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove a forgotten instance of @libsuffix@. -- b2c07bd47bd608afa5cc819b60a7b5bb8c9dd96a removed @libsuffix@ from cmake config files, but missed one instance. Signed-off-by: Heiko Becker <[email protected]>
* qt, cpp: Add cmake config files for w32Andre Heinecke2016-11-156-15/+223
| | | | | | | | | | | | | | | * lang/cpp/src/GpgmeppConfig-w32.cmake.in.in lang/qt/src/QGpgmeConfig-w32.cmake.in.in: New. * lang/cpp/src/GpgmeppConfig.cmake.in.in, lang/qt/src/QGpgmeConfig.cmake.in.in: Remove libsuffix handling. * lang/cpp/src/Makefile.am, lang/qt/src/Makefile.am: Create / install w32 config files. * configure.ac: Configure them. -- To work with DLL's cmake needs to know about the implib and the final DLL. So the config files look different enough that it's better to use alternative files.
* qt: Use new style connect in th..mixinAndre Heinecke2016-11-151-1/+2
| | | | | * lang/qt/src/threadedjobmixin.h (ThreadedJobMixin::lateInitialization): Use new style connect.
* qt: Add API to get the context for a JobAndre Heinecke2016-11-144-2/+36
| | | | | | | | | | | | | | | | | | | | * lang/qt/src/job.cpp, lang/qt/src/job.h (Job::context): New. * lang/qt/src/threadedjobmixin.cpp (ThreadedJobMixin::~ThreadedJobMixin): New. Unregister context. (ThreadedJobMixin::lateInitialization): Register context. * NEWS: Update for cpp and qt. -- The global map hack is necessary because the job class does not know about the context which is held in threadedjobmixin. Adding a virtual function in Job would be an ABI break which I'd like to avoid at this point. Although QGpgME's API will need a big ABI break to make it ABI maintainable. The virtual jobs -> implementation classes are nearly unmaintainable ABI wise. The context is exposed to provide more flexibility to users, e.g. to add a passphrase callback or to set the sender in a context.
* cpp: Add get / set Sender APIAndre Heinecke2016-11-142-0/+14
| | | | | * cpp/src/context.cpp, cpp/src/context.h (Context::setSender), (Context::getSender): Add simple wrappers.