Skip to content

Remove support for BigInteger in generated ASN types - #135911

Merged
bartonjs merged 4 commits into
dotnet:mainfrom
bartonjs:no_asn_biginteger
Oct 18, 2026
Merged

bartonjs merged 4 commits into
dotnet:mainfrom
bartonjs:no_asn_biginteger

Conversation

@bartonjs

Copy link
Copy Markdown
Member

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.

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.
@bartonjs bartonjs added this to the 12.0.0 milestone Oct 16, 2026
@bartonjs bartonjs self-assigned this Oct 16, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 BigInteger fields.
  • 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

Comment thread src/libraries/Common/src/System/Security/Cryptography/Asn1/asn.xsd
@bartonjs
bartonjs merged commit 6ac6d8b into dotnet:main Oct 18, 2026
86 of 88 checks passed
@bartonjs
bartonjs deleted the no_asn_biginteger branch October 20, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants