[Libreoffice-commits] core.git: xmlsecurity/qa
Thorsten Behrens
Thorsten.Behrens at CIB.de
Sat Jan 13 13:38:39 UTC 2018
xmlsecurity/qa/unit/signing/data/encryptedGPG.odt |binary
xmlsecurity/qa/unit/signing/data/pubring.gpg |binary
xmlsecurity/qa/unit/signing/data/secring.gpg |binary
xmlsecurity/qa/unit/signing/data/trustdb.gpg |binary
xmlsecurity/qa/unit/signing/signing.cxx | 13 +++++++++++++
5 files changed, 13 insertions(+)
New commits:
commit 8242c22f84cef1bbc8c385875b2da4713b542329
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date: Sat Jan 13 04:17:37 2018 +0100
gpg4libre: add initial unit test for encryption
Load encrypted document w/ password-less key,
don't fail.
Change-Id: Id782dd865878ae7b8a60c7c80821b1370f6ac7e7
Reviewed-on: https://gerrit.libreoffice.org/47831
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/xmlsecurity/qa/unit/signing/data/encryptedGPG.odt b/xmlsecurity/qa/unit/signing/data/encryptedGPG.odt
new file mode 100644
index 000000000000..9490a0ce58c5
Binary files /dev/null and b/xmlsecurity/qa/unit/signing/data/encryptedGPG.odt differ
diff --git a/xmlsecurity/qa/unit/signing/data/pubring.gpg b/xmlsecurity/qa/unit/signing/data/pubring.gpg
index 40a8d53fb401..007ea98afd55 100644
Binary files a/xmlsecurity/qa/unit/signing/data/pubring.gpg and b/xmlsecurity/qa/unit/signing/data/pubring.gpg differ
diff --git a/xmlsecurity/qa/unit/signing/data/secring.gpg b/xmlsecurity/qa/unit/signing/data/secring.gpg
index d98950c22ecd..f7626df5aee3 100644
Binary files a/xmlsecurity/qa/unit/signing/data/secring.gpg and b/xmlsecurity/qa/unit/signing/data/secring.gpg differ
diff --git a/xmlsecurity/qa/unit/signing/data/trustdb.gpg b/xmlsecurity/qa/unit/signing/data/trustdb.gpg
index c86bb02f3d79..1966b5374cfb 100644
Binary files a/xmlsecurity/qa/unit/signing/data/trustdb.gpg and b/xmlsecurity/qa/unit/signing/data/trustdb.gpg differ
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index 4d67cf429d1e..6efb6f02e029 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -106,6 +106,8 @@ public:
void testODFBrokenStreamGPG();
/// Test a typical broken ODF signature where the XML dsig hash is corrupted.
void testODFBrokenDsigGPG();
+ /// Test loading an encrypted ODF document
+ void testODFEncryptedGPG();
#endif
CPPUNIT_TEST_SUITE(SigningTest);
CPPUNIT_TEST(testDescription);
@@ -134,6 +136,7 @@ public:
CPPUNIT_TEST(testODFUntrustedGoodGPG);
CPPUNIT_TEST(testODFBrokenStreamGPG);
CPPUNIT_TEST(testODFBrokenDsigGPG);
+ CPPUNIT_TEST(testODFEncryptedGPG);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -732,6 +735,16 @@ void SigningTest::testODFBrokenDsigGPG()
CPPUNIT_ASSERT(pObjectShell);
CPPUNIT_ASSERT_EQUAL(static_cast<int>(SignatureState::BROKEN), static_cast<int>(pObjectShell->GetDocumentSignatureState()));
}
+
+void SigningTest::testODFEncryptedGPG()
+{
+ createDoc(m_directories.getURLFromSrc(DATA_DIRECTORY) + "encryptedGPG.odt");
+ SfxBaseModel* pBaseModel = dynamic_cast<SfxBaseModel*>(mxComponent.get());
+ CPPUNIT_ASSERT(pBaseModel);
+ SfxObjectShell* pObjectShell = pBaseModel->GetObjectShell();
+ CPPUNIT_ASSERT(pObjectShell);
+}
+
#endif
void SigningTest::registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx)
More information about the Libreoffice-commits
mailing list