Add test cases for v1 certificates with v3 extensions - #532
Conversation
|
Since the bot cannot run when the PR comes from a fork, here is a copy from our fork for informational purposes: New testcasesThere are new testcases in this change. openssl-3.5.4
pyca-cryptography-46.0.3
rust-webpki
openssl-3.6.0
gnutls-certtool-3.8.3
certvalidator-0.11.1
gocryptox509-go1.25.4
openssl-3.2.6
openssl-3.0.18
openssl-3.4.3
rustls-webpki
openssl-3.3.5
openssl-1.1
|
alex
left a comment
There was a problem hiding this comment.
Curious what @woodruffw thinks, but I'm not sure it's valuable to have N tests of different extensions with v1. They're all testing the same fundamental behavior.
|
The results of the tests indeed suggest that testing different extensions does not add a lot of value. Is there any extension that would be a good representative, or would you prefer a test with all extensions instead? |
|
Yeah, I think I agree with @alex about the limited coverage impact here. I think |
|
Removed all other tests in e03f33a |
e03f33a to
57edc44
Compare
which mandates rejection of v1 certificates containing v3 extensions. Note that this modifies the behavior of the no_extensions flag, but since the flag is only used in one existing test case this is backwards compatible. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
57edc44 to
cd70263
Compare
This PR adds test cases for v1 certificates that contain v3 extensions, which violates RFC 5280 Section 4.1.2.1. The following test cases are added:
v1_cert_without_extensions, should accept. Note that this is similar tov1_certinwebpki, where the same cert is rejected as per CABF requirements.v1_cert_with_subject_key_identifier- TestsSubjectKeyIdentifierextension, should reject.v1_cert_with_basic_constraints- TestsBasicConstraintsextension, should reject.v1_cert_with_key_usage- TestsKeyUsageextension, should reject.v1_cert_with_extended_key_usage- Tests ExtendedKeyUsageextension, should reject.v1_cert_with_subject_alternative_name- TestsSubjectAlternativeNameextension, should reject.v1_cert_with_authority_key_identifier- TestsAuthorityKeyIdentifierextension, should reject.Note that these test cases require a modification to the behavior of the
no_extensionsflag by allowing the caller to define additional extensions that will be added after the extensions are removed. Since the flag is only used in one existing test case that does not define additional extensions (v1_certinwebpki) this change is backwards compatible.🤖 Generated with Claude Code