From dd38ff620b3777aa26835db4c2456b26c6468463 Mon Sep 17 00:00:00 2001 From: Andrew Stakhov Date: Tue, 9 Nov 2021 19:47:47 -0500 Subject: [PATCH 1/5] Remove SupportedOSPlatformAttribute("windows") from LdapSessionOptions due to LDAPS now being supported on Linux as of .NET 6 --- .../ref/System.DirectoryServices.Protocols.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs index c06c517d0aca6..1b740db20bef2 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -372,7 +372,6 @@ internal LdapSessionOptions() { } public bool RootDseCache { get { throw null; } set { } } public string SaslMethod { get { throw null; } set { } } public bool Sealing { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public bool SecureSocketLayer { get { throw null; } set { } } public object SecurityContext { get { throw null; } } public System.TimeSpan SendTimeout { get { throw null; } set { } } From e70a3386564f9578bb950d43ebb7bf2171ef74e3 Mon Sep 17 00:00:00 2001 From: Andrew Stakhov Date: Wed, 10 Nov 2021 10:11:54 -0500 Subject: [PATCH 2/5] Add explicit support for Linux on SSL in LdapSessionOptions. This changes previous commit that removed attribute entirely --- .../ref/System.DirectoryServices.Protocols.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs index 1b740db20bef2..0cf2928d00005 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -372,6 +372,8 @@ internal LdapSessionOptions() { } public bool RootDseCache { get { throw null; } set { } } public string SaslMethod { get { throw null; } set { } } public bool Sealing { get { throw null; } set { } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] + [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")] public bool SecureSocketLayer { get { throw null; } set { } } public object SecurityContext { get { throw null; } } public System.TimeSpan SendTimeout { get { throw null; } set { } } From 216c08ba701e2e519a27406d3905624e9b3100bb Mon Sep 17 00:00:00 2001 From: Andrew Stakhov Date: Wed, 10 Nov 2021 15:30:55 -0500 Subject: [PATCH 3/5] Add SupportedOSPlatformAttribute for LdapSessionOptions.SecureSocketLayer to implementation sources --- .../Protocols/ldap/LdapSessionOptions.Linux.cs | 2 ++ .../Protocols/ldap/LdapSessionOptions.Windows.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs index 96661bd33a7b4..ec78e90001161 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs @@ -11,6 +11,8 @@ private static void PALCertFreeCRLContext(IntPtr certPtr) { /* No op */ } private bool _secureSocketLayer; + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] + [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")] public bool SecureSocketLayer { get diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs index 813005c5ecb72..771452700f957 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs @@ -10,6 +10,8 @@ public partial class LdapSessionOptions { private static void PALCertFreeCRLContext(IntPtr certPtr) => Interop.Ldap.CertFreeCRLContext(certPtr); + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] + [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")] public bool SecureSocketLayer { get From 8fdf24b52a875aa3b58180cd23958be4ef796c3d Mon Sep 17 00:00:00 2001 From: Andrew Stakhov Date: Wed, 10 Nov 2021 16:56:41 -0500 Subject: [PATCH 4/5] Remove SupportedOSPlatformAttribute from LdapSessionOptions.SecureSocketLayer --- .../ref/System.DirectoryServices.Protocols.cs | 2 -- .../Protocols/ldap/LdapSessionOptions.Linux.cs | 3 --- .../Protocols/ldap/LdapSessionOptions.Windows.cs | 2 -- 3 files changed, 7 deletions(-) diff --git a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs index 0cf2928d00005..1b740db20bef2 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -372,8 +372,6 @@ internal LdapSessionOptions() { } public bool RootDseCache { get { throw null; } set { } } public string SaslMethod { get { throw null; } set { } } public bool Sealing { get { throw null; } set { } } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] - [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")] public bool SecureSocketLayer { get { throw null; } set { } } public object SecurityContext { get { throw null; } } public System.TimeSpan SendTimeout { get { throw null; } set { } } diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs index ec78e90001161..e54f0597c4133 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs @@ -10,9 +10,6 @@ public partial class LdapSessionOptions private static void PALCertFreeCRLContext(IntPtr certPtr) { /* No op */ } private bool _secureSocketLayer; - - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] - [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")] public bool SecureSocketLayer { get diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs index 771452700f957..813005c5ecb72 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Windows.cs @@ -10,8 +10,6 @@ public partial class LdapSessionOptions { private static void PALCertFreeCRLContext(IntPtr certPtr) => Interop.Ldap.CertFreeCRLContext(certPtr); - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] - [System.Runtime.Versioning.SupportedOSPlatformAttribute("linux")] public bool SecureSocketLayer { get From d4961ffcb20783f6b9e3a14436aadf2e99f88bcf Mon Sep 17 00:00:00 2001 From: Jose Perez Rodriguez Date: Fri, 19 Nov 2021 15:10:22 -0800 Subject: [PATCH 5/5] Re-adding extra line --- .../DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs index e54f0597c4133..96661bd33a7b4 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.Linux.cs @@ -10,6 +10,7 @@ public partial class LdapSessionOptions private static void PALCertFreeCRLContext(IntPtr certPtr) { /* No op */ } private bool _secureSocketLayer; + public bool SecureSocketLayer { get