8000 pdf2john.py: fix compatibility with current pyhanko versions by exploide · Pull Request #5790 · openwall/john · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pdf2john.py: fix compatibility with current pyhanko versions #5790

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

exploide
Copy link
Contributor
@exploide exploide commented Jun 19, 2025

See #5788

The actual change for compatibility was easy. But while I was at it, I improved the script's resilience with non-pdf files and unencrypted pdf files.

Produces the same output as before on john-samples/**.pdf.

improved resilience with non-pdf files and unencrypted pdf files
print("pyhanko is missing, run 'pip install --user pyhanko==0.20.1' to install it!")
exit(1)
print("pyhanko is missing, run 'pip install --user pyhanko' to install it!", file=sys.stderr)
sys.exit(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, we also have uses of plain exit in a few other scripts:

apop2john.py:    exit(1)
apop2john.py:    exit(1)
authenticator2john.py:    exit(1)
authenticator2john.py:        exit(1)
bestcryptve2john.py:        exit(0)
bitlocker2john.py:            exit()
kdcdump2john.py:    exit()
mosquitto2john.py:            exit(1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could fix them. But these are rather minor linting issues and many scripts produce several linting issues. Too many to go over everything in every script. So tackling exactly the exit() issue would feel a bit random and not very important.

@solardiz
Copy link
Member

Thank you @exploide!

@solardiz solardiz merged commit ac8cbd0 into openwall:bleeding-jumbo Jun 20, 2025
32 of 33 checks passed
@exploide exploide deleted the pdf2john-pyhanko-update branch June 22, 2025 15:44
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.

2 participants
0