diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-10-22 14:02:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-10-22 17:21:27 +0200 |
commit | 4aa8d30c095e08825bc983c699e11f2e88182124 (patch) | |
tree | 320e64e3c3d0a1b0b8e36b4a59e5ced772223992 /sfx2 | |
parent | b2d35dfe19aec40d34f1a2cca0a83ef4cef23a7d (diff) |
cool#9992 lok doc sign: never remember previous .uno:Signature params
Do this explicitly, so it can't happen that .uno:Signature with params
gets dispatched, then .uno:Signature without params still has the old
XCertificate.
Change-Id: I35c4d5e0e4545fb1aabb9050aa6b11cd10c3ca85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175414
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index ff628d18059a..190b87ef2e1b 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -620,10 +620,15 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) } SfxViewFrame* pFrame = GetFrame(); SfxViewShell* pViewShell = pFrame ? pFrame->GetViewShell() : nullptr; - if (!aSignatureCert.empty() && !aSignatureKey.empty() && pViewShell) + if (pViewShell) { - xCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey); - pViewShell->SetSigningCertificate(xCertificate); + uno::Reference<security::XCertificate> xSigningCertificate; + if (!aSignatureCert.empty() && !aSignatureKey.empty()) + { + xSigningCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey); + } + // Always set the signing certificate, to clear data from a previous dispatch. + pViewShell->SetSigningCertificate(xSigningCertificate); } // Async, all code before return has to go into the callback. |