Skip to content

[ci-scan] Test failure: Android X509 DynamicChainTests name-constraint status mismatch #128890

Description

@simonrozsival

Note

This issue draft was prepared with GitHub Copilot assistance and should be reviewed before posting.

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1444966

Additional observed builds:

Build error leg or test failing: android-arm Release AllSubsets_CoreCLR - System.Security.Cryptography.Tests - System.Security.Cryptography.X509Certificates.Tests.DynamicChainTests.NameConstraintViolation_PermittedTree_Dns

Error Details

Several X509 name-constraint tests fail consistently on Android Helix hardware. The failures look like provider/status behavior mismatches: UPN cases fail chain.Build, while DNS cases report InvalidNameConstraints where the test expects PartialChain.

Observed repro details from a representative official runtime-extra-platforms job:

Observed failure summaries:

System.Security.Cryptography.X509Certificates.Tests.DynamicChainTests.NameConstraintViolation_PermittedTree_Upn
chain.Build

System.Security.Cryptography.X509Certificates.Tests.DynamicChainTests.NameConstraintViolation_PermittedTree_Dns
Assert.Equal() Failure: Values differ
Expected: PartialChain
Actual:   InvalidNameConstraints

System.Security.Cryptography.X509Certificates.Tests.DynamicChainTests.NameConstraintViolation_ExcludedTree_Upn
chain.Build

System.Security.Cryptography.X509Certificates.Tests.DynamicChainTests.NameConstraintViolation_ExcludedTree_Dns
Assert.Equal() Failure: Values differ
Expected: PartialChain
Actual:   InvalidNameConstraints

Other official runtime-extra-platforms hits found in Helix testResults.xml:

Error Message

{
  "ErrorMessage": "",
  "ErrorPattern": [
    "\\[FAIL\\][^\\n]*System\\.Security\\.Cryptography\\.X509Certificates\\.Tests\\.DynamicChainTests\\.NameConstraintViolation_(PermittedTree|ExcludedTree)_(Dns|Upn)",
    "Exception messages: (chain\\.Build|Assert\\.Equal\\(\\) Failure: Values differ)"
  ],
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

The ordered ErrorPattern array intentionally matches the DOTNET/logcat summary for all four related failures:

  • NameConstraintViolation_PermittedTree_Upn with chain.Build
  • NameConstraintViolation_PermittedTree_Dns with InvalidNameConstraints
  • NameConstraintViolation_ExcludedTree_Upn with chain.Build
  • NameConstraintViolation_ExcludedTree_Dns with InvalidNameConstraints

Duplicate search

No open issue was found that directly tracks this Android-specific X509 name-constraint mismatch.

Related but not duplicates:

AzDO / Helix history search

Recent public runtime-extra-platforms builds (definition 154) on main were searched for this signature. The important detail is that the xUnit failure text is not present in the AzDO job console logs; it is present in the Helix testResults.xml artifacts linked from those jobs.

  • Query window: recent builds from 1444966 (20260601.4) back through 1406427 (20260502.2).
  • Scope: failed Android job console logs scanned, then System.Security.Cryptography.Tests Helix work items inspected via testResults.xml where available.
  • Search strings: NameConstraintViolation_PermittedTree_Upn, NameConstraintViolation_PermittedTree_Dns, NameConstraintViolation_ExcludedTree_Upn, NameConstraintViolation_ExcludedTree_Dns, InvalidNameConstraints, and PartialChain.
  • Result: 6 official runtime-extra-platforms Helix work items contained all four failures.

Architecture coverage:

  • android-arm: 4 hits (AllSubsets_CoreCLR and one AllSubsets_Mono)
  • android-arm64: 2 hits (AllSubsets_CoreCLR)
  • android-x86: 0 hits in the inspected window
  • android-x64: 0 hits in the inspected window

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1444966
Error message validated: [\[FAIL\][^\n]*System\.Security\.Cryptography\.X509Certificates\.Tests\.DynamicChainTests\.NameConstraintViolation_(PermittedTree|ExcludedTree)_(Dns|Upn) Exception messages: (chain\.Build|Assert\.Equal\(\) Failure: Values differ)]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 6/2/2026 10:42:33 AM UTC

Report

Build Repository Test Pull Request
1444966 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 1 1

Activity

  1. added
    blocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
    Known Build ErrorUse this to report build issues in the .NET Helix tab
    on Jun 2, 2026
  2. dotnet-policy-service commented on Jun 2, 2026

    @dotnet-policy-service
    Contributor

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

  3. bartonjs commented on Jun 3, 2026

    @bartonjs
    Member

    Is it a versioning problem? Either way, the fix is probably in

    private static X509ChainStatusFlags PlatformNameConstraints(X509ChainStatusFlags flags)
    {
    if (PlatformDetection.UsesAppleCrypto)
    {
    const X509ChainStatusFlags AnyNameConstraintFlags =
    X509ChainStatusFlags.HasExcludedNameConstraint |
    X509ChainStatusFlags.HasNotDefinedNameConstraint |
    X509ChainStatusFlags.HasNotPermittedNameConstraint |
    X509ChainStatusFlags.HasNotSupportedNameConstraint |
    X509ChainStatusFlags.InvalidNameConstraints;
    if ((flags & AnyNameConstraintFlags) != 0)
    {
    flags &= ~AnyNameConstraintFlags;
    flags |= X509ChainStatusFlags.InvalidNameConstraints;
    }
    }
    else if (OperatingSystem.IsAndroid())
    {
    // Android always validates name constraints as part of building a path
    // so violations comes back as PartialChain with no elements.
    flags = X509ChainStatusFlags.PartialChain;
    }
    return flags;
    }

  4. dotnet-policy-service commented on Jun 3, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  5. added this to the 11.0.0 milestone on Jun 4, 2026
  6. modified the milestones: 11.0.0, 12.0.0 on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Known Build ErrorUse this to report build issues in the .NET Helix tabarea-System.Securityblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'disabled-testThe test is disabled in source code against the issueos-android

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions