Skip to content

Commit

Permalink
Merge pull request #454 from talex5/fix-eio-eof
Browse files Browse the repository at this point in the history
tls-eio: Fix end-of-file handling
  • Loading branch information
hannesm committed Oct 25, 2022
2 parents d3f3516 + e0d251c commit d265a96
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion eio/tls_eio.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module Raw = struct
| Ok (state', `Response resp, `Data data) ->
let state' = match state' with
| `Ok tls -> `Active tls
| `Eof -> raise End_of_file
| `Eof -> `Eof
| `Alert a -> `Error (Tls_alert a)
in
t.state <- state' ;
Expand Down
4 changes: 2 additions & 2 deletions eio/x509_eio.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let certs_of_pem path =
let certs_of_pem_dir path =
Path.read_dir path
|> List.filter (fun file -> extension file = Some "crt")
|> Eio.Fiber.map (fun file -> certs_of_pem (path </> file))
|> Fiber.List.map (fun file -> certs_of_pem (path </> file))
|> List.concat

let crl_of_pem path =
Expand All @@ -64,7 +64,7 @@ let crl_of_pem path =

let crls_of_pem_dir path =
Path.read_dir path
|> Fiber.map (fun file -> crl_of_pem (path </> file))
|> Fiber.List.map (fun file -> crl_of_pem (path </> file))

(* Would be better to take an Eio.Time.clock here, but that API is likely to change soon. *)
let authenticator ?allowed_hashes ?crls param =
Expand Down
4 changes: 2 additions & 2 deletions tls-eio.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ depends: [
"mirage-crypto-rng" {>= "0.8.0"}
"mirage-crypto-rng-eio" {>= "0.8.0" with-test}
"x509" {>= "0.15.0"}
"eio" {>= "0.5"}
"eio_main" {>= "0.5" with-test}
"eio" {>= "0.6"}
"eio_main" {>= "0.6" with-test}
"mdx" {with-test}
]
tags: [ "org:mirage"]
Expand Down

0 comments on commit d265a96

Please sign in to comment.