better secmod
This commit is contained in:
parent
77d5327745
commit
283ad65a10
24 changed files with 1231 additions and 1022 deletions
|
|
@ -1,7 +1,9 @@
|
|||
open Parse_config
|
||||
|
||||
let config_filename = "mte.conf"
|
||||
let secrets_dir = Fpath.v "secrets"
|
||||
|
||||
(* TODO config
|
||||
read Fpath.t *)
|
||||
|
||||
let config_data =
|
||||
match Assets_crunch.read config_filename with
|
||||
|
|
@ -186,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
|
||||
|
|
@ -196,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
|
||||
|
||||
(* -- *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue