1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-12 10:45:38 +02:00

removed double confiog and fixed shaker

This commit is contained in:
Alexander Graf 2021-06-16 22:06:28 +02:00
parent 731ce8ede9
commit 9ef8aaf698
2 changed files with 1 additions and 3 deletions

View File

@ -140,7 +140,6 @@ class ConfigManager(dict):
self.config['SESSION_STORAGE_URL'] = 'redis://{0}/3'.format(self.config['REDIS_ADDRESS'])
self.config['SESSION_COOKIE_SAMESITE'] = 'Strict'
self.config['SESSION_COOKIE_HTTPONLY'] = True
self.config['SESSION_KEY_BITS'] = 128
self.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=int(self.config['SESSION_LIFETIME']))
# update the app config itself
app.config = self

View File

@ -260,9 +260,8 @@ class MailuSessionConfig:
hash_bytes = bits//8 + (bits%8>0)
time_bytes = 4 # 32 bit timestamp for now
shaker = hashlib.shake_256 if bits>128 else hashlib.shake_128
self._shaker = shaker(want_bytes(app.config.get('SECRET_KEY', '')))
self._shaker = hashlib.shake_128(want_bytes(app.config.get('SECRET_KEY', '')))
self._hash_len = hash_bytes
self._hash_b64 = len(self._encode(bytes(hash_bytes)))
self._key_min = 2*self._hash_b64