Skip to content

Commit 59a0f90

Browse files
authored
Drop RIPEMD160 (#1324)
1 parent 06af2ec commit 59a0f90

File tree

4 files changed

+1
-41
lines changed

4 files changed

+1
-41
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ Private keys can be encrypted using one of the following cipher methods:
113113
* hmac-sha2-256-96
114114
* hmac-sha2-512
115115
* hmac-sha2-512-96
116-
* hmac-ripemd160
117-
* hmac-ripemd160<span></span>@openssh.com
118116
* hmac-md5-etm<span></span>@openssh.com
119117
* hmac-md5-96-etm<span></span>@openssh.com
120118
* hmac-sha1-etm<span></span>@openssh.com

src/Renci.SshNet/Abstractions/CryptoAbstraction.cs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,6 @@ public static System.Security.Cryptography.SHA512 CreateSHA512()
6666
return System.Security.Cryptography.SHA512.Create();
6767
}
6868

69-
#if FEATURE_HASH_RIPEMD160_CREATE || FEATURE_HASH_RIPEMD160_MANAGED
70-
public static System.Security.Cryptography.RIPEMD160 CreateRIPEMD160()
71-
{
72-
#if FEATURE_HASH_RIPEMD160_CREATE
73-
#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
74-
return System.Security.Cryptography.RIPEMD160.Create();
75-
#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
76-
#else
77-
return new System.Security.Cryptography.RIPEMD160Managed();
78-
#endif
79-
}
80-
#else
81-
public static global::SshNet.Security.Cryptography.RIPEMD160 CreateRIPEMD160()
82-
{
83-
return new global::SshNet.Security.Cryptography.RIPEMD160();
84-
}
85-
#endif // FEATURE_HASH_RIPEMD160
86-
8769
public static System.Security.Cryptography.HMACMD5 CreateHMACMD5(byte[] key)
8870
{
8971
#pragma warning disable CA5351 // Do not use broken cryptographic algorithms
@@ -141,19 +123,5 @@ public static HMACSHA512 CreateHMACSHA512(byte[] key, int hashSize)
141123
{
142124
return new HMACSHA512(key, hashSize);
143125
}
144-
145-
#if FEATURE_HMAC_RIPEMD160
146-
public static System.Security.Cryptography.HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key)
147-
{
148-
#pragma warning disable CA5350 // Do not use weak cryptographic algorithms
149-
return new System.Security.Cryptography.HMACRIPEMD160(key);
150-
#pragma warning restore CA5350 // Do not use weak cryptographic algorithms
151-
}
152-
#else
153-
public static global::SshNet.Security.Cryptography.HMACRIPEMD160 CreateHMACRIPEMD160(byte[] key)
154-
{
155-
return new global::SshNet.Security.Cryptography.HMACRIPEMD160(key);
156-
}
157-
#endif // FEATURE_HMAC_RIPEMD160
158126
}
159127
}

src/Renci.SshNet/ConnectionInfo.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,6 @@ public ConnectionInfo(string host, int port, string username, ProxyTypes proxyTy
381381
{ "hmac-sha2-512", new HashInfo(64*8, key => CryptoAbstraction.CreateHMACSHA512(key), isEncryptThenMAC: false) },
382382
{ "hmac-sha2-512-96", new HashInfo(64*8, key => CryptoAbstraction.CreateHMACSHA512(key, 96), isEncryptThenMAC: false) },
383383
{ "hmac-sha2-256-96", new HashInfo(32*8, key => CryptoAbstraction.CreateHMACSHA256(key, 96), isEncryptThenMAC: false) },
384-
{ "hmac-ripemd160", new HashInfo(160, key => CryptoAbstraction.CreateHMACRIPEMD160(key), isEncryptThenMAC: false) },
385-
{ "hmac-ripemd160@openssh.com", new HashInfo(160, key => CryptoAbstraction.CreateHMACRIPEMD160(key), isEncryptThenMAC: false) },
386384
{ "hmac-sha1", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key), isEncryptThenMAC: false) },
387385
{ "hmac-sha1-96", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key, 96), isEncryptThenMAC: false) },
388386
{ "hmac-md5", new HashInfo(16*8, key => CryptoAbstraction.CreateHMACMD5(key), isEncryptThenMAC: false) },

src/Renci.SshNet/Renci.SshNet.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@
2929
</PropertyGroup>
3030

3131
<PropertyGroup Condition=" '$(TargetFramework)' == 'net462' ">
32-
<DefineConstants>$(DefineConstants);FEATURE_BINARY_SERIALIZATION;FEATURE_HASH_RIPEMD160_CREATE;FEATURE_HMAC_RIPEMD160</DefineConstants>
32+
<DefineConstants>$(DefineConstants);FEATURE_BINARY_SERIALIZATION</DefineConstants>
3333
</PropertyGroup>
3434

35-
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1')) ">
36-
<PackageReference Include="SshNet.Security.Cryptography" Version="[1.3.0]" />
37-
</ItemGroup>
38-
3935
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
4036
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
4137
</ItemGroup>

0 commit comments

Comments
 (0)