Move more things away from PointerMemoryManager#125854
Open
vcsjones wants to merge 2 commits intodotnet:mainfrom
Open
Move more things away from PointerMemoryManager#125854vcsjones wants to merge 2 commits intodotnet:mainfrom
vcsjones wants to merge 2 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors PKCS#12/PFX content sniffing on Apple platforms to use stack-only ASN.1 “Value*” ref-struct decoders, reducing reliance on unsafe pinning and PointerMemoryManager.
Changes:
- Replace PKCS#12 sniffing in Apple certificate content-type detection with
ValuePfxAsn.Decode(...). - Update ASN.1 schema emission for
PfxAsn,MacData, andDigestInfoAsnto generate both classic andValue*ref-struct types (emitType="both"). - Introduce
ValuePfxAsn,ValueMacData, andValueDigestInfoAsngenerated decoders/encoders to support span-based parsing.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509Pal.macOS.cs | Switch PKCS#12 sniffing to ValuePfxAsn to avoid unsafe pinning/PointerMemoryManager. |
| src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/AppleCertificatePal.ImportExport.iOS.cs | Switch PKCS#12 sniffing to ValuePfxAsn for span-based parsing. |
| src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.xml.cs | Generated ValuePfxAsn ref-struct implementation (span-based). |
| src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/PfxAsn.xml | Enable dual emission (emitType="both") and specify valueTypeName mappings. |
| src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/MacData.xml.cs | Generated ValueMacData ref-struct implementation (span-based). |
| src/libraries/Common/src/System/Security/Cryptography/Asn1/Pkcs12/MacData.xml | Enable dual emission (emitType="both") and specify valueTypeName mappings. |
| src/libraries/Common/src/System/Security/Cryptography/Asn1/DigestInfoAsn.xml.cs | Generated ValueDigestInfoAsn ref-struct implementation (span-based). |
| src/libraries/Common/src/System/Security/Cryptography/Asn1/DigestInfoAsn.xml | Enable dual emission (emitType="both") and specify valueTypeName mappings. |
...tem.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/X509Pal.macOS.cs
Show resolved
Hide resolved
...hy/src/System/Security/Cryptography/X509Certificates/AppleCertificatePal.ImportExport.iOS.cs
Show resolved
Hide resolved
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A couple of quick things related to PFX that we can ref-struct-ify.