From 9e8591e0d9749de08a011084a4462f4f17c7e747 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Sun, 5 Feb 2023 22:19:18 +0100 Subject: [PATCH] update to mirage-crypto-rng 0.11.0 API --- awa.opam | 2 +- test/awa_gen_key.ml | 2 +- test/awa_lwt_server.ml | 2 +- test/awa_test_client.ml | 2 +- test/awa_test_server.ml | 2 +- test/test.ml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/awa.opam b/awa.opam index ab865db..5f87c66 100644 --- a/awa.opam +++ b/awa.opam @@ -19,7 +19,7 @@ depends: [ "ppx_sexp_conv" "ppx_cstruct" "mirage-crypto" {>= "0.8.1"} - "mirage-crypto-rng" + "mirage-crypto-rng" {>= "0.11.0"} "mirage-crypto-pk" "mirage-crypto-ec" {>= "0.10.0"} "x509" {>= "0.15.2"} diff --git a/test/awa_gen_key.ml b/test/awa_gen_key.ml index e2a7872..65a3d00 100644 --- a/test/awa_gen_key.ml +++ b/test/awa_gen_key.ml @@ -1,6 +1,6 @@ let gen_key seed typ = - Mirage_crypto_rng_unix.initialize (); + Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); let b64s x = Cstruct.to_string x |> Base64.encode_string in let seed = match seed with | None -> b64s (Mirage_crypto_rng.generate 30) diff --git a/test/awa_lwt_server.ml b/test/awa_lwt_server.ml index b805fbe..71da2f9 100644 --- a/test/awa_lwt_server.ml +++ b/test/awa_lwt_server.ml @@ -63,7 +63,7 @@ let rec wait_connection priv_key listen_fd server_port = wait_connection priv_key listen_fd server_port let main = - Mirage_crypto_rng_unix.initialize (); + Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); let g = Mirage_crypto_rng.(create ~seed:(Cstruct.of_string "180586") (module Fortuna)) in let (ec_priv,_) = Mirage_crypto_ec.Ed25519.generate ~g () in let priv_key = Awa.Hostkey.Ed25519_priv (ec_priv) in diff --git a/test/awa_test_client.ml b/test/awa_test_client.ml index 20e9383..5917409 100644 --- a/test/awa_test_client.ml +++ b/test/awa_test_client.ml @@ -39,7 +39,7 @@ let write_cstruct fd buf = let jump _ user seed typ keyfile authenticator host port = let ( let* ) = Result.bind in - Mirage_crypto_rng_unix.initialize (); + Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); let fd = Unix.(socket PF_INET SOCK_STREAM 0) in Unix.(connect fd (ADDR_INET (inet_addr_of_string host, port))); match diff --git a/test/awa_test_server.ml b/test/awa_test_server.ml index 30cda10..b25e639 100644 --- a/test/awa_test_server.ml +++ b/test/awa_test_server.ml @@ -136,7 +136,7 @@ let rec wait_connection priv_key listen_fd server_port = wait_connection priv_key listen_fd server_port let () = - Mirage_crypto_rng_unix.initialize (); + Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); let g = Mirage_crypto_rng.(create ~seed:(Cstruct.of_string "180586") (module Fortuna)) in let (ec_priv,_) = Mirage_crypto_ec.Ed25519.generate ~g () in let priv_key = Awa.Hostkey.Ed25519_priv (ec_priv) in diff --git a/test/test.ml b/test/test.ml index f26cd24..bf54dc2 100644 --- a/test/test.ml +++ b/test/test.ml @@ -608,7 +608,7 @@ let all_tests = [ ] let _ = - Mirage_crypto_rng_unix.initialize (); + Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna); Sys.set_signal Sys.sigalrm (Sys.Signal_handle (fun _ -> failwith "timeout")); Unix.chmod "data/awa_test_rsa" 0o600; List.iter run_test all_tests;