aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* build: Use macOS' compatibility macros to enable all features.Justus Winter2017-02-131-0/+2
| | | | | | | | | | | | * configure.ac: On macOS, use the compatibility macros to expose every feature of the libc. This is the equivalent of _GNU_SOURCE on GNU libc. -- Not defining this leads to compilation errors or superfluous warnings on macOS. GnuPG-bug-id: 2910 Signed-off-by: Justus Winter <[email protected]>
* Revert "Disable fd-passing for Apple."Justus Winter2017-02-131-12/+1
| | | | | | The actual bug has been located, so this can be reverted. This reverts commit ef5b4ae37d13142e89a051908dc080cda3d24baa.
* 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
* doc: Document that gpgme_op_genkey() parms parameter is not XML.Daniel Kahn Gillmor2017-02-061-8/+16
| | | | | | | | | | | | * doc/gpgme.texi (GnupgKeyParms): document that input format is not true XML. -- Please see discussion at https://lists.gnupg.org/pipermail/gnupg-devel/2017-January/032507.html Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* core: Optimize fork/exec for *BSD and Solaris.Werner Koch2017-02-032-13/+37
| | | | | | | * configure.ac (closefrom): Add to ac_check_funcs. * src/posix-io.c (_gpgme_io_spawn): Use closefrom. Signed-off-by: Werner Koch <[email protected]>
* core: Fix possible deadlock due to get_max_fds.Werner Koch2017-02-031-31/+37
| | | | | | | * src/posix-io.c (get_max_fds): Do not use the Linux optimization. -- Signed-off-by: Werner Koch <[email protected]>
* core: Minor cleanup of commit 195c735Werner Koch2017-02-031-8/+8
| | | | | | | * src/verify.c (parse_tofu_user): For cleanness use gpg_error ... (_gpgme_verify_status_handler): ... and gpg_err_code. Signed-off-by: Werner Koch <[email protected]>
* qt: Add test for tofu conflictAndre Heinecke2017-02-021-0/+133
| | | | * lang/qt/tests/t-tofuinfo.cpp (TofuInfoTest::testTofuConflict): New.
* core: Handle multiple TOFU_USER lines in verifyAndre Heinecke2017-02-021-8/+31
| | | | | | | | | | | | * src/verify.c (op_data_t): Add conflict_user_seen. (parse_tofu_user): Return ERR_DUP_VALUE for mutltiple TOFU_USERS. (_gpgme_verify_status_handler): Handle ERR_DUP_VALUE from parse_tofu_user to ignore the next TOFU_STATS. -- This fixes TOFU Conflict verification with GnuPG-2.1.17 and 2.1.18 GnuPG-Bug-Id: 2914
* core: Replace all calls to *sprintf by gpgrt_*sprintf.Werner Koch2017-02-0213-301/+97
| | | | | | | | | | | | | | * configure.ac (vasprintf): Remove check. * src/vasprintf.c: Remove file. * src/util.h (vasprintf, asprintf): Remove prototypes. Replace all calls to vasprintf and asprintf by gpgrt_vasprintf or gpgrt_asprintf. Also take care to use gpgrt_free on the returned value. * src/w32-util.c (_gpgme_get_gpgconf_path): Replace a gpgrt_asprintf by _gpgme_strconcat. (snprintf): New macro to use gpgrt_snprintf instead of the system's standard snprintf. Signed-off-by: Werner Koch <[email protected]>
* core: Remove unused check for funopen/fopencookie.Werner Koch2017-02-022-78/+0
| | | | | | | * configure.ac (funopen): Remove check. * src/funopen.c: Remove file. Signed-off-by: Werner Koch <[email protected]>
* core: Explain in gpgme.h that most stucts are read-only.Werner Koch2017-02-021-10/+70
| | | | | | | | | | | -- It is common that developers look up only the header file and do not read the manual. These comments should make it clear that most structures in gpgme.h are read-only and may only be allocated by gpgme. Signed-off-by: Werner Koch <[email protected]>
* core: Un-deprecate gpgme_data_rewind.Werner Koch2017-02-024-16/+17
| | | | | | | | | | | | | | | * src/gpgme.h.in (gpgme_data_rewind): Un-deprecate. * src/data-compat.c (gpgme_data_rewind): Move to ... * src/data.c (gpgme_data_rewind): here. -- That function is very convenient because it is required a lot with memory streams. It also documents the intention of the caller better than gpgme_data_seek with its addition parameters and the need to map system errors. Thus it does not make sense to make it a first class citizen again. Signed-off-by: Werner Koch <[email protected]>
* core: Move all deprecated stuff to the end of gpgme.h.Werner Koch2017-02-021-315/+315
| | | | Signed-off-by: Werner Koch <[email protected]>
* core: Cleanup gpgme_key_unref freesAndre Heinecke2017-02-011-17/+8
| | | | * src/key.c (gpgme_key_unref): Nowadays we assume free(NULL) is ok.
* core: Fix leakage of address for mail only uidsAndre Heinecke2017-02-011-9/+1
| | | | | | | | | | * src/key.c (gpgme_key_unref): Always free address if set. (_gpgme_key_append_name): Remove memory optimization for address. -- The check if address is not allocated would now be more complicated then just comparing it to email because email is set to address also when an email was not parsed from the user id.
* core: Improve mailbox only uid handlingAndre Heinecke2017-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | * src/key.c (_gpgme_key_append_name): Set email and remove name for uid only keys. -- If we have a name and no email but the name can be parsed as an address we now treat the address as email and remove the name. This fixes downstream users that rely on email to show email addresses and don't expilicity handle this case. E.g. A userid [email protected] was: uid->name = "[email protected]" uid->email = "" uid->address = "[email protected]" It is now: uid->name = "" uid->email = "[email protected]" uid->address = "[email protected]"
* 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]>
* core: Add new context flag "redraw".Werner Koch2017-01-316-1/+49
| | | | | | | | | | * src/context.h (struct gpgme_context): New field 'redraw_suggested'. * src/op-support.c (_gpgme_op_reset): Clear REDRAW_SUGGESTED. * src/progress.c (_gpgme_progress_status_handler): Set REDRAW_SUGGESTED. * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add "redraw". * tests/run-sign.c (main): Use it. Signed-off-by: Werner Koch <[email protected]>
* tests: Reduce iterations / threadsAndre Heinecke2017-01-303-3/+3
| | | | | | | | | | | | * tests/gpg/t-gpgconf.c (main): Reduce iterations to 10. * tests/gpg/t-thread-keylist-verify.c, tests/gpg/t-thread-keylist.c (THREAD_COUNT): Reduce to 10. -- While these tests tested for race conditions a smaller number of iteration should still show problems if they are run on multiple systems and regulary. While the 100 Thread count in the t-thread tests could lead to resource problems.
* 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]>
* tests: Use --debug-quick-random for testsAndre Heinecke2017-01-251-5/+7
| | | | | | | | | | * tests/start-stop-agent: Don't autostart agent on --stop and running check. Use --debug-quick-random when starting. -- This should speed up the tests especially on low entropy systems. Possibly fixing a hang on pythons op_genkey test in the Launchpad build enviorment (see launchpad issue 1655298)
* w32: Fix closing file descriptors.Justus Winter2017-01-231-2/+8
| | | | | | | | | * src/w32-io.c (writer): Only stop once the buffer is drained. (destroy_writer): Wait for the writers buffer to be drained. This aligns '_gpgme_io_close's behavior with close(2) and fclose(3). GnuPG-bug-id: 2881 Signed-off-by: Justus Winter <[email protected]>
* tests: Add safeguards against nullptr derefAndre Heinecke2017-01-171-6/+9
| | | | * t-gpgconf.c (main): Test some values before dereferencing them.
* 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.
* tests: Fix distcheck.Justus Winter2017-01-161-1/+1
| | | | | | | * tests/gpg/Makefile.am (CLEANFILES): Remove gpgconf backups. Fixes-commit: ea7bb62f5d981615847528b3ce53be9cc4d741a7 Signed-off-by: Justus Winter <[email protected]>
* Fix changing options with gpgconf.Justus Winter2017-01-161-12/+54
| | | | | | | | | * src/engine-gpgconf.c (gpgconf_write): Connect a pipe to the child's stderr, and wait for it to be closed as an indication that gpgconf has exited. Also improve error handling. GnuPG-bug-id: 2881 Signed-off-by: Justus Winter <[email protected]>
* tests: Improve the gpgconf test.Justus Winter2017-01-122-53/+129
| | | | | | | | | | | | * tests/gpg/t-gpgconf.c: Include support functions. (fail_if_err): Remove macro. (init_gpgme): Remove function. (lookup): New function. (main): Update some values and verify that the changes are applied. * tests/gpg/t-support.h (test): New assert-like macro. GnuPG-bug-id: 2881 Signed-off-by: Justus Winter <[email protected]>
* tests: Enable gpgconf test.Justus Winter2017-01-121-4/+0
| | | | | | -- Fixes: 02ba35c1b6a2cbb3361b2f2ad507c53564b2be0b Signed-off-by: Justus Winter <[email protected]>
* qt: Add support for stringValueList in CryptoConfAndre Heinecke2017-01-126-1/+69
| | | | | | | | | | | | | | | | * 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-115-0/+87
| | | | | | | | | | | * 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-115-2/+26
| | | | | | | | | | | | * 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.
* core: Always use runtime for gpgconf changesAndre Heinecke2017-01-022-2/+4
| | | | | | | | | | | | * src/engine-gpgconf.c (gpgconf_write): Add --runtime. * src/gpgme.h.in (gpgme_conf_opt_change): Document this behavior. -- If a tool uses GPGME for changing configuration values it needs a way to ensure that these changes take effect. Otherwise users may change and see config values and do not understand why they are not working.
* Fix gpg_addkey() to work with GPGME_CREATE_NOPASSWD as well.Ben Kibbey2016-12-311-0/+2
| | | | | | | | * src/engine-gpg.c (gpg_addkey): Pass --batch to gpg when GPGME_CREATE_NOPASSWD is set to fix pinentry without loopback mode. -- Signed-off-by: Ben Kibbey <[email protected]>
* Fix GPGME_CREATE_NOPASSWD without pinentry loopback.Ben Kibbey2016-12-271-0/+2
| | | | | | | | * src/engine-gpg.c(gpg_createkey): Pass --batch to gpg when GPGME_CREATE_NOPASSWD is set. -- Signed-off-by: Ben Kibbey <[email protected]>
* Qt: Make sure extended grep is used with '|'.Raphael Kubo da Costa2016-12-191-3/+3
| | | | | | | | | | | | | * m4/qt.m4: Use grep -E when using the alternation character. -- POSIX specifies '|' is only supposed to work as an alternation special character when grep is used in extended mode. The code worked fine with GNU grep because it accepts extended regular expressions by default, but other POSIX-compliant implementations might fail and take it literally. Signed-off-by: Raphael Kubo da Costa <[email protected]>