Add additional test cases sourced from x509test (experimental)#255
Add additional test cases sourced from x509test (experimental)#255ctz wants to merge 1 commit intobriansmith:mainfrom
Conversation
|
I started looking at porting this coverage over to the rustls/webpki fork but decided to abandon the effort for a few reasons. I thought recording the challenges here would be helpful history:
I'm sure with more effort I could get the signature algorithm problem resolved but taking a step back and looking at the overall state of this approach I think it's going to be difficult to maintain and so i'm tabling the work for now. I've also been getting input from @djc that there's not a lot of appetite for adding further Python code to the webpki test suite. I think keeping the test generation code in a separate repo like TLDR: I vote that we take a more tactical approach to this coverage and create our own testcases on a more targetted basis (ideally in Rust, but failing that using pyca cryptography). |
This PR adds 90 additional test cases generated from the google/x509test test corpus. The process for that conversion is over on ctz/webpki-x509test.
This PR doesn't include test cases that unexpectedly failed, I will file an issue to discuss those.
Briefly, the structure of x509test is:
ok-) and some expected to fail (prefixedxf-).This naming is maintained into the generated code, so doing
cargo test test_xf_v1_extensionsruns this. The test inputs in x509test have the RFC clause they relate to embedded in the certificate subject. These test names get mapped to expected webpki errors over here -- in this case we don't support v1 so we expect that test case to produceError::UnsupportedCertVersion.There's a lot of commonality to the test cases; currently the generated rust code is very longwinded. I won't do much more polishing on this though until/unless this seems to be a good avenue for improving testing. This might be a good basis for #248 perhaps.