runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Unix X500DistinguishedName prints multicomponent RDNs different than Windows

Open bartonjs opened this issue 11 years ago • 3 comments

"Normal" certificate subjects are similar to

Sequence(
    Set(Sequence(Oid(CN), PrintableString("CommonName"))),
    Set(Sequence(Oid(O), PrintableString("Organization"))))

When presented with a multi-component RDN like

Sequence(
    Set(
        Sequence(Oid(CN), PrintableString("CommonName")),
        Sequence(Oid(O), PrintableString("Organization"))))

Windows prints CN=CommonName + O=Organization. The OpenSSL library seems to float the latter into the former, resulting in Unix builds printing CN=CommonName, O=Organization.

This is not expected to be very common, and Windows has an explicit disrecommendation for this on MSDN (https://msdn.microsoft.com/en-us/library/windows/desktop/aa376556%28v=vs.85%29.aspx - under Remarks):

We recommend against using multicomponent RDNs (e.g., CN=James+O=Microsoft) to avoid possible ordering problems when decoding occurs. Instead, consider using single valued RDNs (e.g., CN=James, O=Microsoft).

bartonjs avatar Oct 15 '15 22:10 bartonjs

Multicomponent RDNs are disrecommended in X.509 spec. They would drag us in the other direction (not being up to date with latest specs). Moreover the cost is high. Closing for now.

karelz avatar Nov 09 '16 22:11 karelz

Disabled test, reopen it.

KristinXie1 avatar Feb 24 '17 07:02 KristinXie1

https://github.com/dotnet/corefx/blob/master/src/System.Security.Cryptography.X509Certificates/tests/X500DistinguishedNameTests.cs#L24

KristinXie1 avatar Feb 27 '17 01:02 KristinXie1