diff --git a/Makefile.am b/Makefile.am index 6cd909ee..a4523812 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,133 +1,134 @@ # Makefile.am - Installer for GnuPG 4 Windows Makefile. # Copyright (C) 2005, 2008, 2012 g10 Code GmbH # # This file is part of GPG4Win. # # GPG4Win is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GPG4Win is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-xz no-dist-gzip DISTCHECK_CONFIGURE_FLAGS = --host=i686-w64-mingw32 if BUILD_GPG4WIN po = po else po = endif if BUILD_GPG4WIN doc = doc else doc = endif SUBDIRS = ${po} packages ${doc} src # find patches -type f | sort | sed 's/$/ \\/' | sed 's/^/ /' # find patches-appimage -type f | sort | sed 's/$/ \\/' | sed 's/^/ /' EXTRA_DIST = autogen.sh README.GIT ONEWS \ doc/license-page doc/GPLv3 \ build-aux/git-log-footer build-aux/git-log-fix \ docker/appimage/Dockerfile \ docker/build-appimage-docker-image.sh \ docker/build-gpg4win-docker-image.sh \ docker/gpg4win-bullseye/Dockerfile \ docker/run-appimage-build.sh \ docker/run-gpg4win-build.sh \ patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \ patches/kconfig/0001-Read-defaults-from-Windows-registry.patch \ patches/kconfigwidgets/0001-Fix-crash-on-exit-on-Windows.patch \ patches/kconfigwidgets/0001-Make-QDbus-optional.patch \ patches/kcoreaddons/0001-Add-KSharedDataCache-for-Windows.patch \ patches/kiconthemes/0001-Make-DBus-optional.patch \ patches/kleopatra/set-windows-registry.patch \ patches/kleopatra/0001-Revert-new-dependency-to-KCMUtils.patch \ patches/kxmlgui/0001-make-qdbus-optional.patch \ patches/kxmlgui/0004-Cruedly-disable-KSendbugmail.patch \ patches/libkleo/set-cxx-standard.patch \ patches/qtbase/0001-Fix-build-without-std-thread.patch \ patches/qtbase/0001-Gpg4win-qstandardpaths-patch.patch \ patches/qtbase/0002-Gpg4win-theme-names-and-relpaths.patch \ patches/qtsvg/CVE-2023-32573-qtsvg-5.15.patch \ + patches/qtbase/CVE-2023-32763-qtbase-5.15.diff \ patches/qttools/disable-most-tools.patch \ patches/kcoreaddons/0001-Fix-MINGW-build.patch \ patches/ki18n/0001-Undef-snprintf-for-windows.patch \ patches/kio/0001-WIP-Remove-dependency-to-dbus.patch \ patches/kservice/0001-Remove-unused-include.patch \ patches/okular/0001-WIP-Buildfix-with-reduced-depdencies.patch \ patches/poppler/0001-Explicitly-take-posix-variant-for-mingw-gcc-cross.patch \ - patches/poppler/0001-Use-central-function-to-find-Font-for-signing.patch \ patches/kparts/0001-Dirty-hack-to-remove-KTextWidgets.patch \ patches/jpeg/fix-redefine.patch \ patches-appimage/kconfigwidgets/0001-build-without-KF5Auth.patch \ patches-appimage/kconfigwidgets/fake-version.patch \ patches-appimage/qtwayland-5.15.0/00-disable-wayland-server.patch \ patches-appimage/libkleo/set-cxx-standard.patch \ patches-appimage/kmime/set-cxx-standard.patch \ patches-appimage/qtsvg/CVE-2023-32573-qtsvg-5.15.patch \ + patches-appimage/qtbase/CVE-2023-32763-qtbase-5.15.diff \ patches-appimage/gnupg-2.3.7/0001-dirmngr-Fix-NTBTLS-include-for-test.patch \ patches-appimage/kleopatra/0001-po-Update-German-translation-for-3.1.26.patch \ patches-appimage/libkleo/0001-po-Update-German-translation-for-kleopatra-3.1.26.patch \ patches-appimage/libkleo/gpg4win-check.patch copy-news: cp NEWS doc/website/NEWS.last copy-release: gpg4win-$(VERSION).tar.bz2 installers/gpg4win-$(VERSION).exe \ installers/gpg4win-light-$(VERSION).exe \ installers/gpg4win-vanilla-$(VERSION).exe @echo Copying $(VERSION) to $(RELEASEHOST) >&2 @set -e;\ if ssh "$$(echo $(RELEASEHOST)|cut -d: -f -1)" \ test -f "$$(echo $(RELEASEHOST)/gpg4win-$(VERSION).exe|cut -d: -f2-)";\ then echo "This release has already been copied to the server" >&2 ;\ else scp gpg4win-$(VERSION).tar.bz2 \ installers/gpg4win-$(VERSION).exe \ installers/gpg4win-light-$(VERSION).exe \ installers/gpg4win-vanilla-$(VERSION).exe \ installers/gpg4win-src-$(VERSION).exe $(RELEASEHOST)/ ;\ for f in en de ; do \ scp src/README.$$f.txt \ $(RELEASEHOST)/README-$(VERSION).$$f.txt; \ done;\ fi dist-hook: gen-ChangeLog gen_start_date = 2012-03-26T00:00:00 .PHONY: gen-ChangeLog gen-ChangeLog: set -e; \ if test -d $(top_srcdir)/.git; then \ (cd $(top_srcdir) && \ $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \ --amend=build-aux/git-log-fix \ --since=$(gen_start_date) ) > $(distdir)/cl-t; \ cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\ rm -f $(distdir)/ChangeLog; \ mv $(distdir)/cl-t $(distdir)/ChangeLog; \ fi download: packages/packages.common packages/packages.4 packages/packages.3 (cd packages; ./download.sh) msi: $(MAKE) $(AM_MAKEFLAGS) -C src msi msi-signed: $(MAKE) $(AM_MAKEFLAGS) -C src msi-signed msi-upload: $(MAKE) $(AM_MAKEFLAGS) -C src msi-upload diff --git a/patches/poppler/0001-Use-central-function-to-find-Font-for-signing.patch b/patches/poppler/0001-Use-central-function-to-find-Font-for-signing.patch deleted file mode 100755 index d05135ba..00000000 --- a/patches/poppler/0001-Use-central-function-to-find-Font-for-signing.patch +++ /dev/null @@ -1,124 +0,0 @@ -#! /bin/sh -patch -p1 -l -f $* < $0 -exit $? - -From 0906a739394a19eeb038a5ce859ab387f1cafbe1 Mon Sep 17 00:00:00 2001 -From: Andre Heinecke -Date: Fri, 5 May 2023 15:09:00 +0200 -Subject: [PATCH] Use central function to find Font for signing - -To find / add a font for the signature annotation should -be done in a central place. Form seems reasonable as it needs -to be available before the Form is specialized into a signature -form. - -This fixes a crash on Windows where Helvetica is not available. -The list of reasonable fonts should probably be extended. ---- - poppler/Form.cc | 24 ++++++++++++++++++++++-- - poppler/Form.h | 4 ++++ - poppler/PDFDoc.cc | 24 +----------------------- - 3 files changed, 27 insertions(+), 25 deletions(-) - -diff --git a/poppler/Form.cc b/poppler/Form.cc -index a56ae048..1a36af50 100644 ---- a/poppler/Form.cc -+++ b/poppler/Form.cc -@@ -702,9 +702,9 @@ bool FormWidgetSignature::signDocumentWithAppearance(const std::string &saveFile - std::string originalDefaultAppearance = aux ? aux->toStr() : std::string(); - - Form *form = doc->getCatalog()->getCreateForm(); -- std::string pdfFontName = form->findFontInDefaultResources("Helvetica", ""); -+ const std::string pdfFontName = form->findPdfFontNameToUseForSigning(); - if (pdfFontName.empty()) { -- pdfFontName = form->addFontToDefaultResources("Helvetica", "").fontName; -+ return false; - } - - const DefaultAppearance da { { objName, pdfFontName.c_str() }, fontSize, std::move(fontColor) }; -@@ -3099,6 +3099,26 @@ void Form::reset(const std::vector &fields, bool excludeFields) - } - } - -+std::string Form::findPdfFontNameToUseForSigning() -+{ -+ static constexpr std::array fontsToUseToSign = { "Helvetica", "Arial" }; -+ for (const char *fontToUseToSign : fontsToUseToSign) { -+ std::string pdfFontName = findFontInDefaultResources(fontToUseToSign, ""); -+ if (!pdfFontName.empty()) { -+ return pdfFontName; -+ } -+ -+ pdfFontName = addFontToDefaultResources(fontToUseToSign, "").fontName; -+ if (!pdfFontName.empty()) { -+ return pdfFontName; -+ } -+ } -+ -+ error(errInternal, -1, "Form::findPdfFontNameToUseForSigning: No suitable font found'\n"); -+ -+ return {}; -+} -+ - //------------------------------------------------------------------------ - // FormPageWidgets - //------------------------------------------------------------------------ -diff --git a/poppler/Form.h b/poppler/Form.h -index 5ebdec0e..12d4c2ed 100644 ---- a/poppler/Form.h -+++ b/poppler/Form.h -@@ -685,6 +685,10 @@ public: - // has the given fontFamily and fontStyle. This makes us relatively sure that we added that font ourselves - std::string findFontInDefaultResources(const std::string &fontFamily, const std::string &fontStyle) const; - -+ // Finds in the default resources a font that is suitable to create a signature annotation. -+ // If none is found then it is added to the default resources. -+ std::string findPdfFontNameToUseForSigning(); -+ - struct AddFontResult - { - std::string fontName; -diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc -index f1b9bfcb..665c1c66 100644 ---- a/poppler/PDFDoc.cc -+++ b/poppler/PDFDoc.cc -@@ -2154,24 +2154,6 @@ bool PDFDoc::hasJavascript() - return jsInfo.containsJS(); - } - --static std::string findPdfFontNameToUseForSigning(Form *form) --{ -- static constexpr std::array fontsToUseToSign = { "Helvetica", "Arial" }; -- for (const char *fontToUseToSign : fontsToUseToSign) { -- std::string pdfFontName = form->findFontInDefaultResources(fontToUseToSign, ""); -- if (!pdfFontName.empty()) { -- return pdfFontName; -- } -- -- pdfFontName = form->addFontToDefaultResources(fontToUseToSign, "").fontName; -- if (!pdfFontName.empty()) { -- return pdfFontName; -- } -- } -- -- return {}; --} -- - bool PDFDoc::sign(const std::string &saveFilename, const std::string &certNickname, const std::string &password, GooString *partialFieldName, int page, const PDFRectangle &rect, const GooString &signatureText, - const GooString &signatureTextLeft, double fontSize, double leftFontSize, std::unique_ptr &&fontColor, double borderWidth, std::unique_ptr &&borderColor, - std::unique_ptr &&backgroundColor, const GooString *reason, const GooString *location, const std::string &imagePath, const std::optional &ownerPassword, const std::optional &userPassword) -@@ -2189,11 +2171,7 @@ bool PDFDoc::sign(const std::string &saveFilename, const std::string &certNickna - } - - Form *form = catalog->getCreateForm(); -- const std::string pdfFontName = findPdfFontNameToUseForSigning(form); -- if (pdfFontName.empty()) { -- return false; -- } -- -+ const std::string pdfFontName = form->findPdfFontNameToUseForSigning(); - const DefaultAppearance da { { objName, pdfFontName.c_str() }, fontSize, std::move(fontColor) }; - - Object annotObj = Object(new Dict(getXRef())); --- -2.40.1