Skip to content

Account for default Windows NTLM signing in NegotiateStream tests - #138129

Merged
rzikm merged 1 commit into
dotnet:mainfrom
rzikm:rzikm/windows-negotiate-encryption
Nov 24, 2026
Merged

rzikm merged 1 commit into
dotnet:mainfrom
rzikm:rzikm/windows-negotiate-encryption

Conversation

@rzikm

@rzikm rzikm commented Nov 23, 2026

Copy link
Copy Markdown
Member

Windows updates released on and after November 10, 2026 offer NTLM signing by default, even when an application does not request integrity. This exposes two outdated assumptions in the Windows-only NegotiateStream tests: ProtectionLevel.None implies no signing, and a None-client/Sign-server handshake must fail. The failing assertions concern IsSigned, not IsEncrypted, and affect both CoreCLR and NativeAOT Windows CI.

Allow optional signing for the None cases while retaining every encryption assertion, requiring signing for encrypted contexts, and checking that client and server signing agree. Change the negative test's server requirement to EncryptAndSign so default signing cannot satisfy the mismatch. No production code or test skips are changed.

Validation

On Windows build 26100 with installed .NET 12, a standalone harness compiled the complete two test source files with real xUnit assertions and repository DelayStream, IdentityValidator and timeout helpers. It uses socket streams and standalone test-host adapters, not the repository testhost.

  • dotnet build .\source-tests.csproj --no-restore --verbosity quiet -p:SourceRoot=<exported-original-sources> followed by dotnet .\bin\Debug\net12.0\source-tests.dll: original sources reproduced the same seven failures; 33 passed, 7 failed.
  • dotnet build .\source-tests.csproj --no-restore --verbosity quiet followed by dotnet .\bin\Debug\net12.0\source-tests.dll: patched sources passed all 40 cases, covering authentication with delays 0/1 and target names across all 13 variants, plus the protection mismatch test.
  • dotnet run --project .\negotiate-probe.csproj --verbosity quiet: 16 protocol cases passed across synchronous/asynchronous authentication, empty/named targets and four protection-level pairs. Successful cases checked data roundtrips; mismatches checked both AuthenticationExceptions and rejected writes.
  • git diff --check: passed.

Full repository build/test suite, NativeAOT execution and old/new Windows Server 2019 container replay were not run. Container-update timing supports the Windows hardening diagnosis but was not A/B tested.

Resolves #138073
Resolves #138074

Note

This PR description and code changes were generated with GitHub Copilot.

Allow optional signing with ProtectionLevel.None while retaining encryption and endpoint-consistency assertions. Require encryption in the protection mismatch test so default NTLM signing cannot satisfy the server requirement.

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 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: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@rzikm

rzikm commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

/ba-g Test failures are unrelated

@rzikm
rzikm merged commit 26e94f3 into dotnet:main Nov 24, 2026
65 of 67 checks passed
@rzikm

rzikm commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

/backport to release/11.0

@rzikm

rzikm commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0 (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

lewing pushed a commit that referenced this pull request Nov 24, 2026
…tream tests (#138197)

Backport of #138129 to release/11.0

/cc @rzikm

Windows updates released on and after November 10, 2026 [offer NTLM
signing by
default](https://support.microsoft.com/en-us/servicing/os/windows/docs/2026/11/kb5135557-ntlm-signing-security-improvements),
even when an application does not request integrity. This exposes two
outdated assumptions in the Windows-only NegotiateStream tests:
ProtectionLevel.None implies no signing, and a None-client/Sign-server
handshake must fail. The failing assertions concern IsSigned, not
IsEncrypted, and affect both CoreCLR and NativeAOT Windows CI.

Allow optional signing for the None cases while retaining every
encryption assertion, requiring signing for encrypted contexts, and
checking that client and server signing agree. Change the negative
test's server requirement to EncryptAndSign so default signing cannot
satisfy the mismatch. No production code or test skips are changed.

## Customer Impact

Test-only change

## Regression

No regression in .NET. Caused by Windows update.

## Testing

Tests in CI

## Risk

Low, test-only change

Co-authored-by: Radek Zikmund <[email protected]>
Co-authored-by: Copilot App <[email protected]>
lewing pushed a commit that referenced this pull request Nov 24, 2026
…tream tests (#138198)

Backport of #138129 to release/10.0

/cc @rzikm

Windows updates released on and after November 10, 2026 [offer NTLM
signing by
default](https://support.microsoft.com/en-us/servicing/os/windows/docs/2026/11/kb5135557-ntlm-signing-security-improvements),
even when an application does not request integrity. This exposes two
outdated assumptions in the Windows-only NegotiateStream tests:
ProtectionLevel.None implies no signing, and a None-client/Sign-server
handshake must fail. The failing assertions concern IsSigned, not
IsEncrypted, and affect both CoreCLR and NativeAOT Windows CI.

Allow optional signing for the None cases while retaining every
encryption assertion, requiring signing for encrypted contexts, and
checking that client and server signing agree. Change the negative
test's server requirement to EncryptAndSign so default signing cannot
satisfy the mismatch. No production code or test skips are changed.

## Customer Impact

Test-only change

## Regression

No regression in .NET. Caused by Windows update.

## Testing

Tests in CI

## Risk

Low, test-only change

Co-authored-by: Radek Zikmund <[email protected]>
Co-authored-by: Copilot App <[email protected]>
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants