Skip to content

Commit

Permalink
adapt to mirage-crypto-rng 1.2.0+
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Feb 5, 2025
1 parent 2c27e51 commit aa2b842
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion awa.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ depends: [
"ocaml" {>= "4.10.0"}
"dune" {>= "2.7"}
"mirage-crypto" {>= "1.0.0"}
"mirage-crypto-rng" {>= "1.0.0"}
"mirage-crypto-rng" {>= "1.2.0"}
"mirage-crypto-pk"
"mirage-crypto-ec" {>= "1.0.0"}
"x509" {>= "1.0.0"}
Expand Down
2 changes: 1 addition & 1 deletion test/awa_gen_key.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

let gen_key seed typ =
Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna);
Mirage_crypto_rng_unix.use_default ();
let seed = match seed with
| None -> Base64.encode_string (Mirage_crypto_rng.generate 30)
| Some x -> x
Expand Down
2 changes: 1 addition & 1 deletion test/awa_test_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let write_cstruct fd buf =

let jump _ user pass seed typ keyfile authenticator host port =
let ( let* ) = Result.bind in
Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna);
Mirage_crypto_rng_unix.use_default ();
let fd = Unix.(socket PF_INET SOCK_STREAM 0) in
Unix.(connect fd (ADDR_INET (inet_addr_of_string host, port)));
match
Expand Down
2 changes: 1 addition & 1 deletion test/awa_test_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ let rec wait_connection priv_key listen_fd server_port =
wait_connection priv_key listen_fd server_port

let jump () =
Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna);
Mirage_crypto_rng_unix.use_default ();
let g = Mirage_crypto_rng.(create ~seed:"180586" (module Fortuna)) in
let (ec_priv,_) = Mirage_crypto_ec.Ed25519.generate ~g () in
let priv_key = Awa.Hostkey.Ed25519_priv (ec_priv) in
Expand Down
2 changes: 1 addition & 1 deletion test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ let all_tests = [
]

let _ =
Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna);
Mirage_crypto_rng_unix.use_default ();
Sys.set_signal Sys.sigalrm (Sys.Signal_handle (fun _ -> failwith "timeout"));
Unix.chmod "data/awa_test_rsa" 0o600;
List.iter run_test all_tests;

0 comments on commit aa2b842

Please sign in to comment.