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

Make verify password robust for existing deployments #1729

Merged
merged 1 commit into from
Dec 24, 2024

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Dec 24, 2024

Important

Enhance verify_password in BCryptCryptoProvider to robustly handle different bcrypt hash formats and errors.

  • Behavior:
    • Enhance verify_password in BCryptCryptoProvider to handle both base64 and raw bcrypt hash formats.
    • Check for valid bcrypt hash prefix $2b$ and adjust stored hash format accordingly.
    • Handle ValueError for invalid salt by attempting alternative hash format.
  • Error Handling:
    • Add nested try-except blocks to manage decoding and bcrypt checking errors in verify_password.

This description was created by Ellipsis for 9c3e9d8. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 9c3e9d8 in 19 seconds

More details
  • Looked at 36 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. py/core/providers/crypto/bcrypt.py:87
  • Draft comment:
    Avoid using bare except clauses. Catch specific exceptions instead, such as except (binascii.Error, ValueError):. This applies to the except block on line 43 as well.
  • Reason this comment was not posted:
    Comment was on unchanged code.

Workflow ID: wflow_xkh6DpWajiTvefcb


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit babb2ec into main Dec 24, 2024
14 checks passed
@NolanTrem NolanTrem deleted the Nolan/FixVerifyPassword branch December 24, 2024 15:31
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.

1 participant