Răsfoiți Sursa

Drop net6.0 target (#1580)

* Drop net6.0 target

* Update src/Renci.SshNet/Common/TaskToAsyncResult.cs

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

* remove redundant #if

for some reason this made the compiler suddenly
realize that the plain text variables are unused.

* use TargetFrameworkIdentifier

this doesn't work in Directory.Build.props, moved it to Directory.Build.targets.

* fix null reference warnings in Benchmarks

seems like the warnings were (somehow) disabled here
before and were fixed by the previous TargetFrameworkIdentifier
change.

* fix unused plainTextOffset in AesGcmCipher.BclImpl

* CI retry

* more cosmetics

* more

* update README

* Revert "use TargetFrameworkIdentifier"

This reverts commit 076ede161d05a1418710c68ba7ecc647bc74ef5c.

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
mus65 8 luni în urmă
părinte
comite
86dc811458
52 a modificat fișierele cu 110 adăugiri și 133 ștergeri
  1. 1 1
      Directory.Build.props
  2. 1 1
      README.md
  3. 2 2
      src/Renci.SshNet/Abstractions/CancellationTokenSourceExtensions.cs
  4. 2 2
      src/Renci.SshNet/Abstractions/SocketAbstraction.Async.cs
  5. 1 1
      src/Renci.SshNet/Abstractions/SocketAbstraction.cs
  6. 5 5
      src/Renci.SshNet/Abstractions/SocketExtensions.cs
  7. 2 4
      src/Renci.SshNet/Abstractions/StreamExtensions.cs
  8. 2 2
      src/Renci.SshNet/ClientAuthentication.cs
  9. 3 3
      src/Renci.SshNet/Common/Extensions.cs
  10. 2 2
      src/Renci.SshNet/Common/SshData.cs
  11. 2 2
      src/Renci.SshNet/Common/SshDataStream.cs
  12. 5 5
      src/Renci.SshNet/Common/TaskToAsyncResult.cs
  13. 4 4
      src/Renci.SshNet/Common/ThrowHelper.cs
  14. 4 4
      src/Renci.SshNet/Compression/Zlib.cs
  15. 1 1
      src/Renci.SshNet/Connection/HttpConnector.cs
  16. 3 3
      src/Renci.SshNet/Connection/ProtocolVersionExchange.cs
  17. 6 6
      src/Renci.SshNet/Connection/ProxyConnector.cs
  18. 2 2
      src/Renci.SshNet/Messages/Authentication/FailureMessage.cs
  19. 3 3
      src/Renci.SshNet/Netconf/NetConfSession.cs
  20. 1 1
      src/Renci.SshNet/PrivateKeyFile.cs
  21. 1 5
      src/Renci.SshNet/Renci.SshNet.csproj
  22. 3 3
      src/Renci.SshNet/ScpClient.cs
  23. 1 1
      src/Renci.SshNet/Security/Cryptography/Ciphers/AesCipher.cs
  24. 2 12
      src/Renci.SshNet/Security/Cryptography/Ciphers/AesGcmCipher.BclImpl.cs
  25. 2 2
      src/Renci.SshNet/Security/Cryptography/Ciphers/AesGcmCipher.cs
  26. 1 1
      src/Renci.SshNet/Security/Cryptography/Ciphers/TripleDesCipher.BlockImpl.cs
  27. 2 2
      src/Renci.SshNet/Security/Cryptography/Ciphers/TripleDesCipher.cs
  28. 1 1
      src/Renci.SshNet/Security/Cryptography/EcdsaKey.cs
  29. 1 1
      src/Renci.SshNet/Security/KeyExchangeECDH.BclImpl.cs
  30. 2 2
      src/Renci.SshNet/Security/KeyExchangeECDH.cs
  31. 1 1
      src/Renci.SshNet/Security/KeyExchangeECDH256.cs
  32. 1 1
      src/Renci.SshNet/Security/KeyExchangeECDH384.cs
  33. 1 1
      src/Renci.SshNet/Security/KeyExchangeECDH521.cs
  34. 2 2
      src/Renci.SshNet/Session.cs
  35. 5 5
      src/Renci.SshNet/Sftp/SftpFileStream.cs
  36. 8 8
      src/Renci.SshNet/Sftp/SftpSession.cs
  37. 2 2
      src/Renci.SshNet/SftpClient.cs
  38. 1 1
      src/Renci.SshNet/Shell.cs
  39. 2 2
      src/Renci.SshNet/ShellStream.cs
  40. 1 1
      test/Renci.SshNet.Benchmarks/Common/HostKeyEventArgsBenchmarks.cs
  41. 1 1
      test/Renci.SshNet.Benchmarks/Security/Cryptography/ED25519DigitalSignatureBenchmarks.cs
  42. 1 1
      test/Renci.SshNet.Benchmarks/Security/Cryptography/RsaDigitalSignatureBenchmarks.cs
  43. 3 3
      test/Renci.SshNet.IntegrationTests/OldIntegrationTests/ForwardedPortLocalTest.cs
  44. 3 10
      test/Renci.SshNet.IntegrationTests/OldIntegrationTests/ScpClientTest.cs
  45. 1 1
      test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SftpClientTest.ListDirectory.cs
  46. 1 1
      test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SshCommandTest.cs
  47. 2 2
      test/Renci.SshNet.IntegrationTests/Properties/AssemblyInfo.cs
  48. 1 1
      test/Renci.SshNet.Tests/Classes/BaseClientTest_ConnectAsync_Timeout.cs
  49. 1 1
      test/Renci.SshNet.Tests/Classes/Common/PipeStreamTest.cs
  50. 1 1
      test/Renci.SshNet.Tests/Classes/SftpClientTest_AsyncExceptions.cs
  51. 2 2
      test/Renci.SshNet.Tests/Properties/AssemblyInfo.cs
  52. 1 1
      test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj

+ 1 - 1
Directory.Build.props

@@ -31,7 +31,7 @@
   <!--
         Disable nullable warnings on old frameworks because of missing annotations.
   -->
-  <PropertyGroup Condition=" !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')) ">
+  <PropertyGroup Condition=" !$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
     <NoWarn>$(NoWarn);CS8602;CS8604;CS8777</NoWarn>
   </PropertyGroup>
 

+ 1 - 1
README.md

@@ -181,7 +181,7 @@ Private keys in PuTTY private key format can be encrypted using the following ci
 **SSH.NET** supports the following target frameworks:
 * .NETFramework 4.6.2 (and higher)
 * .NET Standard 2.0 and 2.1
-* .NET 6 (and higher)
+* .NET 8 (and higher)
 
 ## Building the library
 

+ 2 - 2
src/Renci.SshNet/Abstractions/CancellationTokenSourceExtensions.cs

@@ -1,3 +1,4 @@
+#if !NET
 using System.Threading;
 using System.Threading.Tasks;
 
@@ -5,12 +6,11 @@ namespace Renci.SshNet.Abstractions
 {
     internal static class CancellationTokenSourceExtensions
     {
-#if !NET8_OR_GREATER
         public static Task CancelAsync(this CancellationTokenSource cancellationTokenSource)
         {
             cancellationTokenSource.Cancel();
             return Task.CompletedTask;
         }
-#endif
     }
 }
+#endif

+ 2 - 2
src/Renci.SshNet/Abstractions/SocketAbstraction.Async.cs

@@ -1,4 +1,4 @@
-#if NET6_0_OR_GREATER
+#if NET
 
 using System;
 using System.Diagnostics;
@@ -47,4 +47,4 @@ namespace Renci.SshNet.Abstractions
         }
     }
 }
-#endif // NET6_0_OR_GREATER
+#endif // NET

+ 1 - 1
src/Renci.SshNet/Abstractions/SocketAbstraction.cs

@@ -311,7 +311,7 @@ namespace Renci.SshNet.Abstractions
             return totalBytesRead;
         }
 
-#if NET6_0_OR_GREATER == false
+#if !NET
         public static Task<int> ReadAsync(Socket socket, byte[] buffer, CancellationToken cancellationToken)
         {
             return socket.ReceiveAsync(buffer, 0, buffer.Length, cancellationToken);

+ 5 - 5
src/Renci.SshNet/Abstractions/SocketExtensions.cs

@@ -1,4 +1,4 @@
-#if !NET6_0_OR_GREATER
+#if !NET
 using System;
 using System.Net;
 using System.Net.Sockets;
@@ -93,11 +93,11 @@ namespace Renci.SshNet.Abstractions
             {
                 args.RemoteEndPoint = remoteEndpoint;
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NETSTANDARD2_1
                 await using (cancellationToken.Register(o => ((AwaitableSocketAsyncEventArgs)o).SetCancelled(), args, useSynchronizationContext: false).ConfigureAwait(continueOnCapturedContext: false))
 #else
                 using (cancellationToken.Register(o => ((AwaitableSocketAsyncEventArgs)o).SetCancelled(), args, useSynchronizationContext: false))
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
                 {
                     await args.ExecuteAsync(socket.ConnectAsync);
                 }
@@ -112,11 +112,11 @@ namespace Renci.SshNet.Abstractions
             {
                 args.SetBuffer(buffer, offset, length);
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NETSTANDARD2_1
                 await using (cancellationToken.Register(o => ((AwaitableSocketAsyncEventArgs)o).SetCancelled(), args, useSynchronizationContext: false).ConfigureAwait(continueOnCapturedContext: false))
 #else
                 using (cancellationToken.Register(o => ((AwaitableSocketAsyncEventArgs)o).SetCancelled(), args, useSynchronizationContext: false))
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
                 {
                     await args.ExecuteAsync(socket.ReceiveAsync);
                 }

+ 2 - 4
src/Renci.SshNet/Abstractions/StreamExtensions.cs

@@ -1,18 +1,16 @@
-#if !NET && !NETSTANDARD2_1_OR_GREATER
+#if NETFRAMEWORK || NETSTANDARD2_0
 using System.IO;
 using System.Threading.Tasks;
-#endif
 
 namespace Renci.SshNet.Abstractions
 {
     internal static class StreamExtensions
     {
-#if !NET && !NETSTANDARD2_1_OR_GREATER
         public static ValueTask DisposeAsync(this Stream stream)
         {
             stream.Dispose();
             return default;
         }
-#endif
     }
 }
+#endif

+ 2 - 2
src/Renci.SshNet/ClientAuthentication.cs

@@ -105,11 +105,11 @@ namespace Renci.SshNet
             {
                 authenticationException = new SshAuthenticationException(string.Format(CultureInfo.InvariantCulture,
                                                                                        "No suitable authentication method found to complete authentication ({0}).",
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
                                                                                        string.Join(',', allowedAuthenticationMethods)))
 #else
                                                                                        string.Join(",", allowedAuthenticationMethods)))
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
                 ;
                 return false;
             }

+ 3 - 3
src/Renci.SshNet/Common/Extensions.cs

@@ -48,7 +48,7 @@ namespace Renci.SshNet.Common
 
         internal static BigInteger ToBigInteger(this byte[] data)
         {
-#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
+#if NETSTANDARD2_1 || NET
             return new BigInteger(data, isBigEndian: true);
 #else
             var reversed = new byte[data.Length];
@@ -62,7 +62,7 @@ namespace Renci.SshNet.Common
         /// </summary>
         public static BigInteger ToBigInteger2(this byte[] data)
         {
-#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
+#if NETSTANDARD2_1 || NET
             return new BigInteger(data, isBigEndian: true, isUnsigned: true);
 #else
             if ((data[0] & (1 << 7)) != 0)
@@ -95,7 +95,7 @@ namespace Renci.SshNet.Common
         }
 #endif
 
-#if !NET6_0_OR_GREATER
+#if !NET
         public static long GetBitLength(this BigInteger bigint)
         {
             // Taken from https://github.com/dotnet/runtime/issues/31308

+ 2 - 2
src/Renci.SshNet/Common/SshData.cs

@@ -372,11 +372,11 @@ namespace Renci.SshNet.Common
         /// <param name="data">name-list data to write.</param>
         protected void Write(string[] data)
         {
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
             Write(string.Join(',', data), Ascii);
 #else
             Write(string.Join(",", data), Ascii);
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
         }
 
         /// <summary>

+ 2 - 2
src/Renci.SshNet/Common/SshDataStream.cs

@@ -139,7 +139,7 @@ namespace Renci.SshNet.Common
         {
             ThrowHelper.ThrowIfNull(encoding);
 
-#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
+#if NETSTANDARD2_1 || NET
             ReadOnlySpan<char> value = s;
             var count = encoding.GetByteCount(value);
             var bytes = count <= 256 ? stackalloc byte[count] : new byte[count];
@@ -207,7 +207,7 @@ namespace Renci.SshNet.Common
         {
             var data = ReadBinary();
 
-#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
+#if NETSTANDARD2_1 || NET
             return new BigInteger(data, isBigEndian: true);
 #else
             return new BigInteger(data.Reverse());

+ 5 - 5
src/Renci.SshNet/Common/TaskToAsyncResult.cs

@@ -1,6 +1,6 @@
 #pragma warning disable
-#if !NET8_0_OR_GREATER
-// Copied verbatim from https://github.com/dotnet/runtime/blob/78bd7debe6d8b454294c673c9cb969c6b8a14692/src/libraries/Common/src/System/Threading/Tasks/TaskToAsyncResult.cs
+#if !NET
+// Copied verbatim from https://github.com/dotnet/runtime/blob/261611930d6b436d7c4395450356b624d903d9bf/src/libraries/Common/src/System/Threading/Tasks/TaskToAsyncResult.cs
 
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
@@ -35,7 +35,7 @@ namespace System.Threading.Tasks
         /// </remarks>
         public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state)
         {
-#if NET6_0_OR_GREATER
+#if NET
             ArgumentNullException.ThrowIfNull(task);
 #else
             if (task is null)
@@ -72,7 +72,7 @@ namespace System.Threading.Tasks
         /// <exception cref="ArgumentException"><paramref name="asyncResult"/> was not produced by a call to <see cref="Begin"/>.</exception>
         public static Task Unwrap(IAsyncResult asyncResult)
         {
-#if NET6_0_OR_GREATER
+#if NET
             ArgumentNullException.ThrowIfNull(asyncResult);
 #else
             if (asyncResult is null)
@@ -101,7 +101,7 @@ namespace System.Threading.Tasks
         /// </exception>
         public static Task<TResult> Unwrap<TResult>(IAsyncResult asyncResult)
         {
-#if NET6_0_OR_GREATER
+#if NET
             ArgumentNullException.ThrowIfNull(asyncResult);
 #else
             if (asyncResult is null)

+ 4 - 4
src/Renci.SshNet/Common/ThrowHelper.cs

@@ -9,7 +9,7 @@ namespace Renci.SshNet.Common
     {
         public static void ThrowObjectDisposedIf(bool condition, object instance)
         {
-#if NET7_0_OR_GREATER
+#if NET
             ObjectDisposedException.ThrowIf(condition, instance);
 #else
             if (condition)
@@ -26,7 +26,7 @@ namespace Renci.SshNet.Common
 
         public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
         {
-#if NET6_0_OR_GREATER
+#if NET
             ArgumentNullException.ThrowIfNull(argument, paramName);
 #else
             if (argument is null)
@@ -44,7 +44,7 @@ namespace Renci.SshNet.Common
 
         public static void ThrowIfNullOrWhiteSpace([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
         {
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentException.ThrowIfNullOrWhiteSpace(argument, paramName);
 #else
             if (string.IsNullOrWhiteSpace(argument))
@@ -63,7 +63,7 @@ namespace Renci.SshNet.Common
 
         public static void ThrowIfNullOrEmpty([NotNull] string? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
         {
-#if NET7_0_OR_GREATER
+#if NET
             ArgumentException.ThrowIfNullOrEmpty(argument, paramName);
 #else
             if (string.IsNullOrEmpty(argument))

+ 4 - 4
src/Renci.SshNet/Compression/Zlib.cs

@@ -1,5 +1,5 @@
 using System.IO;
-#if NET6_0_OR_GREATER
+#if NET
 using System.IO.Compression;
 #else
 using Org.BouncyCastle.Utilities.Zlib;
@@ -14,7 +14,7 @@ namespace Renci.SshNet.Compression
     public class Zlib : Compressor
 #pragma warning restore CA1724 // Type names should not match namespaces
     {
-#if NET6_0_OR_GREATER
+#if NET
         private readonly ZLibStream _compressor;
         private readonly ZLibStream _decompressor;
 #else
@@ -45,7 +45,7 @@ namespace Renci.SshNet.Compression
             _compressorStream = new MemoryStream();
             _decompressorStream = new MemoryStream();
 
-#if NET6_0_OR_GREATER
+#if NET
             _compressor = new ZLibStream(_compressorStream, CompressionMode.Compress);
             _decompressor = new ZLibStream(_decompressorStream, CompressionMode.Decompress);
 #else
@@ -74,7 +74,7 @@ namespace Renci.SshNet.Compression
         /// <inheritdoc/>
         protected override byte[] DecompressCore(byte[] data, int offset, int length)
         {
-#if NET6_0_OR_GREATER
+#if NET
             _decompressorStream.Write(data, offset, length);
             _decompressorStream.Position = 0;
 

+ 1 - 1
src/Renci.SshNet/Connection/HttpConnector.cs

@@ -34,7 +34,7 @@ namespace Renci.SshNet.Connection
         private const string HttpResponsePattern = @"HTTP/(?<version>\d[.]\d) (?<statusCode>\d{3}) (?<reasonPhrase>.+)$";
         private const string HttpHeaderPattern = @"(?<fieldName>[^\[\]()<>@,;:\""/?={} \t]+):(?<fieldValue>.+)?";
 
-#if NET7_0_OR_GREATER
+#if NET
         private static readonly Regex HttpResponseRegex = GetHttpResponseRegex();
         private static readonly Regex HttpHeaderRegex = GetHttpHeaderRegex();
 

+ 3 - 3
src/Renci.SshNet/Connection/ProtocolVersionExchange.cs

@@ -24,7 +24,7 @@ namespace Renci.SshNet.Connection
         private const byte Null = 0x00;
         private const string ServerVersionPattern = "^SSH-(?<protoversion>[^-]+)-(?<softwareversion>.*?)([ ](?<comments>.+))?$";
 
-#if NET7_0_OR_GREATER
+#if NET
         private static readonly Regex ServerVersionRegex = GetServerVersionRegex();
 
         [GeneratedRegex(ServerVersionPattern, RegexOptions.ExplicitCapture)]
@@ -89,11 +89,11 @@ namespace Renci.SshNet.Connection
         {
             // Immediately send the identification string since the spec states both sides MUST send an identification string
             // when the connection has been established
-#if NET6_0_OR_GREATER
+#if NET
             await SocketAbstraction.SendAsync(socket, Encoding.UTF8.GetBytes(clientVersion + "\x0D\x0A"), cancellationToken).ConfigureAwait(false);
 #else
             SocketAbstraction.Send(socket, Encoding.UTF8.GetBytes(clientVersion + "\x0D\x0A"));
-#endif // NET6_0_OR_GREATER
+#endif // NET
 
             var bytesReceived = new List<byte>();
 

+ 6 - 6
src/Renci.SshNet/Connection/ProxyConnector.cs

@@ -21,27 +21,27 @@ namespace Renci.SshNet.Connection
 
         // ToDo: Performs async/sync fallback, true async version should be implemented in derived classes
         protected virtual
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
         async
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
         Task HandleProxyConnectAsync(IConnectionInfo connectionInfo, Socket socket, CancellationToken cancellationToken)
         {
             cancellationToken.ThrowIfCancellationRequested();
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
             await using (cancellationToken.Register(o => ((Socket)o).Dispose(), socket, useSynchronizationContext: false).ConfigureAwait(continueOnCapturedContext: false))
 #else
             using (cancellationToken.Register(o => ((Socket)o).Dispose(), socket, useSynchronizationContext: false))
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
             {
 #pragma warning disable MA0042 // Do not use blocking calls in an async method; false positive caused by https://github.com/meziantou/Meziantou.Analyzer/issues/613
                 HandleProxyConnect(connectionInfo, socket);
 #pragma warning restore MA0042 // Do not use blocking calls in an async method
             }
 
-#if !NET && !NETSTANDARD2_1_OR_GREATER
+#if !NET && !NETSTANDARD2_1
             return Task.CompletedTask;
-#endif // !NET && !NETSTANDARD2_1_OR_GREATER
+#endif
         }
 
         /// <summary>

+ 2 - 2
src/Renci.SshNet/Messages/Authentication/FailureMessage.cs

@@ -55,11 +55,11 @@ namespace Renci.SshNet.Messages.Authentication
             PartialSuccess = ReadBoolean();
             if (PartialSuccess)
             {
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
                 Message = string.Join(',', AllowedAuthentications);
 #else
                 Message = string.Join(",", AllowedAuthentications);
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
             }
         }
 

+ 3 - 3
src/Renci.SshNet/Netconf/NetConfSession.cs

@@ -21,7 +21,7 @@ namespace Renci.SshNet.NetConf
         private StringBuilder _rpcReply = new StringBuilder();
         private int _messageId;
 
-#if NET7_0_OR_GREATER
+#if NET
         private static readonly Regex LengthRegex = GetLengthRegex();
         private static readonly Regex ReplyRegex = GetReplyRegex();
 
@@ -181,11 +181,11 @@ namespace Renci.SshNet.NetConf
                     position += match.Index + match.Length + fractionLength;
                 }
 
-#if NET7_0_OR_GREATER
+#if NET
                 if (ReplyRegex.IsMatch(chunk.AsSpan(position)))
 #else
                 if (ReplyRegex.IsMatch(chunk.Substring(position)))
-#endif // NET7_0_OR_GREATER
+#endif // NET
                 {
                     _ = _rpcReplyReceived.Set();
                 }

+ 1 - 1
src/Renci.SshNet/PrivateKeyFile.cs

@@ -119,7 +119,7 @@ namespace Renci.SshNet
         private const string PuTTYPrivateKeyPattern = @"^(?<keyName>PuTTY-User-Key-File)-(?<version>\d+): (?<algorithmName>[\w-]+)\r?\nEncryption: (?<encryptionType>[\w-]+)\r?\nComment: (?<comment>.*?)\r?\nPublic-Lines: \d+\r?\n(?<publicKey>(([a-zA-Z0-9/+=]{1,64})\r?\n)+)(Key-Derivation: (?<argon2Type>\w+)\r?\nArgon2-Memory: (?<argon2Memory>\d+)\r?\nArgon2-Passes: (?<argon2Passes>\d+)\r?\nArgon2-Parallelism: (?<argon2Parallelism>\d+)\r?\nArgon2-Salt: (?<argon2Salt>[a-fA-F0-9]+)\r?\n)?Private-Lines: \d+\r?\n(?<data>(([a-zA-Z0-9/+=]{1,64})\r?\n)+)+Private-MAC: (?<mac>[a-fA-F0-9]+)";
         private const string CertificatePattern = @"(?<type>[-\w]+@openssh\.com)\s(?<data>[a-zA-Z0-9\/+=]*)(\s+(?<comment>.*))?";
 
-#if NET7_0_OR_GREATER
+#if NET
         private static readonly Regex PrivateKeyRegex = GetPrivateKeyRegex();
         private static readonly Regex PuTTYPrivateKeyRegex = GetPrivateKeyPuTTYRegex();
         private static readonly Regex CertificateRegex = GetCertificateRegex();

+ 1 - 5
src/Renci.SshNet/Renci.SshNet.csproj

@@ -4,7 +4,7 @@
     <AssemblyName>Renci.SshNet</AssemblyName>
     <Product>SSH.NET</Product>
     <AssemblyTitle>SSH.NET</AssemblyTitle>
-    <TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net8.0;net9.0</TargetFrameworks>
+    <TargetFrameworks>net462;netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
   </PropertyGroup>
 
   <PropertyGroup>
@@ -36,10 +36,6 @@
     <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
   </PropertyGroup>
 
-  <PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0')) ">
-    <IsTrimmable>true</IsTrimmable>
-  </PropertyGroup>
-  
   <PropertyGroup Condition=" $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0')) ">
     <IsAotCompatible>true</IsAotCompatible>
   </PropertyGroup>

+ 3 - 3
src/Renci.SshNet/ScpClient.cs

@@ -37,7 +37,7 @@ namespace Renci.SshNet
         private const string DirectoryInfoPattern = @"D(?<mode>\d{4}) (?<length>\d+) (?<filename>.+)";
         private const string TimestampPattern = @"T(?<mtime>\d+) 0 (?<atime>\d+) 0";
 
-#if NET7_0_OR_GREATER
+#if NET
         private static readonly Regex FileInfoRegex = GetFileInfoRegex();
         private static readonly Regex DirectoryInfoRegex = GetDirectoryInfoRegex();
         private static readonly Regex TimestampRegex = GetTimestampRegex();
@@ -670,7 +670,7 @@ namespace Renci.SshNet
         /// <param name="fileOrDirectory">The file or directory to upload.</param>
         private void UploadTimes(IChannelSession channel, Stream input, FileSystemInfo fileOrDirectory)
         {
-#if NET ||NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
             var zeroTime = DateTime.UnixEpoch;
 #else
             var zeroTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
@@ -851,7 +851,7 @@ namespace Renci.SshNet
                     var mtime = long.Parse(match.Result("${mtime}"), CultureInfo.InvariantCulture);
                     var atime = long.Parse(match.Result("${atime}"), CultureInfo.InvariantCulture);
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
                     var zeroTime = DateTime.UnixEpoch;
 #else
                     var zeroTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);

+ 1 - 1
src/Renci.SshNet/Security/Cryptography/Ciphers/AesCipher.cs

@@ -31,7 +31,7 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
                 // OFB is not supported on modern .NET
                 _impl = new BlockImpl(key, new OfbCipherMode(iv), pkcs7Padding ? new Pkcs7Padding() : null);
             }
-#if !NET6_0_OR_GREATER
+#if !NET
             else if (mode == AesCipherMode.CFB)
             {
                 // CFB not supported on NetStandard 2.1

+ 2 - 12
src/Renci.SshNet/Security/Cryptography/Ciphers/AesGcmCipher.BclImpl.cs

@@ -1,4 +1,4 @@
-#if NET6_0_OR_GREATER
+#if NET
 using System;
 using System.Security.Cryptography;
 
@@ -16,11 +16,7 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
 
             public BclImpl(byte[] key, byte[] nonce)
             {
-#if NET8_0_OR_GREATER
                 _aesGcm = new AesGcm(key, TagSizeInBytes);
-#else
-                _aesGcm = new AesGcm(key);
-#endif
                 _nonce = nonce;
             }
 
@@ -37,21 +33,15 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
 
             public override void Decrypt(byte[] input, int cipherTextOffset, int cipherTextLength, int associatedDataOffset, int associatedDataLength, byte[] output, int plainTextOffset)
             {
-                var plainTextLength = cipherTextLength;
                 var cipherText = new ReadOnlySpan<byte>(input, cipherTextOffset, cipherTextLength);
                 var tag = new ReadOnlySpan<byte>(input, cipherTextOffset + cipherTextLength, TagSizeInBytes);
-                var plainText = new Span<byte>(output, plainTextOffset, plainTextLength);
                 var associatedData = new ReadOnlySpan<byte>(input, associatedDataOffset, associatedDataLength);
 
                 try
                 {
-                    _aesGcm.Decrypt(_nonce, cipherText, tag, output, associatedData);
+                    _aesGcm.Decrypt(_nonce, cipherText, tag, output.AsSpan(plainTextOffset), associatedData);
                 }
-#if NET8_0_OR_GREATER
                 catch (AuthenticationTagMismatchException ex)
-#else
-                catch (CryptographicException ex)
-#endif
                 {
                     throw new SshConnectionException("MAC error", DisconnectReason.MacError, ex);
                 }

+ 2 - 2
src/Renci.SshNet/Security/Cryptography/Ciphers/AesGcmCipher.cs

@@ -15,7 +15,7 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
         private const int TagSizeInBytes = 16;
         private readonly byte[] _iv;
         private readonly int _aadLength;
-#if NET6_0_OR_GREATER
+#if NET
         private readonly Impl _impl;
 #else
         private readonly BouncyCastleImpl _impl;
@@ -62,7 +62,7 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
             // SSH AES-GCM requires a 12-octet Initial IV
             _iv = iv.Take(12);
             _aadLength = aadLength;
-#if NET6_0_OR_GREATER
+#if NET
             if (System.Security.Cryptography.AesGcm.IsSupported)
             {
                 _impl = new BclImpl(key, _iv);

+ 1 - 1
src/Renci.SshNet/Security/Cryptography/Ciphers/TripleDesCipher.BlockImpl.cs

@@ -1,4 +1,4 @@
-#if !NET6_0_OR_GREATER
+#if !NET
 using System;
 using System.Security.Cryptography;
 

+ 2 - 2
src/Renci.SshNet/Security/Cryptography/Ciphers/TripleDesCipher.cs

@@ -1,7 +1,7 @@
 using System;
 using System.Security.Cryptography;
 
-#if !NET6_0_OR_GREATER
+#if !NET
 using Org.BouncyCastle.Crypto.Paddings;
 
 using Renci.SshNet.Security.Cryptography.Ciphers.Modes;
@@ -31,7 +31,7 @@ namespace Renci.SshNet.Security.Cryptography.Ciphers
         public TripleDesCipher(byte[] key, byte[] iv, System.Security.Cryptography.CipherMode mode, bool pkcs7Padding)
             : base(key, 8, mode: null, padding: null)
         {
-#if !NET6_0_OR_GREATER
+#if !NET
             if (mode == System.Security.Cryptography.CipherMode.CFB)
             {
                 // CFB8 not supported on .NET Framework, but supported on .NET

+ 1 - 1
src/Renci.SshNet/Security/Cryptography/EcdsaKey.cs

@@ -147,7 +147,7 @@ namespace Renci.SshNet.Security
                 Buffer.BlockCopy(qy, 0, q, qx.Length + 1, qy.Length);
 
                 // returns Curve-Name and x/y as ECPoint
-#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
+#if NETSTANDARD2_1 || NET
                 return new[] { curve, new BigInteger(q, isBigEndian: true) };
 #else
                 return new[] { curve, new BigInteger(q.Reverse()) };

+ 1 - 1
src/Renci.SshNet/Security/KeyExchangeECDH.BclImpl.cs

@@ -1,4 +1,4 @@
-#if NET8_0_OR_GREATER
+#if NET
 using System;
 using System.Security.Cryptography;
 

+ 2 - 2
src/Renci.SshNet/Security/KeyExchangeECDH.cs

@@ -9,7 +9,7 @@ namespace Renci.SshNet.Security
 {
     internal abstract partial class KeyExchangeECDH : KeyExchangeEC
     {
-#if NET8_0_OR_GREATER
+#if NET
         private Impl _impl;
 
         /// <summary>
@@ -40,7 +40,7 @@ namespace Renci.SshNet.Security
 
             Session.KeyExchangeEcdhReplyMessageReceived += Session_KeyExchangeEcdhReplyMessageReceived;
 
-#if NET8_0_OR_GREATER
+#if NET
             if (!OperatingSystem.IsWindows() || OperatingSystem.IsWindowsVersionAtLeast(10))
             {
                 _impl = new BclImpl(Curve);

+ 1 - 1
src/Renci.SshNet/Security/KeyExchangeECDH256.cs

@@ -15,7 +15,7 @@ namespace Renci.SshNet.Security
             get { return "ecdh-sha2-nistp256"; }
         }
 
-#if NET8_0_OR_GREATER
+#if NET
         /// <summary>
         /// Gets the curve.
         /// </summary>

+ 1 - 1
src/Renci.SshNet/Security/KeyExchangeECDH384.cs

@@ -15,7 +15,7 @@ namespace Renci.SshNet.Security
             get { return "ecdh-sha2-nistp384"; }
         }
 
-#if NET8_0_OR_GREATER
+#if NET
         /// <summary>
         /// Gets the curve.
         /// </summary>

+ 1 - 1
src/Renci.SshNet/Security/KeyExchangeECDH521.cs

@@ -15,7 +15,7 @@ namespace Renci.SshNet.Security
             get { return "ecdh-sha2-nistp521"; }
         }
 
-#if NET8_0_OR_GREATER
+#if NET
         /// <summary>
         /// Gets the curve.
         /// </summary>

+ 2 - 2
src/Renci.SshNet/Session.cs

@@ -1326,7 +1326,7 @@ namespace Renci.SshNet
             if (_serverMac != null && _serverEtm)
             {
                 var clientHash = _serverMac.ComputeHash(data, 0, data.Length - serverMacLength);
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER
+#if NETSTANDARD2_1 || NET
                 if (!CryptographicOperations.FixedTimeEquals(clientHash, new ReadOnlySpan<byte>(data, data.Length - serverMacLength, serverMacLength)))
 #else
                 if (!Org.BouncyCastle.Utilities.Arrays.FixedTimeEquals(serverMacLength, clientHash, 0, data, data.Length - serverMacLength))
@@ -1354,7 +1354,7 @@ namespace Renci.SshNet
             if (_serverMac != null && !_serverEtm)
             {
                 var clientHash = _serverMac.ComputeHash(data, 0, data.Length - serverMacLength);
-#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP2_1_OR_GREATER
+#if NETSTANDARD2_1 || NET
                 if (!CryptographicOperations.FixedTimeEquals(clientHash, new ReadOnlySpan<byte>(data, data.Length - serverMacLength, serverMacLength)))
 #else
                 if (!Org.BouncyCastle.Utilities.Arrays.FixedTimeEquals(serverMacLength, clientHash, 0, data, data.Length - serverMacLength))

+ 5 - 5
src/Renci.SshNet/Sftp/SftpFileStream.cs

@@ -515,7 +515,7 @@ namespace Renci.SshNet.Sftp
 
             ThrowHelper.ThrowIfNull(buffer);
 
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegative(offset);
             ArgumentOutOfRangeException.ThrowIfNegative(count);
 #else
@@ -657,7 +657,7 @@ namespace Renci.SshNet.Sftp
 
             ThrowHelper.ThrowIfNull(buffer);
 
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegative(offset);
             ArgumentOutOfRangeException.ThrowIfNegative(count);
 #else
@@ -952,7 +952,7 @@ namespace Renci.SshNet.Sftp
         /// </remarks>
         public override void SetLength(long value)
         {
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegative(value);
 #else
             if (value < 0)
@@ -1007,7 +1007,7 @@ namespace Renci.SshNet.Sftp
         {
             ThrowHelper.ThrowIfNull(buffer);
 
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegative(offset);
             ArgumentOutOfRangeException.ThrowIfNegative(count);
 #else
@@ -1107,7 +1107,7 @@ namespace Renci.SshNet.Sftp
         {
             ThrowHelper.ThrowIfNull(buffer);
 
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegative(offset);
             ArgumentOutOfRangeException.ThrowIfNegative(count);
 #else

+ 8 - 8
src/Renci.SshNet/Sftp/SftpSession.cs

@@ -135,22 +135,22 @@ namespace Renci.SshNet.Sftp
             if (fullPath.EndsWith("/.", StringComparison.OrdinalIgnoreCase) ||
                 fullPath.EndsWith("/..", StringComparison.OrdinalIgnoreCase) ||
                 fullPath.Equals("/", StringComparison.OrdinalIgnoreCase) ||
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
                 fullPath.IndexOf('/', StringComparison.OrdinalIgnoreCase) < 0)
 #else
                 fullPath.IndexOf('/') < 0)
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
             {
                 return fullPath;
             }
 
             var pathParts = fullPath.Split('/');
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
             var partialFullPath = string.Join('/', pathParts, 0, pathParts.Length - 1);
 #else
             var partialFullPath = string.Join("/", pathParts, 0, pathParts.Length - 1);
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
 
             if (string.IsNullOrEmpty(partialFullPath))
             {
@@ -206,22 +206,22 @@ namespace Renci.SshNet.Sftp
             if (fullPath.EndsWith("/.", StringComparison.Ordinal) ||
                 fullPath.EndsWith("/..", StringComparison.Ordinal) ||
                 fullPath.Equals("/", StringComparison.Ordinal) ||
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
                 fullPath.IndexOf('/', StringComparison.Ordinal) < 0)
 #else
                 fullPath.IndexOf('/') < 0)
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
             {
                 return fullPath;
             }
 
             var pathParts = fullPath.Split('/');
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
             var partialFullPath = string.Join('/', pathParts);
 #else
             var partialFullPath = string.Join("/", pathParts);
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
 
             if (string.IsNullOrEmpty(partialFullPath))
             {

+ 2 - 2
src/Renci.SshNet/SftpClient.cs

@@ -2336,11 +2336,11 @@ namespace Renci.SshNet
 
             var basePath = fullPath;
 
-#if NET || NETSTANDARD2_1_OR_GREATER
+#if NET || NETSTANDARD2_1
             if (!basePath.EndsWith('/'))
 #else
             if (!basePath.EndsWith("/", StringComparison.Ordinal))
-#endif // NET || NETSTANDARD2_1_OR_GREATER
+#endif
             {
                 basePath = string.Format("{0}/", fullPath);
             }

+ 1 - 1
src/Renci.SshNet/Shell.cs

@@ -118,7 +118,7 @@ namespace Renci.SshNet
             {
                 bufferSize = DefaultBufferSize;
             }
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegativeOrZero(bufferSize);
 #else
             if (bufferSize <= 0)

+ 2 - 2
src/Renci.SshNet/ShellStream.cs

@@ -160,7 +160,7 @@ namespace Renci.SshNet
             {
                 bufferSize = DefaultBufferSize;
             }
-#if NET8_0_OR_GREATER
+#if NET
             ArgumentOutOfRangeException.ThrowIfNegativeOrZero(bufferSize);
 #else
             if (bufferSize <= 0)
@@ -481,7 +481,7 @@ namespace Renci.SshNet
 
                     foreach (var expectAction in expectActions)
                     {
-#if NET7_0_OR_GREATER
+#if NET
                         var matchEnumerator = expectAction.Expect.EnumerateMatches(bufferText.AsSpan(searchStart));
 
                         if (matchEnumerator.MoveNext())

+ 1 - 1
test/Renci.SshNet.Benchmarks/Common/HostKeyEventArgsBenchmarks.cs

@@ -19,7 +19,7 @@ namespace Renci.SshNet.Benchmarks.Common
         {
             using (var s = typeof(HostKeyEventArgsBenchmarks).Assembly.GetManifestResourceStream("Renci.SshNet.Benchmarks.Data.Key.RSA.txt"))
             {
-                var privateKey = new PrivateKeyFile(s);
+                var privateKey = new PrivateKeyFile(s!);
                 return (KeyHostAlgorithm)privateKey.HostKeyAlgorithms.First();
             }
         }

+ 1 - 1
test/Renci.SshNet.Benchmarks/Security/Cryptography/ED25519DigitalSignatureBenchmarks.cs

@@ -21,7 +21,7 @@ namespace Renci.SshNet.Benchmarks.Security.Cryptography
 
             using (var s = typeof(ED25519DigitalSignatureBenchmarks).Assembly.GetManifestResourceStream("Renci.SshNet.Benchmarks.Data.Key.OPENSSH.ED25519.txt"))
             {
-                _key = (ED25519Key)new PrivateKeyFile(s).Key;
+                _key = (ED25519Key)new PrivateKeyFile(s!).Key;
             }
             _signature = new ED25519DigitalSignature(_key).Sign(_data);
         }

+ 1 - 1
test/Renci.SshNet.Benchmarks/Security/Cryptography/RsaDigitalSignatureBenchmarks.cs

@@ -23,7 +23,7 @@ namespace Renci.SshNet.Benchmarks.Security.Cryptography
 
             using (var s = typeof(RsaDigitalSignatureBenchmarks).Assembly.GetManifestResourceStream("Renci.SshNet.Benchmarks.Data.Key.OPENSSH.RSA.txt"))
             {
-                _key = (RsaKey)new PrivateKeyFile(s).Key;
+                _key = (RsaKey)new PrivateKeyFile(s!).Key;
             }
             _signature = new RsaDigitalSignature(_key, HashAlgorithmName.SHA256).Sign(_data);
         }

+ 3 - 3
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/ForwardedPortLocalTest.cs

@@ -1,5 +1,5 @@
 using System.Diagnostics;
-#if !NET6_0_OR_GREATER
+#if !NET
 using System.Net;
 #endif
 
@@ -42,7 +42,7 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
                         var url = "http://www.google.com/";
                         Debug.WriteLine("Starting web request to \"" + url + "\"");
 
-#if NET6_0_OR_GREATER
+#if NET
                         var httpClient = new HttpClient();
                         var response = httpClient.GetAsync(url)
                                                  .ConfigureAwait(false)
@@ -51,7 +51,7 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
 #else
                         var request = (HttpWebRequest)WebRequest.Create(url);
                         var response = (HttpWebResponse)request.GetResponse();
-#endif // NET6_0_OR_GREATER
+#endif // NET
 
                         Assert.IsNotNull(response);
 

+ 3 - 10
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/ScpClientTest.cs

@@ -299,19 +299,12 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
         {
             using (var file = new FileStream(fileName, FileMode.Open))
             {
-#if NET7_0_OR_GREATER
+#if NET
                 var hash = MD5.HashData(file);
 #else
-#if NET6_0
-                var md5 = MD5.Create();
-#else
-                MD5 md5 = new MD5CryptoServiceProvider();
-#endif // NET6_0
+                using MD5 md5 = MD5.Create();
                 var hash = md5.ComputeHash(file);
-#endif // NET7_0_OR_GREATER
-
-                file.Close();
-
+#endif
                 var sb = new StringBuilder();
 
                 for (var i = 0; i < hash.Length; i++)

+ 1 - 1
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SftpClientTest.ListDirectory.cs

@@ -54,7 +54,7 @@ namespace Renci.SshNet.IntegrationTests.OldIntegrationTests
             }
         }
 
-#if NET6_0_OR_GREATER
+#if NET
         [TestMethod]
         [TestCategory("Sftp")]
         public async Task Test_Sftp_ListDirectoryAsync_Current()

+ 1 - 1
test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SshCommandTest.cs

@@ -1,6 +1,6 @@
 using System.Diagnostics;
 
-#if !NET8_0_OR_GREATER
+#if !NET
 using Renci.SshNet.Abstractions;
 #endif
 using Renci.SshNet.Common;

+ 2 - 2
test/Renci.SshNet.IntegrationTests/Properties/AssemblyInfo.cs

@@ -1,5 +1,5 @@
-#if NET6_0_OR_GREATER
+#if NET
 using System.Diagnostics.CodeAnalysis;
 
 [assembly: ExcludeFromCodeCoverage]
-#endif // NET6_0_OR_GREATER
+#endif // NET

+ 1 - 1
test/Renci.SshNet.Tests/Classes/BaseClientTest_ConnectAsync_Timeout.cs

@@ -6,7 +6,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
 
 using Moq;
 
-#if !NET8_0_OR_GREATER
+#if !NET
 using Renci.SshNet.Abstractions;
 #endif
 using Renci.SshNet.Common;

+ 1 - 1
test/Renci.SshNet.Tests/Classes/Common/PipeStreamTest.cs

@@ -4,7 +4,7 @@ using System.Threading.Tasks;
 
 using Microsoft.VisualStudio.TestTools.UnitTesting;
 
-#if !NET && !NETSTANDARD2_1_OR_GREATER
+#if NETFRAMEWORK
 using Renci.SshNet.Abstractions;
 #endif
 using Renci.SshNet.Common;

+ 1 - 1
test/Renci.SshNet.Tests/Classes/SftpClientTest_AsyncExceptions.cs

@@ -8,7 +8,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
 
 using Moq;
 
-#if !NET8_0_OR_GREATER
+#if !NET
 using Renci.SshNet.Abstractions;
 #endif
 using Renci.SshNet.Channels;

+ 2 - 2
test/Renci.SshNet.Tests/Properties/AssemblyInfo.cs

@@ -1,5 +1,5 @@
-#if NET6_0_OR_GREATER
+#if NET
 using System.Diagnostics.CodeAnalysis;
 
 [assembly: ExcludeFromCodeCoverage]
-#endif // NET6_0_OR_GREATER
+#endif // NET

+ 1 - 1
test/Renci.SshNet.Tests/Renci.SshNet.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net462;net6.0;net8.0;net9.0</TargetFrameworks>
+    <TargetFrameworks>net462;net8.0;net9.0</TargetFrameworks>
   </PropertyGroup>
 
   <ItemGroup>