This commit is contained in:
parent
ef99df55a4
commit
8a145a4f98
2 changed files with 10 additions and 9 deletions
|
|
@ -1,6 +1,4 @@
|
||||||
let src = Logs.Src.create "mte.secmod_eddsa"
|
module Log = (val Logs.src_log (Logs.Src.create "mte.secmod_eddsa") : Logs.LOG)
|
||||||
|
|
||||||
module Log = (val Logs.src_log src : Logs.LOG)
|
|
||||||
open Syntax
|
open Syntax
|
||||||
open Crypto
|
open Crypto
|
||||||
open Time
|
open Time
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
(* TODO refacto common parts with secmod_eddsa *)
|
(* TODO refacto common parts with secmod_eddsa *)
|
||||||
|
module Log = (val Logs.src_log (Logs.Src.create "mte.secmod_rsa") : Logs.LOG)
|
||||||
open Syntax
|
open Syntax
|
||||||
open Crypto
|
open Crypto
|
||||||
open Time
|
open Time
|
||||||
|
|
@ -67,11 +68,12 @@ let write_rsa fpath priv =
|
||||||
|
|
||||||
let write_key k = write_rsa (key_fpath k) k.priv
|
let write_key k = write_rsa (key_fpath k) k.priv
|
||||||
|
|
||||||
let delete_key_file k =
|
let delete_file fpath =
|
||||||
let+ () =
|
Log.debug (fun m -> m "(disabled) delete key file `%a`" Fpath.pp fpath);
|
||||||
Bos.OS.File.delete ~must_exist:true (key_fpath k) |> unwrap_err_msg
|
(* TODO just to be safe~~
|
||||||
in
|
let+ () = Bos.OS.File.delete ~must_exist:true fpath |> unwrap_err_msg in
|
||||||
()
|
*)
|
||||||
|
Ok ()
|
||||||
|
|
||||||
let get_key_dir_contents dir_fpath =
|
let get_key_dir_contents dir_fpath =
|
||||||
let* b = Bos.OS.Dir.create ~mode:0o700 dir_fpath |> unwrap_err_msg in
|
let* b = Bos.OS.Dir.create ~mode:0o700 dir_fpath |> unwrap_err_msg in
|
||||||
|
|
@ -202,7 +204,8 @@ module Make () = struct
|
||||||
|
|
||||||
let delete pub =
|
let delete pub =
|
||||||
let* k = find pub in
|
let* k = find pub in
|
||||||
Hashtbl.remove t.ht k.pub; delete_key_file k
|
Hashtbl.remove t.ht k.pub;
|
||||||
|
delete_file (key_fpath k)
|
||||||
|
|
||||||
let _delete_outdated ~now =
|
let _delete_outdated ~now =
|
||||||
Hashtbl.to_seq_values t.ht
|
Hashtbl.to_seq_values t.ht
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue