Commit e621c601 authored by Stephane Glondu's avatar Stephane Glondu

Check presence of voters before generating credentials on server

parent 69627b1d
...@@ -784,8 +784,11 @@ let () = ...@@ -784,8 +784,11 @@ let () =
Any.register Any.register
~service:election_setup_credentials_server ~service:election_setup_credentials_server
(handle_setup (fun se () _ uuid -> (handle_setup (fun se () _ uuid ->
if List.length se.se_voters > !maxmailsatonce then let nvoters = List.length se.se_voters in
if nvoters > !maxmailsatonce then
Lwt.fail (Failure (Printf.sprintf "Cannot send credentials, there are too many voters (max is %d)" !maxmailsatonce)) Lwt.fail (Failure (Printf.sprintf "Cannot send credentials, there are too many voters (max is %d)" !maxmailsatonce))
else if nvoters = 0 then
Lwt.fail (Failure "No voters")
else else
if se.se_public_creds_received then forbidden () else if se.se_public_creds_received then forbidden () else
let () = se.se_metadata <- {se.se_metadata with let () = se.se_metadata <- {se.se_metadata with
......
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