diff options
author | Henry Castro <hcastro@collabora.com> | 2022-11-04 14:00:26 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-01-16 17:30:20 +0100 |
commit | 8c23a0ca44ef86c4bcfd62033a63fb2715f68ef9 (patch) | |
tree | 1595451a63f3eb29c08d025fe17b2e2ae92f4254 /desktop | |
parent | eb60a0f5fb7e8ae3e838433d875fc637ac7bf538 (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.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0567c12edca4..039458f69e22 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3432,6 +3432,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)); |