summaryrefslogtreecommitdiff
path: root/xmlsecurity/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-02 11:10:35 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-02 15:01:02 +0100
commitb0d1a39e995871ef81cb58e8f1587a771fdd2deb (patch)
tree3669d442c26502c5fdbaa794dda1b7e4c0dad1cb /xmlsecurity/qa
parent2734a6ce77b9b104e065b0bc3cc593b107f49883 (diff)
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')
-rw-r--r--xmlsecurity/qa/unit/pdfsigning/data/pdf16adobe.pdfbin0 -> 81882 bytes
-rw-r--r--xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/xmlsecurity/qa/unit/pdfsigning/data/pdf16adobe.pdf b/xmlsecurity/qa/unit/pdfsigning/data/pdf16adobe.pdf
new file mode 100644
index 000000000000..ac1c5f37b972
--- /dev/null
+++ b/xmlsecurity/qa/unit/pdfsigning/data/pdf16adobe.pdf
Binary files differ
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();