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.
 
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
 
Thanks in advance,
 
Jason.

Reply via email to