From d93a683d94819b4ff2fc1227b668d28d5969ca35 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 23 Jun 2020 20:03:59 +0200 Subject: [PATCH] tls: no need to initialize rng (tls.lwt does this for us) --- albatross.opam | 4 ++-- client/albatross_client_remote_tls.ml | 1 - tls/albatross_tls_endpoint.ml | 3 +-- tls/albatross_tls_inetd.ml | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/albatross.opam b/albatross.opam index cf1851a..9a63a9b 100644 --- a/albatross.opam +++ b/albatross.opam @@ -22,9 +22,9 @@ depends: [ "astring" "jsonm" "x509" {>= "0.11.0"} - "tls" {>= "0.12.0"} + "tls" {>= "0.12.2"} "mirage-crypto-pk" - "mirage-crypto-rng" {>= "0.7.0"} + "mirage-crypto-rng" {>= "0.8.0"} "asn1-combinators" {>= "0.2.0"} "duration" "decompress" {>= "0.9.0" & < "1.0.0"} diff --git a/client/albatross_client_remote_tls.ml b/client/albatross_client_remote_tls.ml index 9533a5f..16445b7 100644 --- a/client/albatross_client_remote_tls.ml +++ b/client/albatross_client_remote_tls.ml @@ -15,7 +15,6 @@ let rec read_tls_write_cons t = | Error e -> Lwt.return e let client cas host port cert priv_key = - Mirage_crypto_rng_lwt.initialize () >>= fun () -> let auth = if Sys.is_directory cas then `Ca_dir cas else `Ca_file cas in X509_lwt.authenticator auth >>= fun authenticator -> Lwt.catch (fun () -> diff --git a/tls/albatross_tls_endpoint.ml b/tls/albatross_tls_endpoint.ml index 822b8af..c3361ed 100644 --- a/tls/albatross_tls_endpoint.ml +++ b/tls/albatross_tls_endpoint.ml @@ -17,8 +17,7 @@ let jump _ cacert cert priv_key port tmpdir = Sys.(set_signal sigpipe Signal_ignore); Albatross_cli.set_tmpdir tmpdir; Lwt_main.run - (Mirage_crypto_rng_lwt.initialize () >>= fun () -> - server_socket port >>= fun socket -> + (server_socket port >>= fun socket -> tls_config cacert cert priv_key >>= fun config -> let rec loop () = Lwt.catch (fun () -> diff --git a/tls/albatross_tls_inetd.ml b/tls/albatross_tls_inetd.ml index 96e4da5..aa76828 100644 --- a/tls/albatross_tls_inetd.ml +++ b/tls/albatross_tls_inetd.ml @@ -7,8 +7,7 @@ let jump cacert cert priv_key tmpdir = Sys.(set_signal sigpipe Signal_ignore) ; Albatross_cli.set_tmpdir tmpdir; Lwt_main.run - (Mirage_crypto_rng_lwt.initialize () >>= fun () -> - tls_config cacert cert priv_key >>= fun config -> + (tls_config cacert cert priv_key >>= fun config -> let fd = Lwt_unix.of_unix_file_descr Unix.stdin in Lwt.catch (fun () -> Tls_lwt.Unix.server_of_fd config fd)