gpgme.git
2 years agoMerge branch 'master' of git+ssh://playfair.gnupg.org/git/gpgme
Justus Winter [Tue, 17 May 2016 13:13:46 +0000 (15:13 +0200)]
Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gpgme

2 years agoMerge branch 'justus/pyme3'
Justus Winter [Tue, 17 May 2016 13:10:28 +0000 (15:10 +0200)]
Merge branch 'justus/pyme3'

2 years agoTrailing white space cleanup for 2 files in tests/.
Werner Koch [Tue, 17 May 2016 12:33:49 +0000 (14:33 +0200)]
Trailing white space cleanup for 2 files in tests/.

--

2 years agopython: Clean up examples.
Justus Winter [Tue, 17 May 2016 12:15:21 +0000 (14:15 +0200)]
python: Clean up examples.

* lang/python/examples/delkey.py: Clean up example.
* lang/python/examples/encrypt-to-all.py: Likewise.
* lang/python/examples/genkey.py: Likewise.
* lang/python/examples/inter-edit.py: Likewise.
* lang/python/examples/sign.py: Likewise.
* lang/python/examples/signverify.py: Likewise.
* lang/python/examples/simple.py: Likewise.
* lang/python/examples/t-edit.py: Likewise.
* lang/python/examples/verifydetails.py: Likewise.
* lang/python/pyme/__init__.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Import GPGMEError.
Justus Winter [Tue, 17 May 2016 12:14:25 +0000 (14:14 +0200)]
python: Import GPGMEError.

* pyme/core.py: Import GPGMEError.

Fixes c5d118b2.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Port more tests.
Justus Winter [Tue, 17 May 2016 11:46:44 +0000 (13:46 +0200)]
python: Port more tests.

* lang/python/Makefile.am: Add bits from the c test suite.
* lang/python/support.py: New file.
* lang/python/t-decrypt.py: Likewise.
* lang/python/t-encrypt.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agoQt: Add keyLocateJob and test for it
Andre Heinecke [Fri, 13 May 2016 11:16:12 +0000 (13:16 +0200)]
Qt: Add keyLocateJob and test for it

* configure.ac (LIBQGPGME_LT_REVISION): Bump.
* lang/qt/src/protocol.h (locateKeysJob): Add Job.
* lang/qt/src/protocol_p.h (locateKeysJob): Implement.
* lang/qt/tests/Makefile.am: Add t-keylocate.
* lang/qt/tests/t-keylocate.cpp: New.

2 years agoQt: Add missing copyright header in test
Andre Heinecke [Fri, 13 May 2016 10:52:52 +0000 (12:52 +0200)]
Qt: Add missing copyright header in test

* lang/qt/tests/t-keylist.cpp: Add copyright header.

2 years agopython: Share generated methods between objects. justus/pyme3
Justus Winter [Thu, 12 May 2016 16:29:04 +0000 (18:29 +0200)]
python: Share generated methods between objects.

* lang/python/pyme/util.py (GpgmeWrapper.__getattr__): Monkey-patch
the class.
* lang/python/tests/t-wrapper.py: Demonstrate the sharing.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Raise exceptions on write errors.
Justus Winter [Thu, 12 May 2016 16:00:16 +0000 (18:00 +0200)]
python: Raise exceptions on write errors.

* lang/python/pyme/core.py (Data.write): Handle errors.
* lang/python/pyme/errors.py (GPGMEError.fromSyserror): New function.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Fix writing to data buffers.
Justus Winter [Thu, 12 May 2016 15:44:54 +0000 (17:44 +0200)]
python: Fix writing to data buffers.

* lang/python/gpgme.i: Add typemap for buffers.
* lang/python/pyme/core.py (Data.write): Fix function.
* lang/python/tests/Makefile.am: Add new test.
* lang/python/tests/t-data.py: New file.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Add a test suite.
Justus Winter [Thu, 12 May 2016 13:27:50 +0000 (15:27 +0200)]
python: Add a test suite.

* configure.ac: Add new Makefile.
* lang/python/Makefile.am: Add subdirectory.
* lang/python/tests/Makefile.am: New file.
* lang/python/tests/t-wrapper.py: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Cache generated wrapper functions.
Justus Winter [Thu, 12 May 2016 12:57:42 +0000 (14:57 +0200)]
python: Cache generated wrapper functions.

* lang/python/util.py (GpgmeWrap.__getattr__): Cache generated wrapper
functions.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Fix function invocation.
Justus Winter [Thu, 12 May 2016 10:54:15 +0000 (12:54 +0200)]
python: Fix function invocation.

* lang/python/pyme/core.py (Data.new_from_fd): Fix function
invocation.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Fix name of exception, make slot methods explicit.
Justus Winter [Thu, 12 May 2016 10:51:30 +0000 (12:51 +0200)]
python: Fix name of exception, make slot methods explicit.

* lang/python/pyme/util.py (GpgmeWrapper._getctype): Fix exception,
add docstring.
(GpgmeWrapper._getnameprepend): New function.
(GpgmeWrapper._errorcheck): Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Handle interpreter shutdown.
Justus Winter [Thu, 12 May 2016 09:53:43 +0000 (11:53 +0200)]
python: Handle interpreter shutdown.

* lang/python/pyme/core.py: Avoid races at interpreter shutdown.  This
silences the most annoying occurrences, however this problem also
affects the SWIG generated code, which might indicate that the real
problem is somewhere else.  If so, this change can be easily reverted.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Make test case more robust.
Justus Winter [Thu, 12 May 2016 09:51:21 +0000 (11:51 +0200)]
python: Make test case more robust.

* lang/python/examples/t-edit.py: Check if key is found.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Fix type translation.
Justus Winter [Thu, 12 May 2016 09:21:58 +0000 (11:21 +0200)]
python: Fix type translation.

* lang/python/gpgme.i: Adjust to Python3's string type being
'Unicode', not 'bytes'.  Fix type checking.
* lang/python/core.py (Data.write): Add docstring mentioning the
expected type of parameter 'buffer'.
(Data.read): Adjust read loop.  Also, use a saner chunk size, and join
all chunks at the end instead of adding them.
* lang/python/examples/simple.py: Adjust example.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agoCpp: Ensure gpgme.h is taken from current build
Andre Heinecke [Wed, 11 May 2016 12:56:20 +0000 (14:56 +0200)]
Cpp: Ensure gpgme.h is taken from current build

* lang/cpp/src/Makefile.am (AM_CPPFLAGS): Add gpgme.h location.
--
This fixes the build in case an incompatible gpgme.h is also
installed in other include locations.

2 years agopython: Fix simple example.
Justus Winter [Wed, 11 May 2016 11:51:40 +0000 (13:51 +0200)]
python: Fix simple example.

* lang/python/examples/simple.py: Flush stdout, encode name as
UTF-8 before passing it to GPGME.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Integrate into the build system.
Justus Winter [Wed, 11 May 2016 09:42:00 +0000 (11:42 +0200)]
python: Integrate into the build system.

* configure.ac: Make Python bindings configurable, add new Makefile.
* lang/python/Makefile.am: New file.
* lang/python/setup.py: Integrate into the build system.
* m4/ax_pkg_swig.m4: New file from the autoconf archive.
* m4/m4_ax_swig_python.m4: Likewise.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agoMerge branch 'gpgmepp'
Andre Heinecke [Tue, 10 May 2016 14:43:36 +0000 (16:43 +0200)]
Merge branch 'gpgmepp'

2 years agoQt / Cpp: Fix make dist gpgmepp
Andre Heinecke [Tue, 10 May 2016 13:05:11 +0000 (15:05 +0200)]
Qt / Cpp: Fix make dist

* lang/cpp/src/Makefile.am (EXTRA_DIST): Fix typo.
(private_gpgmepp_headers): New. Private headers.
(libgpgmepp_la_SOURCES): Add private headers.
* lang/qt/src/Makefile.am (t_keylist_SOURCES): Remove non existent
header.

2 years agopython: PEP8 fixes.
Justus Winter [Tue, 10 May 2016 12:45:44 +0000 (14:45 +0200)]
python: PEP8 fixes.

Cherry picked from 0267c151.

Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agoQt: Fix unkonwn doxygen keyword warnings
Andre Heinecke [Tue, 10 May 2016 12:32:22 +0000 (14:32 +0200)]
Qt: Fix unkonwn doxygen keyword warnings

--
Reimp is not a keqword and we inherit documentation anyway.

2 years agoQt: Make Protocol class public API
Andre Heinecke [Tue, 10 May 2016 12:05:10 +0000 (14:05 +0200)]
Qt: Make Protocol class public API

* lang/qt/src/Makefile.am (qgpgme_headers): Add protocol.h
(private_qgpgme_headers): Add protocol_p.h
* lang/qt/src/protocol.h: New. From QGpgMEBackend.
* lang/qt/src/protocol_p.h: New. From QGpgMEBackend.
* lang/qt/src/qgpgmebackend.h,
lang/qt/src/qgpgmebackend.cpp (Protocol): Removed.

--
The backend class does not make much sense anymore as we
only have the GpgME backend obviously. It's purpose was
for Libkleo's Backend abstraction.

2 years agoQt: Make doxygen quieter
Andre Heinecke [Tue, 10 May 2016 10:52:43 +0000 (12:52 +0200)]
Qt: Make doxygen quieter

* lang/qt/doc/Doxyfile.in: Quiet and no undocumented warnings.

2 years agoQt: Only install public headers
Andre Heinecke [Tue, 10 May 2016 10:47:53 +0000 (12:47 +0200)]
Qt: Only install public headers

* lang/qt/src/Makefile.am: Do not install all headers.
--
The qgpgme classes hide the implementation and thus make it
easier to change it without ABI breaks. They should not
be installed.

2 years agopython: Delete trailing whitespace.
Justus Winter [Tue, 10 May 2016 11:30:30 +0000 (13:30 +0200)]
python: Delete trailing whitespace.

--
Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Drop Debian packaging.
Justus Winter [Tue, 10 May 2016 11:21:34 +0000 (13:21 +0200)]
python: Drop Debian packaging.

--
Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agopython: Rename bindings.
Justus Winter [Tue, 10 May 2016 11:19:26 +0000 (13:19 +0200)]
python: Rename bindings.

--
Signed-off-by: Justus Winter <justus@gnupg.org>
2 years agoMerge branch 'master' into justus/pyme3
Justus Winter [Tue, 10 May 2016 11:03:34 +0000 (13:03 +0200)]
Merge branch 'master' into justus/pyme3

2 years agoQt: Add test for async keylisting
Andre Heinecke [Fri, 6 May 2016 14:33:49 +0000 (16:33 +0200)]
Qt: Add test for async keylisting

* src/lang/qt/tests/t-keylist.cpp(KeyListTest::testKeyListAsync): New.

2 years agoAllow cc to detect missing cases in a switch.
Werner Koch [Tue, 10 May 2016 08:27:54 +0000 (10:27 +0200)]
Allow cc to detect missing cases in a switch.

* src/delete.c (delete_status_handler): Remove default case from a
switch so that cc can check the use of all enum values.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 years agoUse common error message style for qt lang checks
Andre Heinecke [Fri, 6 May 2016 12:47:24 +0000 (14:47 +0200)]
Use common error message style for qt lang checks

* configure.ac: Use common error highliting for qt lang options.

2 years agoQt: Fix license mentioned in README
Andre Heinecke [Fri, 6 May 2016 12:41:22 +0000 (14:41 +0200)]
Qt: Fix license mentioned in README

* lang/qt/README: License is GPLv2+ and not LGPL.
--
The only part under lgpl is the QByteArray dataprovider.

2 years agoQt: Fix library name in Copyright headers
Andre Heinecke [Fri, 6 May 2016 12:20:45 +0000 (14:20 +0200)]
Qt: Fix library name in Copyright headers

--
Files are not part of libkleopatra anymore.

2 years agoAdd maybe mode for langs and default to it
Andre Heinecke [Fri, 6 May 2016 12:17:15 +0000 (14:17 +0200)]
Add maybe mode for langs and default to it

* configure.ac (languages): Warn and disable langs for which
requirements are not met.

--
If the languages are explicitly enabled on the command line
missing dependencies for them will still lead to errors.

2 years agoCpp: Handle PINENTRY_LAUNCHED status line
Andre Heinecke [Fri, 6 May 2016 11:19:18 +0000 (13:19 +0200)]
Cpp: Handle PINENTRY_LAUNCHED status line

* lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse):
Add GPGME_STATUS_PINENTRY_LAUNCHED.

--
PINENTRY_LAUNCHED needs no response in any Job. This fixes
Jobs which errored out on unknown status lines.

3 years agoCpp: Add support for pubkey_algo_name
Andre Heinecke [Tue, 12 Apr 2016 14:08:10 +0000 (16:08 +0200)]
Cpp: Add support for pubkey_algo_name

* lang/cpp/src/key.cpp (Subkey::algoName): New.
* lang/cpp/src/key.h: Declare.

3 years agoCpp: Add support for gpgme_data_identify
Andre Heinecke [Tue, 12 Apr 2016 14:05:31 +0000 (16:05 +0200)]
Cpp: Add support for gpgme_data_identify

* lang/cpp/src/data.cpp (Data::type): New.
* lang/cpp/src/data.h (Data::Type): New enum mapping.

3 years agoFix configuration without Qt language
Andre Heinecke [Tue, 12 Apr 2016 07:42:36 +0000 (09:42 +0200)]
Fix configuration without Qt language

* configure.ac: Define HAVE_DOXYGEN also if qt should not be built.

3 years agoQt/Cpp: Bump so version to 6.
Andre Heinecke [Mon, 11 Apr 2016 16:21:26 +0000 (18:21 +0200)]
Qt/Cpp: Bump so version to 6.

* configure.ac (LIBGPGMEPP_LT_CURRENT, LIBQGPGME_LT_CURRENT): Bump.

--
While the KDE Frameworks versions had a different name increasing
the number avoids a conflict with KDE4 versions and is generally
more consistent.

3 years agoQt / Cpp: Mention coding style in READMES
Andre Heinecke [Mon, 11 Apr 2016 16:16:05 +0000 (18:16 +0200)]
Qt / Cpp: Mention coding style in READMES

* src/lang/cpp/README, src/lang/qt/README: Add hacking note.

3 years agoQt: Add doc generation with doxygen
Andre Heinecke [Mon, 11 Apr 2016 16:10:54 +0000 (18:10 +0200)]
Qt: Add doc generation with doxygen

* configure.ac: Look for doxygen if qt is built.
 Configure new files.
* lang/qt/doc/Doxyfile.in: New.
* lang/qt/doc/Makefile.am: New.
* lang/qt/README: Update.

--
Currently this is a standard doxyfile template without much
customization.

3 years agoQt: Fix unit test by adding initial.test dep
Andre Heinecke [Mon, 11 Apr 2016 15:46:03 +0000 (17:46 +0200)]
Qt: Fix unit test by adding initial.test dep

* lang/qt/tests/t-keylist.cpp: Verify that GNUPGHOME is set.
* lang/qt/tests/initial.test: New dummy test.
* lang/qt/tests/Makefile.am: Add dependency to initial.test

--
Feels weird but this follows the pattern in tests/gpg/Makefile.am
and solves the problem that the environment is dirty.

3 years agoQt: Remove remaining boost usage
Andre Heinecke [Mon, 11 Apr 2016 15:15:16 +0000 (17:15 +0200)]
Qt: Remove remaining boost usage

* lang/qt/src/dataprovider.h,
 lang/qt/src/decryptjob.h,
 lang/qt/src/decryptverifyjob.h,
 lang/qt/src/encryptjob.h,
 lang/qt/src/qgpgmeadduseridjob.cpp,
 lang/qt/src/qgpgmechangeexpiryjob.cpp,
 lang/qt/src/qgpgmechangeownertrustjob.cpp,
 lang/qt/src/qgpgmechangepasswdjob.cpp,
 lang/qt/src/qgpgmedecryptjob.cpp,
 lang/qt/src/qgpgmedecryptverifyjob.cpp,
 lang/qt/src/qgpgmedeletejob.cpp,
 lang/qt/src/qgpgmedownloadjob.cpp,
 lang/qt/src/qgpgmeencryptjob.cpp,
 lang/qt/src/qgpgmeexportjob.cpp,
 lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
 lang/qt/src/qgpgmeimportjob.cpp,
 lang/qt/src/qgpgmekeygenerationjob.cpp,
 lang/qt/src/qgpgmekeylistjob.cpp,
 lang/qt/src/qgpgmenewcryptoconfig.cpp,
 lang/qt/src/qgpgmenewcryptoconfig.h,
 lang/qt/src/qgpgmesignencryptjob.cpp,
 lang/qt/src/qgpgmesignjob.cpp,
 lang/qt/src/qgpgmesignkeyjob.cpp,
 lang/qt/src/qgpgmeverifydetachedjob.cpp,
 lang/qt/src/qgpgmeverifyopaquejob.cpp,
 lang/qt/src/signencryptjob.h,
 lang/qt/src/signjob.h,
 lang/qt/src/threadedjobmixin.cpp,
 lang/qt/src/threadedjobmixin.h,
 lang/qt/src/verifydetachedjob.h,
 lang/qt/src/verifyopaquejob.h: Remove boost usage.

--
Mostly done with search and replace.

3 years agoQt: Remove predicates.h and stl_util.h
Andre Heinecke [Mon, 11 Apr 2016 15:12:56 +0000 (17:12 +0200)]
Qt: Remove predicates.h and stl_util.h

* src/lang/qt/predicates.h, src/lang/qt/stl_util.h: Removed.

--
The magic is still better placed in libkleo.

3 years agoQt: Remove usage of stl_util.h and predicates.h
Andre Heinecke [Mon, 11 Apr 2016 15:06:35 +0000 (17:06 +0200)]
Qt: Remove usage of stl_util.h and predicates.h

* src/lang/qt/qgpgmelistallkeysjob.cpp: Use comperators from
  gpgmepp instead of detail. Remove boost usage.

3 years agoCpp: Add string comparators for keys
Andre Heinecke [Mon, 11 Apr 2016 15:02:04 +0000 (17:02 +0200)]
Cpp: Add string comparators for keys

* lang/cpp/src/global.h (GPGMEPP_MAKE_STRCMP): New.
  (_gpgmepp_strcmp): NULL save wrapper around std::strcmp.
* lang/cpp/src/key.h: Add comparators for various attributes.

--
This was taken from libkleo predicates.h. Appears generally useful.

3 years agoCpp: Remove last usages of boost
Andre Heinecke [Mon, 11 Apr 2016 13:50:17 +0000 (15:50 +0200)]
Cpp: Remove last usages of boost

* lang/cpp/src/configuration.cpp: Use std::remove_pointer.
  (Configuration::operator<<): std::for_each.
* lang/cpp/src/context.cpp: Delete manually instead of scoped ptr.
* lang/cpp/src/scdgetinfoassuantransaction.cpp: Use static_assert.
  (to_reader_list): Tokenize with getline.

3 years agoAdd pthread in gpgmepp config
Andre Heinecke [Tue, 8 Mar 2016 17:05:34 +0000 (18:05 +0100)]
Add pthread in gpgmepp config

* lang/cpp/src/GpgmeppConfig.cmake.in.in: Add pthread.

3 years agoCpp / Qt: Reduce boost usage (memory and tuple)
Andre Heinecke [Sun, 3 Apr 2016 12:52:16 +0000 (04:52 -0800)]
Cpp / Qt: Reduce boost usage (memory and tuple)

* cpp/src/assuanresult.h,
 cpp/src/configuration.cpp,
 cpp/src/configuration.h,
 cpp/src/data.h,
 cpp/src/decryptionresult.h,
 cpp/src/defaultassuantransaction.cpp,
 cpp/src/encryptionresult.cpp,
 cpp/src/encryptionresult.h,
 cpp/src/engineinfo.h,
 cpp/src/gpgagentgetinfoassuantransaction.cpp,
 cpp/src/gpgsignkeyeditinteractor.cpp,
 cpp/src/importresult.cpp,
 cpp/src/importresult.h,
 cpp/src/key.h,
 cpp/src/keygenerationresult.h,
 cpp/src/keylistresult.h,
 cpp/src/notation.h,
 cpp/src/signingresult.cpp,
 cpp/src/signingresult.h,
 cpp/src/verificationresult.cpp,
 cpp/src/verificationresult.h,
 cpp/src/vfsmountresult.h,
 qt/src/dataprovider.cpp,
 qt/src/dataprovider.h,
 qt/src/decryptjob.h,
 qt/src/decryptverifyjob.h,
 qt/src/downloadjob.h,
 qt/src/encryptjob.h,
 qt/src/qgpgmeadduseridjob.cpp,
 qt/src/qgpgmechangeexpiryjob.cpp,
 qt/src/qgpgmechangeownertrustjob.cpp,
 qt/src/qgpgmechangepasswdjob.cpp,
 qt/src/qgpgmedecryptjob.cpp,
 qt/src/qgpgmedecryptjob.h,
 qt/src/qgpgmedecryptverifyjob.cpp,
 qt/src/qgpgmedecryptverifyjob.h,
 qt/src/qgpgmedeletejob.cpp,
 qt/src/qgpgmedownloadjob.cpp,
 qt/src/qgpgmedownloadjob.h,
 qt/src/qgpgmeencryptjob.cpp,
 qt/src/qgpgmeencryptjob.h,
 qt/src/qgpgmeexportjob.cpp,
 qt/src/qgpgmeexportjob.h,
 qt/src/qgpgmeimportfromkeyserverjob.cpp,
 qt/src/qgpgmeimportfromkeyserverjob.h,
 qt/src/qgpgmeimportjob.cpp,
 qt/src/qgpgmeimportjob.h,
 qt/src/qgpgmekeygenerationjob.cpp,
 qt/src/qgpgmekeygenerationjob.h,
 qt/src/qgpgmekeylistjob.cpp,
 qt/src/qgpgmekeylistjob.h,
 qt/src/qgpgmelistallkeysjob.cpp,
 qt/src/qgpgmelistallkeysjob.h,
 qt/src/qgpgmenewcryptoconfig.cpp,
 qt/src/qgpgmenewcryptoconfig.h,
 qt/src/qgpgmesignencryptjob.cpp,
 qt/src/qgpgmesignencryptjob.h,
 qt/src/qgpgmesignjob.cpp,
 qt/src/qgpgmesignjob.h,
 qt/src/qgpgmesignkeyjob.cpp,
 qt/src/qgpgmeverifydetachedjob.cpp,
 qt/src/qgpgmeverifydetachedjob.h,
 qt/src/qgpgmeverifyopaquejob.cpp,
 qt/src/qgpgmeverifyopaquejob.h,
 qt/src/signencryptjob.h,
 qt/src/signjob.h,
 qt/src/threadedjobmixin.h,
 qt/src/verifydetachedjob.h,
 qt/src/verifyopaquejob.h: Reduce boost usage.

--
This was mostly done with search and replace to change the
templates / classes from memory and tuple to their c++11
equivalents.

3 years agoCpp: Require c++ 11 if cpp binding requested
Andre Heinecke [Sun, 3 Apr 2016 12:46:51 +0000 (04:46 -0800)]
Cpp: Require c++ 11 if cpp binding requested

* configure.ac: Call ax_cxx_compile_stdcxx
* m4/ax_cxx_compile_stdcxx.m4

--
Depending on c++11 is intended to make the port away from
Boost easier.

The m4 macro was taken from the website mentioned in the License
header of the file.

3 years agoQt: Add static factor methods for protocol
Andre Heinecke [Sun, 3 Apr 2016 10:29:14 +0000 (02:29 -0800)]
Qt: Add static factor methods for protocol

* lang/qt/src/qgpgmebackend.cpp (QGpgME::openpgp, QGpgME::smime): New.
* lang/qt/src/qgpgmebackend.h: Declare.
* lang/qt/tests/t-keylist.cpp (KeyListTest::testSingleKeyListSync):
  Use new functions.

--
This replaces the cryptobackendfactory functionality from libkleo.

3 years agoQt: Add a unit test for qgpgme
Andre Heinecke [Sun, 3 Apr 2016 09:48:46 +0000 (01:48 -0800)]
Qt: Add a unit test for qgpgme

* configure.ac: Configure test Makefile.
* m4/qt.m4: Look up Qt5Test flags.
* lang/qt/tests/t-keylist.cpp: New. Simple keylist check.
* lang/qt/tests/Makefile.am: New. General test framework.

--
This test mostly checks that it basically compiles / works and
adds a test framework.

3 years agoQt: Add missing MOC includes
Andre Heinecke [Sun, 3 Apr 2016 09:33:52 +0000 (01:33 -0800)]
Qt: Add missing MOC includes

* qgpgmeadduseridjob.cpp,
 qgpgmechangeexpiryjob.cpp,
 qgpgmechangeownertrustjob.cpp,
 qgpgmechangepasswdjob.cpp,
 qgpgmedecryptjob.cpp,
 qgpgmedecryptverifyjob.cpp,
 qgpgmedeletejob.cpp,
 qgpgmedownloadjob.cpp,
 qgpgmeencryptjob.cpp,
 qgpgmeexportjob.cpp,
 qgpgmeimportfromkeyserverjob.cpp,
 qgpgmeimportjob.cpp,
 qgpgmekeygenerationjob.cpp,
 qgpgmekeylistjob.cpp,
 qgpgmelistallkeysjob.cpp,
 qgpgmerefreshkeysjob.cpp,
 qgpgmesecretkeyexportjob.cpp,
 qgpgmesignencryptjob.cpp,
 qgpgmesignjob.cpp,
 qgpgmesignkeyjob.cpp,
 qgpgmeverifydetachedjob.cpp,
 qgpgmeverifyopaquejob.cpp: Add missing MOC includes.

--
In the CMake world this was handled by cmake automoc
suppport and not neccessary.

3 years agoQt: Declare pure virtuals as such
Andre Heinecke [Sun, 3 Apr 2016 09:30:57 +0000 (01:30 -0800)]
Qt: Declare pure virtuals as such

* lang/qt/src/qgpgmebackend.h (Protocol): Make all functions
 pure virtual.

--
Fixes errors when linking with QGpgME.

3 years agoQt: Don't declare showErrorDialog anymore
Andre Heinecke [Sun, 3 Apr 2016 09:27:58 +0000 (01:27 -0800)]
Qt: Don't declare showErrorDialog anymore

* cpp/qt/src/job.h: Remove showErrorDialog.

--
If additional error handling is neccessary emitting
signals to a gui application would be better API for qgpgme.

3 years agoQt: Only use GpgME based config class
Andre Heinecke [Sun, 3 Apr 2016 09:22:19 +0000 (01:22 -0800)]
Qt: Only use GpgME based config class

* lang/qt/src/qgpgmecryptoconfig.cpp,
 lang/qt/src/qgpgmecryptoconfig.h: Removed.
* lang/qt/src/qgpgmebackend.cpp: Return newcryptoconfig.

--
The GpgME based config class is the way forward and the
old class was using KDE Code. Probably needs some bugfixes
as previously the new class was only used for Windows CE

3 years agoAdd additional include path in config files
Andre Heinecke [Sat, 2 Apr 2016 17:14:10 +0000 (09:14 -0800)]
Add additional include path in config files

* lang/cpp/src/GpgmeppConfig.cmake.in.in
 lang/qt/src/QGpgmeConfig.cmake.in.in: Include directory above headers.

--
This ensures that code using #inlcude <gpgme++/header.h> still works.

3 years agoQt: Fix library name in nodist variable
Andre Heinecke [Sat, 2 Apr 2016 17:12:23 +0000 (09:12 -0800)]
Qt: Fix library name in nodist variable

* lang/qt/Makefile.am (nodist_qgpgme_SOURCES): Change to real name.

3 years agoAdd missing files to QGpgME
Andre Heinecke [Sat, 2 Apr 2016 16:06:45 +0000 (08:06 -0800)]
Add missing files to QGpgME

* lang/qt/src/gpgme_backend_debug.cpp,
 lang/qt/src/gpgme_backend_debug.h,
 lang/qt/src/predicates.h,
 lang/qt/src/stl_util.h: New.

3 years agoAdd QGpgME code from libkleo
Andre Heinecke [Sat, 2 Apr 2016 12:31:59 +0000 (04:31 -0800)]
Add QGpgME code from libkleo

* lang/qt/src/Makefile.am,
lang/qt/src/abstractimportjob.h,
lang/qt/src/adduseridjob.h,
lang/qt/src/changeexpiryjob.h,
lang/qt/src/changeownertrustjob.h,
lang/qt/src/changepasswdjob.h,
lang/qt/src/cryptoconfig.h,
lang/qt/src/decryptjob.h,
lang/qt/src/decryptverifyjob.h,
lang/qt/src/deletejob.h,
lang/qt/src/downloadjob.h,
lang/qt/src/encryptjob.h,
lang/qt/src/exportjob.h,
lang/qt/src/hierarchicalkeylistjob.h,
lang/qt/src/importfromkeyserverjob.h,
lang/qt/src/importjob.h,
lang/qt/src/job.cpp,
lang/qt/src/job.h,
lang/qt/src/keygenerationjob.h,
lang/qt/src/keylistjob.h,
lang/qt/src/listallkeysjob.h,
lang/qt/src/multideletejob.h,
lang/qt/src/qgpgmeadduseridjob.cpp,
lang/qt/src/qgpgmeadduseridjob.h,
lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmebackend.h,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeexpiryjob.h,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.h,
lang/qt/src/qgpgmechangepasswdjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.h,
lang/qt/src/qgpgmecryptoconfig.cpp,
lang/qt/src/qgpgmecryptoconfig.h,
lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptjob.h,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.h,
lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedeletejob.h,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmedownloadjob.h,
lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeencryptjob.h,
lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeexportjob.h,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.h,
lang/qt/src/qgpgmeimportjob.cpp,
lang/qt/src/qgpgmeimportjob.h,
lang/qt/src/qgpgmekeygenerationjob.cpp,
lang/qt/src/qgpgmekeygenerationjob.h,
lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmekeylistjob.h,
lang/qt/src/qgpgmelistallkeysjob.cpp,
lang/qt/src/qgpgmelistallkeysjob.h,
lang/qt/src/qgpgmenewcryptoconfig.cpp,
lang/qt/src/qgpgmenewcryptoconfig.h,
lang/qt/src/qgpgmerefreshkeysjob.cpp,
lang/qt/src/qgpgmerefreshkeysjob.h,
lang/qt/src/qgpgmesecretkeyexportjob.cpp,
lang/qt/src/qgpgmesecretkeyexportjob.h,
lang/qt/src/qgpgmesignencryptjob.cpp,
lang/qt/src/qgpgmesignencryptjob.h,
lang/qt/src/qgpgmesignjob.cpp,
lang/qt/src/qgpgmesignjob.h,
lang/qt/src/qgpgmesignkeyjob.cpp,
lang/qt/src/qgpgmesignkeyjob.h,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.h,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.h,
lang/qt/src/refreshkeysjob.h,
lang/qt/src/signencryptjob.h,
lang/qt/src/signjob.h,
lang/qt/src/signkeyjob.h,
lang/qt/src/specialjob.h,
lang/qt/src/threadedjobmixin.cpp,
lang/qt/src/threadedjobmixin.h,
lang/qt/src/verifydetachedjob.h,
lang/qt/src/verifyopaquejob.h: New.
* lang/qt/src/Makefile.am:

--
The ShowErrorMessage calls were removed and are to be replaced
by error signals / error status which the UI should then handle.

This allowed to port away from KMessageBox and KLocalizedstring.

Additionally this removed the old process bases qgpgmeconfigdialog,
and GnuPGProcessBase. Classes using GnuPGProcessbase were changed
to KProcess api.

This is a first compiling version. API is subject to change to
resolve the split between base jobs and qgpgme classes.

3 years agoAdd qgpgme as qt language binding
Andre Heinecke [Tue, 8 Mar 2016 13:33:15 +0000 (14:33 +0100)]
Add qgpgme as qt language binding

* configure.ac: Add version defines. Check for qt if neccessary.
* lang/README: Mention qt
* lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove comment. Find qgpgme.
* lang/qt/src/Makefile.am: New. Build qgpgme.
* lang/qt/README,
 lang/qt/src/Makefile.am,
 lang/qt/src/QGpgmeConfig.cmake.in.in,
 lang/qt/src/QGpgmeConfigVersion.cmake.in,
 lang/qt/src/dataprovider.cpp,
 lang/qt/src/dataprovider.h,
 lang/qt/src/qgpgme_export.h,
 m4/qt.m4: New.
* lang/cpp/src/GpgmeppConfig.cmake.in.in,
 lang/cpp/src/Makefile.am: Fix generated config file.

--
For now this is just the dataprovider which was part of the
KF5 Gpgmepp QGpgme variant. This is very thin but a useful
class which is used downstream.

3 years agoRemove obsolete w32-qt code
Andre Heinecke [Thu, 3 Mar 2016 11:46:53 +0000 (12:46 +0100)]
Remove obsolete w32-qt code

* configure.ac (w32-qt): Remove option and Qt checks.
* src/Makefile.am: Remove BUILD_W32_QT handling.
* src/kdpipeiodevice.cpp,
 src/kdpipeiodevice.h,
 src/kdpipeiodevice.moc,
 src/w32-qt-io.cpp: Removed.

--
This code was intended for Kleopatra but Kleopatra is not using
it anymore. QGpgme/dataprovider is a better replacement for this.

3 years agoAdd version info for gpgmepp
Andre Heinecke [Wed, 2 Mar 2016 17:56:12 +0000 (18:56 +0100)]
Add version info for gpgmepp

* lang/cpp/src/Makefile.am (libgpgmepp_la_LDFLAGS): Add version info.

3 years agoAdd cmake configuration files
Andre Heinecke [Wed, 2 Mar 2016 17:41:42 +0000 (18:41 +0100)]
Add cmake configuration files

* configure.ac: Add libgpgmepp version. Configure cmake files.
* lang/cpp/src/Makefile.am: Add targets for cmake files.
 (EXTRA_DIST): Add cmake files.

--
This should smooth the transition for downstream users that
have worked with KF5::Gpgmepp previously.

3 years agoFix export header and windows export macros
Andre Heinecke [Wed, 2 Mar 2016 15:24:09 +0000 (16:24 +0100)]
Fix export header and windows export macros

* lang/cpp/src/gpgme_export.h: Fix variable name. Add Windows ifdefs.

3 years agoAdd header installation
Andre Heinecke [Wed, 2 Mar 2016 15:22:20 +0000 (16:22 +0100)]
Add header installation

* lang/cpp/src/Makefile.am: Add headers as deps and install them.
 (AM_CPPFLAGS): Add BUILDING_GPGMEPP to be used in export macros.

3 years agoAdd enable-languages build option
Andre Heinecke [Wed, 2 Mar 2016 13:00:48 +0000 (14:00 +0100)]
Add enable-languages build option

* acinclude.m4 (LIST_MEMBER): New macro.
* configure.ac (enable-languages): New option. Add info output.
* lang/Makefile.am: Only add enabled language subdirs.

3 years agoAdd README for gpgmepp
Andre Heinecke [Mon, 22 Feb 2016 18:13:36 +0000 (19:13 +0100)]
Add README for gpgmepp

* lang/README: Note down cpp.
* cpp/README: Add README based on original repo version.

3 years agoAdd buildsystem for Gpgmepp
Andre Heinecke [Mon, 22 Feb 2016 18:09:54 +0000 (19:09 +0100)]
Add buildsystem for Gpgmepp

* configure.ac: Configure Makefiles.
* lang/Makefile.am: Add cpp subdir
* lang/cpp/Makefile.am: New. Add src subdir.
* lang/cpp/src/Makefile.am: New. Basic buildsystem.

3 years agoRemove feature check ifdefs
Andre Heinecke [Mon, 22 Feb 2016 18:07:41 +0000 (19:07 +0100)]
Remove feature check ifdefs

* lang/cpp/src/assuanresult.cpp,
 lang/cpp/src/callbacks.cpp,
 lang/cpp/src/configuration.cpp,
 lang/cpp/src/context.cpp,
 lang/cpp/src/context_glib.cpp,
 lang/cpp/src/context_qt.cpp,
 lang/cpp/src/context_vanilla.cpp,
 lang/cpp/src/data.cpp,
 lang/cpp/src/decryptionresult.cpp,
 lang/cpp/src/defaultassuantransaction.cpp,
 lang/cpp/src/editinteractor.cpp,
 lang/cpp/src/encryptionresult.cpp,
 lang/cpp/src/engineinfo.cpp,
 lang/cpp/src/eventloopinteractor.cpp,
 lang/cpp/src/global.h,
 lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
 lang/cpp/src/importresult.cpp,
 lang/cpp/src/interfaces/assuantransaction.h,
 lang/cpp/src/key.cpp,
 lang/cpp/src/keygenerationresult.cpp,
 lang/cpp/src/keylistresult.cpp,
 lang/cpp/src/scdgetinfoassuantransaction.cpp,
 lang/cpp/src/signingresult.cpp,
 lang/cpp/src/trustitem.cpp,
 lang/cpp/src/util.h,
 lang/cpp/src/verificationresult.cpp,
 lang/cpp/src/vfsmountresult.cpp: Remove feature checks.

3 years agoInitial checkin of gpgmepp sources
Andre Heinecke [Mon, 22 Feb 2016 17:28:08 +0000 (18:28 +0100)]
Initial checkin of gpgmepp sources

Based on git.kde.org/pim/gpgmepp rev. 0e3ebc02

* lang/cpp/src/assuanresult.cpp,
 lang/cpp/src/assuanresult.h,
 lang/cpp/src/callbacks.cpp,
 lang/cpp/src/callbacks.h,
 lang/cpp/src/configuration.cpp,
 lang/cpp/src/configuration.h,
 lang/cpp/src/context.cpp,
 lang/cpp/src/context.h,
 lang/cpp/src/context_glib.cpp,
 lang/cpp/src/context_p.h,
 lang/cpp/src/context_qt.cpp,
 lang/cpp/src/context_vanilla.cpp,
 lang/cpp/src/data.cpp,
 lang/cpp/src/data.h,
 lang/cpp/src/data_p.h,
 lang/cpp/src/decryptionresult.cpp,
 lang/cpp/src/decryptionresult.h,
 lang/cpp/src/defaultassuantransaction.cpp,
 lang/cpp/src/defaultassuantransaction.h,
 lang/cpp/src/editinteractor.cpp,
 lang/cpp/src/editinteractor.h,
 lang/cpp/src/encryptionresult.cpp,
 lang/cpp/src/encryptionresult.h,
 lang/cpp/src/engineinfo.cpp,
 lang/cpp/src/engineinfo.h,
 lang/cpp/src/error.h,
 lang/cpp/src/eventloopinteractor.cpp,
 lang/cpp/src/eventloopinteractor.h,
 lang/cpp/src/exception.cpp,
 lang/cpp/src/exception.h,
 lang/cpp/src/global.h,
 lang/cpp/src/gpgadduserideditinteractor.cpp,
 lang/cpp/src/gpgadduserideditinteractor.h,
 lang/cpp/src/gpgagentgetinfoassuantransaction.cpp,
 lang/cpp/src/gpgagentgetinfoassuantransaction.h,
 lang/cpp/src/gpgmefw.h,
 lang/cpp/src/gpgmepp_export.h,
 lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp,
 lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
 lang/cpp/src/gpgsetownertrusteditinteractor.cpp,
 lang/cpp/src/gpgsetownertrusteditinteractor.h,
 lang/cpp/src/gpgsignkeyeditinteractor.cpp,
 lang/cpp/src/gpgsignkeyeditinteractor.h,
 lang/cpp/src/importresult.cpp,
 lang/cpp/src/importresult.h,
 lang/cpp/src/key.cpp,
 lang/cpp/src/key.h,
 lang/cpp/src/keygenerationresult.cpp,
 lang/cpp/src/keygenerationresult.h,
 lang/cpp/src/keylistresult.cpp,
 lang/cpp/src/keylistresult.h,
 lang/cpp/src/notation.h,
 lang/cpp/src/result.h,
 lang/cpp/src/result_p.h,
 lang/cpp/src/scdgetinfoassuantransaction.cpp,
 lang/cpp/src/scdgetinfoassuantransaction.h,
 lang/cpp/src/signingresult.cpp,
 lang/cpp/src/signingresult.h,
 lang/cpp/src/trustitem.cpp,
 lang/cpp/src/trustitem.h,
 lang/cpp/src/util.h,
 lang/cpp/src/verificationresult.cpp,
 lang/cpp/src/verificationresult.h,
 lang/cpp/src/vfsmountresult.cpp,
 lang/cpp/src/vfsmountresult.h,
 lang/cpp/src/interfaces/assuantransaction.h,
 lang/cpp/src/interfaces/dataprovider.h,
 lang/cpp/src/interfaces/passphraseprovider.h,
 lang/cpp/src/interfaces/progressprovider.h: New.

3 years agoFix possible _SC_OPEN_MAX max problem on AIX.
Werner Koch [Fri, 15 Jan 2016 15:16:38 +0000 (16:16 +0100)]
Fix possible _SC_OPEN_MAX max problem on AIX.

* src/posix-io.c [HAVE_STDINT_H]: Include stdint.h.
(get_max_fds): Limit returned value for too high values.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Avoid conflict with Mingw-w64 version 4.0.4-1
Werner Koch [Wed, 9 Dec 2015 10:39:26 +0000 (11:39 +0100)]
w32: Avoid conflict with Mingw-w64 version 4.0.4-1

* src/w32-util.c (mkstemp): Rename to my_mkstemp.  Change caller.
--

For some reason the linker seems to use the mkstemp now provided by
mingw instead of our static symbol.  Strange.

Reported-by: Andrej Kacian <andrej@kacian.sk>
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoReturn on user cancellation of delete operation
Daiki Ueno [Mon, 9 Nov 2015 04:13:50 +0000 (13:13 +0900)]
Return on user cancellation of delete operation

* src/delete.c (delete_status_handler): Return on ERROR status, if the
error location is set to "delete_key.secret" and the code is either
CANCELED or FULLY_CANCELED, which indicates a situation that the user
selected "No" on the confirmation dialog.

3 years agodoc: Fix minor errors
Daiki Ueno [Fri, 4 Dec 2015 08:55:09 +0000 (17:55 +0900)]
doc: Fix minor errors

* doc/gpgme.texi: Fix errors and typos in the cancellation and
gpgme_import_result_t documentation.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoFix typos found by codespell.
Justus Winter [Wed, 2 Dec 2015 10:28:07 +0000 (11:28 +0100)]
Fix typos found by codespell.

--
Signed-off-by: Justus Winter <justus@g10code.com>
3 years agoMake use of user passphrase handler during passwd.
Ben Kibbey [Wed, 28 Oct 2015 22:16:27 +0000 (18:16 -0400)]
Make use of user passphrase handler during passwd.

* src/passwd.c (passwd_start): set engine passphrase command handler.

--
This allows for inquiring a passphrase when changing a passphrase rather
than requiring a pinentry.

3 years agow32: Add extra diagnostic about possible missing gpgme-w32spawn.exe.
Werner Koch [Wed, 28 Oct 2015 15:27:49 +0000 (16:27 +0100)]
w32: Add extra diagnostic about possible missing gpgme-w32spawn.exe.

* src/w32-io.c (_gpgme_io_spawn): Add a new diagnostic.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Improve locating gpgconf on 64 bit systems.
Werner Koch [Wed, 28 Oct 2015 15:26:03 +0000 (16:26 +0100)]
w32: Improve locating gpgconf on 64 bit systems.

* src/w32-util.c (find_program_at_standard_place): Fallback to
CSIDL_PROGRAM_FILESX86.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Add new global flag "w32-inst-dir".
Werner Koch [Wed, 28 Oct 2015 15:24:30 +0000 (16:24 +0100)]
w32: Add new global flag "w32-inst-dir".

* src/gpgme.c (gpgme_set_global_flag): Add flag "w32-inst-dir";
* src/posix-util.c (_gpgme_set_override_inst_dir): New stub.
* src/w32-util.c (override_inst_dir): New var.
(_gpgme_get_inst_dir): Return this var is set.
(_gpgme_set_override_inst_dir): New.
--

See
https://lists.gnupg.org/pipermail/gnupg-devel/2015-September/030267.html
for background.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agocleanup: Fix type mismatch around gpgme_error_t.
NIIBE Yutaka [Fri, 16 Oct 2015 00:51:42 +0000 (09:51 +0900)]
cleanup: Fix type mismatch around gpgme_error_t.

* src/data-compat.c (gpgme_error_to_errno): Use gpg_err_code
to get error code from gpgme_error_t.
* src/gpgme.c (gpgme_new): Don't use gpgme_error.

3 years agogpgme-tool: Switch to argparse.c for option parsing.
Werner Koch [Mon, 31 Aug 2015 18:33:44 +0000 (20:33 +0200)]
gpgme-tool: Switch to argparse.c for option parsing.

* src/argparse.c, src/argparse.h: New. Taken from current gnupg.
* src/Makefile.am (gpgme_tool_SOURCES): New.
* src/gpgme-tool.c: Remove all argp.h stuff.
(my_strusage): New.
(main): Change to use argparse.
--

As a GnuPG related tool the user should get the same experience in
option parsing as with gpg et al.  Thus we use the same parser.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoAdd gpgme_pubkey_algo_string
Werner Koch [Sun, 30 Aug 2015 17:04:44 +0000 (19:04 +0200)]
Add gpgme_pubkey_algo_string

* src/gpgme.h.in (GPGME_PK_EDDSA): New.
(gpgme_pubkey_algo_string): New.
* src/conversion.c (_gpgme_map_pk_algo): Add new algo.
* src/gpgme.c (gpgme_pubkey_algo_string): New.
(gpgme_pubkey_algo_name): Reformat.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoPost release updates
Werner Koch [Wed, 26 Aug 2015 08:16:39 +0000 (10:16 +0200)]
Post release updates

--

3 years agoRelease 1.6.0 gpgme-1.6.0
Werner Koch [Wed, 26 Aug 2015 07:28:32 +0000 (09:28 +0200)]
Release 1.6.0

* configure.ac: Set LT version to C25/A14/R0.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoMake use of GPGRT macros is available.
Werner Koch [Wed, 26 Aug 2015 07:16:36 +0000 (09:16 +0200)]
Make use of GPGRT macros is available.

* src/gpgme.h.in (_GPGME_INLINE): Define using GPGRT_INLINE if
possible.  Fix problem with -Wundef by adding an extra "defined()".
(_GPGME_GCC_VERSION): Define using GPGRT_ macro if possible.

3 years agoAvoid -Wundef warnings if gpgme.h is used by g++.
Werner Koch [Tue, 25 Aug 2015 19:04:15 +0000 (21:04 +0200)]
Avoid -Wundef warnings if gpgme.h is used by g++.

* src/gpgme.h.in (_GPGME_INLINE): Move definition into the
extern-C-scope.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoAdd configure option --enable-build-timestamp.
Werner Koch [Tue, 25 Aug 2015 18:40:06 +0000 (20:40 +0200)]
Add configure option --enable-build-timestamp.

* configure.ac (BUILD_TIMESTAMP): Set to "<none>" by default.
--

This is based on
libgpg-error commit d620005fd1a655d591fccb44639e22ea445e4554
but changed to be disbaled by default.  Check there for some
background.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoRelax ttyname_r error checks
Daiki Ueno [Mon, 27 Jul 2015 07:19:52 +0000 (16:19 +0900)]
Relax ttyname_r error checks

* src/engine-assuan.c (llass_new): Don't treat ttyname_r error as
fatal.
* src/engine-g13.c (g13_new): Likewise.
* src/engine-gpg.c (gpg_new): Likewise.
* src/engine-gpgsm.c (gpgsm_new): Likewise.
* src/engine-uiserver.c (uiserver_new): Likewise.

--
Even though isatty() returns 1, ttyname_r() may fail in many ways, e.g.,
when /dev/pts is not accessible under chroot.  Since all our uses of
ttyname_r() require that the function works, we can treat the failure as
if isatty() fails.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
3 years agoCleanup layout of gpgme.h
Werner Koch [Tue, 25 Aug 2015 16:06:24 +0000 (18:06 +0200)]
Cleanup layout of gpgme.h

* src/gpgme.h.in: Reorder prototypes.  Chnage some comments.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoImprove error return by checking the FAILURE status.
Werner Koch [Tue, 25 Aug 2015 11:22:43 +0000 (13:22 +0200)]
Improve error return by checking the FAILURE status.

* src/gpgme.h.in (GPGME_STATUS_FAILURE): New.
* src/status-table.c (FAILURE): New.
* src/op-support.c (_gpgme_parse_failure): New.
* src/passphrase.c (_gpgme_passphrase_status_handler): Forward FAILURE
status line to the status callback.

* src/decrypt.c (op_data_t): Add field failure_code.
(_gpgme_decrypt_status_handler): Parse that code and act upon it on EOF.
* src/encrypt.c (op_data_t): Add field failure_code.
(_gpgme_encrypt_status_handler): Parse that code and act upon it on EOF.
* src/genkey.c (op_data_t): Add field failure_code.
(genkey_status_handler): Parse that code and act upon it on EOF.
* src/passwd.c (op_data_t): Add field failure_code.
(passwd_status_handler): Parse that code and act upon it on EOF.
* src/sign.c (op_data_t): Add field failure_code.
(_gpgme_sign_status_handler): Parse that code and act upon it on EOF.
* src/verify.c (op_data_t): Add field failure_code.
(_gpgme_verify_status_handler): Parse that code and act upon it on EOF.

--

This requires GnuPG 2.1.8 to actually make a difference.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests: Build test programs in tests/ without wrappers.
Werner Koch [Tue, 25 Aug 2015 08:37:02 +0000 (10:37 +0200)]
tests: Build test programs in tests/ without wrappers.

--

3 years agotests: Allow using run-sign to test loopback pinentry problems.
Werner Koch [Tue, 25 Aug 2015 07:05:27 +0000 (09:05 +0200)]
tests: Allow using run-sign to test loopback pinentry problems.

* tests/run-sign.c: Add options --status and --loopback.

3 years agoCall status_cb for an ERROR status seen in the passphrase handler.
Werner Koch [Mon, 24 Aug 2015 19:17:21 +0000 (21:17 +0200)]
Call status_cb for an ERROR status seen in the passphrase handler.

* src/passphrase.c (_gpgme_passphrase_status_handler): Call status_cb.
--

Frankly, we should have a more generic way of feeding the status_cb
handler than our current ad-hoc method.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Look for gpgconf in the new GnuPG 2.1 install dir.
Werner Koch [Mon, 24 Aug 2015 17:59:43 +0000 (19:59 +0200)]
w32: Look for gpgconf in the new GnuPG 2.1 install dir.

* src/w32-util.c (_gpgme_get_gpgconf_path): Try another location of
gpgconf.exe.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agow32: Expect gpgme-w32spawn.exe only in the gpgme installation dir.
Werner Koch [Mon, 24 Aug 2015 14:34:29 +0000 (16:34 +0200)]
w32: Expect gpgme-w32spawn.exe only in the gpgme installation dir.

* src/w32-util.c (find_program_at_standard_place): Remove.
(_gpgme_get_gpg_path): Make the search order more explicit.
(_gpgme_get_gpgconf_path): Ditto.
(_gpgme_get_w32spawn_path): Search only in the inst_dir.
--

This tries to avoid possible unclear bug reports by removing the
fallback to the current gpg4win installation directory for the gpgme
helper.  It is expected that users of gpgme installing their own gpgme
version also install the matching helper.

Signed-off-by: Werner Koch <wk@gnupg.org>