Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Jan 21, 2020
1 parent 9375e07 commit f41b023
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 5 additions & 4 deletions lib/x509.mli
Original file line number Diff line number Diff line change
Expand Up @@ -816,12 +816,13 @@ module Authenticator : sig

(** [chain_of_trust ~time ~crls ~hash_whitelist trust_anchors] is
[authenticator], which uses the given [time] and list of [trust_anchors]
to verify the certificate chain. This is an implementation of the
algorithm described in
to verify the certificate chain. All signatures must use a hash algorithm
specified in [hash_whitelist], defaults to SHA-2. Signatures on revocation
lists [crls] must also use a hash algorithm in [hash_whitelist]. This is
an implementation of the algorithm described in
{{:https://tools.ietf.org/html/rfc5280#section-6.1}RFC 5280}, using
{!Validation.verify_chain_of_trust}. The given trust anchors are not
checked to be valid trust anchors any further (you have to do this
manually with {!Validation.valid_ca} or {!Validation.valid_cas})! *)
validated, you can filter them with {!Validation.valid_cas} if desired. *)
val chain_of_trust : ?time:Ptime.t -> ?crls:CRL.t list ->
?hash_whitelist:Nocrypto.Hash.hash list -> Certificate.t list -> t

Expand Down
4 changes: 1 addition & 3 deletions tests/regression.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ let test_jc_ca_fail () =
| Error `InvalidChain -> ()
| _ -> Alcotest.fail "something went wrong with jc_ca"

let hash_whitelist = [ `SHA1 ]

let test_jc_ca_all_hashes () =
match Validation.verify_chain_of_trust ~hash_whitelist ~host:(host "jabber.ccc.de") ~anchors:[cacert] [jc ; cacert] with
match Validation.verify_chain_of_trust ~hash_whitelist:[`SHA1] ~host:(host "jabber.ccc.de") ~anchors:[cacert] [jc ; cacert] with
| Ok _ -> ()
| _ -> Alcotest.fail "something went wrong with jc_ca"

Expand Down

0 comments on commit f41b023

Please sign in to comment.