Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Encrypt raw password, not HMAC of password. #376

Closed
wants to merge 3 commits into from
Closed

Encrypt raw password, not HMAC of password. #376

wants to merge 3 commits into from

Conversation

longhotsummer
Copy link

This passes passwords directly to passlib's CryptContext
methods and relies on it to do the hard work.

For backwards compatibility we fall back to trying the old HMAC approach
when verifying passwords, but only if a salt has been set. Legacy passwords
are updated upon check.

Previously, we passed the HMAC'd password to passlib, which meant that
we weren't compatible with other users of passlib (such as Django) or
the Modular Crypt Format at
https://pythonhosted.org/passlib/modular_crypt_format.html

Fixes #320

This passes passwords directly to passlib's CryptContext
methods and relies on it to do the hard work.

For backwards compatibility we fall back to trying the old HMAC approach
when verifying passwords, but only if a salt has been set.

Previously, we passed the HMAC'd password to passlib, which meant that
we weren't compatible with other users of passlib (such as Django) or
the Modular Crypt Format at
https://pythonhosted.org/passlib/modular_crypt_format.html

Fixes #320
@longhotsummer
Copy link
Author

I'd like to get feedback on this before going through and updating the docs.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.14%) to 94.72% when pulling 273cac0 on longhotsummer:no-hmac into c7d0ea9 on mattupstate:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.14%) to 94.72% when pulling 273cac0 on longhotsummer:no-hmac into c7d0ea9 on mattupstate:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.14%) to 94.72% when pulling 50b17fb on longhotsummer:no-hmac into c7d0ea9 on mattupstate:develop.

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

Successfully merging this pull request may close these issues.

having hmac required makes supporting legacy passwords w/o hmac impossible
3 participants