@@ -378,19 +378,21 @@ public ConnectionInfo(string host, int port, string username, ProxyTypes proxyTy
378
378
{ "cast128-cbc" , new CipherInfo ( 128 , ( key , iv ) => new CastCipher ( key , new CbcCipherMode ( iv ) , padding : null ) ) } ,
379
379
} ;
380
380
381
+ #pragma warning disable IDE0200 // Remove unnecessary lambda expression; We want to prevent instantiating the HashAlgorithm objects.
381
382
HmacAlgorithms = new Dictionary < string , HashInfo >
382
383
{
383
- { "hmac-md5" , new HashInfo ( 16 * 8 , CryptoAbstraction . CreateHMACMD5 ) } ,
384
- { "hmac-md5-96" , new HashInfo ( 16 * 8 , key => CryptoAbstraction . CreateHMACMD5 ( key , 96 ) ) } ,
385
- { "hmac-sha1" , new HashInfo ( 20 * 8 , CryptoAbstraction . CreateHMACSHA1 ) } ,
386
- { "hmac-sha1-96" , new HashInfo ( 20 * 8 , key => CryptoAbstraction . CreateHMACSHA1 ( key , 96 ) ) } ,
387
- { "hmac-sha2-256" , new HashInfo ( 32 * 8 , CryptoAbstraction . CreateHMACSHA256 ) } ,
388
- { "hmac-sha2-256-96" , new HashInfo ( 32 * 8 , key => CryptoAbstraction . CreateHMACSHA256 ( key , 96 ) ) } ,
389
- { "hmac-sha2-512" , new HashInfo ( 64 * 8 , CryptoAbstraction . CreateHMACSHA512 ) } ,
384
+ { "hmac-sha2-256" , new HashInfo ( 32 * 8 , key => CryptoAbstraction . CreateHMACSHA256 ( key ) ) } ,
385
+ { "hmac-sha2-512" , new HashInfo ( 64 * 8 , key => CryptoAbstraction . CreateHMACSHA512 ( key ) ) } ,
390
386
{ "hmac-sha2-512-96" , new HashInfo ( 64 * 8 , key => CryptoAbstraction . CreateHMACSHA512 ( key , 96 ) ) } ,
391
- { "hmac-ripemd160" , new HashInfo ( 160 , CryptoAbstraction . CreateHMACRIPEMD160 ) } ,
392
- { "[email protected] " , new HashInfo ( 160 , CryptoAbstraction . CreateHMACRIPEMD160 ) } ,
387
+ { "hmac-sha2-256-96" , new HashInfo ( 32 * 8 , key => CryptoAbstraction . CreateHMACSHA256 ( key , 96 ) ) } ,
388
+ { "hmac-ripemd160" , new HashInfo ( 160 , key => CryptoAbstraction . CreateHMACRIPEMD160 ( key ) ) } ,
389
+ { "[email protected] " , new HashInfo ( 160 , key
=> CryptoAbstraction . CreateHMACRIPEMD160 ( key ) ) } ,
390
+ { "hmac-sha1" , new HashInfo ( 20 * 8 , key => CryptoAbstraction . CreateHMACSHA1 ( key ) ) } ,
391
+ { "hmac-sha1-96" , new HashInfo ( 20 * 8 , key => CryptoAbstraction . CreateHMACSHA1 ( key , 96 ) ) } ,
392
+ { "hmac-md5" , new HashInfo ( 16 * 8 , key => CryptoAbstraction . CreateHMACMD5 ( key ) ) } ,
393
+ { "hmac-md5-96" , new HashInfo ( 16 * 8 , key => CryptoAbstraction . CreateHMACMD5 ( key , 96 ) ) } ,
393
394
} ;
395
+ #pragma warning restore IDE0200 // Remove unnecessary lambda expression
394
396
395
397
HostKeyAlgorithms = new Dictionary < string , Func < byte [ ] , KeyHostAlgorithm > >
396
398
{
0 commit comments