From c70189f122497d9b062a4405ad06d949a03ec6b6 Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Fri, 2 Aug 2024 14:26:53 +0200 Subject: [PATCH 01/11] Obsolete KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream. --- docs/project/list-of-diagnostics.md | 1 + .../Common/src/System/Obsoletions.cs | 3 ++ .../ref/System.Net.Primitives.cs | 11 ++++--- .../Net/SecureProtocols/SslEnumTypes.cs | 4 +++ .../ref/System.Net.Security.cs | 30 +++++++++++-------- .../Net/Security/NetEventSource.Security.cs | 2 ++ .../Net/Security/SslConnectionInfo.Unix.cs | 2 ++ .../Net/Security/SslConnectionInfo.Unix.tt | 3 +- .../src/System/Net/Security/SslStream.IO.cs | 3 +- .../src/System/Net/Security/SslStream.cs | 6 ++++ .../ClientAsyncAuthenticateTest.cs | 4 +++ .../ClientDefaultEncryptionTest.cs | 4 +++ .../ServerAllowNoEncryptionTest.cs | 7 +++++ .../ServerAsyncAuthenticateTest.cs | 2 ++ .../FunctionalTests/ServerNoEncryptionTest.cs | 4 ++- .../ServerRequireEncryptionTest.cs | 8 +++-- .../SslStreamSystemDefaultsTest.cs | 2 ++ 17 files changed, 75 insertions(+), 21 deletions(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 72597030dffaaa..782a417cb829af 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -112,6 +112,7 @@ The PR that reveals the implementation of the ` private void UsingCachedCredential(int sslStreamHash) => WriteEvent(UsingCachedCredentialId, sslStreamHash); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. [Event(SspiSelectedCipherSuitId, Keywords = Keywords.Default, Level = EventLevel.Informational)] public void SspiSelectedCipherSuite( string process, @@ -204,6 +205,7 @@ public void SspiSelectedCipherSuite( process, (int)sslProtocol, (int)cipherAlgorithm, cipherStrength, (int)hashAlgorithm, hashStrength, (int)keyExchangeAlgorithm, keyExchangeStrength); } +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. [NonEvent] public void RemoteCertificateError(SslStream SslStream, string message) => diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs index e68fb8e693bfb1..71c8d628cb2096 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs @@ -10,6 +10,8 @@ using System.Diagnostics; using System.Security.Authentication; +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. + namespace System.Net.Security { internal partial struct SslConnectionInfo diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt index 6d853177e69c46..44749a7ee9d971 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt @@ -13,10 +13,11 @@ <# Array dataCipherAlgs = typeof(CipherAlgorithmTypeIndex).GetEnumValues(); #> <# Array dataHashAlgs = typeof(HashAlgorithmTypeIndex).GetEnumValues(); #> - using System.Diagnostics; using System.Security.Authentication; +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. + namespace System.Net.Security { internal partial struct SslConnectionInfo diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs index faf807ff2603f0..d24f24a0fb60fb 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs @@ -392,6 +392,7 @@ private async Task ForceAuthenticationAsync(bool receiveFirst, byte[ _localClientCertificateUsed = -1; } +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. if (NetEventSource.Log.IsEnabled()) NetEventSource.Log.SspiSelectedCipherSuite(nameof(ForceAuthenticationAsync), SslProtocol, @@ -401,7 +402,7 @@ private async Task ForceAuthenticationAsync(bool receiveFirst, byte[ HashStrength, KeyExchangeAlgorithm, KeyExchangeStrength); - +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } // This method will make sure we have at least one full TLS frame buffered. diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs index 4b3893156be3e1..5607489e38d55d 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs @@ -580,6 +580,7 @@ public virtual TlsCipherSuite NegotiatedCipherSuite } } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public virtual CipherAlgorithmType CipherAlgorithm { get @@ -589,6 +590,7 @@ public virtual CipherAlgorithmType CipherAlgorithm } } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public virtual int CipherStrength { get @@ -598,6 +600,7 @@ public virtual int CipherStrength } } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public virtual HashAlgorithmType HashAlgorithm { get @@ -607,6 +610,7 @@ public virtual HashAlgorithmType HashAlgorithm } } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public virtual int HashStrength { get @@ -616,6 +620,7 @@ public virtual int HashStrength } } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public virtual ExchangeAlgorithmType KeyExchangeAlgorithm { get @@ -625,6 +630,7 @@ public virtual ExchangeAlgorithmType KeyExchangeAlgorithm } } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public virtual int KeyExchangeStrength { get diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs index 73c102d51e953a..16443d97e85ffc 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs @@ -156,10 +156,12 @@ private async Task ClientAsyncSslHelper( await clientTask.WaitAsync(TestConfiguration.PassingTestTimeout); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server with encryption cipher: {0} {1}-bit strength", client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } finally { @@ -197,7 +199,9 @@ private bool AllowAnyServerCertificateAndVerifyConnectionInfo( SslStream stream = (SslStream)sender; Assert.NotEqual(SslProtocols.None, stream.SslProtocol); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. Assert.NotEqual(CipherAlgorithmType.None, stream.CipherAlgorithm); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. return true; // allow everything } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs index 6059ec3477184a..7e81899d9726cd 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs @@ -34,10 +34,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength) ; Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } @@ -56,10 +58,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs index dea9fbe963f9b1..10078580d5db27 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs @@ -35,10 +35,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocols.None, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.NotEqual(CipherAlgorithmType.Null, client.CipherAlgorithm); Assert.True(client.CipherStrength > 0); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } @@ -59,10 +61,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocols.None, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.NotEqual(CipherAlgorithmType.Null, client.CipherAlgorithm); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } @@ -85,12 +89,15 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); #pragma warning restore SYSLIB0039 + +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); CipherAlgorithmType expected = CipherAlgorithmType.Null; Assert.Equal(expected, client.CipherAlgorithm); Assert.Equal(0, client.CipherStrength); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs index 446b87e5e773ba..0529fe3b80dd31 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs @@ -429,6 +429,7 @@ private async Task ServerAsyncSslHelper( await serverAuthentication.WaitAsync(TestConfiguration.PassingTestTimeout); _logVerbose.WriteLine("ServerAsyncAuthenticateTest.serverAuthentication complete."); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine( "Server({0}) authenticated with encryption cipher: {1} {2}-bit strength", serverStream.Socket.LocalEndPoint, @@ -440,6 +441,7 @@ private async Task ServerAsyncSslHelper( "Cipher algorithm should not be NULL"); Assert.True(sslServerStream.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs index c23a38a8854257..51d4848a6ad1a6 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs @@ -70,13 +70,15 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( // null encryption is not permitted with Tls13 client.AuthenticateAsClientAsync("localhost", null, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning restore SYSLIB0039 +#pragma warning restore SYSLIB0039 +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", serverStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.Equal(CipherAlgorithmType.Null, client.CipherAlgorithm); Assert.Equal(0, client.CipherStrength); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs index 992cafcc581f1e..8e6d5b4e3493fb 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs @@ -34,10 +34,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } @@ -58,10 +60,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } @@ -79,10 +83,10 @@ public async Task ServerRequireEncryption_ClientNoEncryption_NoConnect() using (var server = new SslStream(serverStream)) { Task serverTask = server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate); -#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete +#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete await Assert.ThrowsAsync(TestConfiguration.SupportsHandshakeAlerts ? typeof(AuthenticationException) : typeof(IOException), () => client.AuthenticateAsClientAsync("localhost", null, SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12, false)); -#pragma warning restore SYSLIB0039 +#pragma warning restore SYSLIB0039 try { await serverTask.WaitAsync(TestConfiguration.PassingTestTimeout); diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs index 51b28f5b26f60c..b9ec3bec495258 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs @@ -95,6 +95,7 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( #pragma warning restore 0618 { Assert.True( +#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. #pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete (_clientStream.SslProtocol == SslProtocols.Tls11 && _clientStream.HashAlgorithm == HashAlgorithmType.Sha1) || #pragma warning restore SYSLIB0039 @@ -102,6 +103,7 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( _clientStream.HashAlgorithm == HashAlgorithmType.Sha384 || _clientStream.HashAlgorithm == HashAlgorithmType.Sha512, _clientStream.SslProtocol + " " + _clientStream.HashAlgorithm); +#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. } } } From 734f2a3a42b99a0e2e3e19820fd06db22330b2d8 Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Fri, 2 Aug 2024 15:05:28 +0200 Subject: [PATCH 02/11] Fix build of S.N.S --- docs/project/list-of-diagnostics.md | 2 +- .../Common/src/System/Obsoletions.cs | 2 +- .../SocketsHttpHandler/HttpConnectionBase.cs | 2 ++ .../ref/System.Net.Primitives.cs | 6 ++-- .../ref/System.Net.Security.cs | 12 ++++---- .../Net/Security/NetEventSource.Security.cs | 4 +-- .../Net/Security/SslConnectionInfo.Unix.cs | 2 +- .../src/System/Net/Security/SslStream.IO.cs | 4 +-- .../ClientAsyncAuthenticateTest.cs | 30 ++++++++++--------- .../ClientDefaultEncryptionTest.cs | 10 +++---- .../ServerAllowNoEncryptionTest.cs | 12 ++++---- .../ServerAsyncAuthenticateTest.cs | 4 +-- .../FunctionalTests/ServerNoEncryptionTest.cs | 4 +-- .../ServerRequireEncryptionTest.cs | 8 ++--- .../SslStreamSystemDefaultsTest.cs | 4 +-- 15 files changed, 55 insertions(+), 51 deletions(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 782a417cb829af..e14f9adb49764d 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -112,7 +112,7 @@ The PR that reveals the implementation of the ` private void UsingCachedCredential(int sslStreamHash) => WriteEvent(UsingCachedCredentialId, sslStreamHash); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. [Event(SspiSelectedCipherSuitId, Keywords = Keywords.Default, Level = EventLevel.Informational)] public void SspiSelectedCipherSuite( string process, @@ -205,7 +205,7 @@ public void SspiSelectedCipherSuite( process, (int)sslProtocol, (int)cipherAlgorithm, cipherStrength, (int)hashAlgorithm, hashStrength, (int)keyExchangeAlgorithm, keyExchangeStrength); } -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. [NonEvent] public void RemoteCertificateError(SslStream SslStream, string message) => diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs index 71c8d628cb2096..baf35867eb598e 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs @@ -10,7 +10,7 @@ using System.Diagnostics; using System.Security.Authentication; -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. namespace System.Net.Security { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs index d24f24a0fb60fb..eac06538b92119 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs @@ -392,7 +392,7 @@ private async Task ForceAuthenticationAsync(bool receiveFirst, byte[ _localClientCertificateUsed = -1; } -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. if (NetEventSource.Log.IsEnabled()) NetEventSource.Log.SspiSelectedCipherSuite(nameof(ForceAuthenticationAsync), SslProtocol, @@ -402,7 +402,7 @@ private async Task ForceAuthenticationAsync(bool receiveFirst, byte[ HashStrength, KeyExchangeAlgorithm, KeyExchangeStrength); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } // This method will make sure we have at least one full TLS frame buffered. diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs index 16443d97e85ffc..e3f11f7e835cde 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientAsyncAuthenticateTest.cs @@ -143,25 +143,27 @@ private async Task ClientAsyncSslHelper( try { Task clientTask = client.AuthenticateAsClientAsync(new SslClientAuthenticationOptions - { - EnabledSslProtocols = clientSslProtocols, - RemoteCertificateValidationCallback = AllowAnyServerCertificate, - TargetHost = serverName }); - serverTask = server.AuthenticateAsServerAsync( new SslServerAuthenticationOptions - { - EncryptionPolicy = encryptionPolicy, - EnabledSslProtocols = serverSslProtocols, - ServerCertificate = TestConfiguration.ServerCertificate, - CertificateRevocationCheckMode = X509RevocationMode.NoCheck }); + { + EnabledSslProtocols = clientSslProtocols, + RemoteCertificateValidationCallback = AllowAnyServerCertificate, + TargetHost = serverName + }); + serverTask = server.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + EncryptionPolicy = encryptionPolicy, + EnabledSslProtocols = serverSslProtocols, + ServerCertificate = TestConfiguration.ServerCertificate, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck + }); await clientTask.WaitAsync(TestConfiguration.PassingTestTimeout); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server with encryption cipher: {0} {1}-bit strength", client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } finally { @@ -199,9 +201,9 @@ private bool AllowAnyServerCertificateAndVerifyConnectionInfo( SslStream stream = (SslStream)sender; Assert.NotEqual(SslProtocols.None, stream.SslProtocol); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. Assert.NotEqual(CipherAlgorithmType.None, stream.CipherAlgorithm); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. return true; // allow everything } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs index 7e81899d9726cd..083aa5c5aad6b3 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ClientDefaultEncryptionTest.cs @@ -34,12 +34,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", - clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength) ; + clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } @@ -58,12 +58,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs index 10078580d5db27..f4c47cf0605cb7 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAllowNoEncryptionTest.cs @@ -35,12 +35,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocols.None, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.NotEqual(CipherAlgorithmType.Null, client.CipherAlgorithm); Assert.True(client.CipherStrength > 0); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } @@ -61,12 +61,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocols.None, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.NotEqual(CipherAlgorithmType.Null, client.CipherAlgorithm); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } @@ -90,14 +90,14 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); #pragma warning restore SYSLIB0039 -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); CipherAlgorithmType expected = CipherAlgorithmType.Null; Assert.Equal(expected, client.CipherAlgorithm); Assert.Equal(0, client.CipherStrength); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs index 0529fe3b80dd31..44861f71ee3082 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerAsyncAuthenticateTest.cs @@ -429,7 +429,7 @@ private async Task ServerAsyncSslHelper( await serverAuthentication.WaitAsync(TestConfiguration.PassingTestTimeout); _logVerbose.WriteLine("ServerAsyncAuthenticateTest.serverAuthentication complete."); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine( "Server({0}) authenticated with encryption cipher: {1} {2}-bit strength", serverStream.Socket.LocalEndPoint, @@ -441,7 +441,7 @@ private async Task ServerAsyncSslHelper( "Cipher algorithm should not be NULL"); Assert.True(sslServerStream.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs index 51d4848a6ad1a6..d93a4e2a999d27 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerNoEncryptionTest.cs @@ -72,13 +72,13 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); #pragma warning restore SYSLIB0039 -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", serverStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.Equal(CipherAlgorithmType.Null, client.CipherAlgorithm); Assert.Equal(0, client.CipherStrength); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs index 8e6d5b4e3493fb..63adbe3e96a49c 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/ServerRequireEncryptionTest.cs @@ -34,12 +34,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } @@ -60,12 +60,12 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( client.AuthenticateAsClientAsync("localhost", null, SslProtocolSupport.DefaultSslProtocols, false), server.AuthenticateAsServerAsync(TestConfiguration.ServerCertificate)); -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. _log.WriteLine("Client authenticated to server({0}) with encryption cipher: {1} {2}-bit strength", clientStream.Socket.RemoteEndPoint, client.CipherAlgorithm, client.CipherStrength); Assert.True(client.CipherAlgorithm != CipherAlgorithmType.Null, "Cipher algorithm should not be NULL"); Assert.True(client.CipherStrength > 0, "Cipher strength should be greater than 0"); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs index b9ec3bec495258..5bdfa0f5d7ac65 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/SslStreamSystemDefaultsTest.cs @@ -95,7 +95,7 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( #pragma warning restore 0618 { Assert.True( -#pragma warning disable SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. #pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete (_clientStream.SslProtocol == SslProtocols.Tls11 && _clientStream.HashAlgorithm == HashAlgorithmType.Sha1) || #pragma warning restore SYSLIB0039 @@ -103,7 +103,7 @@ await TestConfiguration.WhenAllOrAnyFailedWithTimeout( _clientStream.HashAlgorithm == HashAlgorithmType.Sha384 || _clientStream.HashAlgorithm == HashAlgorithmType.Sha512, _clientStream.SslProtocol + " " + _clientStream.HashAlgorithm); -#pragma warning restore SYSLIB0058 // Use NegotiatedTlsCipherSuite. +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. } } } From f5f6435b9d03d39c37f6d9de948c421a28f88428 Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Fri, 2 Aug 2024 15:20:40 +0200 Subject: [PATCH 03/11] Tentatively unobsolete enum types --- .../System.Net.Primitives/ref/System.Net.Primitives.cs | 3 --- .../src/System/Net/SecureProtocols/SslEnumTypes.cs | 3 --- 2 files changed, 6 deletions(-) diff --git a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs index 770d0cd351a3b3..694ec16f4f90e6 100644 --- a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs +++ b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs @@ -526,7 +526,6 @@ protected SocketException(System.Runtime.Serialization.SerializationInfo seriali } namespace System.Security.Authentication { - [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public enum CipherAlgorithmType { None = 0, @@ -540,7 +539,6 @@ public enum CipherAlgorithmType Aes = 26129, Rc4 = 26625, } - [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public enum ExchangeAlgorithmType { None = 0, @@ -548,7 +546,6 @@ public enum ExchangeAlgorithmType RsaKeyX = 41984, DiffieHellman = 43522, } - [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public enum HashAlgorithmType { None = 0, diff --git a/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs b/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs index a79e11dd7729f2..8a2a75fbe204a8 100644 --- a/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs +++ b/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs @@ -25,7 +25,6 @@ public enum SslProtocols Default = Ssl3 | Tls } - [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public enum ExchangeAlgorithmType { None = 0, @@ -34,7 +33,6 @@ public enum ExchangeAlgorithmType DiffieHellman = (Interop.Crypt32.ALG_CLASS_KEY_EXCHANGE | Interop.Crypt32.ALG_TYPE_DH | Interop.Crypt32.ALG_SID_DH_EPHEM), } - [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public enum CipherAlgorithmType { None = 0, // No encryption @@ -49,7 +47,6 @@ public enum CipherAlgorithmType Null = (Interop.Crypt32.ALG_CLASS_ENCRYPT), // 0-bit NULL cipher algorithm } - [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public enum HashAlgorithmType { None = 0, From 2ec5f9f0c0aedec96768d81edfb27246a55c788c Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Sat, 3 Aug 2024 10:19:32 +0200 Subject: [PATCH 04/11] Revert "Tentatively unobsolete enum types" This reverts commit f5f6435b9d03d39c37f6d9de948c421a28f88428. --- .../System.Net.Primitives/ref/System.Net.Primitives.cs | 3 +++ .../src/System/Net/SecureProtocols/SslEnumTypes.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs index 694ec16f4f90e6..770d0cd351a3b3 100644 --- a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs +++ b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs @@ -526,6 +526,7 @@ protected SocketException(System.Runtime.Serialization.SerializationInfo seriali } namespace System.Security.Authentication { + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public enum CipherAlgorithmType { None = 0, @@ -539,6 +540,7 @@ public enum CipherAlgorithmType Aes = 26129, Rc4 = 26625, } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public enum ExchangeAlgorithmType { None = 0, @@ -546,6 +548,7 @@ public enum ExchangeAlgorithmType RsaKeyX = 41984, DiffieHellman = 43522, } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public enum HashAlgorithmType { None = 0, diff --git a/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs b/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs index 8a2a75fbe204a8..a79e11dd7729f2 100644 --- a/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs +++ b/src/libraries/System.Net.Primitives/src/System/Net/SecureProtocols/SslEnumTypes.cs @@ -25,6 +25,7 @@ public enum SslProtocols Default = Ssl3 | Tls } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public enum ExchangeAlgorithmType { None = 0, @@ -33,6 +34,7 @@ public enum ExchangeAlgorithmType DiffieHellman = (Interop.Crypt32.ALG_CLASS_KEY_EXCHANGE | Interop.Crypt32.ALG_TYPE_DH | Interop.Crypt32.ALG_SID_DH_EPHEM), } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public enum CipherAlgorithmType { None = 0, // No encryption @@ -47,6 +49,7 @@ public enum CipherAlgorithmType Null = (Interop.Crypt32.ALG_CLASS_ENCRYPT), // 0-bit NULL cipher algorithm } + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public enum HashAlgorithmType { None = 0, From 8307afcccf08c181d8c3c33e37ca5081e918127c Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Sat, 3 Aug 2024 10:39:30 +0200 Subject: [PATCH 05/11] Obsolete other usages of enums --- .../ref/System.DirectoryServices.Protocols.cs | 6 ++++++ .../Protocols/ldap/LdapSessionOptions.cs | 8 ++++++++ 2 files changed, 14 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 32262da81be3e2..4b3c1de22c5e88 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -658,11 +658,17 @@ public enum SecurityMasks public partial class SecurityPackageContextConnectionInformation { internal SecurityPackageContextConnectionInformation() { } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public System.Security.Authentication.CipherAlgorithmType AlgorithmIdentifier { get { throw null; } } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public int CipherStrength { get { throw null; } } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public int ExchangeStrength { get { throw null; } } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public System.Security.Authentication.HashAlgorithmType Hash { get { throw null; } } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public int HashStrength { get { throw null; } } + [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public int KeyExchangeAlgorithm { get { throw null; } } public System.DirectoryServices.Protocols.SecurityProtocol Protocol { get { throw null; } } } diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs index 0fa241fc30113d..73e96010fc62c7 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs @@ -71,9 +71,11 @@ public class SecurityPackageContextConnectionInformation { // Not marked as readonly to enable passing to Unsafe.As in GetPinnableReference. private SecurityProtocol _securityProtocol; +#pragma warning disable SYSLIB0058 // Use NegotiatedCipherSuite. private readonly CipherAlgorithmType _identifier; private readonly int _strength; private readonly HashAlgorithmType _hashAlgorithm; +#pragma warning restore SYSLIB0058 // Use NegotiatedCipherSuite. private readonly int _hashStrength; private readonly int _keyExchangeAlgorithm; private readonly int _exchangeStrength; @@ -84,16 +86,22 @@ internal SecurityPackageContextConnectionInformation() public SecurityProtocol Protocol => _securityProtocol; + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public CipherAlgorithmType AlgorithmIdentifier => _identifier; + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public int CipherStrength => _strength; + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public HashAlgorithmType Hash => _hashAlgorithm; + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public int HashStrength => _hashStrength; + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public int KeyExchangeAlgorithm => _keyExchangeAlgorithm; + [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] public int ExchangeStrength => _exchangeStrength; internal ref readonly byte GetPinnableReference() => ref Unsafe.As(ref _securityProtocol); From b01d7c1dced092c06d03deb889b9ea7adfdab102 Mon Sep 17 00:00:00 2001 From: wfurt Date: Mon, 5 Aug 2024 12:10:46 +0200 Subject: [PATCH 06/11] 9.0 --- .../ref/System.DirectoryServices.Protocols.cs | 12 ++++++++++++ 1 file changed, 12 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 4b3c1de22c5e88..b1a33305e21477 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -658,17 +658,29 @@ public enum SecurityMasks public partial class SecurityPackageContextConnectionInformation { internal SecurityPackageContextConnectionInformation() { } +#if NET9_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] +#endif public System.Security.Authentication.CipherAlgorithmType AlgorithmIdentifier { get { throw null; } } +#if NET9_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] +#endif public int CipherStrength { get { throw null; } } +#if NET9_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] +#endif public int ExchangeStrength { get { throw null; } } +#if NET9_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] +#endif public System.Security.Authentication.HashAlgorithmType Hash { get { throw null; } } +#if NET9_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] +#endif public int HashStrength { get { throw null; } } +#if NET9_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] +#endif public int KeyExchangeAlgorithm { get { throw null; } } public System.DirectoryServices.Protocols.SecurityProtocol Protocol { get { throw null; } } } From ef918ace3b08866ea21db0324d77bc0a9e785dfe Mon Sep 17 00:00:00 2001 From: wfurt Date: Tue, 6 Aug 2024 12:56:36 -0700 Subject: [PATCH 07/11] Suppressions --- .../src/CompatibilitySuppressions.xml | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml diff --git a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml new file mode 100644 index 00000000000000..0abcacd0551169 --- /dev/null +++ b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml @@ -0,0 +1,220 @@ + + + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + lib/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + \ No newline at end of file From 76feeac00332fe42bf5057b24998a94673f4e1ad Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Thu, 15 Aug 2024 12:10:26 +0200 Subject: [PATCH 08/11] Change #ifdef checks to 10.0 --- .../ref/System.DirectoryServices.Protocols.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 b1a33305e21477..cf1b9154d7befe 100644 --- a/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs +++ b/src/libraries/System.DirectoryServices.Protocols/ref/System.DirectoryServices.Protocols.cs @@ -658,27 +658,27 @@ public enum SecurityMasks public partial class SecurityPackageContextConnectionInformation { internal SecurityPackageContextConnectionInformation() { } -#if NET9_0_OR_GREATER +#if NET10_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.Authentication.CipherAlgorithmType AlgorithmIdentifier { get { throw null; } } -#if NET9_0_OR_GREATER +#if NET10_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public int CipherStrength { get { throw null; } } -#if NET9_0_OR_GREATER +#if NET10_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public int ExchangeStrength { get { throw null; } } -#if NET9_0_OR_GREATER +#if NET10_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public System.Security.Authentication.HashAlgorithmType Hash { get { throw null; } } -#if NET9_0_OR_GREATER +#if NET10_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public int HashStrength { get { throw null; } } -#if NET9_0_OR_GREATER +#if NET10_0_OR_GREATER [Obsolete("KeyExchangeAlgorithm, KeyExchangeStrength, CipherAlgorithm, CipherAlgorithmStrength, HashAlgorithm and HashStrength properties of SslStream are obsolete. Use NegotiatedCipherSuite instead.", DiagnosticId = "SYSLIB0058", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] #endif public int KeyExchangeAlgorithm { get { throw null; } } From 5bab62ae2d4200d6a211025d9825cbe4cbe6791d Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Wed, 2 Oct 2024 09:57:15 +0200 Subject: [PATCH 09/11] Update compatibility suppressions --- .../src/CompatibilitySuppressions.xml | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml index 0abcacd0551169..be6bd771f6f1a3 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml @@ -4,217 +4,217 @@ CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - lib/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + lib/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + ref/net9.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - \ No newline at end of file + From b6c3b5c0e03a530db3816e48d6b371bdfe8c2ba4 Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Wed, 2 Oct 2024 12:25:53 +0200 Subject: [PATCH 10/11] Regenerated suppresions --- .../src/CompatibilitySuppressions.xml | 112 +++++++++++++++++- 1 file changed, 110 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml index be6bd771f6f1a3..cd8d78e1390f03 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml @@ -1,5 +1,5 @@  - + CP0016 @@ -109,6 +109,114 @@ lib/net9.0/System.DirectoryServices.Protocols.dll runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + + + CP0016 + P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] + ref/net8.0/System.DirectoryServices.Protocols.dll + runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll + CP0016 P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] @@ -217,4 +325,4 @@ ref/net9.0/System.DirectoryServices.Protocols.dll runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - + \ No newline at end of file From 4209aa11925d97f6c49b40704f6098f79ee0efa3 Mon Sep 17 00:00:00 2001 From: Radek Zikmund Date: Thu, 3 Oct 2024 12:15:05 +0200 Subject: [PATCH 11/11] Fix build --- .../src/CompatibilitySuppressions.xml | 328 ------------------ .../Protocols/ldap/LdapSessionOptions.cs | 13 +- 2 files changed, 12 insertions(+), 329 deletions(-) delete mode 100644 src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml diff --git a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml b/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml deleted file mode 100644 index cd8d78e1390f03..00000000000000 --- a/src/libraries/System.DirectoryServices.Protocols/src/CompatibilitySuppressions.xml +++ /dev/null @@ -1,328 +0,0 @@ - - - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - lib/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net8.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net8.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/linux/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/osx/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.AlgorithmIdentifier:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.CipherStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.ExchangeStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.Hash:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.HashStrength:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - - CP0016 - P:System.DirectoryServices.Protocols.SecurityPackageContextConnectionInformation.KeyExchangeAlgorithm:[T:System.ObsoleteAttribute] - ref/net9.0/System.DirectoryServices.Protocols.dll - runtimes/win/lib/net9.0/System.DirectoryServices.Protocols.dll - - \ No newline at end of file diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs index 73e96010fc62c7..42fae51688a49f 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapSessionOptions.cs @@ -85,23 +85,34 @@ internal SecurityPackageContextConnectionInformation() } public SecurityProtocol Protocol => _securityProtocol; - +#if NET10_0_OR_GREATER [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] +#endif public CipherAlgorithmType AlgorithmIdentifier => _identifier; +#if NET10_0_OR_GREATER [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] +#endif public int CipherStrength => _strength; +#if NET10_0_OR_GREATER [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] +#endif public HashAlgorithmType Hash => _hashAlgorithm; +#if NET10_0_OR_GREATER [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] +#endif public int HashStrength => _hashStrength; +#if NET10_0_OR_GREATER [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] +#endif public int KeyExchangeAlgorithm => _keyExchangeAlgorithm; +#if NET10_0_OR_GREATER [Obsolete(Obsoletions.TlsCipherAlgorithmEnumsMessage, DiagnosticId = Obsoletions.TlsCipherAlgorithmEnumsDiagId, UrlFormat = Obsoletions.SharedUrlFormat)] +#endif public int ExchangeStrength => _exchangeStrength; internal ref readonly byte GetPinnableReference() => ref Unsafe.As(ref _securityProtocol);