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

Fixes bluebeam password protection issue #6531

Merged
merged 1 commit into from
Oct 16, 2015

Conversation

covlllp
Copy link

@covlllp covlllp commented Oct 15, 2015

Fixes issue where a pdf will have a user password but no owner password. Previously, pdf.js will still show the pdf even though no password was given. Now, it checks that a password was given and that it matches either the user or owner password.

@timvandermeij
Copy link
Contributor

Do you have an example PDF file? It would be nice if it can be included as a test case too.

@covlllp
Copy link
Author

covlllp commented Oct 15, 2015

https://www.dropbox.com/sh/e2v70szpauyjqvr/AACAYFqtfSPKdzrzI3FdBp9La?dl=0&s=so

Both passwords are asdfasdf.

  • bluesbrothers.pdf has both a user and owner password.
  • bluebeam-enc-test-256.pdf only has a user password (owner password is null).

@timvandermeij
Copy link
Contributor

Thank you for providing the test PDF. Could you add it to this PR in a similar way as in 27c8291? Essentially you put the bluebeam-enc-test-256.pdf file in test/pdfs as pr6531.pdf (such that we can easily trace it back to this PR), you exclude it in the .gitignore file and you add an entry for it in the test manifest file (just copy that one and alter the values). That way the test bot will run the test and make sure that future changes do not break this case.

Finally I'm not sure how we should format this line of code. Having all these parameters below each other on new lines and not aligned does not look great to me. Perhaps @Snuffleupagus, @yurydelendik or @brendandahl has a suggestion for formatting this in a more readable way?

@brendandahl
Copy link
Contributor

Thank you for providing the test PDF. Could you add it to this PR in a similar way as in 27c8291? Essentially you put the bluebeam-enc-test-256.pdf

I'm not sure the test harness will work for this case, we want to show that the pdf won't render with a blank password. With a blank password I think it will error out. A unit test would probably work, but I'm fine with doing that in a follow up.

Finally I'm not sure how we should format this line of code.

Nothing look good here with our short line limit, but lining the args up with the dot looks like we're chaining. Let's indent by two spaces e.g. https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L1664

@timvandermeij
Copy link
Contributor

That seems reasonable to me. Let's just indent the arguments with two more spaces (instead of aligning them with the dot) for readability. That will probably cause a new commit, so please squash the commits into one after you're done using the steps in https://github.com/mozilla/pdf.js/wiki/Squashing-Commits.

@covlllp
Copy link
Author

covlllp commented Oct 16, 2015

I updated the branch to match your preferred styling. Let me know if you need any further changes made.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/0fcac4eacbb2d34/output.txt

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/ffbef61bd43fff6/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/6c5e861f679eacb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/6c5e861f679eacb/output.txt

Total script time: 18.69 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/ffbef61bd43fff6/output.txt

Total script time: 60.00 mins

@brendandahl
Copy link
Contributor

/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://107.21.233.14:8877/0b38105a6d87917/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/0b38105a6d87917/output.txt

Total script time: 0.65 mins

  • Font tests: FAILED
  • Unit tests: FAILED
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/0b38105a6d87917/reftest-analyzer.html#web=eq.log

@brendandahl
Copy link
Contributor

Firefox is having issues updating on linux again, hopefully it resolved for the time being.
/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://107.21.233.14:8877/144f1f69b1ffc13/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Failed

Full output at http://107.21.233.14:8877/144f1f69b1ffc13/output.txt

Total script time: 6.71 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://107.21.233.14:8877/144f1f69b1ffc13/reftest-analyzer.html#web=eq.log

@brendandahl
Copy link
Contributor

This PR is probably good to merge, but the linux bot is still having issues. Now chrome seems to be leaving several processes behind. Looking into it more in #6508, so I don't generate more noise here.

@brendandahl
Copy link
Contributor

/botio-linux test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @brendandahl received. Current queue size: 0

Live output at: http://107.21.233.14:8877/28ed2425d5561aa/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/28ed2425d5561aa/output.txt

Total script time: 19.98 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

brendandahl added a commit that referenced this pull request Oct 16, 2015
Fixes bluebeam password protection issue
@brendandahl brendandahl merged commit e4f0e6f into mozilla:master Oct 16, 2015
@brendandahl
Copy link
Contributor

Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants