[Libreoffice-commits] core.git: xmlsecurity/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 10 08:06:03 UTC 2021
xmlsecurity/source/helper/pdfsignaturehelper.cxx | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
New commits:
commit 2d30c903afddbb416c50587dec1c787c1edfa39f
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Mar 9 21:12:10 2021 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Mar 10 09:05:19 2021 +0100
xmlsecurity: rework to avoid pdfium ifdefs in pdfsignaturehelper
Return early in case pdfium is not available, to avoid the ifdef forest.
Change-Id: I1fd1b22015e10527a989c8a1c4f4073fef29553e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112238
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/xmlsecurity/source/helper/pdfsignaturehelper.cxx b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
index d336b696cb18..1ce8bf08cf41 100644
--- a/xmlsecurity/source/helper/pdfsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/pdfsignaturehelper.cxx
@@ -33,11 +33,7 @@
#include <vcl/checksum.hxx>
#include <rtl/ustrbuf.hxx>
#include <svl/cryptosign.hxx>
-#include <config_features.h>
#include <vcl/filter/PDFiumLibrary.hxx>
-#if HAVE_FEATURE_PDFIUM
-#include <fpdf_signature.h>
-#endif
using namespace ::com::sun::star;
@@ -119,7 +115,6 @@ void GetSignatureLineShape(const uno::Reference<frame::XModel>& xModel, sal_Int3
aStream.ReadBytes(rSignatureLineShape.data(), rSignatureLineShape.size());
}
-#if HAVE_FEATURE_PDFIUM
/// Represents a parsed signature.
struct Signature
{
@@ -405,7 +400,6 @@ bool ValidateSignature(SvStream& rStream, const Signature& rSignature,
return svl::crypto::Signing::Verify(rStream, rSignature.m_aByteRanges, bNonDetached, aContents,
rInformation);
}
-#endif
}
PDFSignatureHelper::PDFSignatureHelper() = default;
@@ -425,8 +419,12 @@ bool PDFSignatureHelper::ReadAndVerifySignature(
bool PDFSignatureHelper::ReadAndVerifySignatureSvStream(SvStream& rStream)
{
-#if HAVE_FEATURE_PDFIUM
auto pPdfium = vcl::pdf::PDFiumLibrary::get();
+ if (!pPdfium)
+ {
+ return true;
+ }
+
SvMemoryStream aStream;
sal_uInt64 nPos = rStream.Tell();
rStream.Seek(0);
@@ -482,9 +480,6 @@ bool PDFSignatureHelper::ReadAndVerifySignatureSvStream(SvStream& rStream)
m_aSignatureInfos.push_back(aInfo);
}
-#else
- (void)rStream;
-#endif
return true;
}
More information about the Libreoffice-commits
mailing list