On 2026/10/20 06:24, Jason Tubnor wrote: > Hi, > > I've migrated a otterwiki over from FreeBSD to OpenBSD and I'm hitting: > > File > "/home/otterwiki/otterwiki/venv/lib/python3.13/site-packages/werkzeug/security.py", > line 58, in _hash_internal > hashlib.scrypt( > ^^^^^^^^^^^^^^ > AttributeError: module 'hashlib' has no attribute 'scrypt' > > I believe this is due to differences in LibreSSL and OpenSSL.
yes. > Now, I can pip install pycryptodome in a virtual environment and then add the > following to: > /home/otterwiki/otterwiki/venv/lib/python3.13/site-packages/sitecustomize.py > > > import hashlib > if not hasattr(hashlib, "scrypt"): > from Crypto.Protocol.KDF import scrypt as _cd_scrypt > def _scrypt(password, *, salt, n, r, p, maxmem=0, dklen=64): > return _cd_scrypt(password, salt, dklen, N=n, r=r, p=p) > hashlib.scrypt = _scrypt > > > This resolves this issue. But there must be a more elegant way to fix this > issue? Occurs on both 7.9 and 8.0 would be a code change for the application, but they could move to using to the maintained fork of passlib, which provides quite a nice framework https://pypi.org/project/libpass/ https://github.com/notypecheck/passlib otherwise, only by adding scrypt to libressl, really. I don't know if there are any plans for this.
