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
cert-request: allow directoryName in SAN extension #228
cert-request: allow directoryName in SAN extension #228
Conversation
Allow directoryName in SAN extension if the value matches the subject principal's DN in the IPA directory. Fixes: https://fedorahosted.org/freeipa/ticket/6112
|
As I have understood from the mailing list discussion, we have two options:
Perhaps I'm missing something, but the first option doesn't seem very useful and I don't know if the second one is a valid and needed use case. |
|
@tomaskrizek
|
|
@frasertweedale, if the subject DN need not match the LDAP DN, then DN SANs need not match it as well - both the subject DN and DN SANs are supposed to identify the subject in the directory, and for us the directory is LDAP. There should be no special casing one way or the other, if something is allowed for the subject DN it must be allowed for DN SANs and vice-versa (with the exception of the special handling of the most specific CN in subject DN of server certificates). The fact that we currently require a non-LDAP subject DN in |
|
@jcholast OK. Let's put this PR on ice for now... I may well take up your suggestion to allow subject DN to match LDAP DN, but I don't have the cycles for it right now. Thanks for your feedback. |
|
@jcholast I'm not familiar with any standard that mandates that a X.509 Subject DN should identify a subject in a directory. Which standard mandates the relationship? RFC 5280 only requires that the Subject DN must be unique for each entity. A CA is allowed to issue multiple certs with the same Subject DN for the same entity. https://tools.ietf.org/html/rfc5280#section-4.1.2.6 |
|
@tiran, could you please stay on topic? I haven't said anything about it being mandatory, and it's not the point anyway (consistency between subject DN and DN SAN validation is). About CA being allowed to issue multiple certs with the same subject DN, thanks for stating the obvious, but again, not the point here. |
|
I'm on topic and I'm trying to understand your point. Why do you see a relationship between the subject DN of a X.509 and the directoryName general name in SAN X.509v3 extension? It doesn't make sense to me. The subject follows different rules, e.g. a disjunct set of RDN attributes. Attributes like DC, UID etc. are not commonly found in a X.509 cert's subject. Further more a CA usually imposes some policies and requires the certificate's subject to have fixed C, O, OU etc values. With multiple SubCAs (e.g. for VPN, client cert auth, host certs) we end up with different subject DNs but with the same directoryName GN SAN entry. The directoryName is designed to hold a LDAP DN. By the way, I was quoting the RFC to give some context. With X.509 there is no such thing as an obvious thing. In fact multiple certs with the same Subject DN is very relevant and important for this topic. A certificate's Subject DN is not really a distinguishing name in the sense of a unique identifier. |
|
@frasertweedale Oh, I didn't realize the DN in SAN matches the LDAP DN, while the Subject DN does not. In that case, this PR makes sense to me as is. I also don't see the need to validate Subject DN and SAN DN the same way, since they use different representation (subject is a more generic identifier, as @tiran pointed out; while SAN DN should be the unique LDAP DN identifier). |
|
Ok,
According to RFC 5280 section 4.1.2.6 the subject DN and SANs are equivallent in terms of identifying the subject entity:
Compare how the subject DN is defined in RFC 5280 section 4.1.2.6:
... with how the DN SAN is defined in RFC 5280 section 4.2.1.6:
See that there is no mention of any semantical difference between them as means of identifying the subject entity. Further specifications such as the name constraints extension also treat them equally. RFC 5280 section 4.2.1.10:
I could not find any mention of this in RFC 5280 nor the X.500 series of standards. I'm assuming it's because it's not there.
Neither RFC 5280 nor the X.500 series of standards impose any restrictions on the attributes used. However, RFC 5280 section 4.1.2.4 says:
Currently we in fact end up with the same subject DN. Which is just fine, as they refer to the same subject entity.
I don't think that's true, as there is no mention of this in the directoryName SAN specification (see above).
Let me quote RFC 5280 section 4.1.2.6 again:
|
|
I'm closing this PR (and associated ticket). I felt it was an uncontroversial change (and tbh it looks like there are numbers |
|
@frasertweedale I still think it's a useful and uncontroversial improvement. In a matter of fact I don't understand why this simple and obvious change resulted in a lengthy discussion. |
Allow directoryName in SAN extension if the value matches the
subject principal's DN in the IPA directory.
Fixes: https://fedorahosted.org/freeipa/ticket/6112
A bit of commentary about this feature: it was just a drive-by case
of "hey I could implement this in a way that I think makes sense".
Noone actually asked for it (yet).
Also, there is not agreement that using directoryName to carry the
DN of the subject is valid. On my part, I think it is obviously
valid, but see the original review thread for discussion:
https://www.redhat.com/archives/freeipa-devel/2016-August/msg00714.html
I had to rebase this commit and resolve conflicts, so now it is a PR
and it can age in oak on GitHub instead of the mailing list :)