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

Ensure deterministic behavior on protected PDF signature #800

Merged
merged 21 commits into from
Sep 15, 2022

Conversation

bsanchezb
Copy link
Contributor

Description of the new Feature/Bugfix

This fix enables a possibility to ensure deterministic signature creation within a password-protected (encrypted) PDF document.
Before the code always generated a different random identifier in case of encrypted documents, even when overrideFileId has been provided.

Unit-Tests for the new Feature/Bugfix

  • Unit-Tests added to reproduce the bug
  • Unit-Tests added to the added feature

Compatibilities Issues

The fix does not change the original behavior, but takes into account overrideFileId for protected documents, when provided. The change does not require any modifications on user's side.

Testing details

Unit tests are added, ensuring different identifiers are computed by default, but deterministic ones when overrideFileId is provided. Unit tests also verify that the signed PDF document is still readable.
Unit tests have also been executed on our side with the fix applied.

bsanchezb and others added 14 commits September 1, 2022 10:55
Bumps `junit.version` from 5.8.2 to 5.9.0.

Updates `junit-jupiter-api` from 5.8.2 to 5.9.0
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.8.2...r5.9.0)

Updates `junit-jupiter-params` from 5.8.2 to 5.9.0
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.8.2...r5.9.0)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps maven-bundle-plugin from 5.1.6 to 5.1.8.

---
updated-dependencies:
- dependency-name: org.apache.felix:maven-bundle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](apache/maven-javadoc-plugin@maven-javadoc-plugin-3.4.0...maven-javadoc-plugin-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 10.3.1 to 10.3.3.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-10.3.1...checkstyle-10.3.3)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [mockito-core](https://github.com/mockito/mockito) from 4.6.1 to 4.8.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.6.1...v4.8.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases)
- [Commits](apache/maven-checkstyle-plugin@maven-checkstyle-plugin-3.1.2...maven-checkstyle-plugin-3.2.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps `bouncycastle.version` from 1.71 to 1.71.1.

Updates `bcprov-jdk18on` from 1.71 to 1.71.1
- [Release notes](https://github.com/bcgit/bc-java/releases)
- [Changelog](https://github.com/bcgit/bc-java/blob/master/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Updates `bcpkix-jdk18on` from 1.71 to 1.71.1
- [Release notes](https://github.com/bcgit/bc-java/releases)
- [Changelog](https://github.com/bcgit/bc-java/blob/master/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

---
updated-dependencies:
- dependency-name: org.bouncycastle:bcprov-jdk18on
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.bouncycastle:bcpkix-jdk18on
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [maven-jxr-plugin](https://github.com/apache/maven-jxr) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/apache/maven-jxr/releases)
- [Commits](apache/maven-jxr@jxr-3.2.0...jxr-3.3.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-jxr-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@asturio
Copy link
Member

asturio commented Sep 12, 2022

Hi @bsanchezb , the checkstyle problems were fixed on master. Can you please rebase your branch onto OpenPdf/master?

@sonarcloud
Copy link

sonarcloud bot commented Sep 13, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bsanchezb
Copy link
Contributor Author

@asturio , done.

@asturio asturio merged commit cc3fd97 into LibrePDF:master Sep 15, 2022
@asturio asturio added this to the 1.3.30 milestone Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants