[Libreoffice-commits] core.git: config_host/config_features.h.in configure.ac solenv/bin vcl/source
Caolán McNamara
caolanm at redhat.com
Sat Dec 17 20:30:04 UTC 2016
config_host/config_features.h.in | 5 +++++
configure.ac | 3 ++-
solenv/bin/native-code.py | 4 ++--
vcl/source/gdi/pdfwriter_impl.cxx | 25 +++++++++++++------------
4 files changed, 22 insertions(+), 15 deletions(-)
New commits:
commit 7ccf36d81f53abacd92f014c7f6e1c2b1e618873
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 16 15:10:51 2016 +0000
split out inability to have nss as HAVE_FEATURE_NSS
Change-Id: Ie9fa0291117ba81529cc396f96f3f02c4a7e4d79
Reviewed-on: https://gerrit.libreoffice.org/32093
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index bae2ecd..5dd85df 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -179,4 +179,9 @@
*/
#define HAVE_FEATURE_PDFIMPORT 0
+/*
+ * Whether NSS is available
+ */
+#define HAVE_FEATURE_NSS 0
+
#endif
diff --git a/configure.ac b/configure.ac
index 66edc32..2ef68d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9018,8 +9018,9 @@ AC_SUBST(TLS)
dnl ===================================================================
dnl Check for system NSS
dnl ===================================================================
-if test $_os != iOS; then
+if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
+ AC_DEFINE(HAVE_FEATURE_NSS)
fi
if test "$with_system_nss" = "yes"; then
libo_MINGW_CHECK_DLL([libnspr4])
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 9668c67..ce3aa93 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -48,10 +48,10 @@ core_factory_list = [
("libunordflo.a", "unordf_component_getFactory"),
("libunoxmllo.a", "unoxml_component_getFactory"),
("libutllo.a", "utl_component_getFactory"),
- ("libxmlsecurity.a", "xmlsecurity_component_getFactory", "#if !defined ANDROID && !defined IOS"),
+ ("libxmlsecurity.a", "xmlsecurity_component_getFactory", "#if !defined ANDROID && HAVE_FEATURE_NSS"),
("libxoflo.a", "xof_component_getFactory"),
("libxolo.a", "xo_component_getFactory"),
- ("libxsec_xmlsec.a", "xsec_xmlsec_component_getFactory", "#if !defined ANDROID && !defined IOS"),
+ ("libxsec_xmlsec.a", "xsec_xmlsec_component_getFactory", "#if !defined ANDROID && HAVE_FEATURE_NSS"),
("libxstor.a", "xstor_component_getFactory"),
("libvclcanvaslo.a", "vclcanvas_component_getFactory"),
("libmtfrendererlo.a", "mtfrenderer_component_getFactory"),
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 78d341b..7a78058 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -72,7 +72,7 @@
#include "pdfwriter_impl.hxx"
-#if !defined(ANDROID) && !defined(IOS) && !defined(_WIN32)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS && !defined(_WIN32)
// NSS headers for PDF signing
#include "nss.h"
#include "cert.h"
@@ -99,6 +99,7 @@
#endif
#include <config_eot.h>
+#include <config_features.h>
#if ENABLE_EOT
#include <libeot/libeot.h>
@@ -108,7 +109,7 @@ using namespace vcl;
static bool g_bDebugDisableCompression = getenv("VCL_DEBUG_DISABLE_PDFCOMPRESSION");
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
// Is this length truly the maximum possible, or just a number that
// seemed large enough when the author tested this (with some type of
// certificates)? I suspect the latter.
@@ -5184,7 +5185,7 @@ bool PDFWriterImpl::emitCatalog()
}
aLine.append( "\n]" );
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
if (m_nSignatureObject != -1)
aLine.append( "/SigFlags 3");
#endif
@@ -5194,7 +5195,7 @@ bool PDFWriterImpl::emitCatalog()
aLine.append( " 0 R" );
// NeedAppearances must not be used if PDF is signed
if( m_bIsPDF_A1
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
|| ( m_nSignatureObject != -1 )
#endif
)
@@ -5226,7 +5227,7 @@ bool PDFWriterImpl::emitCatalog()
return true;
}
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
bool PDFWriterImpl::emitSignature()
{
@@ -5301,7 +5302,7 @@ bool PDFWriterImpl::emitSignature()
return true;
}
-#if !defined(ANDROID) && !defined(IOS) && !defined(_WIN32)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS && !defined(_WIN32)
namespace {
#if 0
@@ -6137,7 +6138,7 @@ NSSCMSMessage *CreateCMSMessage(PRTime* time,
#endif
} // anonymous namespace
-#endif // !defined(ANDROID) && !defined(IOS) && !defined(_WIN32)
+#endif // !defined(ANDROID) && HAVE_FEATURE_NSS && !defined(_WIN32)
#ifdef _WIN32
@@ -7269,7 +7270,7 @@ bool PDFWriterImpl::finalizeSignature()
#endif
}
-#else // defined(ANDROID) || defined(IOS)
+#else // defined(ANDROID) || !HAVE_FEATURE_NSS
bool PDFWriter::Sign(PDFSignContext& /*rContext*/)
{
// Not implemented.
@@ -8054,7 +8055,7 @@ bool PDFWriterImpl::emit()
// needed for widget tab order
sortWidgets();
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
if( m_aContext.SignPDF )
{
// sign the document
@@ -8070,7 +8071,7 @@ bool PDFWriterImpl::emit()
// emit catalog
CHECK_RETURN( emitCatalog() );
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
if (m_nSignatureObject != -1) // if document is signed, emit sigdict
{
if( !emitSignature() )
@@ -8084,7 +8085,7 @@ bool PDFWriterImpl::emit()
// emit trailer
CHECK_RETURN( emitTrailer() );
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
if (m_nSignatureObject != -1) // finalize the signature
{
if( !finalizeSignature() )
@@ -12994,7 +12995,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
createDefaultEditAppearance( rNewWidget, rEdit );
}
-#if !defined(ANDROID) && !defined(IOS)
+#if !defined(ANDROID) && HAVE_FEATURE_NSS
else if( rControl.getType() == PDFWriter::Signature)
{
sigHidden = true;
More information about the Libreoffice-commits
mailing list