Use SHA256 for more secure session association

This commit is contained in:
R. Miles McCain 2020-06-28 17:55:59 +00:00
parent f464a7ee67
commit 1a7594be93
No known key found for this signature in database
GPG Key ID: F1053629E2905557

View File

@ -1,7 +1,7 @@
import ipaddress import ipaddress
import json import json
import logging import logging
from hashlib import sha1 from hashlib import sha256
import geoip2.database import geoip2.database
import user_agents import user_agents
@ -73,7 +73,7 @@ def ingress_request(
if payload.get("loadTime", 1) <= 0: if payload.get("loadTime", 1) <= 0:
payload["loadTime"] = None payload["loadTime"] = None
association_id_hash = sha1() association_id_hash = sha256()
association_id_hash.update(str(ip).encode("utf-8")) association_id_hash.update(str(ip).encode("utf-8"))
association_id_hash.update(str(user_agent).encode("utf-8")) association_id_hash.update(str(user_agent).encode("utf-8"))
session_cache_path = ( session_cache_path = (