summaryrefslogtreecommitdiff
path: root/xmlsecurity/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2025-01-13 11:18:12 +0100
committerMiklos Vajna <vmiklos@collabora.com>2025-01-13 17:53:43 +0100
commit7d4222d0088f22a68941d2e910fe50bd10e8bdfe (patch)
tree6e65378fd0675cd6d1da216123b8679ef32548fa /xmlsecurity/source
parentfe1a096573c6757dc7962658a23939a3cf77c251 (diff)
cool#10630 doc electronic sign: fix insertion of the signature line
Have electronic signing configured in the LOK client, try to insert a signature line, you'll get a certificate picker, while we don't have a cert during esign. What's in fact needed for creating the signature line is just a name (previously extracted from the certificate), we can survive the lack of actual certificate. Fix the problem by adding a new External parameter to .uno:InsertSignatureLine to hint that the certificate chooser should not be opened, instead the editor name (used for comments already) should be used. Add a new CertificateOrName in svl/ and use that in all places where previously we wanted a certificate but in fact it's enough to have a certificate or a name to create the signature line. The name on the signature line is just visual feedback, the actual name on the crypto signature is still not based on untrusted used input. Change-Id: Ib7008112a8e28a9e7d9649745e6021dd6b6b9c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180193 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmlsecurity/source')
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx5
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx2
2 files changed, 4 insertions, 3 deletions
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 0cb00f7a049b..fae0bf2a86c4 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -28,6 +28,7 @@
#include <comphelper/xmlsechelper.hxx>
#include <comphelper/lok.hxx>
#include <sfx2/viewsh.hxx>
+#include <svl/cryptosign.hxx>
#include <com/sun/star/security/NoPasswordException.hpp>
#include <com/sun/star/security/CertificateCharacters.hpp>
@@ -227,9 +228,9 @@ void CertificateChooser::ImplInitialize(bool mbSearch)
if (comphelper::LibreOfficeKit::isActive())
{
// The LOK case takes the signing certificate from the view.
- if (m_pViewShell && m_pViewShell->GetSigningCertificate().is())
+ if (m_pViewShell && m_pViewShell->GetSigningCertificate().m_xCertificate.is())
{
- xCerts = { m_pViewShell->GetSigningCertificate() };
+ xCerts = { m_pViewShell->GetSigningCertificate().m_xCertificate };
}
}
else
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 4c865aac9817..d1a9b2af1cb8 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -265,7 +265,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
if (comphelper::LibreOfficeKit::isActive())
{
// If the view has a signing certificate, then allow adding a signature.
- if (!pViewShell || !pViewShell->GetSigningCertificate().is())
+ if (!pViewShell || !pViewShell->GetSigningCertificate().m_xCertificate.is())
{
m_xAddBtn->hide();
}