forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCapability.Security.Unix.cs
29 lines (27 loc) · 1.37 KB
/
Capability.Security.Unix.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Runtime.InteropServices;
namespace System.Net.Test.Common
{
public static partial class Capability
{
public static bool IsNtlmInstalled()
{
if (OperatingSystem.IsBrowser() || OperatingSystem.IsWasi())
{
return false;
}
return
// Linux bionic uses managed NTLM implementation
(OperatingSystem.IsLinux() && RuntimeInformation.RuntimeIdentifier.StartsWith("linux-bionic-", StringComparison.Ordinal)) ||
// GSS on Linux does not work with OpenSSL 3.0. Fix was submitted to gss-ntlm (v 1.2.0+) but it will take a while to make to
// all supported distributions. The second part of the check should be removed when it does. In the meantime, we whitelist
// distributions containing the updated gss-ntlm package.
Interop.NetSecurityNative.IsNtlmInstalled() && (!PlatformDetection.IsOpenSslSupported || PlatformDetection.OpenSslVersion.Major < 3
|| PlatformDetection.IsUbuntu23OrLater
// || PlatformDetection.IsFedora40OrLater
// || PlatformDetection.IsDebian12OrLater
);
}
}
}