gpgme.git
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 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 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 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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>
2 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>
2 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.

2 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>
2 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>
2 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.

2 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>
2 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>
2 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>
2 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>
3 years agow32: Print the installation directory in debug mode.
Werner Koch [Mon, 24 Aug 2015 13:03:20 +0000 (15:03 +0200)]
w32: Print the installation directory in debug mode.

* src/debug.c (debug_init) [W32]: Show libgpgme installation dir.
--

I expect that gpgme will be distributed by applications and thus it
will be helpful to see in the debug log which gpgme is actually used.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoAdd an export secret key feature.
Werner Koch [Mon, 24 Aug 2015 10:41:24 +0000 (12:41 +0200)]
Add an export secret key feature.

* src/gpgme.h.in (GPGME_EXPORT_MODE_SECRET): New.
(GPGME_EXPORT_MODE_RAW): New.
(GPGME_EXPORT_MODE_PKCS12): New.
* src/export.c (export_start, export_ext_start): Allow new flags.
* src/engine-gpg.c (export_common): Support secret key export.
* src/engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.

* src/gpgme-tool.c (cmd_export): Add options --secret, --raw,
and --pkcs12.
* tests/run-export.c (main): Likewise.
--

Note that exporting secret X.509 keys requires GnuPG 2.1.8.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoParse INQUIRE_MAXLEN in the passphrase callback.
Ben Kibbey [Sun, 16 Aug 2015 16:29:41 +0000 (12:29 -0400)]
Parse INQUIRE_MAXLEN in the passphrase callback.

* src/passphrase.c (_gpgme_passphrase_status_handler): Parse
GPGME_STATUS_INQUIRE_MAXLEN.
* src/passphrase.c (_gpgme_passphrase_command_handler): Send the
INQUIRE_MAXLEN status message.

--
Fixes passing this status message along when decrypting symmetric data
from gpg.

3 years agoFix gpgme_{get,set}_status_cb to match documentation.
Ben Kibbey [Sat, 15 Aug 2015 20:58:04 +0000 (16:58 -0400)]
Fix gpgme_{get,set}_status_cb to match documentation.

* doc/gpgme.texi: Minor fixes.
* src/gpgme.c (gpgme_get_status_cb): Set return variables to NULL and
check for a valid ctx pointer.

3 years agoParse the INQUIRE_MAXLEN status message.
Ben Kibbey [Fri, 17 Apr 2015 01:05:01 +0000 (21:05 -0400)]
Parse the INQUIRE_MAXLEN status message.

* src/gpgme.h.in: (gpgme_status_code_t): Add INQUIRE_MAXLEN.
* src/status-table.c (status_table_s): Ditto.
* src/genkey.c (genkey_status_handler): Parse INQUIRE_MAXLEN.
* src/decrypt.c (_gpgme_decrypt_status_handler): Ditto.
* src/sign.c (_gpgme_sign_status_handler): Ditto.

This status message informs the client of the maximum length of an
inquired line. It is sent from gpg and forwarded to the client via
gpgme_status_cb_t.

3 years agoAdd gpgme_set/get_status_cb().
Ben Kibbey [Fri, 17 Apr 2015 00:23:38 +0000 (20:23 -0400)]
Add gpgme_set/get_status_cb().

* src/gpgme.h.in (gpgme_set_status_cb): New.
(gpgme_get_status_cb): New.
(gpgme_status_cb_t): New.
* src/gpgme.c (gpgme_set_status_cb): New.
(gpgme_get_status_cb): New.
* src/context.h (status_cb): New.
(status_cb_value): New.
* src/gpgme.def: Export new symbols.
* src/libgpgme.vers: Ditto.
* doc/gpgme.texi: Document these new functions.

--
This callback function is used to forward status messages from gpg back
to the client.

3 years agoMake use of user passphrase handler during genkey.
Ben Kibbey [Tue, 14 Apr 2015 22:39:26 +0000 (18:39 -0400)]
Make use of user passphrase handler during genkey.

* src/genkey.c (genkey_start): set engine passphrase command handler.

--
This allows for inquiring a new passphrase during key generation rather
than requiring a pinentry. Needs a patch to gnupg to make use of
--command-fd with --gen-key.

3 years agoAlso check the return code in gpg_sign().
Ben Kibbey [Wed, 12 Aug 2015 10:46:43 +0000 (06:46 -0400)]
Also check the return code in gpg_sign().

* src/engine-gpg.c (gpg_sign): Check return value from start().

3 years agoCheck the return value when starting gpg.
Ben Kibbey [Tue, 11 Aug 2015 01:23:02 +0000 (21:23 -0400)]
Check the return value when starting gpg.

* src/engine-gpg.c (gpg_decrypt, gpg_delete, gpg_passwd): Check return
value of start().

3 years agoAdd offline mode support for CMS keylisting
Andre Heinecke [Thu, 2 Jul 2015 08:19:04 +0000 (10:19 +0200)]
Add offline mode support for CMS keylisting

* doc/gpgme.texi: Document offline mode.
* src/context.h (gpgme_context): Add offline.
* src/engine-backend.h (keylist, keylist_ext): Add engine_flags.
* src/engine.c, src/engine.h (_gpgme_engine_op_keylist): Ditto.
  (_gpgme_engine_op_keylist_ext): Ditto.
* src/engine.h (GPGME_ENGINE_FLAG_OFFLINE): New.
* src/engine-gpg.c (gpg_keylist, gpg_keylist_ext): Ditto.
* src/engine-gpgsm.c (gpgsm_keylist): Handle engine_flags.
  (gpgsm_keylist_ext): Ditto.
* src/gpgme.c (gpgme_set_offline, gpgme_get_offline): New.
* src/gpgme.def (gpgme_set_offline, gpgme_get_offline): New.
* src/gpgme.h.in (gpgme_set_offline, gpgme_get_offline): New.
* src/libgpgme.vers (gpgme_set_offline, gpgme_get_offline): New.
* src/keylist.c (gpgme_op_keylist_start): Set offline flag.
  (gpgme_op_keylist_ext_start): Ditto.
* tests/run-keylist.c (show_usage, main): Add offline argument.

--
The offline engine option was introduced with gpgsm 2.1.6
it is mainly useful for a full keylisting that includes
the certificate validation but does not depend on external
information that could take an indefinite amount of time to
collect.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
3 years agobuild: ignore scissor line for the commit-msg hook
Peter Wu [Thu, 9 Jul 2015 15:11:33 +0000 (17:11 +0200)]
build: ignore scissor line for the commit-msg hook

* build-aux/git-hooks/commit-msg: Stop processing more lines when the
  scissor line is encountered.
--
This allows the command `git commit -v` to work even if the code is
longer than 72 characters. Note that comments are already ignored by the
previous line.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
3 years agoAdd option --lib-version to gpgme-tool.
Werner Koch [Thu, 23 Jul 2015 09:40:09 +0000 (11:40 +0200)]
Add option --lib-version to gpgme-tool.

* src/gpgme-tool.c (options, parse_options):  Add --lib-version
(CMD_LIBVERSION): New.
(main): Implement.

3 years agoPost release updates
Werner Koch [Mon, 8 Jun 2015 13:18:56 +0000 (15:18 +0200)]
Post release updates

--

3 years agoRelease 1.5.5 gpgme-1.5.5
Werner Koch [Mon, 8 Jun 2015 12:58:44 +0000 (14:58 +0200)]
Release 1.5.5

3 years agoFix regression with gpgsm 2.0 due to "OPTION with-secret".
Werner Koch [Mon, 8 Jun 2015 10:34:49 +0000 (12:34 +0200)]
Fix regression with gpgsm 2.0 due to "OPTION with-secret".

* src/engine-gpgsm.c (gpgsm_assuan_simple_command): Do not terminate
on a status lines.
--

This bug has been with us since the support for gpgsm: If there is no
status line handler but a status line is received anyway the command
handling loop terminates and thus the command/answer order gets out of
sync.  In the case of the bug report this is triggered by sending an
option which starts the agent and that starting emits a "PROGRESS"
status line.

The solution is not to stop reading after a status line but record a
possible error code and return that only after OK or ERR.

GnuPG-bug-id: 1795
Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agotests: Add option --secret to run-keylist.
Werner Koch [Mon, 8 Jun 2015 10:30:11 +0000 (12:30 +0200)]
tests: Add option --secret to run-keylist.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoFix compiler warnings about unused value in TRACE macros.
Werner Koch [Mon, 8 Jun 2015 09:08:08 +0000 (11:08 +0200)]
Fix compiler warnings about unused value in TRACE macros.

* src/debug.h: Change macros to not have a literal 0 as last
expression of the comma operator.
* src/debug.c (_gpgme_debug_frame_end): Return 0.
(_gpgme_debug): Return 0.
--

Instead of using
   foo(), 0
for the trace macros we let foo() return 0 instead.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoFix test suite for GnuPG 2.1 which uses pubring.kbx.
Werner Koch [Mon, 8 Jun 2015 08:43:29 +0000 (10:43 +0200)]
Fix test suite for GnuPG 2.1 which uses pubring.kbx.

* tests/gpgsm/final.test: New.
* tests/gpgsm/initial.test: New.
* tests/gpg/start-stop-agent: Move to ../.
* tests/gpgsm/Makefile.am (TESTS_ENVIRONMENT): Export top_srcdir.
(TESTS): Add intial.test and final.test.
(AM_LDFLAGS): Add -no-install.
(clean-local): Use start-stop-agent
(initial.test): Add dependency.
* tests/gpg/Makefile.am (top_srcdir): Export top_srcdir.
(AM_LDFLAGS): Add -no-install.
(check-local): Depend on pubring-stamp instead of pubring.gpg.
(initial.test): Depend on check-local.
(./pubring-gpg): Replace by rule for ./pubring-stamp.
--

There are also a couple of other changes which should make the tests a
bit more robust and the gpg and gpgsm tests more similar.

The -no-install avoids creating wrappers for test programs, which make
debugging easier.

The dependency on check-local guarantees that its rules are run before
the first test.  This is important because conf files are setup by
this rule.  Earlier automake versions seem to have run check-local
always before the tests but today the order of execution is not
defined.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoSet GPGME_SIGSUM_KEY_REVOKED also for gpg.
Matthew Barnes [Wed, 18 Mar 2015 21:20:55 +0000 (17:20 -0400)]
Set GPGME_SIGSUM_KEY_REVOKED also for gpg.

* src/verify.c (calc_sig_summary): Handle GPG_ERR_CERT_REVOKED.

--

parse_new_sig() handles a revoked key by setting sig->status to
GPG_ERR_CERT_REVOKED, but then later calc_sig_summary() expects that
code in sig->validity_reason.

Additional comments added by wk.

3 years agoFix segv for userids with a backslash.
Werner Koch [Fri, 5 Jun 2015 12:25:59 +0000 (14:25 +0200)]
Fix segv for userids with a backslash.

* src/engine-gpg.c (gpg_keylist_preprocess): Increment SRC for a
backslash.
--

This bug is not exploitable because this bug fills up .data with
backslashes and thus causes the segv.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoPost release updates.
Werner Koch [Mon, 13 Apr 2015 13:50:59 +0000 (15:50 +0200)]
Post release updates.

--

3 years agoRelease 1.5.4. gpgme-1.5.4
Werner Koch [Mon, 13 Apr 2015 13:43:13 +0000 (15:43 +0200)]
Release 1.5.4.

3 years agow32: Use -static-libgcc to avoid linking to libgcc_s_sjlj-1.dll.
Werner Koch [Mon, 13 Apr 2015 13:35:06 +0000 (15:35 +0200)]
w32: Use -static-libgcc to avoid linking to libgcc_s_sjlj-1.dll.

* src/Makefile.am (extra_ltoptions): New.
(libgpgme_la_LDFLAGS): Use it.
(libgpgme_pthread_la_LDFLAGS): Ditto.
(libgpgme_glib_la_LDFLAGS): Ditto.
--

Since gcc 4.8 there is a regression in Mingw64 in that plain C
programs may link to libgcc_s.a which has a dependency on
libgcc_s_sjlj.dll.  This is for example triggered by using long long
arithmetic on a 32 bit Windows (e.g symbol __udivdi3).

Note that we don't use this patch for the Qt version which, as C++
programs, actually requires that DLL,

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoFix potential crash in trace macro.
Werner Koch [Mon, 16 Mar 2015 12:40:34 +0000 (13:40 +0100)]
Fix potential crash in trace macro.

* src/signers.c (gpgme_signers_add): Avoid deref of a NULL KEY in the
trace macro.
* src/engine-spawn.c (engspawn_release): Remove always true condition.
* src/engine-gpg.c (gpg_release): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agoFix one byte too short malloc.
Werner Koch [Mon, 16 Mar 2015 12:38:10 +0000 (13:38 +0100)]
Fix one byte too short malloc.

* src/engine-spawn.c (add_data): Fix malloc
--

Bummer.  Why did I subtracted one from the size?  Did I assume a
dynamically allocated structure with a string field which was not
going to be used?  Very strange.

Not a real problem though because malloc will anyway round up the
allocation to at least the next word size.

Detected by Stack 0.3.

3 years agoSwitch to automake 1.14 and update build-aux files.
Werner Koch [Fri, 30 Jan 2015 09:45:20 +0000 (10:45 +0100)]
Switch to automake 1.14 and update  build-aux files.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 years agodoc: Update gpl.texi to match version from gnupg
Daniel Kahn Gillmor [Sat, 6 Sep 2014 05:04:07 +0000 (01:04 -0400)]
doc: Update gpl.texi to match version from gnupg

--

Somehow the doc/gpl.texi from gpgme and gnupg drifted out of sync.
This patch to gpgme's file brings it in line with gnupg's master
branch, and avoids the following errors during make:

./gpl.texi:667: @section seen before @end enumerate
./gpl.texi:724: unmatched `@end enumerate'
./gpl.texi:1: warning: node next `Copying' in menu `Concept Index'
   and in sectioning `Function and Data Index' differ

3 years agoPost release updates.
Werner Koch [Thu, 11 Dec 2014 11:53:28 +0000 (12:53 +0100)]
Post release updates.

--