* configure.ac: Remove "qt" from default_languages. Add "qt5 qt6" to
default_languages. Remove "qt" from help for --enable-languages. Don't
fail anymore if "qt5" and "qt6" are enabled. Warn that "qt" is
deprecated if it was enabled.
* lang/qt/src/Makefile.am (libqgpgme_la, libqgpgmeqt6_la): New.
(lib_LTLIBRARIES): Set Qt 5 and/or Qt 6 variant of libqgpgme.
(AM_CPPFLAGS): Replace with libqgpgme_la_CPPFLAGS for Qt 5 and
libqgpgmeqt6_la_CPPFLAGS for Qt 6.
--
This makes it possible to build QGpgME simultaneously for Qt 5 and Qt 6.
By default, QGpgME is now built for all versions of Qt that are found.
Specifying "qt" as language is deprecated.
GnuPG-bug-id: 7205
* m4/qt5.m4: Export moc for Qt 5 in variable MOC5. Unset temporary MOC2.
* m4/qt6.m4: Export moc for Qt 6 in variable MOC6.
* lang/qt/src/Makefile.am: Generate .moc5 files from .h files. Generate
.moc forwarding headers in moc5 subfolder. Add moc5 subfolder to include
paths for Qt 5-based qgpgme library. Ditto for Qt 6. Clean up moc5 and
moc6 subfolders.
* lang/qt/tests/Makefile.am: List tests and test runners for Qt 5 and
Qt 6. Generate .moc5 files from .cpp files of tests. Generate .moc
forwarding headers in moc5 subfolder. Generate .hmoc file from
t-support.h directly in moc5 subfolder. Add moc5 subfolder to include
paths for all Qt 5-based tests and runners. Ditto for Qt 6. Specify
sources, LDADD and CPPFLAGS for all tests and test runners for Qt 5 and
Qt 6. Clean up moc5 and moc6 subfolders.
--
The output of Qt 5's moc and Qt 6's moc is incompatible. Therefore, we
need to generate different .moc files for Qt 5 and Qt 6 to support
co-building of the Qt 5 and Qt 6 bindings. The duplication of the
listing of the tests couldn't be avoided because automake doesn't
understand `the_tests5 = $(the_tests:%=%5)` and couldn't match the
tests with their _SOURCES. Maybe some m4 programming would have helped,
but that would have made the Makefiles even more unreadable.
GnuPG-bug-id: 7205
* lang/qt/src/Makefile.am (uninstall-include-dirs-qt5,
uninstall-include-dirs-qt6): New targets.
(uninstall_include_dirs_qt5, uninstall_include_dirs_qt6): New variables.
(uninstall-local): Replace with...
(uninstall-hook): ...this. Add new uninstall_include_dirs_qt* variables.
--
We have to use uninstall-hook because uninstall-local runs before the
header files have been removed from the include folders we want to
remove.
GnuPG-bug-id: 7205
* lang/qt/src/Makefile.am (install-cmake-files): Rename target to
install-cmake-files-qt5 and install-cmake-files-qt6.
(uninstall-cmake-files): Rename target to uninstall-cmake-files-qt5 and
uninstall-cmake-files-qt6.
(install_cmake_files_qt5, uninstall_cmake_files_qt5,
install_cmake_files_qt6, uninstall_cmake_files_qt6): New variables.
(install-data-local): Depend on both install-cmake-files-qt* targets.
(uninstall-local): Depend on both uninstall-cmake-files-qt* targets.
--
This prepares the targets for the case that WANT_QT5 and WANT_QT6 are
both true.
GnuPG-bug-id: 7205
* src/gpgme-tool.c (gt_get_keylist_mode): Increase NR_KEYLIST_MODES to
number of keylist modes. Add support for GPGME_KEYLIST_MODE_WITH_TOFU,
GPGME_KEYLIST_MODE_WITH_KEYGRIP, GPGME_KEYLIST_MODE_WITH_V5FPR. Write
all modes.
(hlp_keylist_mode): List all supported keylist modes.
(cmd_keylist_mode): Add support for GPGME_KEYLIST_MODE_WITH_TOFU,
GPGME_KEYLIST_MODE_WITH_KEYGRIP, GPGME_KEYLIST_MODE_WITH_V5FPR.
--
This fixes the possible overrun reported by Michal Hlavinka and adds
support for all keylist modes.
* lang/cpp/src/Makefile.am (build rule for copied headers): Write
abs_srcdir instead of srcdir in the generated headers.
--
The generated include paths lacked a "../" if srcdir was relative. This
lead to self-including includes for in-source builds. Including the real
headers with their absolute paths fixes this.
GnuPG-bug-id: 7110
* lang/cpp/src/error.h, lang/cpp/src/context.cpp (class Error): New
member function asStdString.
--
Unlike asString the new function doesn't cache the value returned by
gpgme_strerror_r. This ensures that on Windows the UTF-8 encoded text
is returned for the main thread even if the function was called before
for another thread. For other threads asStdString will still return the
natively encoded error description until UTF-8 encoded error
descriptions can be enabled for all threads (T7185).
GnuPG-bug-id: 7188
* 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. This also helps to avoid including a C++ header with the same
name as a header in the Qt bindings (e.g. util.h).
GnuPG-bug-id: 7110
* src/Makefile.am (system_components): We don't use ath.h any more.
(main_sources): Remove ath.h and ath.c.
--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* src/debug.c [HAVE_W32_SYSTEM or __linux] (tid_log_callback): Use
native thread ID call for Windows and Linux, ifdef-out-ed.
(debug_init): Only call gpgrt_log_set_pid_suffix_cb for relevant
systems.
--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* src/b64dec.c: Remove.
* src/Makefile.am (main_sources): Remove b64dec.c.
* src/data-identify.c (pgp_binary_detection): Use gpgrt_b64dec in
libgpg-error.
--
gpgrt_b64dec is available in libgpg-error 1.27 and it is already in
use by JSON support.
GnuPG-bug-id: 7180
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* lang/qt/src/qgpgmesignjob.cpp (sign_to_filename): Add argument
"appendSignature". Append new detached signature to an existing file if
requested.
* lang/qt/src/signjob.cpp, lang/qt/src/signjob.h (class SignJob): Add
member functions setAppendSignature, appendSignatureEnabled.
* lang/qt/src/signjob_p.h (struct SignJobPrivate): Add member
m_appendSignature.
* lang/qt/tests/run-signjob.cpp (struct CommandLineOptions): Add members
signingFlags, appendSignature. Initialize armor.
(parseCommandLine): Add command line options --detach-sign and --append.
(main): Do not exit if output file exists and append is enabled.
Pass new options to the job.
--
This change simplifies cross-signing a document by appending additional
detached signatures to a file with already existing detached signatures.
GnuPG-bug-id: 6867
* lang/qt/src/Makefile.am (includeprefix): New.
(qgpgmeincludedir, camelcaseincludedir): Add $(includeprefix).
(QGpgmeConfig.cmake, QGpgmeQt6Config.cmake): Add $(includeprefix) to
replacement for @resolved_includedir@.
--
This installs the headers for Qt 5 in $(includedir)/qgpgme-qt5 and the
headers for Qt 6 in $(includedir)/qgpgme-qt6. For users of the CMake
files the change will be transparent, i.e. they don't have to do
anything. Packagers will have to change their scripts but in the end
this change will make their lifes easier.
GnuPG-bug-id: 7161
* lang/qt/tests/t-tofuinfo.cpp (TofuInfoTest::signAndVerify,
TofuInfoTest::testTofuPolicy): Use range-based for loop instead of Qt's
deprecated foreach.
--
* lang/qt/src/importjob.cpp, lang/qt/src/importjob.h (setImportOptions):
Change type of argument "options" to QStringList.
(importOptions): Change return type to QStringList.
* lang/qt/src/importjob_p.h (struct ImportJobPrivate): Change type of
member m_importOptions to QStringList.
* lang/qt/src/qgpgmeimportjob.cpp (import_qba): Change type of argument
"importOptions" to QStringList. Join list of import options with ','
when setting the "import-options" context flag.
* lang/qt/tests/t-import.cpp (ImportTest::testImportWithImportOptions):
Adapt to API change.
--
This makes the API that was introduced with the previous commit easier
to use.
GnuPG-bug-id: 7152
* src/context.h (struct gpgme_context): New field import_options.
* src/engine-backend.h (struct engine_ops): Add arg import_options to
field 'import'.
* src/engine-gpg.c (gpg_import): Add arg import_options and pass option
--import-options with argument value to gpg.
* src/engine-gpgsm.c (gpgsm_import): Add dummy arg import_options.
* src/engine.c (_gpgme_engine_op_import): Add arg import_options and
pass option to import function of engine.
* src/engine.h (_gpgme_engine_op_import): Add arg import_options.
* src/gpgme.c (gpgme_release): Free 'import_options'.
(gpgme_set_ctx_flag, gpgme_get_ctx_flag): New flag "import-options".
* src/import.c (_gpgme_op_import_start, _gpgme_op_import_keys_start,
_gpgme_op_receive_keys_start): Pass import options stored in context to
_gpgme_engine_op_import.
* tests/run-import.c (show_usage, main): Add option --import-options.
--
This makes the --import-options option available in the GPGME API for
key imports.
GnuPG-bug-id: 7152
* 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.
* 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.
* 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.
* 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.
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
* 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.
* 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.
* 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
* 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
* 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.
* 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