zlint icon indicating copy to clipboard operation
zlint copied to clipboard

Update single email subject if present

Open mtgag opened this issue 1 year ago • 5 comments

This PR addresses an issue with lint_single_email_if_present.go. The lint takes a look into the SAN entries to check if there is an entry with two email addresses. The description and citation shows to the entries in the subjectDN. On the one hand taking a look into the SAN entries for two email addresses is meaningful, on the other hand the citation and implementation do not align. Therefore this PR adds a new lint to check the subjectDN entries, re-using the implementation. I believe following actions can be further taken. One is to keep the original lint and change the citation/description. A second is to incorporate the two implementations into one lint that checks both the subjectDN and the SAN entries.

Best, Vangelis

mtgag avatar Feb 25 '24 11:02 mtgag

Ah, I see the issue, thank you for catching that @mtgag.

I think that my take is that the later is preferred...

A second is to incorporate the two implementations into one lint that checks both the subjectDN and the SAN entries.

We've done this before in the repo wherein a lint checks additional, related, structures as a part of one unified lint. I believe that that this helps keep citation implementations near each other as otherwise it would be easy to forget to update one if the implementation were split.

christopher-henderson avatar Feb 25 '24 16:02 christopher-henderson

I agree that an additional lint is warranted here. I believe this will close #795 as well. Thanks for tackling that, @mtgag

cardonator avatar Feb 25 '24 18:02 cardonator

I agree that an additional lint is warranted here. I believe this will close #795 as well. Thanks for tackling that, @mtgag

Should I incorporate lint_single_email_if_present (and then delete it) into lint_single_subject_email_if_present, or keep both and slightly refactor it to reflect the discussion here and comments from #795?

mtgag avatar Feb 29 '24 09:02 mtgag

My suggestion would be the latter.

cardonator avatar Feb 29 '24 14:02 cardonator

My suggestion would be the latter.

I will open a new PR for this. Then we have a stable pre-review and pre-merge state in lint_single_email_if_present addressing https://github.com/zmap/zlint/issues/795. We can still decide whether to go for one or two lints. I see benefits in both approaches.

UPDATE: PR https://github.com/zmap/zlint/pull/808

mtgag avatar Mar 01 '24 08:03 mtgag