From 7a6324ea0d81bbe2bba09f8a7f5230342a4f4e85 Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Fri, 4 Nov 2022 14:00:26 -0400 Subject: 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 Change-Id: I7ac1d7eeee681995e6c284e2dd4595a33d044af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142213 Tested-by: Jenkins CollaboraOffice Reviewed-by: Aron Budea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142289 Tested-by: Jenkins Reviewed-by: Andras Timar --- desktop/source/lib/init.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'desktop') diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index bdc4b1869ded..8e98e675bb79 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3404,6 +3404,20 @@ static void doc_iniUnoCommands () return; } + uno::Reference xSEInitializer = xml::crypto::SEInitializer::create(xContext); + if (!xSEInitializer.is()) + { + SAL_WARN("lok", "iniUnoCommands: XSEInitializer is not available"); + return; + } + + uno::Reference xSecurityContext = + xSEInitializer->createSecurityContext(OUString()); + if (!xSecurityContext.is()) + { + SAL_WARN("lok", "iniUnoCommands: failed to create security context"); + } + SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool(pViewFrame); uno::Reference xParser(util::URLTransformer::create(xContext)); -- cgit