different verify for master sigs

This commit is contained in:
swrup 2026-02-21 21:32:18 +01:00
parent 37ed47326a
commit 45df994c13
5 changed files with 108 additions and 138 deletions

View file

@ -12,11 +12,6 @@ module Make (Conn : Pg.CONN) = struct
let conn = (module Conn : Pg.CONN)
(* - *)
let master_pub = Config.Exchange.master_public_key
let secmod_eddsa_pub = Sm_eddsa.sm_pub
let secmod_rsa_pub = Sm_rsa.sm_pub
(* TODO
error "key not found", either:
- we tried to sign with a key that is not ours
@ -37,7 +32,8 @@ module Make (Conn : Pg.CONN) = struct
let find_denomination h_pub = Pg.find_denom conn h_pub |> unwrap_err_caqti
(* TODO
check if database is coherent with secmod *)
check if database is coherent with secmod
=> have something to run independent tests with clean db+sm *)
let signkeys () : Signkey.t list result =
let now = Timestamp.of_ptime @@ Ptime_clock.now () in
Pg.get_active_signkeys conn ~now |> unwrap_err_caqti
@ -173,6 +169,19 @@ module Make (Conn : Pg.CONN) = struct
in
List.filter_map Fun.id l
let make_future_keys_response () =
let* future_signkeys = future_signkeys () in
let* future_denoms = future_denominations () in
Ok
Api.FutureKeysResponse.
{
future_denoms;
future_signkeys;
master_pub= Config.Exchange.master_public_key;
denom_secmod_public_key= Sm_rsa.sm_pub;
signkey_secmod_public_key= Sm_eddsa.sm_pub;
}
let sk_of_future_sk future_sk master_sig =
let Api.FutureSignKey.
{ key; stamp_start; stamp_expire; stamp_end; signkey_secmod_sig= _ } =