vmmc_bistro: validity starts at now - 10

This commit is contained in:
Hannes Mehnert 2019-03-02 21:29:51 +01:00
parent 752536c38f
commit dce477a01e
1 changed files with 6 additions and 3 deletions

View File

@ -22,9 +22,12 @@ let key_ids pub issuer =
let timestamps validity =
let now = Ptime_clock.now () in
match Ptime.add_span now (Ptime.Span.of_int_s validity) with
| None -> invalid_arg "span too big - reached end of ptime"
| Some exp -> (now, exp)
match
Ptime.sub_span now (Ptime.Span.of_int_s 10),
Ptime.add_span now (Ptime.Span.of_int_s validity)
with
| None, _ | _, None -> invalid_arg "span too big - reached end of ptime"
| Some now, Some exp -> (now, exp)
let handle (host, port) cert key ca id (cmd : Vmm_commands.t) =
Vmm_lwt.read_from_file cert >>= fun cert_cs ->