Skip to content
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

Second digital signature invalidates the first one #4

Closed
ugochirico opened this issue Aug 12, 2022 · 3 comments
Closed

Second digital signature invalidates the first one #4

ugochirico opened this issue Aug 12, 2022 · 3 comments
Labels
bug Something isn't working feedback pending A feedback is pending

Comments

@ugochirico
Copy link

When you apply a second digital signature to a pdf that already has a digital signature, the first one is invalidated, this digital signature is not more valid and adobe reader says "the document has been modified after the digital signature".

This happens because the incremental update doesn't work correctly.

@ceztko
Copy link
Contributor

ceztko commented Aug 17, 2022

The incremental update mechanism is a complex beast and there are many bugs in legacy PoDoDo. In my tests, the main reason the previous signatures invalidates after the following one is that the incremental update unnecessarily rewrites several objects of the previous revision. The objects may be rewritten without changes but Acrobat Reader decides this is a violation of the restrictions that are imposed in incremental updates to consider previous signatures as valid. With this regard, PoDoFo was buggy/lacking in these areas:

  • Handling of XRef entries for in use/free objects during incremental updates;
  • Correct tracking of dirty flags in objects after document load or when manipulating it;
  • Support of XRef streams in incremental updates.

All of these areas were taken care in pdfmm in several commits through the last 2-3 years. Here it follows an incomplete list:

This probably means that there's no simple fix for the kind of issue you're seeing, not at least in the general case. One option would be (keep trying?) using pdfmm, or wait for PoDoFo-next to be introduced, which should be a matter of weeks[1], and trying to see if this fixes the issue for you. Other options is looking through the list of commits I wrote here to look if you can craft a fix yourself, or find other maintainers interested in looking through this issue in 0.9.x. As I previously clarified with the community, I won't look through 0.9.x code.

[1] https://www.mail-archive.com/podofo-users@lists.sourceforge.net/msg04855.html

@ceztko
Copy link
Contributor

ceztko commented Jan 10, 2023

PoDoFo-next (soon it will be 0.10) is now up and I recommend retry the issue with it for correct working. Please read carefully the FAQ, which are now currently 100% focused on signing.

@ceztko ceztko added the feedback pending A feedback is pending label Jan 17, 2023
@ceztko ceztko added the bug Something isn't working label Mar 24, 2023
@ceztko
Copy link
Contributor

ceztko commented Mar 24, 2023

The issue is probably fixed in 0.10.0. If it's not, please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback pending A feedback is pending
Projects
None yet
Development

No branches or pull requests

2 participants