File tree 5 files changed +6
-5
lines changed
5 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 2
2
(name websocket)
3
3
(public_name websocket)
4
4
(modules sha1 websocket)
5
- (libraries astring base64 ocplib-endian conduit cohttp))
5
+ (libraries astring base64 ocplib-endian conduit cohttp mirage-crypto-rng ))
Original file line number Diff line number Diff line change @@ -21,8 +21,7 @@ let b64_encoded_sha1sum s = Base64.encode_exn (Sha1.sha_1 s)
21
21
let websocket_uuid = " 258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
22
22
23
23
module Rng = struct
24
- let init ?(state = Random. get_state () ) () len =
25
- String. v ~len (fun _ -> Char. of_byte (Random.State. bits state land 0xFF ))
24
+ let init () len = Mirage_crypto_rng. generate len |> Cstruct. to_string
26
25
end
27
26
28
27
module Frame = struct
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ val upgrade_present : Cohttp.Header.t -> bool
22
22
exception Protocol_error of string
23
23
24
24
module Rng : sig
25
- val init : ? state : Random.State .t -> unit -> int -> string
25
+ val init : unit -> int -> string
26
26
(* * [init ?state ()] is a function that returns a string of random
27
27
bytes of length equal to its argument. *)
28
28
end
Original file line number Diff line number Diff line change 33
33
( conduit ( >= 5 .1.0) )
34
34
( cohttp ( >= 5 .0.0) )
35
35
( ocplib-endian ( >= 1 .0) )
36
- ( astring ( >= 0 .8.3) ) ) )
36
+ ( astring ( >= 0 .8.3) )
37
+ mirage-crypto-rng) )
37
38
38
39
( package
39
40
(name websocket-async)
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ depends: [
30
30
"cohttp" {>= "5.0.0"}
31
31
"ocplib-endian" {>= "1.0"}
32
32
"astring" {>= "0.8.3"}
33
+ "mirage-crypto-rng"
33
34
"odoc" {with-doc}
34
35
]
35
36
build: [
You can’t perform that action at this time.
0 commit comments