Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lint for S/MIME subject directory attributes extension (7.1.2.3j) #798

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

bitlux
Copy link
Contributor

@bitlux bitlux commented Feb 16, 2024

I tried but failed to create a negative test case for this. The x509.Certificate type does not have subject directory attributes, and as far as I can tell, OpenSSL does not support writing them from the command line.

InputFilename: "smime/mailboxValidatedStrictWithCommonName.pem",
ExpectedResult: lint.Pass,
},
// A negative test case is hard to construct because neither the x509 package

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does indeed happen and there a handful of such cases throughout this code base where producing a negative example is (thankfully?) quite difficult without facing the daunting task of constructing these certificates nearly by hand.

Fortunately, the test corpus helps save us from ourselves by grapping hundreds-of-thousands of certificates from the wild to see if there are any examples that we could not catch ourselves.

None of the test corpus failed, which there are nearly 200k SMIME certs. So I guess it suppose the generating libraries just generally do a good job on this one.

@christopher-henderson christopher-henderson merged commit a4b46ef into zmap:master Feb 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants