diff options
author | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-12-28 22:15:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-01-08 15:52:25 +0100 |
commit | e0721a655ca69d699024fd91da7071da0485b218 (patch) | |
tree | e4743271e938e62368cb4beff2c40c544e05386d | |
parent | fdfd132dc2f596472f0dfd99f7acd2a3d6509527 (diff) |
Update gpgme to 1.16.0
* remove GPGME_CAN_EXPORT_MINIMAL_KEY, upstream now has support for
key export flags in c++ wrapper (gpgmepp >= 1.14)
* therefore, external/gpgmepp/add-minimal-keyexport.patch now fully
obsolete, tweaked xmlsecurity code to use upstream function
* bits of external/gpgmepp/find-libgpg-error-libassuan.patch are
upstream now (configure and makefile pieces, though we keep
configure.ac changes for the while - to not pick up system versions
too easily)
* external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1
was from upstream anyway, removed
Change-Id: I991c20c0eeff0f9135e97c991afcb905be55a959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127665
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit 78dae8b20b85686d1a642415195d2e10fbb2dc1f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128085
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | config_host/config_gpgme.h.in | 3 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | download.lst | 4 | ||||
-rw-r--r-- | external/gpgmepp/ExternalPackage_gpgmepp.mk | 4 | ||||
-rw-r--r-- | external/gpgmepp/UnpackedTarball_gpgmepp.mk | 2 | ||||
-rw-r--r-- | external/gpgmepp/add-minimal-keyexport.patch | 68 | ||||
-rw-r--r-- | external/gpgmepp/find-libgpg-error-libassuan.patch | 29 | ||||
-rw-r--r-- | external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 | 30 | ||||
-rw-r--r-- | external/gpgmepp/w32-build-fixes.patch.1 | 9 | ||||
-rw-r--r-- | external/gpgmepp/w32-fix-win32-macro.patch.1 | 3 | ||||
-rw-r--r-- | xmlsecurity/source/gpg/CertificateImpl.cxx | 7 |
11 files changed, 17 insertions, 145 deletions
diff --git a/config_host/config_gpgme.h.in b/config_host/config_gpgme.h.in index 3c483d08f564..ead3ca7bc2b9 100644 --- a/config_host/config_gpgme.h.in +++ b/config_host/config_gpgme.h.in @@ -26,9 +26,6 @@ # include "config_lgpl.h" #endif -// Defined if gpgme supports exporting minimal key. -#define GPGME_CAN_EXPORT_MINIMAL_KEY 0 - #undef GPGME_GPGCONF #endif diff --git a/configure.ac b/configure.ac index aca958768d0a..ce82177fa691 100644 --- a/configure.ac +++ b/configure.ac @@ -12443,7 +12443,7 @@ elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ], - [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], []) + [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp >= 1.14 development package])], []) # progress_callback is the only func with plain C linkage # checking for it also filters out older, KDE-dependent libgpgmepp versions AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ], @@ -12453,7 +12453,6 @@ elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then else AC_MSG_RESULT([internal]) BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP" - AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY]) GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src" LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src" diff --git a/download.lst b/download.lst index d7e47f661dda..e7aed759c8ee 100644 --- a/download.lst +++ b/download.lst @@ -100,8 +100,8 @@ export FREETYPE_SHA256SUM := 8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce export FREETYPE_TARBALL := freetype-2.11.0.tar.xz export GLM_SHA256SUM := 6bba5f032bed47c73ad9397f2313b9acbfb56253d0d0576b5873d3dcb25e99ad export GLM_TARBALL := glm-0.9.9.8.zip -export GPGME_SHA256SUM := c4e30b227682374c23cddc7fdb9324a99694d907e79242a25a4deeedb393be46 -export GPGME_TARBALL := gpgme-1.13.1.tar.bz2 +export GPGME_SHA256SUM := 6c8cc4aedb10d5d4c905894ba1d850544619ee765606ac43df7405865de29ed0 +export GPGME_TARBALL := gpgme-1.16.0.tar.bz2 export GRAPHITE_SHA256SUM := b8e892d8627c41888ff121e921455b9e2d26836978f2359173d19825da62b8fc export GRAPHITE_TARBALL := graphite2-minimal-1.3.14.tgz export HARFBUZZ_SHA256SUM := d58461395ce28b9dc03903254374dd70c38c8c28c5046db123c08f7ab9417be7 diff --git a/external/gpgmepp/ExternalPackage_gpgmepp.mk b/external/gpgmepp/ExternalPackage_gpgmepp.mk index 6bab3e5e293f..a2b207597cdd 100644 --- a/external/gpgmepp/ExternalPackage_gpgmepp.mk +++ b/external/gpgmepp/ExternalPackage_gpgmepp.mk @@ -15,8 +15,8 @@ ifneq ($(DISABLE_DYNLOADING),TRUE) ifeq ($(OS),LINUX) -$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.10.0)) -$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.22.1)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgmepp.so.6,lang/cpp/src/.libs/libgpgmepp.so.6.13.0)) +$(eval $(call gb_ExternalPackage_add_file,gpgmepp,$(LIBO_LIB_FOLDER)/libgpgme.so.11,src/.libs/libgpgme.so.11.25.0)) else ifeq ($(OS),MACOSX) diff --git a/external/gpgmepp/UnpackedTarball_gpgmepp.mk b/external/gpgmepp/UnpackedTarball_gpgmepp.mk index b314357734ab..05bfc9f07bf1 100644 --- a/external/gpgmepp/UnpackedTarball_gpgmepp.mk +++ b/external/gpgmepp/UnpackedTarball_gpgmepp.mk @@ -19,13 +19,11 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,gpgmepp,0)) $(eval $(call gb_UnpackedTarball_add_patches,gpgmepp, \ external/gpgmepp/find-libgpg-error-libassuan.patch \ external/gpgmepp/fix-autoconf-macros.patch \ - external/gpgmepp/add-minimal-keyexport.patch \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-build-fixes.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-disable-docs.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-win32-macro.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-fix-libtool.patch.1) \ $(if $(filter MSC,$(COM)),external/gpgmepp/w32-add-initializer.patch.1) \ - external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 \ external/gpgmepp/w32-build-fixes-2.patch \ $(if $(filter LINUX,$(OS)),external/gpgmepp/asan.patch) \ $(if $(filter LINUX,$(OS)),external/gpgmepp/rpath.patch) \ diff --git a/external/gpgmepp/add-minimal-keyexport.patch b/external/gpgmepp/add-minimal-keyexport.patch deleted file mode 100644 index d163ef814917..000000000000 --- a/external/gpgmepp/add-minimal-keyexport.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- lang/cpp/src/context.h.bak 2017-10-18 12:28:00.898945587 +0200 -+++ lang/cpp/src/context.h 2017-10-18 12:28:35.794832395 +0200 -@@ -178,10 +178,10 @@ - // Key Export - // - -- GpgME::Error exportPublicKeys(const char *pattern, Data &keyData); -- GpgME::Error exportPublicKeys(const char *pattern[], Data &keyData); -- GpgME::Error startPublicKeyExport(const char *pattern, Data &keyData); -- GpgME::Error startPublicKeyExport(const char *pattern[], Data &keyData); -+ GpgME::Error exportPublicKeys(const char *pattern, Data &keyData, bool minimal=false); -+ GpgME::Error exportPublicKeys(const char *pattern[], Data &keyData, bool minimal=false); -+ GpgME::Error startPublicKeyExport(const char *pattern, Data &keyData, bool minimal=false); -+ GpgME::Error startPublicKeyExport(const char *pattern[], Data &keyData, bool minimal=false); - - // - // Key Import ---- lang/cpp/src/context.cpp.bak 2017-10-18 12:27:50.830978224 +0200 -+++ lang/cpp/src/context.cpp 2017-10-18 12:30:13.278515603 +0200 -@@ -557,14 +557,14 @@ - } - } - --Error Context::exportPublicKeys(const char *pattern, Data &keyData) -+Error Context::exportPublicKeys(const char *pattern, Data &keyData, bool minimal) - { - d->lastop = Private::Export; - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export(d->ctx, pattern, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export(d->ctx, pattern, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - --Error Context::exportPublicKeys(const char *patterns[], Data &keyData) -+Error Context::exportPublicKeys(const char *patterns[], Data &keyData, bool minimal) - { - d->lastop = Private::Export; - #ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN -@@ -574,17 +574,17 @@ - } - #endif - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - --Error Context::startPublicKeyExport(const char *pattern, Data &keyData) -+Error Context::startPublicKeyExport(const char *pattern, Data &keyData, bool minimal) - { - d->lastop = Private::Export; - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export_start(d->ctx, pattern, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export_start(d->ctx, pattern, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - --Error Context::startPublicKeyExport(const char *patterns[], Data &keyData) -+Error Context::startPublicKeyExport(const char *patterns[], Data &keyData, bool minimal) - { - d->lastop = Private::Export; - #ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN -@@ -594,7 +594,7 @@ - } - #endif - Data::Private *const dp = keyData.impl(); -- return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, 0, dp ? dp->data : nullptr)); -+ return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, minimal ? GPGME_EXPORT_MODE_MINIMAL : 0, dp ? dp->data : nullptr)); - } - - ImportResult Context::importKeys(const Data &data) diff --git a/external/gpgmepp/find-libgpg-error-libassuan.patch b/external/gpgmepp/find-libgpg-error-libassuan.patch index 699136cfb066..a65e453fc8b6 100644 --- a/external/gpgmepp/find-libgpg-error-libassuan.patch +++ b/external/gpgmepp/find-libgpg-error-libassuan.patch @@ -40,35 +40,6 @@ index f28480b..92a3e85 100644 if test "$have_libassuan" = "yes"; then AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version", [version of the libassuan library]) -diff --git a/src/Makefile.am b/src/Makefile.am -index ce6f1d4..6b1d835 100644 ---- src/Makefile.am -+++ src/Makefile.am -@@ -26,7 +26,7 @@ - m4data_DATA = gpgme.m4 - nodist_include_HEADERS = gpgme.h - --bin_PROGRAMS = gpgme-tool gpgme-json -+bin_PROGRAMS = gpgme-tool - - if BUILD_W32_GLIB - ltlib_gpgme_glib = libgpgme-glib.la -@@ -97,13 +97,10 @@ - - # We use a global CFLAGS setting for all libraries - # versions, because then every object file is only compiled once. --AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GLIB_CFLAGS@ -+AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@ @GLIB_CFLAGS@ - - gpgme_tool_SOURCES = gpgme-tool.c argparse.c argparse.h --gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@ -- --gpgme_json_SOURCES = gpgme-json.c cJSON.c cJSON.h --gpgme_json_LDADD = -lm libgpgme.la $(GPG_ERROR_LIBS) -+gpgme_tool_LDADD = libgpgme.la @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ - - - if HAVE_W32_SYSTEM --- lang/cpp/tests/Makefile.am 2020-06-20 00:43:49.213657887 +0200 +++ lang/cpp/tests/Makefile.am~ 2019-01-25 13:27:34.000000000 +0100 @@ -21,7 +21,7 @@ diff --git a/external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 b/external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 deleted file mode 100644 index 1b5e22a7eccd..000000000000 --- a/external/gpgmepp/gpgme.git-fe2892618c20cd40c342cce26ffb6ac4644fd3c3.patch.1 +++ /dev/null @@ -1,30 +0,0 @@ -From fe2892618c20cd40c342cce26ffb6ac4644fd3c3 Mon Sep 17 00:00:00 2001 -From: Andre Heinecke <aheinecke@gnupg.org> -Date: Mon, 28 Oct 2019 16:00:29 +0100 -Subject: [PATCH 1/1] core,w32: Initialize dbg_help for socket debugging - -* src/w32-io.c (_gpgme_io_select): Initialize dbg_help. - --- -This fixes a crash on Windows because dbg_help might -be used unitialized. ---- - src/w32-io.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/w32-io.c b/src/w32-io.c -index c5c21f59..80978f9a 100644 ---- a/src/w32-io.c -+++ b/src/w32-io.c -@@ -1643,7 +1643,7 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock) - int i; - int any; - int count; -- void *dbg_help; -+ void *dbg_help = NULL; - TRACE_BEG (DEBUG_SYSIO, "_gpgme_io_select", fds, - "nfds=%u, nonblock=%u", nfds, nonblock); - --- -2.11.0 - diff --git a/external/gpgmepp/w32-build-fixes.patch.1 b/external/gpgmepp/w32-build-fixes.patch.1 index 9bc8f52b4c64..01ea99d91e43 100644 --- a/external/gpgmepp/w32-build-fixes.patch.1 +++ b/external/gpgmepp/w32-build-fixes.patch.1 @@ -83,12 +83,12 @@ diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am m4data_DATA = gpgme.m4 nodist_include_HEADERS = gpgme.h --bin_PROGRAMS = gpgme-tool +-bin_PROGRAMS = gpgme-tool gpgme-json +bin_PROGRAMS = if BUILD_W32_GLIB ltlib_gpgme_glib = libgpgme-glib.la -@@ -99,8 +99,8 @@ +@@ -99,11 +99,11 @@ # versions, because then every object file is only compiled once. AM_CFLAGS = @LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@ @GLIB_CFLAGS@ @@ -97,6 +97,11 @@ diff -ru gpgme.orig/src/Makefile.am gpgme/src/Makefile.am +gpgme_tool_SOURCES = +gpgme_tool_LDADD = +-gpgme_json_SOURCES = gpgme-json.c cJSON.c cJSON.h +-gpgme_json_LDADD = -lm libgpgme.la $(GPG_ERROR_LIBS) ++gpgme_json_SOURCES = ++gpgme_json_LDADD = + if HAVE_W32_SYSTEM @@ -120,7 +120,7 @@ diff --git a/external/gpgmepp/w32-fix-win32-macro.patch.1 b/external/gpgmepp/w32-fix-win32-macro.patch.1 index 70a8b5ffe6e8..66e9ac48099a 100644 --- a/external/gpgmepp/w32-fix-win32-macro.patch.1 +++ b/external/gpgmepp/w32-fix-win32-macro.patch.1 @@ -103,13 +103,14 @@ diff -ur gpgmepp.org/lang/cpp/src/interfaces/dataprovider.h gpgmepp/lang/cpp/src diff -ur gpgmepp.org/lang/cpp/src/key.cpp gpgmepp/lang/cpp/src/key.cpp --- gpgmepp.org/lang/cpp/src/key.cpp 2017-03-20 20:10:15.000000000 +0100 +++ gpgmepp/lang/cpp/src/key.cpp 2017-11-20 17:44:50.321858800 +0100 -@@ -33,10 +33,16 @@ +@@ -33,11 +33,17 @@ #include <gpgme.h> #include <string.h> +#if HAVE_STRINGS_H #include <strings.h> +#endif + #include <cassert> #include <istream> #include <iterator> diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx index 523c2d6d959c..a0a08fc807a8 100644 --- a/xmlsecurity/source/gpg/CertificateImpl.cxx +++ b/xmlsecurity/source/gpg/CertificateImpl.cxx @@ -215,10 +215,9 @@ void CertificateImpl::setCertificate(GpgME::Context* ctx, const GpgME::Key& key) ctx->setArmor(false); // caller will base64-encode anyway GpgME::Error err = ctx->exportPublicKeys( key.primaryFingerprint(), - data_out -#if GPGME_CAN_EXPORT_MINIMAL_KEY - , officecfg::Office::Common::Security::OpenPGP::MinimalKeyExport::get() -#endif + data_out, + officecfg::Office::Common::Security::OpenPGP::MinimalKeyExport::get() + ? GpgME::Context::ExportMinimal : 0 ); if (err) |