summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-03 19:54:04 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-03 22:49:56 +0100
commit13c6497512c3784507ea5d210e340b9f2605630a (patch)
treed8c682b4afa26bbb41c255e9033e5e42060635e5 /xmlsecurity
parent9f33f046f0d0d491dec305c8e7efa2ccadb64bff (diff)
Split xmlsecurity components based on the config
One non-obvious hunk is the dependency of GPG based on NSS. While it doesn't need NSS per-se, the signature validation code uses NSS functions. This is mainly an improvement / has the same origin then commit 1c6382b2564fbf19f8ee99e11021dff2ce19ed6f ("xmlsec: handle missing EqualDistinguishedNames"). Change-Id: I12416139e1e391822d878c61b4ed06f3a409c334 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127913 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/Library_xmlsecurity.mk2
-rw-r--r--xmlsecurity/Library_xsec_xmlsec.mk13
-rw-r--r--xmlsecurity/util/xmlsecurity.component1
-rw-r--r--xmlsecurity/util/xmlsecurity.component.dds7
-rw-r--r--xmlsecurity/util/xsec_xmlsec.component6
-rw-r--r--xmlsecurity/util/xsec_xmlsec.component.gpg7
-rw-r--r--xmlsecurity/util/xsec_xmlsec.component.nss7
-rw-r--r--xmlsecurity/util/xsec_xmlsec.component.nss_mscrypt10
8 files changed, 52 insertions, 1 deletions
diff --git a/xmlsecurity/Library_xmlsecurity.mk b/xmlsecurity/Library_xmlsecurity.mk
index a4491134a08b..8507b4bab2e1 100644
--- a/xmlsecurity/Library_xmlsecurity.mk
+++ b/xmlsecurity/Library_xmlsecurity.mk
@@ -79,6 +79,8 @@ $(eval $(call gb_Library_add_exception_objects,xmlsecurity,\
xmlsecurity/source/helper/xmlsignaturehelper \
xmlsecurity/source/helper/xsecverify \
))
+
+$(eval $(call gb_Library_add_componentimpl,xmlsecurity,dds))
endif
$(eval $(call gb_Library_use_externals,xmlsecurity,\
diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk
index 25b679c7266e..615c3eba0032 100644
--- a/xmlsecurity/Library_xsec_xmlsec.mk
+++ b/xmlsecurity/Library_xsec_xmlsec.mk
@@ -11,6 +11,12 @@ $(eval $(call gb_Library_Library,xsec_xmlsec))
$(eval $(call gb_Library_set_componentfile,xsec_xmlsec,xmlsecurity/util/xsec_xmlsec,services))
+$(eval $(call gb_Library_add_componentimpls,xsec_xmlsec, \
+ $(if $(ENABLE_GPGMEPP),gpg) \
+ $(if $(or $(ENABLE_NSS),$(filter WNT,$(OS))),nss_mscrypt) \
+ $(if $(ENABLE_NSS),nss) \
+))
+
$(eval $(call gb_Library_set_include,xsec_xmlsec,\
$$(INCLUDE) \
-I$(SRCDIR)/xmlsecurity/inc \
@@ -126,13 +132,18 @@ else # !$(OS),WNT
ifeq ($(SYSTEM_XMLSEC),)
$(eval $(call gb_Library_add_libs,xsec_xmlsec,\
- $(call gb_UnpackedTarball_get_dir,xmlsec)/src/nss/.libs/libxmlsec1-nss.a \
$(call gb_UnpackedTarball_get_dir,xmlsec)/src/.libs/libxmlsec1.a \
))
endif
ifeq ($(ENABLE_NSS),TRUE)
+ifeq ($(SYSTEM_XMLSEC),)
+$(eval $(call gb_Library_add_libs,xsec_xmlsec,\
+ $(call gb_UnpackedTarball_get_dir,xmlsec)/src/nss/.libs/libxmlsec1-nss.a \
+))
+endif
+
$(eval $(call gb_Library_add_exception_objects,xsec_xmlsec,\
xmlsecurity/source/xmlsec/nss/ciphercontext \
xmlsecurity/source/xmlsec/nss/digestcontext \
diff --git a/xmlsecurity/util/xmlsecurity.component b/xmlsecurity/util/xmlsecurity.component
index adb647f20491..7dfe91a0d964 100644
--- a/xmlsecurity/util/xmlsecurity.component
+++ b/xmlsecurity/util/xmlsecurity.component
@@ -26,5 +26,6 @@
<implementation name="com.sun.star.security.DocumentDigitalSignatures"
constructor="com_sun_star_security_DocumentDigitalSignatures_get_implementation">
<service name="com.sun.star.security.DocumentDigitalSignatures"/>
+ <optional/>
</implementation>
</component>
diff --git a/xmlsecurity/util/xmlsecurity.component.dds b/xmlsecurity/util/xmlsecurity.component.dds
new file mode 100644
index 000000000000..5dc5f6765382
--- /dev/null
+++ b/xmlsecurity/util/xmlsecurity.component.dds
@@ -0,0 +1,7 @@
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+com.sun.star.security.DocumentDigitalSignatures
diff --git a/xmlsecurity/util/xsec_xmlsec.component b/xmlsecurity/util/xsec_xmlsec.component
index d219dc6f9d71..f2b072949a98 100644
--- a/xmlsecurity/util/xsec_xmlsec.component
+++ b/xmlsecurity/util/xsec_xmlsec.component
@@ -22,18 +22,22 @@
<implementation name="com.sun.star.xml.crypto.NSSInitializer"
constructor="com_sun_star_xml_crypto_NSSInitializer_get_implementation">
<service name="com.sun.star.xml.crypto.NSSInitializer"/>
+ <optional/>
</implementation>
<implementation name="com.sun.star.xml.crypto.SEInitializer"
constructor="com_sun_star_xml_crypto_SEInitializer_get_implementation">
<service name="com.sun.star.xml.crypto.SEInitializer"/>
+ <optional/>
</implementation>
<implementation name="com.sun.star.xml.security.SEInitializer_Gpg"
constructor="com_sun_star_xml_security_SEInitializer_Gpg_get_implementation">
<service name="com.sun.star.xml.crypto.GPGSEInitializer"/>
+ <optional/>
</implementation>
<implementation name="com.sun.star.xml.crypto.SecurityEnvironment"
constructor="com_sun_star_xml_crypto_SecurityEnvironment_get_implementation">
<service name="com.sun.star.xml.crypto.SecurityEnvironment"/>
+ <optional/>
</implementation>
<implementation name="com.sun.star.xml.wrapper.XMLDocumentWrapper"
constructor="com_sun_star_xml_wrapper_XMLDocumentWrapper_get_implementation">
@@ -46,9 +50,11 @@
<implementation name="com.sun.star.xml.crypto.XMLSecurityContext"
constructor="com_sun_star_xml_crypto_XMLSecurityContext_get_implementation">
<service name="com.sun.star.xml.crypto.XMLSecurityContext"/>
+ <optional/>
</implementation>
<implementation name="com.sun.star.xml.crypto.XMLSignature"
constructor="com_sun_star_xml_crypto_XMLSignature_get_implementation">
<service name="com.sun.star.xml.crypto.XMLSignature"/>
+ <optional/>
</implementation>
</component>
diff --git a/xmlsecurity/util/xsec_xmlsec.component.gpg b/xmlsecurity/util/xsec_xmlsec.component.gpg
new file mode 100644
index 000000000000..c770a555ba9a
--- /dev/null
+++ b/xmlsecurity/util/xsec_xmlsec.component.gpg
@@ -0,0 +1,7 @@
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+com.sun.star.xml.security.SEInitializer_Gpg
diff --git a/xmlsecurity/util/xsec_xmlsec.component.nss b/xmlsecurity/util/xsec_xmlsec.component.nss
new file mode 100644
index 000000000000..3ff9557b92c0
--- /dev/null
+++ b/xmlsecurity/util/xsec_xmlsec.component.nss
@@ -0,0 +1,7 @@
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+com.sun.star.xml.crypto.NSSInitializer
diff --git a/xmlsecurity/util/xsec_xmlsec.component.nss_mscrypt b/xmlsecurity/util/xsec_xmlsec.component.nss_mscrypt
new file mode 100644
index 000000000000..c713c1e83f5c
--- /dev/null
+++ b/xmlsecurity/util/xsec_xmlsec.component.nss_mscrypt
@@ -0,0 +1,10 @@
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+com.sun.star.xml.crypto.SecurityEnvironment
+com.sun.star.xml.crypto.SEInitializer
+com.sun.star.xml.crypto.XMLSecurityContext
+com.sun.star.xml.crypto.XMLSignature