This commit is contained in:
swrup 2026-02-20 12:59:53 +01:00
parent 0bacf492ab
commit d9f8e3c558
2 changed files with 19 additions and 7 deletions

View file

@ -114,8 +114,7 @@ let gen_additional_keys_until_lookahead ~now ~section_name l =
let new_keys =
List.map
(fun (t1, t2) ->
(* TODO ~bits is in coin's config *)
let priv, pub = RsaPrivateKey.generate ~bits:2048 () in
let priv, pub = RsaPrivateKey.generate ~bits:Cfg.rsa_keysize () in
{ section_name; priv; pub; t1; t2 })
periodes
in
@ -147,11 +146,8 @@ let load_section section_name =
let keys = List.filter_map Fun.id l in
Ok keys
(* TODO read from config *)
let sections = []
let load () =
let* keys_l = list_map load_section sections in
let* keys_l = list_map load_section Cfg.sections in
let keys = List.concat keys_l in
match keys with
| [] -> Ok None
@ -182,7 +178,7 @@ let init () =
List.filter (fun k -> k.section_name = section_name) all_keys
in
gen_additional_keys_until_lookahead ~now ~section_name keys)
sections
Cfg.sections
in
let new_keys = List.concat new_keys_l in
let () = List.iter (fun k -> Hashtbl.replace t.ht k.pub k) new_keys in