From e9834a3eaf35a2c7b61cf45c2d64e9f3bbe89982 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 19 Oct 2016 12:36:37 +0200 Subject: 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 --- xmlsecurity/source/pdfio/pdfdocument.cxx | 4 ++-- 1 file 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& 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()); } -- cgit