summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2022-11-04 14:00:26 -0400
committerAron Budea <aron.budea@collabora.com>2022-11-04 21:53:35 +0100
commite4b6498eca03a5f055a4fc006a0241d50111cd42 (patch)
tree9b3f58e6bf15099fd75e39aaaf8a9bd8b97774e9 /desktop
parent17bf69ba9d8168106162d1a4ddef7cb34d50fe73 (diff)
lok: ensure to initialize the security context
if the backend NSS is used, before load the document ensure the NSS is initialized otherwise NSS next functions calls will fail. Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: I7ac1d7eeee681995e6c284e2dd4595a33d044af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142213 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a9bf7ca19635..212fc322ba8f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3240,6 +3240,20 @@ static void doc_iniUnoCommands ()
return;
}
+ uno::Reference<xml::crypto::XSEInitializer> xSEInitializer = xml::crypto::SEInitializer::create(xContext);
+ if (!xSEInitializer.is())
+ {
+ SAL_WARN("lok", "iniUnoCommands: XSEInitializer is not available");
+ return;
+ }
+
+ uno::Reference<xml::crypto::XXMLSecurityContext> xSecurityContext =
+ xSEInitializer->createSecurityContext(OUString());
+ if (!xSecurityContext.is())
+ {
+ SAL_WARN("lok", "iniUnoCommands: failed to create security context");
+ }
+
SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame);
uno::Reference<util::XURLTransformer> xParser(util::URLTransformer::create(xContext));