This commit is contained in:
swrup 2026-02-26 18:15:55 +01:00
parent 9c948327c1
commit 3f73149816

View file

@ -165,8 +165,7 @@ module Auditors = struct
() ()
| Some auditor -> | Some auditor ->
if Timestamp.geq auditor.last_change validity_start then if Timestamp.geq auditor.last_change validity_start then
Error Error "replay attack on enable-auditor"
"database has more recent auditor data for this auditor public key"
else else
let+ () = Pg.update_auditor db_conn auditor |> unwrap_err_caqti in let+ () = Pg.update_auditor db_conn auditor |> unwrap_err_caqti in
Logs.info (fun m -> m "updated auditor"); Logs.info (fun m -> m "updated auditor");
@ -201,8 +200,7 @@ module Auditors_disable = struct
| None -> Error "auditor not found" | None -> Error "auditor not found"
| Some auditor -> ( | Some auditor -> (
if Timestamp.geq auditor.last_change validity_end then if Timestamp.geq auditor.last_change validity_end then
Error Error "replay attack on disable-auditor"
"database has more recent auditor data for this auditor public key"
else else
match auditor.is_active with match auditor.is_active with
| false -> | false ->
@ -454,7 +452,7 @@ module Wire = struct
() ()
| Some (wire, _is_active, last_change) -> | Some (wire, _is_active, last_change) ->
if Timestamp.geq last_change validity_start then if Timestamp.geq last_change validity_start then
Error "database has more recent wire data" Error "replay attack on enable-wire"
else else
let+ () = let+ () =
Pg.update_wire db_conn ~is_active:true ~last_change:validity_start Pg.update_wire db_conn ~is_active:true ~last_change:validity_start
@ -493,7 +491,7 @@ module Wire_disable = struct
| None -> Error "wire not found" | None -> Error "wire not found"
| Some (wire, _is_active, last_change) -> | Some (wire, _is_active, last_change) ->
if Timestamp.geq last_change validity_end then if Timestamp.geq last_change validity_end then
Error "database has more recent wire data" Error "replay attack on disable-wire"
else else
let+ () = let+ () =
Pg.update_wire db_conn ~is_active:false ~last_change:validity_end Pg.update_wire db_conn ~is_active:false ~last_change:validity_end