Skip to content

Commit f037063

Browse files
committed
Catch exception when blinding fails
If there is some invalid session_id it could result in sodium failing the blinding calculation; in such a case just warn and skip it.
1 parent 150d8ab commit f037063

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sogs/db.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ def check_needs_blinding(dbconn):
218218
""",
219219
dbconn=dbconn,
220220
):
221-
pos_derived = crypto.compute_blinded_abs_id(sid)
221+
try:
222+
pos_derived = crypto.compute_blinded_abs_id(sid)
223+
except Exception as e:
224+
logging.warning(f"Failed to blind session_id {sid}: {e}")
225+
continue
226+
222227
query(
223228
'INSERT INTO needs_blinding (blinded_abs, "user") VALUES (:blinded, :uid)',
224229
blinded=pos_derived,

0 commit comments

Comments
 (0)