haskell-tls / hs-certificate

Certificate and Key Reader/Writer in haskell
60 stars 57 forks source link

Certificate name validation #75

Closed ocheron closed 8 years ago

ocheron commented 8 years ago

This request changes domain name matching in x509-validation to get closer to other implementations and RFCs :

Case conversion is performed directly in splitDot, and the function call is now moved into matchDomain so that the original name before conversion can be returned inside InvalidName.

A wildcard is supported only for the left-most component just like before. I didn’t consider extending this or supporting component fragments like f*o.example.com because this is more complex and probably never used in practice (discussed somehow in RFC 6125 §7.2).

ocheron commented 8 years ago

Related to vincenthz/hs-tls#163.

vincenthz commented 8 years ago

Thanks. looking good, although the general validation sorely lack automated testing

ocheron commented 8 years ago

OK, I'll see if I can add a test suite to x509-validation to test expected validation results.