Kaydet (Commit) e9834a3e authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst f7397024
......@@ -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());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment