Skip to content

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

Merged
christopher-henderson merged 2 commits intomasterfrom
smime_single_email
Oct 16, 2023
Merged

CABF SMIME 7.1.4.2.h If present, the subject:emailAddress SHALL contain a single Mailbox Address#752
christopher-henderson merged 2 commits intomasterfrom
smime_single_email

Conversation

@christopher-henderson
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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