Commit Graph

3665 Commits

Author SHA1 Message Date
Ingo Klöcker
28c23ce8db
build,cpp: Separate C++ bindings from gpgme
* configure.ac: Remove definition and substitution of
LIBGPGMEPP_LT_CURRENT, LIBGPGMEPP_LT_AGE, LIBGPGMEPP_LT_REVISION.
Remove "cpp" from available_languages and from default_languages.
Remove checks for C++ 11 and for support of visibility attribute.
Remove substitution of GPGME_CPP_CFLAGS.
Remove definition and substitution of GPGMEPP_PKGCONFIG_LIBS,
GPGMEPP_PKGCONFIG_CFLAGS, GPGMEPP_PKGCONFIG_HOST.
Remove generation of files in lang/cpp.
* lang/Makefile.am (DIST_SUBDIRS): Remove cpp.
* lang/cpp/.gitignore, lang/cpp/AUTHORS, lang/cpp/COPYING,
lang/cpp/COPYING.LESSER, lang/cpp/COPYING.LIB, lang/cpp/ChangeLog,
lang/cpp/INSTALL, lang/cpp/NEWS, lang/cpp/autogen.rc,
lang/cpp/autogen.sh, lang/cpp/configure.ac: New.
* lang/cpp/Makefile.am (EXTRA_DIST): Add autogen.sh, autogen.rc,
VERSION.
(RELEASE_ARCHIVE_SUFFIX, ACLOCAL_AMFLAGS, dist-hook, distcheck-hook,
.PHONY, gen_start_date, gen-ChangeLog, RELEASE_NAME, release,
sign-release): New (copied from top-level Makefile.am).
* lang/cpp/build-aux/compile, lang/cpp/build-aux/config.guess,
lang/cpp/build-aux/config.sub, lang/cpp/build-aux/depcomp,
lang/cpp/build-aux/install-sh, lang/cpp/build-aux/libtool-patch.sed,
lang/cpp/build-aux/ltmain.sh, lang/cpp/build-aux/missing: New.
* m4/ax_cxx_compile_stdcxx.m4: Move to...
* lang/cpp/m4/ax_cxx_compile_stdcxx.m4: ...here.
* m4/ax_gcc_func_attribute.m4: Move to...
* lang/cpp/m4/ax_gcc_func_attribute.m4: ...here.
* lang/cpp/m4/gpg-error.m4, lang/cpp/m4/gpgme.m4,
lang/cpp/m4/libtool.m4, lang/cpp/m4/ltoptions.m4,
lang/cpp/m4/ltsugar.m4, lang/cpp/m4/ltversion.m4,
lang/cpp/m4/lt~obsolete.m4: New.
* lang/cpp/src/GpgmeppConfig-w32.cmake.in.in,
lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove @LIBASSUAN_LIBS@ from
INTERFACE_LINK_LIBRARIES of Gpgmepp target.
* lang/cpp/src/Makefile.am (AM_CPPFLAGS): Replace include paths of
gpgme relative to top_builddir with @GPGME_CFLAGS@. Remove
@LIBASSUAN_CFLAGS@.
(libgpgmepp_la_LIBADD): Replace relative paths of libgpgme.la with
@GPGME_LIBS@. Remove @LIBASSUAN_LIBS@.
* lang/cpp/tests/Makefile.am (LDADD): Replace relative paths of
libgpgme.la with @GPGME_LIBS@.
(AM_CPPFLAGS): Replace include paths of gpgme relative to top_builddir
with @GPGME_CFLAGS@. Remove @LIBASSUAN_CFLAGS@. Remove -DTOP_SRCDIR.
--

This makes building and distributing GpgME++ independent of the sources
of gpgme. Many of the new files are copied from gpgme to make GpgME++ a
self-contained package. A later commit re-adds the possibility to build
GpgME++ as nested package together with gpgme.

GnuPG-bug-id: 7110
2024-06-11 14:23:40 +02:00
Ingo Klöcker
e64dd7ee51
cpp: Don't include config.h
* lang/cpp/src/*.cpp, lang/cpp/tests/*.cpp: Remove config.h include.
--

The C++ binding sources don't need anything from config.h.

GnuPG-bug-id: 7110
2024-06-11 14:23:40 +02:00
Ingo Klöcker
130766ffc5
build,qt: Separate Qt bindings from gpgme
* configure.ac: Remove definition and substitution of
LIBQGPGME_LT_CURRENT, LIBQGPGME_LT_AGE, LIBQGPGME_LT_REVISION.
Remove "qt qt5 qt6" from available_languages.
Remove "qt" from default_languages.
Remove options --enable-reduce-relocations and
--enable-no-direct-extern-access.
Remove checks for pkg-config, Qt 5, Qt 6 and C++ 17.
Remove adding visibility flag to GPGME_QT5_CFLAGS and GPGME_QT6_CFLAGS.
Remove definition of conditionals WANT_QT5 and WANT_QT6.
Remove checks for doxygen and dot.
Remove generation of files in lang/qt.
* lang/Makefile.am (DIST_SUBDIRS): Remove qt.
* lang/qt/.gitignore, lang/qt/AUTHORS, lang/qt/COPYING,
lang/qt/ChangeLog, lang/qt/INSTALL, lang/qt/NEWS, lang/qt/autogen.rc,
lang/qt/autogen.sh, lang/qt/configure.ac: New.
* lang/qt/Makefile.am (EXTRA_DIST): Add autogen.sh, autogen.rc,
VERSION.
(RELEASE_ARCHIVE_SUFFIX, ACLOCAL_AMFLAGS, dist-hook, distcheck-hook,
.PHONY, gen_start_date, gen-ChangeLog, RELEASE_NAME, release,
sign-release): New (copied from top-level Makefile.am).
* lang/qt/build-aux/compile, lang/qt/build-aux/config.guess,
lang/qt/build-aux/config.sub, lang/qt/build-aux/depcomp,
lang/qt/build-aux/install-sh, lang/qt/build-aux/libtool-patch.sed,
lang/qt/build-aux/ltmain.sh, lang/qt/build-aux/missing: New.
* lang/qt/doc/Doxyfile.in (INPUT): Update path.
* m4/ax_check_compile_flag.m4: Move to...
* lang/qt/m4/ax_check_compile_flag.m4: ...here
* m4/pkg.m4: Move to...
* lang/qt/m4/pkg.m4: ...here
* m4/qt5.m4: Move to...
* lang/qt/m4/qt5.m4: ...here
* m4/qt6.m4: Move to...
* lang/qt/m4/qt6.m4: ...here
* lang/qt/m4/ax_cxx_compile_stdcxx.m4,
lang/qt/m4/ax_gcc_func_attribute.m4, lang/qt/m4/gpg-error.m4,
lang/qt/m4/gpgme.m4, lang/qt/m4/gpgmepp.m4, lang/qt/m4/libtool.m4,
lang/qt/m4/ltoptions.m4, lang/qt/m4/ltsugar.m4,
lang/qt/m4/ltversion.m4, lang/qt/m4/lt~obsolete.m4: New.
* lang/qt/src/Makefile.am (AM_CPPFLAGS): Replace include paths of
gpgmepp and gpgme relative to top_builddir with @GPGMEPP_CFLAGS@ and
@GPGME_CFLAGS@.
(libqgpgme_la_LIBADD, libqgpgmeqt6_la_LIBADD): Replace relative paths
of libgpgmepp.la and libgpgme.la with @GPGMEPP_LIBS@ and @GPGME_LIBS@.
* lang/qt/tests/Makefile.am (EXTRA_DIST): Add new files.
(LDADD): Replace relative paths of libgpgmepp.la and libgpgme.la with
@GPGMEPP_LIBS@ and @GPGME_LIBS@.
(AM_CPPFLAGS): Replace include paths of gpgmepp and gpgme relative to
top_builddir with @GPGMEPP_CFLAGS@ and @GPGME_CFLAGS@.
(pubring-stamp): Use local copies of pubdemo.asc and secdemo.asc.
* lang/qt/tests/pubdemo.asc, lang/qt/tests/secdemo.asc,
lang/qt/tests/start-stop-agent: New.
--

This makes building and distributing QGpgME independent of the sources
of gpgme. Many of the new files are copied from gpgme to make QGpgME a
self-contained package. A later commit re-adds the possibility to build
QGpgME as nested package together with gpgme.

GnuPG-bug-id: 7110
2024-06-11 14:23:39 +02:00
Ingo Klöcker
13726d146c
build: Allow autoheader to be skipped
* autogen.sh: If skip_autoheader is set via autogen.rc then do not run
autoheader.
--

This makes it possible to skip running autoheader for packages which
don't need a config.h header.

GnuPG-bug-id: 7110
2024-06-10 17:22:01 +02:00
Ingo Klöcker
f97245f628
build: Make autogen.sh --find-version work for nested packages
* autogen.sh: If package_subdir is set then look for .git in the root
of the package containing the nested package in package_subdir.
--

This makes it possible to use autogen.sh --find-version from
configure.ac files in nested packages.

GnuPG-bug-id: 7110
2024-06-10 17:22:01 +02:00
Ingo Klöcker
84affea627
qt: Don't include config.h
* lang/qt/src/*.cpp, lang/qt/tests/*.cpp: Remove config.h include.
--

The Qt binding sources don't need anything from config.h.

GnuPG-bug-id: 7110
2024-06-10 14:59:29 +02:00
Ingo Klöcker
76b38f54a5
cpp: Add pkgconfig file for gpgmepp
* configure.ac: Add substitutions GPGMEPP_PKGCONFIG_LIBS,
GPGMEPP_PKGCONFIG_CFLAGS, GPGMEPP_PKGCONFIG_HOST. Apply them. Configure
gpgmepp.pc file.
* lang/cpp/src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New.
(EXTRA_DIST): Add gpgmepp.pc.in.
* lang/cpp/src/gpgmepp.pc.in: New.
--

This pkgconfig file will be used by qgpgme to find gpgmepp.

GnuPG-bug-id: 7110
2024-06-10 14:58:53 +02:00
Ingo Klöcker
5b0903c9af
qt: Always include C++ binding headers with gpgme++/ prefix
* lang/qt/src/Makefile.am, lang/qt/tests/Makefile.am (AM_CPPFLAGS):
Add builddir instead of srcdir of C++ bindings as include path.
* lang/qt/src/changeexpiryjob.cpp, lang/qt/src/changeexpiryjob.h,
lang/qt/src/changeownertrustjob.h, lang/qt/src/dataprovider.cpp,
lang/qt/src/dataprovider.h, lang/qt/src/debug.cpp,
lang/qt/src/decryptverifyarchivejob.cpp,
lang/qt/src/decryptverifyarchivejob.h,
lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h,
lang/qt/src/encryptjob.h, lang/qt/src/encryptjob_p.h,
lang/qt/src/filelistdataprovider.cpp,
lang/qt/src/filelistdataprovider.h,
lang/qt/src/hierarchicalkeylistjob.h, lang/qt/src/importjob.cpp,
lang/qt/src/importjob.h, lang/qt/src/importjob_p.h, lang/qt/src/job.h,
lang/qt/src/keyformailboxjob.h, lang/qt/src/keylistjob.h,
lang/qt/src/listallkeysjob.h, lang/qt/src/multideletejob.cpp,
lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp,
lang/qt/src/qgpgmeadduseridjob.cpp, lang/qt/src/qgpgmebackend.cpp,
lang/qt/src/qgpgmechangeexpiryjob.cpp,
lang/qt/src/qgpgmechangeownertrustjob.cpp,
lang/qt/src/qgpgmechangepasswdjob.cpp, lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmedecryptjob.h,
lang/qt/src/qgpgmedecryptverifyarchivejob.cpp,
lang/qt/src/qgpgmedecryptverifyarchivejob.h,
lang/qt/src/qgpgmedecryptverifyjob.cpp,
lang/qt/src/qgpgmedecryptverifyjob.h, lang/qt/src/qgpgmedeletejob.cpp,
lang/qt/src/qgpgmedownloadjob.cpp,
lang/qt/src/qgpgmeencryptarchivejob.cpp,
lang/qt/src/qgpgmeencryptarchivejob.h, lang/qt/src/qgpgmeencryptjob.cpp,
lang/qt/src/qgpgmeencryptjob.h, lang/qt/src/qgpgmeexportjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.h,
lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmeimportjob.h,
lang/qt/src/qgpgmekeyformailboxjob.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/qgpgmequickjob.cpp,
lang/qt/src/qgpgmereceivekeysjob.h,
lang/qt/src/qgpgmerefreshsmimekeysjob.cpp,
lang/qt/src/qgpgmerefreshsmimekeysjob.h,
lang/qt/src/qgpgmerevokekeyjob.cpp,
lang/qt/src/qgpgmesetprimaryuseridjob.cpp,
lang/qt/src/qgpgmesignarchivejob.cpp,
lang/qt/src/qgpgmesignarchivejob.h,
lang/qt/src/qgpgmesignencryptarchivejob.cpp,
lang/qt/src/qgpgmesignencryptarchivejob.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/qgpgmetofupolicyjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.cpp,
lang/qt/src/qgpgmeverifydetachedjob.h,
lang/qt/src/qgpgmeverifyopaquejob.cpp,
lang/qt/src/qgpgmeverifyopaquejob.h, lang/qt/src/qgpgmewkdlookupjob.cpp,
lang/qt/src/qgpgmewkdrefreshjob.cpp, lang/qt/src/qgpgmewkdrefreshjob.h,
lang/qt/src/qgpgmewkspublishjob.cpp, lang/qt/src/quickjob.h,
lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h,
lang/qt/src/signencryptarchivejob.cpp,
lang/qt/src/signencryptarchivejob.h, lang/qt/src/signencryptjob.h,
lang/qt/src/signencryptjob_p.h, lang/qt/src/signjob.h,
lang/qt/src/signjob_p.h, lang/qt/src/threadedjobmixin.cpp,
lang/qt/src/threadedjobmixin.h, lang/qt/src/tofupolicyjob.h,
lang/qt/src/util.cpp, lang/qt/src/wkdlookupresult.cpp,
lang/qt/src/wkdlookupresult.h, lang/qt/src/wkdrefreshjob_p.h,
lang/qt/tests/run-decryptverifyarchivejob.cpp,
lang/qt/tests/run-decryptverifyjob.cpp,
lang/qt/tests/run-encryptarchivejob.cpp,
lang/qt/tests/run-encryptjob.cpp, lang/qt/tests/run-exportjob.cpp,
lang/qt/tests/run-importjob.cpp, lang/qt/tests/run-keyformailboxjob.cpp,
lang/qt/tests/run-receivekeysjob.cpp,
lang/qt/tests/run-refreshkeysjob.cpp,
lang/qt/tests/run-signarchivejob.cpp, lang/qt/tests/run-signjob.cpp,
lang/qt/tests/run-verifydetachedjob.cpp,
lang/qt/tests/run-verifyopaquejob.cpp,
lang/qt/tests/run-wkdrefreshjob.cpp,
lang/qt/tests/t-addexistingsubkey.cpp,
lang/qt/tests/t-changeexpiryjob.cpp, lang/qt/tests/t-config.cpp,
lang/qt/tests/t-decryptverify.cpp, lang/qt/tests/t-encrypt.cpp,
lang/qt/tests/t-import.cpp, lang/qt/tests/t-keylist.cpp,
lang/qt/tests/t-keylocate.cpp, lang/qt/tests/t-ownertrust.cpp,
lang/qt/tests/t-remarks.cpp, lang/qt/tests/t-revokekey.cpp,
lang/qt/tests/t-setprimaryuserid.cpp, lang/qt/tests/t-support.cpp,
lang/qt/tests/t-support.h, lang/qt/tests/t-tofuinfo.cpp,
lang/qt/tests/t-trustsignatures.cpp, lang/qt/tests/t-various.cpp,
lang/qt/tests/t-verify.cpp, lang/qt/tests/t-wkdlookup.cpp,
lang/qt/tests/t-wkspublish.cpp: Include GpgME++ headers with gpgme++/
prefix.
--

This prepares the Qt bindings for building them separately from the C++
bindings.

GnuPG-bug-id: 7110
2024-06-10 14:58:53 +02:00
Ingo Klöcker
8be031ebdb
build,cpp: Create forwarding headers in a gpgme++ folder
* lang/cpp/src/Makefile.am (copied_headers): New.
(build rule for all copied headers): New.
(BUILT_SOURCES): New.
(CLEANFILES): Add copied_headers.
--

The forwarding headers make it easier to use the headers from the Qt
bindings when building them against the built but not installed C++
bindings because we can always include the C++ headers with gpgme++/
prefix.

GnuPG-bug-id: 7110
2024-06-10 14:58:53 +02:00
Ingo Klöcker
87319b3fc7
qt: Align license of some Makefiles with license of other Makefiles
* lang/qt/doc/Makefile.am, lang/qt/tests/Makefile.am: Change license
from LGPL to GPL.
--

Both files are part of QGpgME (as lang/qt/Makefile.am and
lang/qt/src/Makefile.am). Hence, they should be licensed as other parts
of QGpgME.
2024-06-10 14:56:02 +02:00
Ingo Klöcker
29be63ae37
qt: Fix license headers of Makefiles
* lang/qt/Makefile.am, lang/qt/src/Makefile.am: Files are part of
QGpgme. Fix wrong package name (GPGME-CL -> QGpgME). Replace references
to LGPL with references to GPL.
--

The files were already licensed under the GPL but the license headers
contained multiple (copy&paste?) errors.
2024-06-10 14:55:50 +02:00
Ingo Klöcker
09cc0c81f7
qt: Fix license headers of CMake config files
* lang/qt/src/QGpgmeConfig-w32.cmake.in.in,
lang/qt/src/QGpgmeConfig.cmake.in.in,
lang/qt/src/QGpgmeConfigVersion.cmake.in: Files are part of QGpgME.
Fix copy&paste error (GPGME-CL -> QGpgME). Fix reference to license
to check for details.
* lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in,
lang/qt/src/QGpgmeQt6Config.cmake.in.in,
lang/qt/src/QGpgmeQt6ConfigVersion.cmake.in: Files are part of QGpgME.
Fix reference to license to check for details.
--

The files were already licensed under the GPL but the license headers
contained multiple (copy&paste?) errors.
2024-06-10 14:55:42 +02:00
Ingo Klöcker
967b6b726e
qt: Fix license headers of dataprovider.*
* lang/qt/src/dataprovider.cpp, lang/qt/src/dataprovider.h: Change
license header from LGPL to GPL.
--

QGpgME is released under the GPL. As part of QGpgME these files (that
were originally licensed under the LGPL) are released under the GPL.
2024-06-10 14:55:26 +02:00
Ingo Klöcker
4136928f0d
cpp: Remove commented out and disabled code
* lang/cpp/src/configuration.cpp: Remove disabled, abandoned code.
* lang/cpp/src/context.cpp: Remove commented out, obsolete code.
--
2024-06-10 14:54:48 +02:00
Werner Koch
5d9269cb4f
doc: Extend description for GPGME_CREATE_ADSK
--
2024-06-05 13:50:17 +02:00
Ingo Klöcker
25dd284b0c
core,w32: Pass file names with forward slashes to gpg and gpgtar
src/conversion.c, src/util.h (_gpgme_replace_backslashes): New.
src/engine-gpg.c (_add_arg): Add argument file_name. On Windows, replace
backslashes in file name arguments with forward slashes.
(add_arg_ext, add_arg_with_locp, add_arg, add_arg_pfx, add_gpg_arg,
add_gpg_arg_with_value, add_arg_len): Adjust call of _add_arg.
(add_file_name_arg, add_file_name_arg_len, add_gpg_arg_with_file_name):
New.
(add_file_name_arg_or_data): Call add_file_name_arg for file name.
(gpg_new): Call add_gpg_arg_with_file_name for home directory.
(gpg_decrypt): Call add_file_name_arg for output directory and output
file name.
(append_args_from_recipients_string): Call add_file_name_arg_len for
recipients file name.
(gpg_encrypt): Call add_file_name_arg for output file name, base
directory and input file name. Call add_gpg_arg_with_file_name to set
file name stored in message.
(gpg_encrypt_sign): Call add_file_name_arg for output file name, base
directory and input file name. Call add_gpg_arg_with_file_name to set
file name stored in message.
(gpg_sign): Call add_file_name_arg for output file name, base directory
and input file name. Call add_gpg_arg_with_file_name to set file name
stored in message.
(gpg_verify): Call add_file_name_arg for output directory and output
file name.
--

By passing all file names with forward slashes to gpg and gpgtar we
avoid problems caused by the quoting of backslashes.

GnuPG-bug-id: 7141
2024-06-04 16:52:24 +02:00
Ingo Klöcker
1245b09012
build,python: Fix make distcheck for Python 3.9+
* lang/python/Makefile.am (uninstall-local): Remove installed .egg
folders.
--

Python 3.9+ install the module into a gpg-*.egg folder instead of in
"gpg" with accompanying gpg-*.egg-info file. Moreover, Python 3.9+
normalize version numbers, e.g. the version 1.24.0_beta576 is normalized
as 1.24.0b576.
2024-05-29 17:13:30 +02:00
Ingo Klöcker
09d81da665
build,python: Remove support for Python 3.4, 3.5, 3.7
* configure.ac: Don't look for Python 3.4, 3.5, 3.7 anymore.
--

This complements the previous commit where those versions where removed
from python.m4.
2024-05-29 17:06:16 +02:00
Ben Greiner
5844d9e700
build,python: Build Python bindings without distutils
* m4/python.m4: Add python3.12 and 3.11 as valid interpreters, remove
EOL 3.4, 3.5, 3.7 (keep 3.6 because some distributions still ship and
maintain it).
* lang/python/Makefile.am (clean-local): Remove dist and gpg.egg-info
created by Python 3.9+ on make install.
* lang/python/setup.py.in: switch from distutils to setuptools where
possible, remove obsolete and deprecated -py3 option of swig, add
classifiers up to 3.12, remove 3.4, 3.5, 3.7.
* lang/python/doc/src/gpgme-python-howto.org: replace distutils with
setuptools
* lang/python/examples/howto/advanced/cython/setup.py: replace distutils
with setuptools
--

This fixes building the Python bindings for Python 3.12 where distutils
has been removed.

Based on D545
2024-05-29 17:04:10 +02:00
Ingo Klöcker
986c5f0b94
tests: Add new files to distribution
* tests/json/Makefile.am (EXTRA_DIST): Add files added with f2575b63.
--

Fixes-commit: f2575b6313
GnuPG-bug-id: 7118
2024-05-24 13:46:55 +02:00
Ingo Klöcker
6aa359b1e8
cpp: Fix includes in public headers
* lang/cpp/src/defaultassuantransaction.h,
lang/cpp/src/gpgadduserideditinteractor.h,
lang/cpp/src/gpgagentgetinfoassuantransaction.h,
lang/cpp/src/gpggencardkeyinteractor.h,
lang/cpp/src/gpgsetexpirytimeeditinteractor.h,
lang/cpp/src/gpgsetownertrusteditinteractor.h,
lang/cpp/src/gpgsignkeyeditinteractor.h,
lang/cpp/src/interfaces/assuantransaction.h,
lang/cpp/src/interfaces/dataprovider.h,
lang/cpp/src/interfaces/statusconsumer.h,
lang/cpp/src/scdgetinfoassuantransaction.h,
lang/cpp/src/statusconsumerassuantransaction.h,
lang/cpp/src/trustitem.h: Use #include "foo.h" instead of
#include <foo.h> for own headers.
--

This fixes the build for projects that include the headers (as intended)
with #include <gpgme++/...> and that don't add the gpgme++ subdirectory
to the list of include paths for the compiler.

GnuPG-bug-id: 7110
2024-05-24 10:51:32 +02:00
Ingo Klöcker
f0d1f2c4c7
Merge branch 'ikloecker/t7118-revkeys' 2024-05-24 10:47:15 +02:00
Tobias Fella
15718cb295
qt,cpp: Implement adding ADSKs to existing keys
* lang/cpp/src/context.cpp: Add functions for adding ADSKs.
* lang/cpp/src/context.h: Ditto.
* lang/qt/src/qgpgmequickjob.cpp: Add implementation of ADSK job.
* lang/qt/src/qgpgmequickjob.h: Ditto.
* lang/qt/src/quickjob.h: Add job for adding ADSKs.
2024-05-22 13:08:50 +02:00
Tobias Fella
e42b72bc2b
core: Implement adding ADSKs through gpgme_createsubkey
* src/engine-gpg.c: Add and use function for adding ADSKs.
* src/genkey.c: Prevent error due to no status line.
* src/gpgme.h.in: Add flag GPGME_CREATE_ADSK
* doc/gpgme.texi: Add documentation for ADSKs
* tests/run-genkey.c: Add test for adding ADSKs
--

This adds the ability to add ADSKs through
the gpgme_createsubkey interface.
The function must be called with NULL userid,
the ADSK fingerprint in algo
and the GPGME_CREATE_ADSK flag.
2024-05-22 10:16:19 +02:00
Ingo Klöcker
90eb80134b
cpp: Add information about revocation keys to Key
* lang/cpp/src/gpgmefw.h (gpgme_revocation_key_t): New forward
declaration.
* lang/cpp/src/key.cpp, lang/cpp/src/key.h (class Key): New methods
revocationKey, numRevocationKeys, revocationKeys.
(class RevocationKey): New.
(swap): New overload for RevocationKey.
(operator<<): New overload for RevocationKey.
* lang/cpp/src/key.cpp (operator<<): Add information about revocation
keys to the output stream for Key.

* lang/cpp/tests/run-keylist.cpp (main): Don't output Key if nextKey
failed, e.g. at the end of the key listing.
--

GnuPG-bug-id: 7118
2024-05-21 16:38:59 +02:00
Ingo Klöcker
f2575b6313
json: Add information about revocation keys to key list result
* src/gpgme-json.c (revocation_key_to_json): New.
(key_to_json): Add list of revocation keys.

* tests/json/Makefile.am (pubring-stamp): Import new pub key.
* tests/json/key-with-revokers.asc: New.
* tests/json/t-json.c (tests): Add "t-keylist-revokers".
* tests/json/t-keylist-revokers.in.json,
tests/json/t-keylist-revokers.in.json: New.
--

GnuPG-bug-id: 7118
2024-05-21 16:38:59 +02:00
Ingo Klöcker
adadfac997
core: Add information about revocation keys to keys
* src/gpgme.h.in (struct _gpgme_revocation_key,
gpgme_revocation_key_t): New.
(struct _gpgme_key): Add fields 'revkeys', '_last_revkey'.
* src/key.c (_gpgme_key_add_rev_key): New.
(gpgme_key_unref): Free revkeys.
* src/keylist.c (keylist_colon_handler): Parse rvk lines.
* src/ops.h (_gpgme_key_add_rev_key): New.

* tests/run-keylist.c (main): Print revocation key info.
--

GnuPG-bug-id: 7118
2024-05-21 16:38:59 +02:00
Werner Koch
ac4bf86bb6
tests: Fix segv in t-json.c
* tests/json/t-json.c (test_contains): Avoid calling recusivly with no
child.
2024-05-21 14:36:07 +02:00
Werner Koch
55a1ae4163
tests: Avoid some compiler warnings.
* tests/gpg/t-support.h (fail_with_syserr): New.
(check_data): Use it to avoid compiler warnings.
* tests/run-support.h (fail_with_syserr): New.
--

I don't think that there is a way to tell gcc that
gpgme_err_code_from_errno will never return 0.  Thus we better use a
different macro.
2024-05-21 13:45:02 +02:00
Ingo Klöcker
c933269d3a
qt: Avoid bogus stringop-overread warning
* lang/qt/src/threadedjobmixin.cpp (_detail::audit_log_as_html): Use
QByteArray overload of QString::fromUtf8.
--

There's no need to make the code more complicated than necessary. Unless
we want to provoke weird compiler warnings. :-)
2024-05-21 12:36:11 +02:00
Ingo Klöcker
333241b286
qt: Fix warning about missing return
* lang/qt/src/qgpgmeexportjob.cpp (ExportJob::exec): Return a value and
remove unused argument names.
--

ExportJob::exec is never executed because its virtual overload is always
used. Therefore it doesn't matter what value we return.
2024-05-21 12:24:31 +02:00
Werner Koch
73403a8ba0
core: speedup gpgme_get_key
* src/engine.c (_gpgme_set_engine_info): Change engine_get_version.
--

GnuPG-bug-id: 6369
2024-05-21 10:59:43 +02:00
NIIBE Yutaka
0f5e8182e7
m4: Update libassuan.m4 from master.
* m4/libassuan.m4: Update.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2024-05-17 14:22:36 +09:00
Ingo Klöcker
3e3db5784f
Require at least libgpg-error 1.47
* configure.ac (NEED_GPG_ERROR_VERSION): Require 1.47.
--

Libgpg-error 1.47 has been released more than 1 year ago and we use a
new error code defined in this version.

GnuPG-bug-id: 6971
2024-05-16 10:29:50 +02:00
NIIBE Yutaka
87061c0260
gpgme.m4: Set $host correctly always.
* src/gpgme.m4 (AM_PATH_GPGME): Add AC_CANONICAL_HOST.

--

GnuPG-bug-id: 7114
Reported-by: Andreas Metzler
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2024-05-16 09:27:58 +09:00
Ingo Klöcker
a73a41109f
tests: Fix test after changed behavior of gpgme_op_verify
* tests/gpg/t-verify.c (main): Change assertion of test.
--

The change introduced with 1dc44b7c makes gpg abort the verification
of a clear-signed message if it encounters garbage following the
signed data. We have to adapt the test to this change.

GnuPG-bug-id: 6907
2024-05-15 11:53:06 +02:00
NIIBE Yutaka
06db03ea9b
doc: Update use of Autoconf with PKG_CHECK_MODULES.
--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2024-05-14 11:42:24 +09:00
NIIBE Yutaka
882ccc8ea7
gpgme.m4: Update _AM_PATH_GPGRT_CONFIG macro from gpg-error.m4.
* src/gpgme.m4 (_AM_PATH_GPGRT_CONFIG): Update.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2024-05-14 10:30:47 +09:00
Ingo Klöcker
e4a95746ad
cpp: Handle smart card op failure status messages
* lang/cpp/src/editinteractor.cpp (parse_sc_op_failure): New.
(CallbackHelper::edit_interactor_callback_impl): Parse failure code on
GPGME_STATUS_SC_OP_FAILURE status.
(sc_op_failure_to_error): New.
--

This converts a SC_OP_FAILURE status message logged by gpg to a
corresponding error. Unfortunately, GPG_ERR_BAD_PIN and
GPG_ERR_BAD_RESET_CODE are mapped to the same SC_OP_FAILURE code, so
that we had to choose one.

GnuPG-bug-id: 6971
2024-04-05 15:08:01 +02:00
Andre Heinecke
67057d83f5
Qt: Fix windows build of new jobs
--
See git log for changes.
2024-03-13 13:15:41 +01:00
Ingo Klöcker
7158397c09
core: Check STATUS_FAILURE in import operations.
* src/import.c (op_data_t): Add failure_code.
(_gpgme_import_status_handler): Set it. Return it on EOF.
--

GnuPG-bug-id: 7036
2024-03-11 13:53:18 +01:00
Tobias Fella
47f3d92bf3
qt: Add function for synchronously executing ExportJob
* lang/qt/src/exportjob: Add exec function.
* lang/qt/src/qgpgmeexportjob.cpp: Implement exec function.
* lang/qt/src/qgpgmeexportjob.h: Override exec function.

--

GnuPG-Bug-Id: 6893
2024-01-22 11:24:49 +01:00
Ingo Klöcker
0011412193
qt: Remove superfluous virtual overrides and member variables
* lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp
(QGpgMEAddExistingSubkeyJob::exec): Remove call of resultHook.
* lang/qt/src/qgpgmedecryptjob.cpp (QGpgMEDecryptJob::exec): Remove
call of resultHook.
(QGpgMEDecryptJob::resultHook): Remove.
* lang/qt/src/qgpgmedecryptjob.h (QGpgMEDecryptJob): Remove resultHook
override. Remove member mResult.
* lang/qt/src/qgpgmedecryptverifyjob.cpp (QGpgMEDecryptVerifyJob::exec):
Remove call of resultHook.
(QGpgMEDecryptVerifyJob::resultHook): Remove.
* lang/qt/src/qgpgmedecryptverifyjob.h (QGpgMEDecryptVerifyJob): Remove
resultHook override. Remove member mResult.
* lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJob::exec): Remove
call of resultHook.
(QGpgMEEncryptJob::resultHook): Remove.
* lang/qt/src/qgpgmeencryptjob.h (QGpgMEEncryptJob): Remove resultHook
override. Remove member mResult.
* lang/qt/src/qgpgmegpgcardjob.cpp (QGpgMEGpgCardJob::exec): Remove
call of resultHook.
* lang/qt/src/qgpgmeimportfromkeyserverjob.cpp
(QGpgMEImportFromKeyserverJob::exec): Remove call of resultHook.
(QGpgMEImportFromKeyserverJob::resultHook): Remove.
* lang/qt/src/qgpgmeimportfromkeyserverjob.h
(QGpgMEImportFromKeyserverJob): Remove resultHook override. Remove
member mResult.
* lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJob::exec): Remove call
of resultHook.
(QGpgMEImportJob::resultHook): Remove.
* lang/qt/src/qgpgmeimportjob.h (QGpgMEImportJob): Remove resultHook
override. Remove member mResult.
* lang/qt/src/qgpgmekeyformailboxjob.cpp (QGpgMEKeyForMailboxJob::exec):
Remove call of resultHook.
* lang/qt/src/qgpgmekeylistjob.cpp (QGpgMEKeyListJob::QGpgMEKeyListJob):
Remove initialization of mResult.
(QGpgMEKeyListJob::resultHook): Do not set (removed) mResult.
* lang/qt/src/qgpgmekeylistjob.h (QGpgMEKeyListJob): Remove member
mResult.
* lang/qt/src/qgpgmelistallkeysjob.cpp
(QGpgMEListAllKeysJob::QGpgMEListAllKeysJob): Remove initialization of
mResult.
(QGpgMEListAllKeysJob::exec): Remove call of resultHook.
(QGpgMEListAllKeysJob::resultHook): Remove.
* lang/qt/src/qgpgmelistallkeysjob.h (QGpgMEListAllKeysJob): Remove
resultHook override. Remove member mResult.
* lang/qt/src/qgpgmereceivekeysjob.cpp (QGpgMEReceiveKeysJob::exec):
Remove call of resultHook.
(QGpgMEReceiveKeysJob::resultHook): Remove.
* lang/qt/src/qgpgmereceivekeysjob.h (QGpgMEReceiveKeysJob): Remove
resultHook override. Remove member mResult.
* lang/qt/src/qgpgmerevokekeyjob.cpp (QGpgMERevokeKeyJob::exec): Remove
call of resultHook.
* lang/qt/src/qgpgmesignencryptjob.cpp (QGpgMESignEncryptJob::exec):
Remove call of resultHook.
(QGpgMESignEncryptJob::resultHook): Remove.
* lang/qt/src/qgpgmesignencryptjob.h (QGpgMESignEncryptJob): Remove
resultHook override. Remove member mResult.
* lang/qt/src/qgpgmesignjob.cpp (QGpgMESignJob::exec): Remove call of
resultHook.
(QGpgMESignJob::resultHook): Remove.
* lang/qt/src/qgpgmesignjob.h (QGpgMESignJob): Remove resultHook
override. Remove member mResult.
* lang/qt/src/qgpgmeverifydetachedjob.cpp
(QGpgMEVerifyDetachedJob::exec): Remove call of resultHook.
(QGpgMEVerifyDetachedJob::resultHook): Remove.
* lang/qt/src/qgpgmeverifydetachedjob.h (QGpgMEVerifyDetachedJob):
Remove resultHook override. Remove member mResult.
* lang/qt/src/qgpgmeverifyopaquejob.cpp (QGpgMEVerifyOpaqueJob::exec):
Remove call of resultHook.
(QGpgMEVerifyOpaqueJob::resultHook): Remove.
* lang/qt/src/qgpgmeverifyopaquejob.h (QGpgMEVerifyOpaqueJob): Remove
resultHook override. Remove member mResult.
* lang/qt/src/qgpgmewkdlookupjob.cpp (QGpgMEWKDLookupJob::exec):
Remove call of resultHook.
--

All overrides of resultHook (except for the one of QGpgMEKeyListJob)
are superfluous. All the resultHook overrides do is store the result in
a member variable which is then returned in exec() (which just before
returning calls resultHook). The member variable the result is stored in
is only ever used by exec(). So exec() can simply return the result
directly. Some Job subclasses call resultHook without overriding it.
That's equally useless because the default implementation of resultHook
is empty. The only resultHook override that does anything useful is the
one of QGpgMEKeyListJob.
2024-01-19 16:07:14 +01:00
Ingo Klöcker
eae22d9a48
qt: Remove left-over mentions of showErrorDialog
* lang/qt/src/qgpgmedecryptjob.cpp,
lang/qt/src/qgpgmeimportfromkeyserverjob.cpp,
lang/qt/src/qgpgmeimportjob.cpp: Remove obsolete comment.
* lang/qt/src/qgpgmekeylistjob.cpp,
lang/qt/src/qgpgmelistallkeysjob.cpp: Remove long obsolete, #if 0'ed out
definitions of showErrorDialog.
--

Informing the users about errors is the responsibility of the users of
the QGpgME Job API since a long time.
2024-01-19 15:44:22 +01:00
Ingo Klöcker
cc1f2b5acb
build: Re-add still needed custom changes to Python autoconf macro
* m4/ax_python_devel.m4: Do not emit 'HAVE_PYTHON'.
--

This reapplies the changes made with 5189c08 that are still needed for
detecting multiple Python versions.
2024-01-16 09:58:33 +01:00
Ingo Klöcker
e3ae88267f
build: Update Python autoconf macro
* configure.ac: Call AX_PYTHON_DEVEL with new "optional" argument.
* m4/ax_python_devel.m4: Replace with current version from the autoconf
archive.
--

The new "optional" argument allows us to leave out one of our custom
changes.
2024-01-16 09:53:39 +01:00
Werner Koch
18388f93ab
doc: Add a deprecated warning to gpgme_op_delete. 2024-01-15 11:12:29 +01:00
Werner Koch
b37efb11be
doc: Fix minor typo.
--

Reported-by: Ming Kuang
2024-01-15 08:30:01 +01:00
Ingo Klöcker
85c7a94d63
cpp,tests: Launch dirmngr with gpg-conf
* lang/cpp/tests/run-wkdlookup.cpp (main): Replace backslashes with
forward slashes in homedir returned by GpgME::dirInfo. Use "gpgconf
--launch dirmngr" to start dirmngr.
--

With this change the same code as by QGpgMEWKDLookupJob is again used to
launch dirmngr. It also fixes the bad example of starting dirmngr
without the help of gpgconf.

GnuPG-bug-id: 6833
2024-01-09 11:22:43 +01:00
Ingo Klöcker
7e520213c0
qt: Pass home directory with forward slashes when launching dirmngr
* lang/qt/src/qgpgmewkdlookupjob.cpp (startDirmngr): Replace backslashes
with forward slashes in homedir returned by GpgME::dirInfo.
--

This works around a bug which causes backslashes to be escaped (doubled)
twice on Windows, once by gpgme_op_spawn and once by the spawn helper
gpgme-w32spawn. The next versions of GnuPG 2.2 and 2.4 also have a
workaround for this.

GnuPG-bug-id: 6833
2024-01-09 11:13:51 +01:00