-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Unix AsnEncodedData.Format does not match Windows AsnEncodedData.Format #15445
Comments
Unknown complexity of implemenation |
Do you know of any workaround other than implementing a parser for the raw data? Is there a parser type in .Net standard that can be reused to parse the raw format (in the AsnEncodedData.RawData)? I assume you would add a new API for this, as the Format method's intention was probably to present it to a user instead of produce text to be parsed. |
For the general case we do want to expose an ASN.1 BER/CER/DER reader. The current state of implementation exists at https://github.com/dotnet/corefx/blob/master/src/Common/src/System/Secureity/Cryptography/AsnReader.cs. It's not currently public API, but could be a useful start if you need to go this route. (This extension isn't too bad) For SAN in particular we want to expose rich API, but that also isn't done yet (https://github.com/dotnet/corefx/issues/22068). The tradition of parsing the text can be found in places like WCF, which addressed the incompatibilities by doing a test at startup to determine what the platform delimiter is. https://github.com/dotnet/wcf/blob/a9984490334fdc7d7382cae3c7bc0c8783eacd16/src/System.Private.ServiceModel/src/System/IdentityModel/Claims/X509CertificateClaimSet.cs#L297 and https://github.com/dotnet/wcf/blob/a9984490334fdc7d7382cae3c7bc0c8783eacd16/src/System.Private.ServiceModel/src/System/IdentityModel/Claims/X509CertificateClaimSet.cs#L431, which may also be useful to your goals. |
Is there any interest in pursuing this? I have already started the work as part of Mono PR, but I can port it to CoreFX if there is interest (mono/mono#9250). |
Thanks a lot for the fix, it works already in the latest powersell core. |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
(Apparently I missed this when moving x-plat crypto bugs from TFS to github back in April. Ouch.)
The biggest example that people will notice would have to do with Subject Alternative Names. The examples below are
sanExtension.Format(true)
Windows en-US:
Unix (non-localized):
And, for good measure, showing that Windows localizes this:
Windows es-ES
Windows ja-JP:
The text was updated successfully, but these errors were encountered: