Commit 72f1ebf2 authored by Stephane Glondu's avatar Stephane Glondu

Do no longer rely on Ocsipersist for partial decryptions

parent 84d53590
......@@ -88,14 +88,14 @@ let get_election_date kind uuid =
| `Archive -> return dates.e_archive
| `LastMail -> return dates.e_last_mail
let election_pds = Ocsipersist.open_table "election_pds"
let get_partial_decryptions x =
try%lwt Ocsipersist.find election_pds (raw_string_of_uuid x)
with Not_found -> return []
let set_partial_decryptions x pds =
Ocsipersist.add election_pds (raw_string_of_uuid x) pds
let get_partial_decryptions uuid =
match%lwt read_file ~uuid "partial_decryptions.json" with
| Some [x] -> return @@ partial_decryptions_of_string x
| _ -> return []
let set_partial_decryptions uuid pds =
write_file ~uuid "partial_decryptions.json"
[string_of_partial_decryptions pds]
let get_raw_election uuid =
match%lwt read_file ~uuid "election.json" with
......
......@@ -36,8 +36,8 @@ type election_date =
val get_election_date : election_date -> uuid -> datetime option Lwt.t
val set_election_date : election_date -> uuid -> datetime -> unit Lwt.t
val get_partial_decryptions : uuid -> (int * string) list Lwt.t
val set_partial_decryptions : uuid -> (int * string) list -> unit Lwt.t
val get_partial_decryptions : uuid -> partial_decryptions Lwt.t
val set_partial_decryptions : uuid -> partial_decryptions -> unit Lwt.t
val get_auth_config : uuid -> (string * (string * string list)) list Lwt.t
......
......@@ -82,6 +82,8 @@ type election_state =
| Archived
]
type partial_decryptions = (int * string) list
(** {1 Types related to elections being prepared} *)
type draft_voter = {
......
......@@ -253,7 +253,7 @@ let delete_sensitive_data uuid =
let uuid_s = raw_string_of_uuid uuid in
let%lwt () = cleanup_file (!spool_dir / uuid_s / "state.json") in
let%lwt () = cleanup_table ~uuid_s "site_tokens_decrypt" in
let%lwt () = cleanup_table ~uuid_s "election_pds" in
let%lwt () = cleanup_file (!spool_dir / uuid_s / "partial_decryptions.json") in
let%lwt () = cleanup_file (!spool_dir / uuid_s / "extended_records.jsons") in
let%lwt () = cleanup_file (!spool_dir / uuid_s / "credential_mappings.jsons") in
let%lwt () = rmdir (!spool_dir / uuid_s / "ballots") in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment