sfx2/source/doc/objstor.cxx | 3 - xmlsecurity/qa/unit/signing/signing2.cxx | 58 ++++++++++++++++--------------- 2 files changed, 31 insertions(+), 30 deletions(-)
New commits: commit d0dcd87788910e3c9f67a2b68534019c05b77bad Author: Thorsten Behrens <thorsten.behr...@allotropia.de> AuthorDate: Mon Jan 15 00:26:02 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Jan 23 21:41:03 2024 +0100 Make wholesome ODF package encryption the default Change-Id: I825ae7a5e4b80d390804a7bb2cfdfc3b1843bd07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162066 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 854389ae31be..27fb68c83f87 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -170,8 +170,7 @@ bool SfxObjectShell::QuerySlotExecutable( sal_uInt16 /*nSlotId*/ ) static bool UseODFWholesomeEncryption(SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion) { - return nODFVersion == SvtSaveOptions::ODFSVER_LATEST_EXTENDED - && officecfg::Office::Common::Misc::ExperimentalMode::get(); + return nODFVersion == SvtSaveOptions::ODFSVER_LATEST_EXTENDED; } bool GetEncryptionData_Impl( const SfxItemSet* pSet, uno::Sequence< beans::NamedValue >& o_rEncryptionData ) diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx b/xmlsecurity/qa/unit/signing/signing2.cxx index 71e887df236a..dd6f9e09a83d 100644 --- a/xmlsecurity/qa/unit/signing/signing2.cxx +++ b/xmlsecurity/qa/unit/signing/signing2.cxx @@ -128,9 +128,21 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) CPPUNIT_ASSERT_EQUAL(SignatureState::OK, pObjectShell->GetScriptingSignatureState()); } - saveAndReload("writer8", "password"); { - // test standard ODF 1.2/1.3/1.4 encryption + // test the old, standard ODF 1.2/1.3/1.4 encryption + Resetter resetter([]() { + std::shared_ptr<comphelper::ConfigurationChanges> pBatch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Save::ODF::DefaultVersion::set(3, pBatch); + return pBatch->commit(); + }); + std::shared_ptr<comphelper::ConfigurationChanges> pBatch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Save::ODF::DefaultVersion::set(10, pBatch); + pBatch->commit(); + + saveAndReload("writer8", "password"); + xmlDocUniquePtr pXmlDoc = parseExport("META-INF/manifest.xml"); assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, "1.3"); assertXPath(pXmlDoc, "/manifest:manifest/manifest:file-entry[@manifest:size != '0']"_ostr, @@ -174,18 +186,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODF13) } { - Resetter resetter([]() { - std::shared_ptr<comphelper::ConfigurationChanges> pBatch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::ExperimentalMode::set(false, pBatch); - return pBatch->commit(); - }); - std::shared_ptr<comphelper::ConfigurationChanges> pBatch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::ExperimentalMode::set(true, pBatch); - pBatch->commit(); - - // store it experimental - reload + // store it with new wholesome ODF extended encryption - reload saveAndReload("writer8", "password"); // test wholesome ODF extended encryption @@ -253,18 +254,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODFWholesom } { - Resetter resetter([]() { - std::shared_ptr<comphelper::ConfigurationChanges> pBatch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::ExperimentalMode::set(false, pBatch); - return pBatch->commit(); - }); - std::shared_ptr<comphelper::ConfigurationChanges> pBatch( - comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::ExperimentalMode::set(true, pBatch); - pBatch->commit(); - - // store it experimental - reload + // store it with new wholesome ODF extended encryption - reload saveAndReload("writer8", "password"); // test wholesome ODF extended encryption @@ -321,9 +311,21 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, testPasswordPreserveMacroSignatureODFWholesom CPPUNIT_ASSERT_EQUAL(SignatureState::OK, pObjectShell->GetScriptingSignatureState()); } - saveAndReload("writer8", "password"); { - // test standard ODF 1.2/1.3/1.4 encryption + // test the old, standard ODF 1.2/1.3/1.4 encryption + Resetter resetter([]() { + std::shared_ptr<comphelper::ConfigurationChanges> pBatch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Save::ODF::DefaultVersion::set(3, pBatch); + return pBatch->commit(); + }); + std::shared_ptr<comphelper::ConfigurationChanges> pBatch( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Save::ODF::DefaultVersion::set(10, pBatch); + pBatch->commit(); + + saveAndReload("writer8", "password"); + xmlDocUniquePtr pXmlDoc = parseExport("META-INF/manifest.xml"); assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, "1.3"); assertXPath(pXmlDoc, "/manifest:manifest/manifest:file-entry[@manifest:size != '0']"_ostr,