{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/27466","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/27466/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/27466/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/27466/events","html_url":"https://github.com/dotnet/corefx/issues/27466","id":300138788,"number":27466,"title":"Cannot decode X500DistinguishedName correctly with T61String.","user":{"login":"mousehuang","id":35925663,"avatar_url":"https://avatars1.githubusercontent.com/u/35925663?v=4","gravatar_id":"","url":"https://api.github.com/users/mousehuang","html_url":"https://github.com/mousehuang","followers_url":"https://api.github.com/users/mousehuang/followers","following_url":"https://api.github.com/users/mousehuang/following{/other_user}","gists_url":"https://api.github.com/users/mousehuang/gists{/gist_id}","starred_url":"https://api.github.com/users/mousehuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mousehuang/subscriptions","organizations_url":"https://api.github.com/users/mousehuang/orgs","repos_url":"https://api.github.com/users/mousehuang/repos","events_url":"https://api.github.com/users/mousehuang/events{/privacy}","received_events_url":"https://api.github.com/users/mousehuang/received_events","type":"User","site_admin":false},"labels":[{"id":163633782,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Security","name":"area-System.Security","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/5","html_url":"https://github.com/dotnet/corefx/milestone/5","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/5/labels","id":1328080,"number":5,"title":"Future","description":"Milestone tracking issues not triaged to a planned release. Work in this milestone may happen, or may not: it is not committed.","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars1.githubusercontent.com/u/1302850?v=4","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":1715,"closed_issues":148,"state":"open","created_at":"2015-09-29T00:25:45Z","updated_at":"2018-02-27T00:34:24Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-02-26T07:52:56Z","updated_at":"2018-02-27T17:18:11Z","closed_at":null,"author_association":"NONE","body":"In an ASP.NET CORE 2.0 project under MAC OS, we have a byte array which is the raw data of the x500 distinguished name, to decode it with the X500DistinguishedName class, the value can be decoded if it is a printable string, but the value CANNOT be decoded if it is a T61String.\r\n\r\nIt's OK in:\r\n1) Windows platform (all projects)\r\n2) MAC, .NET Framework project\r\nIt's NOT OK in:\r\n1) MAC, ASP.NET CORE 2.0 project\r\n\r\nSteps:\r\n1) Run the following codes in a ASP.NET CORE 2.0 project. \r\n// CN=GrapeCity inc., OU=Tools Development, O=GrapeCity inc., L=Sendai Izumi-ku, S=Miyagi, C=JP\r\n// the CN, OU, O value is T61String\r\n// the L, S, C value is printable string\r\nvar base64 = \"MIGGMQswCQYDVQQGEwJKUDEPMA0GA1UECBMGTWl5YWdpMRgwFgYDVQQHEw9TZW5kYWkgSXp1bWkta3UxFzAVBgNVBAoUDkdyYXBlQ2l0eSBpbmMuMRowGAYDVQQLFBFUb29scyBEZXZlbG9wbWVudDEXMBUGA1UEAxQOR3JhcGVDaXR5IGluYy4=\";\r\n            var bytes = System.Convert.FromBase64String(base64);\r\n            var x500name = new System.Security.Cryptography.X509Certificates.X500DistinguishedName(bytes);\r\n            var name = x500name.Name;\r\n2) get's the value of name.\r\n<observed>CN=\"\", OU=\"\", O=\"\", L=Sendai Izumi-ku, S=Miyagi, C=JP\r\n<expected>CN=GrapeCity inc., OU=Tools Development, O=GrapeCity inc., L=Sendai Izumi-ku, S=Miyagi, C=JP\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/368955358","html_url":"https://github.com/dotnet/corefx/issues/27466#issuecomment-368955358","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/27466","id":368955358,"user":{"login":"bartonjs","id":10642668,"avatar_url":"https://avatars3.githubusercontent.com/u/10642668?v=4","gravatar_id":"","url":"https://api.github.com/users/bartonjs","html_url":"https://github.com/bartonjs","followers_url":"https://api.github.com/users/bartonjs/followers","following_url":"https://api.github.com/users/bartonjs/following{/other_user}","gists_url":"https://api.github.com/users/bartonjs/gists{/gist_id}","starred_url":"https://api.github.com/users/bartonjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartonjs/subscriptions","organizations_url":"https://api.github.com/users/bartonjs/orgs","repos_url":"https://api.github.com/users/bartonjs/repos","events_url":"https://api.github.com/users/bartonjs/events{/privacy}","received_events_url":"https://api.github.com/users/bartonjs/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T17:18:11Z","updated_at":"2018-02-27T17:18:11Z","author_association":"MEMBER","body":"Okay, it looks like https://en.wikipedia.org/wiki/ITU_T.61 mostly explains the mostly standard parts, except that the Cx values are modifiers.  0xCA => \"put a ring on it\", so `0xCA 0x79` => LATIN SMALL LETTER Y (0x79) WITH RING ABOVE => `\\u1e99'.  Mainly because it meant \"draw a ring, but don't seek forward\".\r\n\r\nT.61 allows for dynamically redefinable character sets (DRCS), which can be used to draw strokes for Japanese.  And I have no idea how that's encoded... though I've finally figured out that in these datasheets `12/10` means `0xCA` (top nybble: 12, bottom nybble: 10).  So maybe one day I'll know what `ESC 2/8 2/0 F` means, other than it might involve 0x28 and 0x20.\r\n\r\nIt'll definitely require some edge case tests against Windows (like what happens if the last byte is 0xCA? is that an ASN decode failure?  What happens if any of the \"not defined\" values is sent?)"}}
{"actor":{"display_login":"bartonjs"}}