Browse Source

Remove feature binary serialization (#1325)

* Drop RIPEMD160

* Replace FEATURE_BINARY_SERIALIZATION with NETFRAMEWORK
Scott Xu 1 năm trước cách đây
mục cha
commit
e66a032308

+ 6 - 6
src/Renci.SshNet/Common/NetConfServerException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when there is something wrong with the server capabilities.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class NetConfServerException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="NetConfServerException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/ProxyException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when a proxy connection cannot be established.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class ProxyException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="ProxyException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/ScpException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when SCP error occurred.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class ScpException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="ScpException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SftpPathNotFoundException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when file or directory is not found.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SftpPathNotFoundException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SftpPathNotFoundException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SftpPermissionDeniedException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when operation permission is denied.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SftpPermissionDeniedException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SftpPermissionDeniedException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SshAuthenticationException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when authentication failed.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SshAuthenticationException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SshAuthenticationException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SshConnectionException.cs

@@ -1,7 +1,7 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 using Renci.SshNet.Messages.Transport;
 
 namespace Renci.SshNet.Common
@@ -9,9 +9,9 @@ namespace Renci.SshNet.Common
     /// <summary>
     /// The exception that is thrown when connection was terminated.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SshConnectionException : SshException
     {
         /// <summary>
@@ -70,7 +70,7 @@ namespace Renci.SshNet.Common
             DisconnectReason = disconnectReasonCode;
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
         /// </summary>
@@ -82,6 +82,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SshException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when SSH exception occurs.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SshException : Exception
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SshException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SshOperationTimeoutException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when operation is timed out.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SshOperationTimeoutException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SshOperationTimeoutException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 6 - 6
src/Renci.SshNet/Common/SshPassPhraseNullOrEmptyException.cs

@@ -1,16 +1,16 @@
 using System;
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
 using System.Runtime.Serialization;
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
 
 namespace Renci.SshNet.Common
 {
     /// <summary>
     /// The exception that is thrown when pass phrase for key file is empty or <see langword="null"/>.
     /// </summary>
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     public class SshPassPhraseNullOrEmptyException : SshException
     {
         /// <summary>
@@ -39,7 +39,7 @@ namespace Renci.SshNet.Common
         {
         }
 
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
         /// <summary>
         /// Initializes a new instance of the <see cref="SshPassPhraseNullOrEmptyException"/> class.
         /// </summary>
@@ -51,6 +51,6 @@ namespace Renci.SshNet.Common
             : base(info, context)
         {
         }
-#endif // FEATURE_BINARY_SERIALIZATION
+#endif // NETFRAMEWORK
     }
 }

+ 0 - 4
src/Renci.SshNet/Renci.SshNet.csproj

@@ -29,10 +29,6 @@
     <EnableAotAnalyzer>true</EnableAotAnalyzer>
   </PropertyGroup>
 
-  <PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
-    <DefineConstants>$(DefineConstants);FEATURE_BINARY_SERIALIZATION</DefineConstants>
-  </PropertyGroup>
-
   <ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
     <!-- Must be kept at version 1.0.0 or higher, see https://github.com/sshnet/SSH.NET/pull/1288 for details. -->
     <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="[1.0.0,)" />

+ 1 - 1
src/Renci.SshNet/Security/BouncyCastle/math/BigInteger.cs

@@ -10,7 +10,7 @@ using Renci.SshNet.Security.Org.BouncyCastle.Utilities;
 
 namespace Renci.SshNet.Security.Org.BouncyCastle.Math
 {
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
 #endif
     internal class BigInteger

+ 1 - 1
src/Renci.SshNet/Security/BouncyCastle/security/SecurityUtilityException.cs

@@ -2,7 +2,7 @@ using System;
 
 namespace Renci.SshNet.Security.Org.BouncyCastle.Security
 {
-#if FEATURE_BINARY_SERIALIZATION
+#if NETFRAMEWORK
     [Serializable]
 #endif
     internal class SecurityUtilityException