diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-10-22 14:02:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-10-22 15:16:36 +0200 |
commit | 2990c7ea4da17e555903ff8854c03b71aa7ecddd (patch) | |
tree | c5acf8358e8c34299a50e2a17835f7303687201c /sfx2 | |
parent | d48264d51891d81f77fcfd77766e1d34ec17412b (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/+/175409
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
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 096c97344b3b..35efc6dcf60c 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -630,10 +630,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. |