Skip to content

Commit

Permalink
autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Aug 5, 2024
1 parent 0ca91e5 commit 62afc58
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 0.25.1
version = 0.26.2
profile=conventional
2 changes: 1 addition & 1 deletion ca-certs.opam
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ depends: [
"fpath"
"ptime"
"logs"
"mirage-crypto"
"mirage-crypto" {>= "1.0.0"}
"x509" {>= "1.0.0"}
"ocaml" {>= "4.08.0"}
"alcotest" {with-test}
Expand Down
4 changes: 2 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
(name ca-certs)
(depends
bos fpath ptime logs
(mirage-crypto (< 1.0.0))
(x509 (and (>= 0.13.0) (< 1.0.0)))
(mirage-crypto (>= 1.0.0))
(x509 (>= 1.0.0))
(ocaml (>= 4.08.0))
(alcotest :with-test)
(fmt (and :with-test (>= 0.8.7))))
Expand Down
5 changes: 1 addition & 4 deletions lib/ca_certs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ external iter_on_anchors : (string -> unit) -> unit = "ca_certs_iter_on_anchors"

let get_anchors () =
let der_list = ref [] in
match
iter_on_anchors (fun der_cert ->
der_list := der_cert :: !der_list)
with
match iter_on_anchors (fun der_cert -> der_list := der_cert :: !der_list) with
| () -> Ok !der_list
| exception Failure msg -> Error (`Msg msg)

Expand Down
2 changes: 1 addition & 1 deletion lib/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name ca_certs)
(public_name ca-certs)
(libraries mirage-crypto x509 bos fpath logs ptime.clock.os)
(libraries mirage-crypto x509 bos fpath logs ptime.clock.os digestif)
(foreign_stubs
(language c)
(names ca_certs_stubs))
Expand Down
10 changes: 2 additions & 8 deletions test/tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -971,21 +971,15 @@ let tests tas =
List.map
(fun (name, data, time) ->
let host = Domain_name.(of_string_exn name |> host_exn)
and chain =
Result.get_ok
(X509.Certificate.decode_pem_multiple data)
in
and chain = Result.get_ok (X509.Certificate.decode_pem_multiple data) in
( name,
`Quick,
test_one ?time tas (Ok (Some (chain, List.hd chain))) host chain ))
ok_tests
@ List.map
(fun (name, result, data, time) ->
let host = Domain_name.(of_string_exn name |> host_exn)
and chain =
Result.get_ok
(X509.Certificate.decode_pem_multiple data)
in
and chain = Result.get_ok (X509.Certificate.decode_pem_multiple data) in
(name, `Quick, test_one ?time tas (Error (result host chain)) host chain))
err_tests

Expand Down

0 comments on commit 62afc58

Please sign in to comment.