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

Add support for adapted base64 #150

Closed
Firstyear opened this issue Nov 23, 2020 · 4 comments
Closed

Add support for adapted base64 #150

Firstyear opened this issue Nov 23, 2020 · 4 comments

Comments

@Firstyear
Copy link

Python passlib [0] previously used their own variant of base64 configuration with the character '+' replaced with '.' and no padding. Passlib is attempting to deprecate and remove this, but unfortunately other opensource projects such as OpenLDAP have adopted this scheme for their PBKDF2 password hashing plugins.

It would be good to have support for this for these legacy applications.

https://foss.heptapod.net/python-libs/passlib/-/blob/branch/stable/passlib/utils/binary.py#L185

@marshallpierce
Copy link
Owner

My condolences for whatever path has brought you in contact with Yet Another Weird Nonstandard Base64 Flavor. ;)

I'll try to add this in the next release, which should happen shortly as soon as I review the extant PRs.

@Firstyear
Copy link
Author

Firstyear commented Nov 25, 2020

Thank you, I really appreciate it. It's annoying to ask but is it possible to allow '+' and '.' an equivalents in the one flavor? It's unfortunately appears that Passlib and OpenLDAP accept both for compatibility, and may even emit standard .... sigh

edit: it looks also like python base64 allows trailing bits to be true by default as well if that matters for the construction of a config.

@marshallpierce
Copy link
Owner

I'm working on adding support for user-specified custom character sets, which should address this. As for supporting multiple variants, it should be feasible to simply do a find-and-replace on the input text to normalize the base64.

I disagree with Python about many things, including their choice to allow stray trailing bits by default. :)

@marshallpierce
Copy link
Owner

Fixed in #157.

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

No branches or pull requests

2 participants