-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using TSA causes a extra xref size #77
Comments
Hi, I also had some glitches when testing TSA, but I thought it was my fault... let's debug |
Maybe it's not because |
I'm currently away from computer and not possible to analyze it soon. |
It was already at 27742, increasing it to 32000 does not look to mitigate the issue, it still fails every one or two successes. |
any update on this? |
If what is meant is about the change in size due to one tsa request and another, I don't really understand this question because it is related to the pdf structure (outside of cryptography issues).
I plan to do the next update for some improvements, also by including ecc certificate support. |
I am testing the TSA feature (set_tsa and not set_ltv) with a dompdf generated pdf, after the signing I load again the PDF with "$pdfDoc = PDFDoc::from_string($pdfSigned);" doing this several times with the same input sometimes $pdfDoc returns true;
The error is related to "xref tag not found at position", I checked the signed pdf buffer and in some cases the xref_pos size is different, when using TSA feature sometimes it adds 4 chars to the xref_pos, this is an example of PDF signed with TSA and checked correctly with startxref 17394:
and this is the same PDF signed again that reports startxref 17398 bytes:
In the second case the function "public static function get_xref_1_4" xref_line starts in "obj\n" instead of "xref\n" and the code reports the "xref tag not found at position".
I could fix the code to detect this 4 bytes shift when searching the xref anchor but the bug itself is probably upstream when applying the TSA signature, as the documents have the same exact sizes with different signatures, any ideas?.
I have repeat the test several times without set_tsa, or with set_ltv and it only triggers with set_tsa, I am testing with the digicert timestap service.
Cheers
Jacq
The text was updated successfully, but these errors were encountered: