desktop/source/lib/init.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit e4b6498eca03a5f055a4fc006a0241d50111cd42
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Fri Nov 4 14:00:26 2022 -0400
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Fri Nov 4 21:53:35 2022 +0100

    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>

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));
 

Reply via email to