diff options
author | Henry Castro <hcastro@collabora.com> | 2022-11-04 14:00:26 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-01-23 21:47:29 +0000 |
commit | 7a6324ea0d81bbe2bba09f8a7f5230342a4f4e85 (patch) | |
tree | c9b42a219740ebaa7d1ea598d324d65ba773f635 /desktop | |
parent | 66291d467be4bf0e841814111d57d1af76117f8e (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142289
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@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 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)); |