Explorar el Código

Drop RIPEMD160 (#1324)

Scott Xu hace 1 año
padre
commit
59a0f9030a

+ 0 - 2
README.md

@@ -113,8 +113,6 @@ Private keys can be encrypted using one of the following cipher methods:
 * hmac-sha2-256-96
 * hmac-sha2-512
 * hmac-sha2-512-96
-* hmac-ripemd160
-* hmac-ripemd160<span></span>@openssh.com
 * hmac-md5-etm<span></span>@openssh.com
 * hmac-md5-96-etm<span></span>@openssh.com
 * hmac-sha1-etm<span></span>@openssh.com

+ 0 - 32
src/Renci.SshNet/Abstractions/CryptoAbstraction.cs

@@ -66,24 +66,6 @@ namespace Renci.SshNet.Abstractions
             return System.Security.Cryptography.SHA512.Create();
         }
 
-#if FEATURE_HASH_RIPEMD160_CREATE || FEATURE_HASH_RIPEMD160_MANAGED
-        public static System.Security.Cryptography.RIPEMD160 CreateRIPEMD160()
-        {
-#if FEATURE_HASH_RIPEMD160_CREATE
-#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
-            return System.Security.Cryptography.RIPEMD160.Create();
-#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
-#else
-            return new System.Security.Cryptography.RIPEMD160Managed();
-#endif
-        }
-#else
-        public static global::SshNet.Security.Cryptography.RIPEMD160 CreateRIPEMD160()
-        {
-            return new global::SshNet.Security.Cryptography.RIPEMD160();
-        }
-#endif // FEATURE_HASH_RIPEMD160
-
         public static System.Security.Cryptography.HMACMD5 CreateHMACMD5(byte[] key)
         {
 #pragma warning disable CA5351 // Do not use broken cryptographic algorithms
@@ -141,19 +123,5 @@ namespace Renci.SshNet.Abstractions
         {
             return new HMACSHA512(key, hashSize);
         }
-
-#if FEATURE_HMAC_RIPEMD160
-        public static System.Security.Cryptography.HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key)
-        {
-#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
-            return new System.Security.Cryptography.HMACRIPEMD160(key);
-#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
-        }
-#else
-        public static global::SshNet.Security.Cryptography.HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key)
-        {
-            return new global::SshNet.Security.Cryptography.HMACRIPEMD160(key);
-        }
-#endif // FEATURE_HMAC_RIPEMD160
     }
 }

+ 0 - 2
src/Renci.SshNet/ConnectionInfo.cs

@@ -381,8 +381,6 @@ namespace Renci.SshNet
                     { "hmac-sha2-512", new HashInfo(64*8, key => CryptoAbstraction.CreateHMACSHA512(key), isEncryptThenMAC: false) },
                     { "hmac-sha2-512-96", new HashInfo(64*8,  key => CryptoAbstraction.CreateHMACSHA512(key, 96), isEncryptThenMAC: false) },
                     { "hmac-sha2-256-96", new HashInfo(32*8, key => CryptoAbstraction.CreateHMACSHA256(key, 96), isEncryptThenMAC: false) },
-                    { "hmac-ripemd160", new HashInfo(160, key => CryptoAbstraction.CreateHMACRIPEMD160(key), isEncryptThenMAC: false) },
-                    { "hmac-ripemd160@openssh.com", new HashInfo(160, key => CryptoAbstraction.CreateHMACRIPEMD160(key), isEncryptThenMAC: false) },
                     { "hmac-sha1", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key), isEncryptThenMAC: false) },
                     { "hmac-sha1-96", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key, 96), isEncryptThenMAC: false) },
                     { "hmac-md5", new HashInfo(16*8, key => CryptoAbstraction.CreateHMACMD5(key), isEncryptThenMAC: false) },

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

@@ -29,13 +29,9 @@
   </PropertyGroup>
 
   <PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
-    <DefineConstants>$(DefineConstants);FEATURE_BINARY_SERIALIZATION;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_RIPEMD160</DefineConstants>
+    <DefineConstants>$(DefineConstants);FEATURE_BINARY_SERIALIZATION</DefineConstants>
   </PropertyGroup>
 
-  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1')) ">
-    <PackageReference Include="SshNet.Security.Cryptography" Version="[1.3.0]" />
-  </ItemGroup>
-
   <ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
     <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
   </ItemGroup>