Skip to content

Framework for linting OSCP responses#917

Merged
christopher-henderson merged 5 commits intozmap:masterfrom
kowshikRoy:ocsp
Mar 23, 2025
Merged

Framework for linting OSCP responses#917
christopher-henderson merged 5 commits intozmap:masterfrom
kowshikRoy:ocsp

Conversation

@kowshikRoy
Copy link
Copy Markdown
Contributor

Support for OCSP Response Linting

@christopher-henderson
Copy link
Copy Markdown
Member

Howdy @kowshikRoy! This is very cool, although I do need help understanding the impetus for support OSCP response linting.

Is there a history of non-compliance with RFC 6960 that would help me get a sense of the need for an OCSP linter? Or would you happen to have insights into CAs wishing that they had this linter?

I'm not opposed to such additions to ZLint. I would consider OCSP within the realm of the web PKI and thus not outside ZLint's jurisdiction in the slightest. However, I also do not wish to maintain code for which no CA has shown an interest in using.

@kowshikRoy
Copy link
Copy Markdown
Contributor Author

Hi @christopher-henderson
We're Google Trust Services(https://pki.goog) are interested to have OCSP linting. We currently use zlint to lint our certificates and CRLs. We are planning to add some checks related to OCSP.
I see that there are previous issues #458 where people have shown interested having this linting within an industry-standard tooling.

Copy link
Copy Markdown
Member

@christopher-henderson christopher-henderson left a comment

Choose a reason for hiding this comment

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

Thank you very much for doing this legwork @kowshikRoy. Both on the code itself as well as digging up past conversations.

This isn't an action item for this pull request, more of a meta comment to myself, but it is quite clear that this codebase has gotten a bit redundant. It could benefit from, perhaps, generics. I had shyed away from generics several years ago as ZLint is indeed used as a library and I didn't want to force a Golang upgrade across the ecosystem. But it's been some time, so I may revisit the topic.

} else if l := r.ocspResponseLints.ByName(name); l != nil {
meta = l.LintMetadata
registerFunc = func() error {
if err := filteredRegistry.registerOcspResponseLint(l); err != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
if err := filteredRegistry.registerOcspResponseLint(l); err != nil {
return filteredRegistry.registerOcspResponseLint(l) {

// RegisterOcspResponseLint must be called once for each OcspResponseLint to be executed.
// Normally, RegisterOcspResponseLint is called from the Go init() function of a lint implementation.
//
// IMPORTANT: RegisterOcspResponseLint will panic if given a nil lint, or a lint
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the panic documentation.

* permissions and limitations under the License.
*/

import (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for some first lints to show the system in action.

@christopher-henderson christopher-henderson changed the title Ocsp Framework for linting OSCP responses Mar 23, 2025
@christopher-henderson christopher-henderson merged commit 80afcba into zmap:master Mar 23, 2025
5 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