Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UseManagedNtlm linker substitutions #90957

Merged
merged 5 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<linker>
<assembly fullname="System.Net.Security">
<type fullname="System.Net.NegotiateAuthenticationPal">
<method signature="System.Boolean get_UseManagedNtlm()" feature="System.Net.Security.UseManagedNtlm" featurevalue="false" featuredefault="true" body="stub" value="false" />
</type>
</assembly>
</linker>
Copy link
Contributor

@teo-tsirpanis teo-tsirpanis Aug 22, 2023

Choose a reason for hiding this comment

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

How about you call it ILLink.Substitutions.Apple.xml? OSXLike does not exist in any other file.

(misclicked Approve 😅)

Copy link
Member Author

Choose a reason for hiding this comment

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

I have no strong preference on this, but Apple sounds good. There's at least one other case where OSX is used for both macOS and iOS.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<UseManagedNtlm Condition="'$(TargetPlatformIdentifier)' == 'android' or '$(TargetPlatformIdentifier)' == 'tvos'">true</UseManagedNtlm>
<DefineConstants Condition="'$(UseAndroidCrypto)' == 'true' or '$(UseAppleCrypto)' == 'true'">$(DefineConstants);SYSNETSECURITY_NO_OPENSSL</DefineConstants>
<GenAPIExcludeApiList>ReferenceAssemblyExclusions.txt</GenAPIExcludeApiList>
<ILLinkArgs>$(ILLinkArgs) --ignore-substitutions</ILLinkArgs>
</PropertyGroup>
<Import Project="$(CommonPath)System\Security\Cryptography\Asn1Reader\System.Security.Cryptography.Asn1Reader.Shared.projitems" Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'" />
<ItemGroup>
Expand Down Expand Up @@ -284,7 +285,8 @@
<Compile Include="System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(UseManagedNtlm)' != 'true'">
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
<ILLinkSubstitutionsXmls Condition="'$(TargetPlatformIdentifier)' == 'linux'" Include="$(ILLinkDirectory)ILLink.Substitutions.Linux.xml" />
<ILLinkSubstitutionsXmls Condition="'$(TargetPlatformIdentifier)' != 'linux'" Include="$(ILLinkDirectory)ILLink.Substitutions.OSXLike.xml" />
<Compile Include="System\Net\NegotiateAuthenticationPal.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace System.Net
{
internal partial class NegotiateAuthenticationPal
{
private static bool UseManagedNtlm { get; } =
public static bool UseManagedNtlm { get; } =
filipnavara marked this conversation as resolved.
Show resolved Hide resolved
AppContext.TryGetSwitch("System.Net.Security.UseManagedNtlm", out bool useManagedNtlm) ?
useManagedNtlm :
OperatingSystem.IsMacOS() || OperatingSystem.IsIOS() || OperatingSystem.IsMacCatalyst();
Expand Down