Skip to content

Commit bb600e2

Browse files
committed
use mirage-crypto-rng directly, no need for mirage-random-test
1 parent be78e22 commit bb600e2

9 files changed

+18
-19
lines changed

Diff for: tcpip.opam

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ depends: [
3030
"cstruct-lwt"
3131
"mirage-net" {>= "3.0.0"}
3232
"mirage-clock" {>= "3.0.0"}
33-
"mirage-random" {>= "2.0.0"}
33+
"mirage-random" {>= "2.0.0" & < "4.0.0"}
3434
"mirage-time" {>= "2.0.0"}
3535
"ipaddr" {>= "5.0.0"}
3636
"macaddr" {>="4.0.0"}
@@ -48,7 +48,7 @@ depends: [
4848
"alcotest" {with-test & >="1.5.0"}
4949
"pcap-format" {with-test}
5050
"mirage-clock-unix" {with-test & >= "3.0.0"}
51-
"mirage-random-test" {with-test & >= "0.1.0"}
51+
"mirage-crypto-rng" {with-test & >= "0.11.0"}
5252
"ipaddr-cstruct"
5353
"macaddr-cstruct"
5454
"lru" {>= "0.3.0"}

Diff for: test/dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(test
22
(name test)
3-
(libraries alcotest mirage-random-test lwt.unix logs logs.fmt
3+
(libraries alcotest mirage-crypto-rng mirage-crypto-rng.unix lwt.unix logs logs.fmt
44
mirage-flow mirage-vnetif mirage-clock-unix pcap-format duration
55
mirage-random arp arp.mirage ethernet tcpip.ipv4 tcpip.tcp tcpip.udp
66
tcpip.stack-direct tcpip.icmpv4 tcpip.udpv4v6-socket tcpip.tcpv4v6-socket

Diff for: test/low_level.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Time = Vnetif_common.Time
1212
module V = Vnetif.Make(Vnetif_backends.Basic)
1313
module E = Ethernet.Make(V)
1414
module A = Arp.Make(E)(Time)
15-
module I = Static_ipv4.Make(Mirage_random_test)(Vnetif_common.Clock)(E)(A)
15+
module I = Static_ipv4.Make(Mirage_crypto_rng)(Vnetif_common.Clock)(E)(A)
1616
module Wire = Tcp.Wire
1717
module WIRE = Wire.Make(I)
1818
module Tcp_wire = Tcp.Tcp_wire

Diff for: test/test.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ let run test () =
3939

4040
let () =
4141
Printexc.record_backtrace true;
42-
(* someone has to call Mirage_random_test.initialize () *)
43-
Mirage_random_test.initialize ();
42+
Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna);
4443
(* enable logging to stdout for all modules *)
4544
Logs.set_reporter (Logs_fmt.reporter ());
4645
Logs.set_level ~all:true (Some Logs.Debug);

Diff for: test/test_deadlock.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Client_log = (val Logs.src_log client_log : Logs.LOG)
1010

1111
module TCPIP =
1212
struct
13-
module RANDOM = Mirage_random_test
13+
module RANDOM = Mirage_crypto_rng
1414

1515
module TIME =
1616
struct
@@ -80,7 +80,7 @@ let test_digest netif1 netif2 =
8080
TCPIP.make `Server netif2 >>= fun server_stack ->
8181

8282
let send_data () =
83-
let data = Mirage_random_test.generate 100_000_000 |> Cstruct.to_string in
83+
let data = Mirage_crypto_rng.generate 100_000_000 |> Cstruct.to_string in
8484
let t0 = Unix.gettimeofday () in
8585
TCPIP.TCP.create_connection
8686
TCPIP.(tcp @@ tcpip server_stack) (Ipaddr.V4 TCPIP.client_ip, port) >>= function

Diff for: test/test_icmpv4.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ type decomposed = {
1818
ethernet_header : Ethernet.Packet.t;
1919
}
2020

21-
module Ip = Static_ipv4.Make(Mirage_random_test)(Mclock)(E)(Static_arp)
21+
module Ip = Static_ipv4.Make(Mirage_crypto_rng)(Mclock)(E)(Static_arp)
2222
module Icmp = Icmpv4.Make(Ip)
2323

24-
module Udp = Udp.Make(Ip)(Mirage_random_test)
24+
module Udp = Udp.Make(Ip)(Mirage_crypto_rng)
2525

2626
type stack = {
2727
backend : B.t;

Diff for: test/test_ipv6.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module B = Vnetif_backends.Basic
44
module V = Vnetif.Make(B)
55
module E = Ethernet.Make(V)
66

7-
module Ipv6 = Ipv6.Make(V)(E)(Mirage_random_test)(Time)(Mclock)
8-
module Udp = Udp.Make(Ipv6)(Mirage_random_test)
7+
module Ipv6 = Ipv6.Make(V)(E)(Mirage_crypto_rng)(Time)(Mclock)
8+
module Udp = Udp.Make(Ipv6)(Mirage_crypto_rng)
99
open Lwt.Infix
1010

1111
let ip =

Diff for: test/test_udp.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module B = Basic_backend.Make
55
module V = Vnetif.Make(B)
66
module E = Ethernet.Make(V)
77
module Static_arp = Static_arp.Make(E)(Time)
8-
module Ip = Static_ipv4.Make(Mirage_random_test)(Mclock)(E)(Static_arp)
9-
module Udp = Udp.Make(Ip)(Mirage_random_test)
8+
module Ip = Static_ipv4.Make(Mirage_crypto_rng)(Mclock)(E)(Static_arp)
9+
module Udp = Udp.Make(Ip)(Mirage_crypto_rng)
1010

1111
type stack = {
1212
backend : B.t;

Diff for: test/vnetif_common.ml

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ end
7070
module E = Ethernet.Make(V)
7171

7272
module A = Arp.Make(E)(Time)
73-
module Ip4 = Static_ipv4.Make(Mirage_random_test)(Clock)(E)(A)
73+
module Ip4 = Static_ipv4.Make(Mirage_crypto_rng)(Clock)(E)(A)
7474
module Icmp4 = Icmpv4.Make(Ip4)
75-
module Ip6 = Ipv6.Make(V)(E)(Mirage_random_test)(Time)(Clock)
75+
module Ip6 = Ipv6.Make(V)(E)(Mirage_crypto_rng)(Time)(Clock)
7676
module Ip46 = Tcpip_stack_direct.IPV4V6(Ip4)(Ip6)
77-
module U = Udp.Make(Ip46)(Mirage_random_test)
78-
module T = Tcp.Flow.Make(Ip46)(Time)(Clock)(Mirage_random_test)
77+
module U = Udp.Make(Ip46)(Mirage_crypto_rng)
78+
module T = Tcp.Flow.Make(Ip46)(Time)(Clock)(Mirage_crypto_rng)
7979

8080
module Stack =
81-
Tcpip_stack_direct.MakeV4V6(Time)(Mirage_random_test)(V)(E)(A)(Ip46)(Icmp4)(U)(T)
81+
Tcpip_stack_direct.MakeV4V6(Time)(Mirage_crypto_rng)(V)(E)(A)(Ip46)(Icmp4)(U)(T)
8282

8383
let create_backend () =
8484
B.create ()

0 commit comments

Comments
 (0)