-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use managed NTLM/SPNEGO on Apple platforms by default (#89267)
- Loading branch information
1 parent
762030c
commit 9d53816
Showing
2 changed files
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
using System; | ||
using System.Buffers; | ||
using System.Buffers.Binary; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Net.Security; | ||
using System.Net.Test.Common; | ||
|
@@ -148,15 +149,23 @@ public void NtlmProtocolExampleTest() | |
Assert.False(fakeNtlmServer.IsMICPresent); | ||
} | ||
|
||
[ConditionalFact(nameof(IsNtlmAvailable))] | ||
public void NtlmCorrectExchangeTest() | ||
public static IEnumerable<object[]> TestCredentials() | ||
{ | ||
using FakeNtlmServer fakeNtlmServer = new FakeNtlmServer(s_testCredentialRight); | ||
yield return new object[] { new NetworkCredential("rightusername", "rightpassword") }; | ||
yield return new object[] { new NetworkCredential("rightusername", "rightpassword", "rightdomain") }; | ||
yield return new object[] { new NetworkCredential("[email protected]", "rightpassword") }; | ||
} | ||
|
||
[ConditionalTheory(nameof(IsNtlmAvailable))] | ||
[MemberData(nameof(TestCredentials))] | ||
public void NtlmCorrectExchangeTest(NetworkCredential credential) | ||
{ | ||
using FakeNtlmServer fakeNtlmServer = new FakeNtlmServer(credential); | ||
NegotiateAuthentication ntAuth = new NegotiateAuthentication( | ||
new NegotiateAuthenticationClientOptions | ||
{ | ||
Package = "NTLM", | ||
Credential = s_testCredentialRight, | ||
Credential = credential, | ||
TargetName = "HTTP/foo", | ||
RequiredProtectionLevel = ProtectionLevel.Sign | ||
}); | ||
|
@@ -191,7 +200,6 @@ public void NtlmIncorrectExchangeTest() | |
} | ||
|
||
[ConditionalFact(nameof(IsNtlmAvailable))] | ||
[ActiveIssue("https://github.com/dotnet/runtime/issues/65678", TestPlatforms.OSX | TestPlatforms.iOS | TestPlatforms.MacCatalyst)] | ||
public void NtlmSignatureTest() | ||
{ | ||
using FakeNtlmServer fakeNtlmServer = new FakeNtlmServer(s_testCredentialRight); | ||
|
should we do it on tvOS as well?
edit nevermind, the .csproj forces UseManagedNtlm on tvOS