better secmod

This commit is contained in:
swrup 2026-02-21 23:32:20 +01:00
parent 1e30753ba9
commit b98a818793
18 changed files with 1166 additions and 876 deletions

View file

@ -1,8 +1,9 @@
open Parse_config
let config_filename = "mte.conf"
let secrets_dir = Fpath.v "secrets"
let secmod_dir = Fpath.(secrets_dir / "secmod")
(* TODO config
read Fpath.t *)
let config_data =
match Assets_crunch.read config_filename with
@ -187,7 +188,25 @@ module Exchange_secmod_rsa = struct
let lookahead_sign = get "lookahead_sign" |> duration
let overlap_duration = get "overlap_duration" |> duration
(* not relevant: sm_priv_key key_dir unixpath *)
let duration = get "duration" |> duration
let key_dir = get "key_dir"
let sm_priv_key = get "sm_priv_key"
(* only support one rsa_keysize *)
let rsa_keysize =
Coin.all_coins
|> List.map (fun coin -> coin.Coin.rsa_keysize)
|> List.sort_uniq Int.compare
|> function
| [] -> fail "no coin section found"
| a :: b :: _ ->
fail
"coins with different rsa_keysize are not supported, found \
rsa_keysize = %d and %d"
a b
| n :: [] -> n
let sections = Coin.all_coins |> List.map (fun coin -> coin.Coin.section_name)
end
module Exchange_secmod_eddsa = struct
@ -197,6 +216,9 @@ module Exchange_secmod_eddsa = struct
let lookahead_sign = get "lookahead_sign" |> duration
let overlap_duration = get "overlap_duration" |> duration
let duration = get "duration" |> duration
let key_dir = get "key_dir"
let sm_priv_key = get "sm_priv_key"
end
(* -- *)