From 56ce27c46de0f43426f7cbbb49386dd15e8688e6 Mon Sep 17 00:00:00 2001 From: Leandro Ostera Date: Mon, 20 Nov 2023 09:16:42 +0100 Subject: [PATCH] fix: initialize rng --- sihl/src/dune | 2 +- sihl/src/web_csrf.ml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sihl/src/dune b/sihl/src/dune index f3e41766..4c432250 100644 --- a/sihl/src/dune +++ b/sihl/src/dune @@ -4,7 +4,7 @@ (libraries sexplib fmt fmt.tty logs logs.fmt lwt lwt.unix tsort conformist base64 yojson ppx_deriving_yojson.runtime safepass ptime ptime.clock.os jwto uuidm opium caqti-lwt caqti-lwt.unix str dune-build-info bos - containers mirage-crypto mirage-crypto-rng cstruct) + containers mirage-crypto mirage-crypto-rng mirage-crypto-rng.unix cstruct) (preprocess (pps ppx_fields_conv ppx_deriving_yojson ppx_deriving.eq ppx_deriving.show ppx_deriving.make ppx_sexp_conv lwt_ppx))) diff --git a/sihl/src/web_csrf.ml b/sihl/src/web_csrf.ml index 5c17360d..73cdd7c3 100644 --- a/sihl/src/web_csrf.ml +++ b/sihl/src/web_csrf.ml @@ -33,6 +33,7 @@ let set token req = *) module Crypto = struct + let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna) let block_size = 16 (** [token_length] is the amount of bytes used in the unencrypted CSRF tokens. *)