Skip to content

PR #1069 follow-up - #1071

Open
robstradling wants to merge 2 commits into
masterfrom
pr1069_followup
Open

PR #1069 follow-up#1071
robstradling wants to merge 2 commits into
masterfrom
pr1069_followup

Conversation

@robstradling

Copy link
Copy Markdown
Member

The lint_org_validated_invalid_cn lint added by PR #1069 mishandles OV S/MIME certificates that omit the Subject CN field. Instead of treating the lint as not applicable due to the absent CN, it treats the empty string as an invalid email address and a mismatch for the Subject O.

This PR fixes the problem and adds a suitable test case.

The S/MIME BRs say the Subject CN field is optional for Organization
Validated certificates. The lint was treating an absent CN (empty
string) as invalid, returning Error instead of Pass.

Also guard against a potential panic when Subject.Organization is empty.

Fixes issue reported after merging of #1069.
The S/MIME BRs say the Subject CN field is optional. Move the
empty-CN check from Execute into CheckApplies so the lint returns
NA (not applicable) rather than Error when no CN is present.
@robstradling

Copy link
Copy Markdown
Member Author

I also thought about how to handle Subject CNs where the attribute is present but its value is zero-length. It seems that the e_subject_contains_noninformational_value lint already handles this, meaning that lint_org_validated_invalid_cn doesn't need to.

@defacto64

Copy link
Copy Markdown
Contributor

@robstradling You are right: I forgot to consider the case when the Subject CN is absent, which is allowed. As to the case when it is empty, that's a different problem. At any rate, I am fine with your proposed adjustments.

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