Commit 3ac4f27d authored by Stephane Glondu's avatar Stephane Glondu Committed by Stéphane Glondu

Check group membership of signature verification key more often

parent 8f989459
......@@ -535,6 +535,7 @@ module Make (W : ELECTION_DATA) (M : RANDOM) = struct
| Some {s_public_key = y; s_challenge; s_response} ->
let zkp = G.to_string y in
let ok =
G.check y &&
check_modulo q s_challenge &&
check_modulo q s_response &&
let commitment = g **~ s_response *~ y **~ s_challenge in
......
......@@ -105,7 +105,13 @@ module Make (P : PARSED_PARAMS) : S = struct
let public_creds = lazy (
get_public_creds () |> Option.map (fun creds ->
let res = ref GSet.empty in
Stream.iter (fun x -> res := GSet.add (G.of_string x) false !res) creds;
Stream.iter
(fun x ->
let y = G.of_string x in
if not (G.check y) then
Printf.ksprintf failwith "%s is not a valid public credential" x;
res := GSet.add y false !res
) creds;
res
)
)
......
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