desktop/source/lib/init.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
New commits: commit 7a6324ea0d81bbe2bba09f8a7f5230342a4f4e85 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Nov 4 14:00:26 2022 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Jan 23 21:47:29 2023 +0000 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 <hcas...@collabora.com> Change-Id: I7ac1d7eeee681995e6c284e2dd4595a33d044af4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142213 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Aron Budea <aron.bu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142289 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.ti...@collabora.com> 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<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));