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

CABF SMIME 7.1.4.2.h If present, the subject:emailAddress SHALL contain a single Mailbox Address #752

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

christopher-henderson
Copy link
Member

@christopher-henderson christopher-henderson commented Oct 15, 2023

Addresses #753 and accomplishes the following from #712

subject:emailAddress, all: if present, the subject:emailAddress SHALL contain a single Mailbox Address. (7.1.4.2.2.h)

@christopher-henderson christopher-henderson changed the title CABF SMIMS 4.1.4.2.h If present, the subject:emailAddress SHALL contain a single Mailbox Address CABF SMIME 4.1.4.2.h If present, the subject:emailAddress SHALL contain a single Mailbox Address Oct 15, 2023
@christopher-henderson christopher-henderson changed the title CABF SMIME 4.1.4.2.h If present, the subject:emailAddress SHALL contain a single Mailbox Address CABF SMIME 7.1.4.2.h If present, the subject:emailAddress SHALL contain a single Mailbox Address Oct 15, 2023
}

func (l *singleEmailIfPresent) CheckApplies(c *x509.Certificate) bool {
return util.IsSubscriberCert(c) && c.EmailAddresses != nil && len(c.EmailAddresses) != 0
Copy link
Member

Choose a reason for hiding this comment

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

Just want to check that this last part len(c.EmailAddresses) != 0 is correct. It would seem that, if present, the field shouldn't be empty either. (I suspect though that this could just be an idiosyncrasy with Go X.509 and how fields are parsed)

Copy link
Member Author

Choose a reason for hiding this comment

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

I suspect though that this could just be an idiosyncrasy with Go X.509 and how fields are parsed

I precisely wanted to avoid any such shenanigans being possible. I was uncertain what upstream systems would generate in a not present scenario. I reckoned that both nil and empty would count as not being present (generally speaking, rather than speaking to the specific Go implementation).

@christopher-henderson christopher-henderson merged commit 2f54486 into master Oct 16, 2023
8 checks passed
@christopher-henderson christopher-henderson deleted the smime_single_email branch October 16, 2023 01:14
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