summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@allotropia.de>2024-01-15 00:26:02 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-01-23 21:41:03 +0100
commitd0dcd87788910e3c9f67a2b68534019c05b77bad (patch)
tree498e3e4c9683c6cfab001de1bc3f0dc98414873b /xmlsecurity
parentac1cafad398b13a831de913e11143760fd6b822b (diff)
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.behrens@allotropia.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/qa/unit/signing/signing2.cxx58
1 files changed, 30 insertions, 28 deletions
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,