diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-02 11:10:35 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-02 15:01:02 +0100 |
commit | b0d1a39e995871ef81cb58e8f1587a771fdd2deb (patch) | |
tree | 3669d442c26502c5fdbaa794dda1b7e4c0dad1cb /xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | |
parent | getNonLayoutRealParent is unused (diff) | |
download | core-b0d1a39e995871ef81cb58e8f1587a771fdd2deb.tar.gz core-b0d1a39e995871ef81cb58e8f1587a771fdd2deb.zip |
xmlsecurity PDF verify: add support for object streams
Adobe Acrobat uses object streams (PDF 1.6) when it signs a PDF exported
from LO (PDF 1.4), with this we can verify that signature.
If the PDF had at least one signature in LO, then the doc is not
upgraded from PDF 1.4, so that was working already.
Change-Id: I54b4447ca965a8ba1ffc69bde228ab6f0bda59ee
Diffstat (limited to 'xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx')
-rw-r--r-- | xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx index 469ded6978c6..2f7ef572c581 100644 --- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx +++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx @@ -57,6 +57,8 @@ public: void testPDFRemoveAll(); /// Test a PDF 1.4 document, signed by Adobe. void testPDF14Adobe(); + /// Test a PDF 1.6 document, signed by Adobe. + void testPDF16Adobe(); CPPUNIT_TEST_SUITE(PDFSigningTest); CPPUNIT_TEST(testPDFAdd); @@ -64,6 +66,7 @@ public: CPPUNIT_TEST(testPDFRemove); CPPUNIT_TEST(testPDFRemoveAll); CPPUNIT_TEST(testPDF14Adobe); + CPPUNIT_TEST(testPDF16Adobe); CPPUNIT_TEST_SUITE_END(); }; @@ -254,6 +257,17 @@ void PDFSigningTest::testPDF14Adobe() #endif } +void PDFSigningTest::testPDF16Adobe() +{ +#ifndef _WIN32 + // Contains a cross-reference stream, object streams and a compressed + // stream with a predictor. And a valid signature. + // Found signatures was 0, as parsing failed due to lack of support for + // these features. + verify(m_directories.getURLFromSrc(DATA_DIRECTORY) + "pdf16adobe.pdf", 1); +#endif +} + CPPUNIT_TEST_SUITE_REGISTRATION(PDFSigningTest); CPPUNIT_PLUGIN_IMPLEMENT(); |