Repository navigation
Remove support for BigInteger in generated ASN types - #135911
Merged
Merged
Conversation
Aside from DssParms, we basically always want Int32 or ReadOnlyMemory, so let's make the one place that cares care, and remove code from the generator.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
This was referenced Oct 16, 2026
Closed
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The collection schema still accepts BigInteger definitions that the generator no longer supports.
1 open finding
What changed in this PR
Simplifies ASN.1 generation by moving the remaining BigInteger conversions into DSA key handling.
Changes:
- Removes generator support for
BigIntegerfields. - Represents DSA parameters as encoded integer bytes.
- Changes certification-request versions to
int.
| File | Description |
|---|---|
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificationRequestInfoAsn.xml.cs |
Uses int version fields and decoding. |
src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/X509Certificates/Asn1/CertificationRequestInfoAsn.xml |
Specifies the integer backing type. |
src/libraries/Common/src/System/Security/Cryptography/DSAKeyFormatHelper.cs |
Converts encoded DSA parameters to BigInteger locally. |
src/libraries/Common/src/System/Security/Cryptography/Asn1/DssParms.xml.cs |
Stores and decodes parameters as byte spans. |
src/libraries/Common/src/System/Security/Cryptography/Asn1/DssParms.xml |
Specifies byte-backed parameters. |
src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xslt |
Removes BigInteger generation templates. |
src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xsd |
Requires explicit backing types for integer fields. |
🧠 Review effort: Balanced
(XSLT was already patched)
vcsjones
approved these changes
Oct 16, 2026
bartonjs
enabled auto-merge (squash)
October 16, 2026 17:27
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.

Aside from DssParms, we basically always want Int32 or ReadOnlyMemory, so let's make the one place that cares care, and remove code from the generator.