diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-18 17:17:24 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-22 09:43:22 +0200 |
commit | 090e243c401fdb73a917a5deb36279c445cfcbb9 (patch) | |
tree | 1c5e9e1710e648b9eac664b8d23cc485cbdaf233 | |
parent | 6499ea2ff45fa42094d41c5c417f66a3ae5a22ae (diff) |
tdf#83877 Use Signer comments as signature description
Change-Id: Ia9f18addeee9cf86989c873419113ddbd07c219f
Reviewed-on: https://gerrit.libreoffice.org/54551
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | cui/source/dialogs/SignSignatureLineDialog.cxx | 2 | ||||
-rw-r--r-- | include/sfx2/docfile.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/objsh.hxx | 3 | ||||
-rw-r--r-- | offapi/com/sun/star/security/XDocumentDigitalSignatures.idl | 3 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 5 | ||||
-rw-r--r-- | xmlsecurity/source/component/documentdigitalsignatures.cxx | 9 |
7 files changed, 21 insertions, 13 deletions
diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx index 78cb0bd88b17..8cc06d90a4eb 100644 --- a/cui/source/dialogs/SignSignatureLineDialog.cxx +++ b/cui/source/dialogs/SignSignatureLineDialog.cxx @@ -148,7 +148,7 @@ void SignSignatureLineDialog::Apply() Reference<XGraphic> xValidGraphic = getSignedGraphic(true); Reference<XGraphic> xInvalidGraphic = getSignedGraphic(false); pShell->SignSignatureLine(m_aSignatureLineId, m_xSelectedCertifate, xValidGraphic, - xInvalidGraphic); + xInvalidGraphic, m_xEditComment->get_text()); } const css::uno::Reference<css::graphic::XGraphic> diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx index 5ef0426c36c1..d3db0dfaba79 100644 --- a/include/sfx2/docfile.hxx +++ b/include/sfx2/docfile.hxx @@ -272,7 +272,8 @@ public: const css::uno::Reference<css::graphic::XGraphic> xValidGraphic = css::uno::Reference<css::graphic::XGraphic>(), const css::uno::Reference<css::graphic::XGraphic> xInvalidGraphic - = css::uno::Reference<css::graphic::XGraphic>()); + = css::uno::Reference<css::graphic::XGraphic>(), + const OUString& aComment = OUString()); // the following two methods must be used and make sense only during saving currently // TODO/LATER: in future the signature state should be controlled by the medium not by the document diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 1fa653b93437..ad56de0173ca 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -364,7 +364,8 @@ public: void SignSignatureLine(const OUString& aSignatureLineId, const css::uno::Reference<css::security::XCertificate> xCert, const css::uno::Reference<css::graphic::XGraphic> xValidGraphic, - const css::uno::Reference<css::graphic::XGraphic> xInvalidGraphic); + const css::uno::Reference<css::graphic::XGraphic> xInvalidGraphic, + const OUString& aComment); SignatureState GetScriptingSignatureState(); void SignScriptingContent(); DECL_LINK(SignDocumentHandler, Button*, void); diff --git a/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl b/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl index b1c3020229e0..3b2e543d2fab 100644 --- a/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl +++ b/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl @@ -61,7 +61,8 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface [in] string signatureLineId, [in] ::com::sun::star::security::XCertificate xCertificate, [in] ::com::sun::star::graphic::XGraphic xValidGraphic, - [in] ::com::sun::star::graphic::XGraphic xInvalidGraphic); + [in] ::com::sun::star::graphic::XGraphic xInvalidGraphic, + [in] string comment); /** checks for digital signatures and their status. diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index c56be8e20329..72a6c131fc41 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -3668,7 +3668,8 @@ bool SfxMedium::SignContents_Impl(bool bSignScriptingContent, const OUString& aSignatureLineId, const Reference<XCertificate> xCert, const Reference<XGraphic> xValidGraphic, - const Reference<XGraphic> xInvalidGraphic) + const Reference<XGraphic> xInvalidGraphic, + const OUString& aComment) { bool bChanges = false; @@ -3759,7 +3760,8 @@ bool SfxMedium::SignContents_Impl(bool bSignScriptingContent, bool bSuccess = false; if (xCert.is()) bSuccess = xSigner->signSignatureLine( - GetZipStorageToSign_Impl(), xStream, aSignatureLineId, xCert, xValidGraphic, xInvalidGraphic); + GetZipStorageToSign_Impl(), xStream, aSignatureLineId, xCert, + xValidGraphic, xInvalidGraphic, aComment); else bSuccess = xSigner->signDocumentContent(GetZipStorageToSign_Impl(), xStream); @@ -3785,7 +3787,8 @@ bool SfxMedium::SignContents_Impl(bool bSignScriptingContent, if (xCert.is()) { bSuccess = xSigner->signSignatureLine( - GetZipStorageToSign_Impl(/*bReadOnly=*/false), xStream, aSignatureLineId, xCert, xValidGraphic, xInvalidGraphic); + GetZipStorageToSign_Impl(/*bReadOnly=*/false), xStream, aSignatureLineId, + xCert, xValidGraphic, xInvalidGraphic, aComment); } else { diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 8a259909c534..29a398c92f8c 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1565,7 +1565,8 @@ void SfxObjectShell::SignDocumentContent() void SfxObjectShell::SignSignatureLine(const OUString& aSignatureLineId, const Reference<XCertificate> xCert, const Reference<XGraphic> xValidGraphic, - const Reference<XGraphic> xInvalidGraphic) + const Reference<XGraphic> xInvalidGraphic, + const OUString& aComment) { if (!PrepareForSigning()) return; @@ -1574,7 +1575,7 @@ void SfxObjectShell::SignSignatureLine(const OUString& aSignatureLineId, return; bool bSignSuccess = GetMedium()->SignContents_Impl( - false, HasValidSignatures(), aSignatureLineId, xCert, xValidGraphic, xInvalidGraphic); + false, HasValidSignatures(), aSignatureLineId, xCert, xValidGraphic, xInvalidGraphic, aComment); AfterSigning(bSignSuccess, false); } diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 2c40f69b53f6..7b708b0c99aa 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -109,7 +109,8 @@ public: const css::uno::Reference<css::io::XStream>& xSignStream, const OUString& aSignatureLineId, const Reference<css::security::XCertificate>& xCertificate, const Reference<css::graphic::XGraphic>& xValidGraphic, - const Reference<css::graphic::XGraphic>& xInvalidGraphic) override; + const Reference<css::graphic::XGraphic>& xInvalidGraphic, + const OUString& aComment) override; css::uno::Sequence<css::security::DocumentSignatureInformation> SAL_CALL verifyDocumentContentSignatures( const css::uno::Reference<css::embed::XStorage>& xStorage, @@ -230,7 +231,8 @@ sal_Bool DocumentDigitalSignatures::signSignatureLine( const OUString& aSignatureLineId, const Reference<css::security::XCertificate>& xCertificate, const Reference<css::graphic::XGraphic>& xValidGraphic, - const Reference<css::graphic::XGraphic>& xInvalidGraphic) + const Reference<css::graphic::XGraphic>& xInvalidGraphic, + const OUString& aComment) { OSL_ENSURE(!m_sODFVersion.isEmpty(), "DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); @@ -253,8 +255,7 @@ sal_Bool DocumentDigitalSignatures::signSignatureLine( xSecurityContext = aSignatureManager.getSecurityContext(); sal_Int32 nSecurityId; - OUString aDescription(""); - bool bSuccess = aSignatureManager.add(xCertificate, xSecurityContext, aDescription, nSecurityId, + bool bSuccess = aSignatureManager.add(xCertificate, xSecurityContext, aComment, nSecurityId, true, aSignatureLineId, xValidGraphic, xInvalidGraphic); if (!bSuccess) return false; |