summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2018-07-07 15:21:12 +0200
committerTomaž Vajngerl <quikee@gmail.com>2018-07-07 22:58:28 +0200
commit8efeb81537726445954b10314ebbd770d266ac20 (patch)
tree11ef8fdd4c560bd37998dabafd0f95c4960d7bb0 /sw
parent4fe073b563336c1b8bfb97a9addc8fb7a8145858 (diff)
Add LO standard encryption to the ooxml encryption tests
Change-Id: I199ed40d409dc4baf9102480eadffde9a7c26a78 Reviewed-on: https://gerrit.libreoffice.org/57139 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docxbin0 -> 7680 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlencryption.cxx16
2 files changed, 12 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docx b/sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docx
new file mode 100644
index 000000000000..c35aaf12ad2c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/Encrypted_LO_Standard_abc.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx b/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx
index 66ae8f1754ac..7ec52f34d0e9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlencryption.cxx
@@ -16,32 +16,40 @@ public:
Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") {}
protected:
- bool mustTestImportOf(const char* filename) const override {
+ bool mustTestImportOf(const char* filename) const override
+ {
return OString(filename).endsWith(".docx");
}
};
-DECLARE_SW_ROUNDTRIP_TEST(testPassword2007, "Encrypted_MSO2007_abc.docx", "abc", Test)
+DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2007, "Encrypted_MSO2007_abc.docx", "abc", Test)
{
// Standard encryption format, AES 128, SHA1
uno::Reference<text::XTextRange> xParagraph(getParagraph(1));
CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph->getString());
}
-DECLARE_SW_ROUNDTRIP_TEST(testPassword2010, "Encrypted_MSO2010_abc.docx", "abc", Test)
+DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2010, "Encrypted_MSO2010_abc.docx", "abc", Test)
{
// Agile encryption format, AES 128, CBC, SHA1
uno::Reference<text::XTextRange> xParagraph(getParagraph(1));
CPPUNIT_ASSERT_EQUAL(OUString("abc"), xParagraph->getString());
}
-DECLARE_SW_ROUNDTRIP_TEST(testPassword2013, "Encrypted_MSO2013_abc.docx", "abc", Test)
+DECLARE_SW_ROUNDTRIP_TEST(testPasswordMSO2013, "Encrypted_MSO2013_abc.docx", "abc", Test)
{
// Agile encryption format, AES 256, CBC, SHA512
uno::Reference<text::XTextRange> xParagraph(getParagraph(1));
CPPUNIT_ASSERT_EQUAL(OUString("ABC"), xParagraph->getString());
}
+DECLARE_SW_ROUNDTRIP_TEST(testPasswordLOStandard, "Encrypted_LO_Standard_abc.docx", "abc", Test)
+{
+ // Standard encryption format, AES 128, SHA1
+ uno::Reference<text::XTextRange> xParagraph(getParagraph(1));
+ CPPUNIT_ASSERT_EQUAL(OUString("ABC"), xParagraph->getString());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */