Skip to content

fix(ssh2john): correct bcrypt rounds assignment and update exception …#5975

Open
dejanazul wants to merge 1 commit intoopenwall:bleeding-jumbofrom
dejanazul:fix-ssh2john-python3-and-logic
Open

fix(ssh2john): correct bcrypt rounds assignment and update exception …#5975
dejanazul wants to merge 1 commit intoopenwall:bleeding-jumbofrom
dejanazul:fix-ssh2john-python3-and-logic

Conversation

@dejanazul
Copy link
Copy Markdown

…handling

This commit addresses two issues in the OpenSSH private key extraction process:

  1. Exception Handling: Updated the decoding try-except block to catch binascii.Error directly, ensuring decode failures are handled gracefully in Python 3 environments.
  2. Logic Bug: Fixed a fallback assignment issue for OpenSSH bcrypt_pbkdf keys. Replaced an incorrect equality check (rounds == 16) with an assignment (rounds = 16) so that the iteration count defaults correctly when initially read as 0.

…handling

This commit addresses two issues in the OpenSSH private key extraction process:
1. Exception Handling: Updated the decoding try-except block to catch `binascii.Error` directly, ensuring decode failures are handled gracefully in Python 3 environments.
2. Logic Bug: Fixed a fallback assignment issue for OpenSSH `bcrypt_pbkdf` keys. Replaced an incorrect equality check (`rounds == 16`) with an assignment (`rounds = 16`) so that the iteration count defaults correctly when initially read as 0.
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