offapi/com/sun/star/security/XDocumentDigitalSignatures.idl | 53 -------- xmlsecurity/inc/digitalsignaturesdialog.hxx | 1 xmlsecurity/inc/documentsignaturehelper.hxx | 1 xmlsecurity/source/component/documentdigitalsignatures.cxx | 77 ------------ xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 4 xmlsecurity/source/helper/documentsignaturehelper.cxx | 6 xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui | 12 - 7 files changed, 1 insertion(+), 153 deletions(-)
New commits: commit 81d3aefd8598fba835eeb21404fc4bd7dddf98b9 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Fri Sep 13 09:02:16 2024 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Sep 13 10:27:14 2024 +0200 [API CHANGE] XDocumentDigitalSignatures: remove deprecated / unused functions Some functions were already a stub and only aborted on calling them. The *Package* functions were added in commit c9ed2f359a9e899c3046c8151c831e24250fddbb (INTEGRATION: CWS xmlsec08 (1.4.24); FILE MERGED 2005/02/22 13:07:19 mt 1.4.24.1: #i36682# Accept separate Stream for signatures..., 2005-03-10), but it seems nobody called them. This also means that DocumentSignatureMode is now never set to DocumentSignatureMode::Package, so remove that as well. It seems to be unlikely that this non-published service was used by 3rd-party code, since it was specific to the needs of sfx2/ code, not generic functionality that could be useful in other contexts. Change-Id: Icfed9a0e6568f6eb21f9236901af01f1915bf2f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173313 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl b/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl index 04f9ef95c1e5..c21bb0317934 100644 --- a/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl +++ b/offapi/com/sun/star/security/XDocumentDigitalSignatures.idl @@ -29,15 +29,6 @@ module com { module sun { module star { module security { interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface { - /** signs the content of the document including text and pictures. - - <p>Macros will not be signed.</p> - - Deprecated, this synchronous version would block the UI till signing is in progress. - */ - boolean signDocumentContent( [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XStream xSignStream); - /** Signs the content of the document including text and pictures using the given XCertificate. @@ -75,15 +66,6 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface */ string getDocumentContentSignatureDefaultStreamName(); - /** signs the content of the Scripting including macros and basic dialogs - - <p>The rest of document content will not be signed.</p> - - Deprecated, this synchronous version would block the UI till signing is in progress. - */ - boolean signScriptingContent( [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XStream xSignStream); - /** checks for digital signatures and their status. <p>Only Scripting content will be checked.</p> @@ -103,33 +85,6 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface */ string getScriptingContentSignatureDefaultStreamName(); - /** signs the full Package, which means everything in the storage except the content of META-INF - - Deprecated, this synchronous version would block the UI till signing is in progress. - */ - boolean signPackage( [in] ::com::sun::star::embed::XStorage Storage, - [in] ::com::sun::star::io::XStream xSignStream); - - /** checks for digital signatures and their status. - - <p>Only Package content will be checked.</p> - */ - sequence< com::sun::star::security::DocumentSignatureInformation > verifyPackageSignatures( - [in] ::com::sun::star::embed::XStorage Storage, - [in] ::com::sun::star::io::XInputStream xSignInStream ); - - /** shows the digital signatures of the package - */ - void showPackageSignatures( - [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XInputStream xSignInStream ); - - /** allows to get the default stream name for storing of the signature of - the package. - */ - string getPackageSignatureDefaultStreamName(); - - void showCertificate( [in] com::sun::star::security::XCertificate Certificate ); @@ -220,14 +175,6 @@ interface XDocumentDigitalSignatures : com::sun::star::uno::XInterface [in] ::com::sun::star::embed::XStorage xStorage, [in] ::com::sun::star::io::XStream xStream); - /** signs the full Package, which means everything in the storage except the content of META-INF with the provided certificate. - - @since LibreOffice 7.0 - */ - boolean signPackageWithCertificate([in] ::com::sun::star::security::XCertificate xCertificate, - [in] ::com::sun::star::embed::XStorage xStorage, - [in] ::com::sun::star::io::XStream xStream); - /** queries the user if they want to trust an untrusted certificate. @since LibreOffice 24.8 diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index a56175fff5b4..924288968961 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -53,7 +53,6 @@ private: std::unique_ptr<weld::Label> m_xHintDocFT; std::unique_ptr<weld::Label> m_xHintBasicFT; - std::unique_ptr<weld::Label> m_xHintPackageFT; std::unique_ptr<weld::TreeView> m_xSignaturesLB; std::unique_ptr<weld::Image> m_xSigsValidImg; std::unique_ptr<weld::Label> m_xSigsValidFI; diff --git a/xmlsecurity/inc/documentsignaturehelper.hxx b/xmlsecurity/inc/documentsignaturehelper.hxx index eb50b3761423..e13bdc81911d 100644 --- a/xmlsecurity/inc/documentsignaturehelper.hxx +++ b/xmlsecurity/inc/documentsignaturehelper.hxx @@ -36,7 +36,6 @@ enum class DocumentSignatureMode { Content, Macros, - Package }; enum class DocumentSignatureAlgorithm diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 9c89b293bb39..07512080cf9e 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -121,9 +121,6 @@ public: css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override; // XDocumentDigitalSignatures - sal_Bool SAL_CALL - signDocumentContent(const css::uno::Reference<css::embed::XStorage>& xStorage, - const css::uno::Reference<css::io::XStream>& xSignStream) override; sal_Bool SAL_CALL signSignatureLine( const css::uno::Reference<css::embed::XStorage>& Storage, const css::uno::Reference<css::io::XStream>& xSignStream, const OUString& aSignatureLineId, @@ -139,9 +136,6 @@ public: const css::uno::Reference<css::embed::XStorage>& xStorage, const css::uno::Reference<css::io::XInputStream>& xSignInStream) override; OUString SAL_CALL getDocumentContentSignatureDefaultStreamName() override; - sal_Bool SAL_CALL - signScriptingContent(const css::uno::Reference<css::embed::XStorage>& xStorage, - const css::uno::Reference<css::io::XStream>& xSignStream) override; css::uno::Sequence<css::security::DocumentSignatureInformation> SAL_CALL verifyScriptingContentSignatures( const css::uno::Reference<css::embed::XStorage>& xStorage, @@ -150,17 +144,6 @@ public: const css::uno::Reference<css::embed::XStorage>& xStorage, const css::uno::Reference<css::io::XInputStream>& xSignInStream) override; OUString SAL_CALL getScriptingContentSignatureDefaultStreamName() override; - sal_Bool SAL_CALL - signPackage(const css::uno::Reference<css::embed::XStorage>& Storage, - const css::uno::Reference<css::io::XStream>& xSignStream) override; - css::uno::Sequence<css::security::DocumentSignatureInformation> - SAL_CALL verifyPackageSignatures( - const css::uno::Reference<css::embed::XStorage>& Storage, - const css::uno::Reference<css::io::XInputStream>& xSignInStream) override; - void SAL_CALL - showPackageSignatures(const css::uno::Reference<css::embed::XStorage>& xStorage, - const css::uno::Reference<css::io::XInputStream>& xSignInStream) override; - OUString SAL_CALL getPackageSignatureDefaultStreamName() override; void SAL_CALL showCertificate(const css::uno::Reference<css::security::XCertificate>& Certificate) override; void SAL_CALL manageTrustedSources() override; @@ -190,11 +173,6 @@ public: css::uno::Reference<css::embed::XStorage> const & xStoragexStorage, css::uno::Reference<css::io::XStream> const & xStream) override; - sal_Bool SAL_CALL signPackageWithCertificate( - css::uno::Reference<css::security::XCertificate> const& xCertificate, - css::uno::Reference<css::embed::XStorage> const& xStoragexStorage, - css::uno::Reference<css::io::XStream> const& xStream) override; - sal_Bool SAL_CALL trustUntrustedCertificate( css::uno::Reference<css::security::XCertificate> const& xCertificate) override; @@ -286,13 +264,6 @@ DocumentDigitalSignatures::getSupportedServiceNames() return aRet; } -sal_Bool DocumentDigitalSignatures::signDocumentContent( - const Reference< css::embed::XStorage >& /*rxStorage*/, - const Reference< css::io::XStream >& /*xSignStream*/) -{ - for (;;) { std::abort(); } // avoid "must return a value" warnings -} - sal_Bool DocumentDigitalSignatures::signSignatureLine( const Reference<css::embed::XStorage>& rxStorage, const Reference<css::io::XStream>& xSignStream, @@ -363,13 +334,6 @@ OUString DocumentDigitalSignatures::getDocumentContentSignatureDefaultStreamName return DocumentSignatureHelper::GetDocumentContentSignatureDefaultStreamName(); } -sal_Bool DocumentDigitalSignatures::signScriptingContent( - const Reference< css::embed::XStorage >& /*rxStorage*/, - const Reference< css::io::XStream >& /*xSignStream*/ ) -{ - for (;;) { std::abort(); } // avoid "must return a value" warnings -} - Sequence< css::security::DocumentSignatureInformation > DocumentDigitalSignatures::verifyScriptingContentSignatures( const Reference< css::embed::XStorage >& rxStorage, @@ -392,37 +356,6 @@ OUString DocumentDigitalSignatures::getScriptingContentSignatureDefaultStreamNam return DocumentSignatureHelper::GetScriptingContentSignatureDefaultStreamName(); } - -sal_Bool DocumentDigitalSignatures::signPackage( - const Reference< css::embed::XStorage >& /*rxStorage*/, - const Reference< css::io::XStream >& /*xSignStream*/ ) -{ - for (;;) { std::abort(); } // avoid "must return a value" warnings -} - -Sequence< css::security::DocumentSignatureInformation > -DocumentDigitalSignatures::verifyPackageSignatures( - const Reference< css::embed::XStorage >& rxStorage, - const Reference< css::io::XInputStream >& xSignInStream ) -{ - OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); - return ImplVerifySignatures( rxStorage, xSignInStream, DocumentSignatureMode::Package ); -} - -void DocumentDigitalSignatures::showPackageSignatures( - const Reference< css::embed::XStorage >& rxStorage, - const Reference< css::io::XInputStream >& xSignInStream ) -{ - OSL_ENSURE(!m_sODFVersion.isEmpty(),"DocumentDigitalSignatures: ODF Version not set, assuming minimum 1.2"); - ImplViewSignatures( rxStorage, xSignInStream, DocumentSignatureMode::Package, true ); -} - -OUString DocumentDigitalSignatures::getPackageSignatureDefaultStreamName( ) -{ - return DocumentSignatureHelper::GetPackageSignatureDefaultStreamName(); -} - - void DocumentDigitalSignatures::ImplViewSignatures( const Reference< css::embed::XStorage >& rxStorage, const Reference< css::io::XInputStream >& xSignStream, @@ -861,16 +794,6 @@ void DocumentDigitalSignatures::SetSignScriptingContent( mxScriptingSignStream = xScriptingSignStream; } -sal_Bool DocumentDigitalSignatures::signPackageWithCertificate( - css::uno::Reference<css::security::XCertificate> const& xCertificate, - css::uno::Reference<css::embed::XStorage> const& xStorage, - css::uno::Reference<css::io::XStream> const& xStream) -{ - uno::Reference<frame::XModel> xModel; - return signWithCertificateImpl(xModel, xCertificate, xStorage, xStream, - DocumentSignatureMode::Package); -} - sal_Bool DocumentDigitalSignatures::trustUntrustedCertificate( css::uno::Reference<css::security::XCertificate> const& xCertificate) { diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 0b1173f70e7a..15f8e98b4f63 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -200,7 +200,6 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( , m_bWarningShowSignMacro(false) , m_xHintDocFT(m_xBuilder->weld_label(u"dochint"_ustr)) , m_xHintBasicFT(m_xBuilder->weld_label(u"macrohint"_ustr)) - , m_xHintPackageFT(m_xBuilder->weld_label(u"packagehint"_ustr)) , m_xSignaturesLB(m_xBuilder->weld_tree_view(u"signatures"_ustr)) , m_xSigsValidImg(m_xBuilder->weld_image(u"validimg"_ustr)) , m_xSigsValidFI(m_xBuilder->weld_label(u"validft"_ustr)) @@ -256,9 +255,6 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( case DocumentSignatureMode::Macros: m_xHintBasicFT->show(); break; - case DocumentSignatureMode::Package: - m_xHintPackageFT->show(); - break; } if (comphelper::LibreOfficeKit::isActive()) diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index b35c709915f4..e3908fc5ee76 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -281,12 +281,6 @@ DocumentSignatureHelper::CreateElementList( } } break; - case DocumentSignatureMode::Package: - { - // Everything except META-INF - ImplFillElementList(aElements, rxStore, std::u16string_view(), true, mode); - } - break; } return aElements; diff --git a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui index 34e68a5eed3a..483605961f2c 100644 --- a/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui +++ b/xmlsecurity/uiconfig/ui/digitalsignaturesdialog.ui @@ -369,17 +369,7 @@ </packing> </child> <child> - <object class="GtkLabel" id="packagehint"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="label" translatable="yes" context="digitalsignaturesdialog|packagehint">The following have signed this package:</property> - <property name="xalign">0</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">5</property> - </packing> + <placeholder/> </child> <child> <!-- n-columns=2 n-rows=4 -->