wip fix FAT

This commit is contained in:
swrup 2026-03-14 20:48:42 +01:00
parent 67e09d38b6
commit a1a9d698b0
5 changed files with 21 additions and 15 deletions

View file

@ -4,7 +4,7 @@ vendor_list := \
x509 vifu cachet mfat caqti \ x509 vifu cachet mfat caqti \
base32 cohttp mirage-mtime mirage-ptime base32 cohttp mirage-mtime mirage-ptime
secmod_fat=secrets/secmod.fat secmod_fat=assets/secmod.fat
tap_device=tap0 tap_device=tap0
check-kvm: check-kvm:
@ -44,8 +44,8 @@ clean:
rm -rf vendors/ rm -rf vendors/
# todo: don't erase already existing # todo: don't erase already existing
secmod-storage: secmod.fat:
@mkdir -p secrets @mkdir -p assets
mfat make --sectors=2048 $(secmod_fat) mfat make --sectors=2048 $(secmod_fat)
assets: assets:

View file

@ -43,15 +43,11 @@ config = "pgx://mte:hunter2@10.0.0.1:5432/taler-exchange"
lookahead_sign = "7 weeks" lookahead_sign = "7 weeks"
overlap_duration = "1 hour" overlap_duration = "1 hour"
duration = "3 weeks" duration = "3 weeks"
key_dir = "secrets/secmod_rsa"
sm_priv_key = "secrets/secmod_rsa/sm_key"
[taler-exchange-secmod-eddsa] [taler-exchange-secmod-eddsa]
lookahead_sign = "1 year" lookahead_sign = "1 year"
overlap_duration = "1 hour" overlap_duration = "1 hour"
duration = "3 weeks" duration = "3 weeks"
key_dir = "secrets/secmod_eddsa"
sm_priv_key = "secrets/secmod_eddsa/sm_key"
[coin_kudo_1] [coin_kudo_1]
value= KUDOS:0.01 value= KUDOS:0.01

View file

@ -218,8 +218,10 @@ module Exchange_secmod_rsa = struct
let lookahead_sign = get "lookahead_sign" |> duration let lookahead_sign = get "lookahead_sign" |> duration
let overlap_duration = get "overlap_duration" |> duration let overlap_duration = get "overlap_duration" |> duration
let key_dir = get "key_dir"
let sm_priv_key = get "sm_priv_key" (* 8.3 filenames for FAT *)
let key_dir = "secmod_rsa"
let sm_priv_key = "secmod_rsa/sm_key"
end end
module Exchange_secmod_eddsa = struct module Exchange_secmod_eddsa = struct
@ -230,8 +232,8 @@ module Exchange_secmod_eddsa = struct
let lookahead_sign = get "lookahead_sign" |> duration let lookahead_sign = get "lookahead_sign" |> duration
let overlap_duration = get "overlap_duration" |> duration let overlap_duration = get "overlap_duration" |> duration
let duration = get "duration" |> duration let duration = get "duration" |> duration
let key_dir = get "key_dir" let key_dir = "secmod_eddsa"
let sm_priv_key = get "sm_priv_key" let sm_priv_key = "secmod_eddsa/sm_key"
end end
(* -- *) (* -- *)

View file

@ -58,7 +58,11 @@ let key_fpath k =
let read_key fs fpath = let read_key fs fpath =
Log.debug (fun m -> m "reading key file `%a`" Fpath.pp fpath); Log.debug (fun m -> m "reading key file `%a`" Fpath.pp fpath);
let fpath = Fpath.to_string fpath in let fpath = Fpath.to_string fpath in
let* data = Fat.read fs fpath |> unwrap_msg in let* data =
Fat.read fs fpath |> function
| Error (`Msg _e) -> Error "uhuh read_keay"
| Ok v -> Ok v
in
EddsaPrivateKey.of_octets data EddsaPrivateKey.of_octets data
let write_eddsa fs fpath priv = let write_eddsa fs fpath priv =
@ -84,11 +88,15 @@ let delete_file fs fpath =
() ()
let get_key_dir_contents fs dir = let get_key_dir_contents fs dir =
Log.debug (fun m -> m "get_key_dir_contents `%s`" dir);
let* dir = Fpath.of_string dir |> unwrap_msg in let* dir = Fpath.of_string dir |> unwrap_msg in
let dir = Fpath.to_string dir in let dir = Fpath.to_string dir in
let dir = String.uppercase_ascii dir in
let dir = "/" ^ dir in
let* () = Fat.mkdir fs dir |> unwrap_msg in let* () = Fat.mkdir fs dir |> unwrap_msg in
Log.info (fun m -> m "created directory `%s`" dir); Log.debug (fun m -> m "created directory `%s`" dir);
let+ l = Fat.ls fs dir |> unwrap_msg in let+ l = Fat.ls fs dir |> unwrap_msg in
Log.debug (fun m -> m "ls ok --");
(* List.map Fpath.normalize l *) (* List.map Fpath.normalize l *)
let l = List.map (fun entry -> entry.Fat.name) l in let l = List.map (fun entry -> entry.Fat.name) l in
let l = List.map Fpath.v l in let l = List.map Fpath.v l in

View file

@ -54,8 +54,8 @@ module Log_reporter = struct
() ()
let setup () = let setup () =
(*set_level_secmods (Some Logs.Debug);*) set_level_secmods (Some Logs.Debug);
let level = Some Logs.Info in let level = Some Logs.Debug in
Logs.set_level ~all:false level; Logs.set_level ~all:false level;
Logs.Src.set_level Logs.default level; Logs.Src.set_level Logs.default level;
Logs.set_reporter reporter; Logs.set_reporter reporter;