summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-10-19 12:36:37 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-19 16:46:20 +0200
commite9834a3eaf35a2c7b61cf45c2d64e9f3bbe89982 (patch)
treed4980546bff3d3d81924fe6848c5e4dc71b68e46
parentf7397024fef154f7bedcb844678e1cabba1e5cd8 (diff)
xmlsecurity: fix the PDF incremental update's cross-references table
The VCL pdf export writes a space after the in-use entry, and turns out Adobe Acrobat starts to "repair" the file if there is no such space. Which means the signature is validated against the repaired document, resulting in a "The signature byte range is invalid" error message, hiding the root cause. Not that ISO-32000 7.5.4 "Cross-References Table" would mention the need for such whitespace at the end of the lines. Change-Id: I165b57809550f184f374c00f28426a3cd813c63f
-rw-r--r--xmlsecurity/source/pdfio/pdfdocument.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 6e807a4d4cb1..ad488cfad762 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -462,9 +462,9 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat
while (aBuffer.getLength() < 10)
aBuffer.insert(0, "0");
if (nObject == 0)
- aBuffer.append(" 65535 f\n");
+ aBuffer.append(" 65535 f \n");
else
- aBuffer.append(" 00000 n\n");
+ aBuffer.append(" 00000 n \n");
m_aEditBuffer.WriteOString(aBuffer.toString());
}