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

Incorrect warning on multiple attributes in one RDN #220

Closed
YuryStrozhevsky opened this issue May 7, 2018 · 11 comments
Closed

Incorrect warning on multiple attributes in one RDN #220

YuryStrozhevsky opened this issue May 7, 2018 · 11 comments
Assignees
Labels

Comments

@YuryStrozhevsky
Copy link

YuryStrozhevsky commented May 7, 2018

In your code you have this warning on having "multiple attributes in one RDN" in one certificate. In fact I do not understand the warning and why you made it.

As from initial type definition we have this:

RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
		
RelativeDistinguishedName ::=
SET SIZE (1..MAX) OF AttributeTypeAndValue

And nothing stops us from having multiple AttributeTypeAndValue - could be (1..MAX) values inside one RelativeDistinguishedName.

So, could you describe why you made the warning in zlint?

@justinbastress
Copy link
Contributor

@YuryStrozhevsky from the Source (https://github.com/zmap/zlint/blob/master/lints/lint_subject_multiple_rdn.go#L52), it appear this was pulled from the AWSLabs certlint -- and there doesn't seem to be any I don't see any further reference to a specification there (https://github.com/awslabs/certlint/blob/25d5957f8c36dafcbd82870df57a8367b49650be/lib/certlint/namelint.rb#L121).

@rmhrisk
Copy link

rmhrisk commented May 7, 2018

@pzb can you elaborate?

@pzb
Copy link

pzb commented May 7, 2018

Certlint warns about it because I observed that the majority of multiple attribute RDNs are due to bugs. A surprising number of certificates includes all the attributes in a single RDN by mistake. I'm assuming this was because of a poor API to create Names where an array of attributes becomes a single RDN rather than becoming a sequence of RDNs with one attribute each.

In certlint Warnings (W) are advisory only. It will warn on things that seem "odd" even if they can be correct; another example is leading/trailing whitespace in attribute values. That can be completely valid, but also can be an indication of a bug

@zakird
Copy link
Member

zakird commented May 7, 2018

It might be worth downgrading this from a warning to a notice. We typically use warnings to denote practices that aren't consistent with community guidelines (e.g., a SHOULD clause in an RFC).

@dadrian
Copy link
Member

dadrian commented May 7, 2018

Are client API's equipped to deal with RDN's of size > 1? Offhand, I know that at least Golang pushes the extra attributes to a grab-bag []Names for certain values, including CommonName and SerialNumber. If many clients don't expose these values, it may be worth leaving the notice as a warning.

https://golang.org/src/crypto/x509/pkix/pkix.go?s=3333:3386#L123

@pzb
Copy link

pzb commented May 7, 2018

Ruby also has issues:

https://github.com/ruby/openssl/blob/master/lib/openssl/x509.rb#L127 (parsing string into Name)

https://github.com/ruby/openssl/blob/master/ext/openssl/ossl_x509name.c#L332 (name converts to Array of Attributes, not Array of Array of Attributes); if to do OpenSSL::X509::Name.new(cert.subject.to_a) in Ruby, you will get a new name with each attribute as its own RDN. Ruby has no way to construct a name with a multiple attribute RDN

@zakird
Copy link
Member

zakird commented May 7, 2018

@dadrian thanks for noting that. I think this is generally the type of case that we try to catch with a Notice. There aren't very many in general (see https://github.com/zmap/ztag/blob/master/ztag/schema.py#L940).

We've tried to stick pretty religiously to needing a document to point to (e.g., RFC or CA/B Forum clause) in order for something to rise up to be a Warning or Error.

@dadrian
Copy link
Member

dadrian commented May 7, 2018

Sounds like we should make this a notice, and then get the BR's changed. 🤪

@rmhrisk
Copy link

rmhrisk commented May 7, 2018

It seems, based on Ruby's behavior, a client that wants to interoperate with poorly done implementations should default to the other form. It also seems in the context of zlint this should be a Notice.

@zakird zakird added the bug label May 7, 2018
@pzb
Copy link

pzb commented May 7, 2018

Certlint is usually uses notice versus warning for software incompatibilities; I should probably the multi-attribute message to be a notice as well:

https://github.com/awslabs/certlint/blob/master/lib/certlint/certlint.rb#L278
https://github.com/awslabs/certlint/blob/master/lib/certlint/certlint.rb#L406

@YuryStrozhevsky
Copy link
Author

YuryStrozhevsky commented May 8, 2018

@pzb BTW I made same issue for certlint. So, probably would be better to just reference this issue from certlint's issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants