|
5 | 5 | using System.Security.Cryptography;
|
6 | 6 | using System.Text;
|
7 | 7 |
|
8 |
| -using Renci.SshNet.Abstractions; |
9 | 8 | using Renci.SshNet.Common;
|
10 | 9 | using Renci.SshNet.Compression;
|
11 | 10 | using Renci.SshNet.Messages.Authentication;
|
@@ -397,37 +396,18 @@ public ConnectionInfo(string host, int port, string username, ProxyTypes proxyTy
|
397 | 396 | Encryptions.Add("aes192-cbc", new CipherInfo(192, (key, iv) => new AesCipher(key, iv, AesCipherMode.CBC, pkcs7Padding: false)));
|
398 | 397 | Encryptions.Add("aes256-cbc", new CipherInfo(256, (key, iv) => new AesCipher(key, iv, AesCipherMode.CBC, pkcs7Padding: false)));
|
399 | 398 | Encryptions.Add("3des-cbc", new CipherInfo(192, (key, iv) => new TripleDesCipher(key, new CbcCipherMode(iv), padding: null)));
|
400 |
| - Encryptions.Add("blowfish-cbc", new CipherInfo(128, (key, iv) => new BlowfishCipher(key, new CbcCipherMode(iv), padding: null))); |
401 |
| - Encryptions.Add("twofish-cbc", new CipherInfo(256, (key, iv) => new TwofishCipher(key, new CbcCipherMode(iv), padding: null))); |
402 |
| - Encryptions.Add("twofish192-cbc", new CipherInfo(192, (key, iv) => new TwofishCipher(key, new CbcCipherMode(iv), padding: null))); |
403 |
| - Encryptions.Add("twofish128-cbc", new CipherInfo(128, (key, iv) => new TwofishCipher(key, new CbcCipherMode(iv), padding: null))); |
404 |
| - Encryptions.Add("twofish256-cbc", new CipherInfo(256, (key, iv) => new TwofishCipher(key, new CbcCipherMode(iv), padding: null))); |
405 |
| - Encryptions.Add("arcfour", new CipherInfo(128, (key, iv) => new Arc4Cipher(key, dischargeFirstBytes: false))); |
406 |
| - Encryptions.Add("arcfour128", new CipherInfo(128, (key, iv) => new Arc4Cipher(key, dischargeFirstBytes: true))); |
407 |
| - Encryptions.Add("arcfour256", new CipherInfo(256, (key, iv) => new Arc4Cipher(key, dischargeFirstBytes: true))); |
408 |
| - Encryptions.Add("cast128-cbc", new CipherInfo(128, (key, iv) => new CastCipher(key, new CbcCipherMode(iv), padding: null))); |
409 |
| - |
410 |
| -#pragma warning disable IDE0200 // Remove unnecessary lambda expression; We want to prevent instantiating the HashAlgorithm objects. |
| 399 | + |
411 | 400 | HmacAlgorithms = new Dictionary<string, HashInfo>
|
412 | 401 | {
|
413 | 402 | /* Encrypt-and-MAC (encrypt-and-authenticate) variants */
|
414 |
| - { "hmac-sha2-256", new HashInfo(32*8, key => CryptoAbstraction.CreateHMACSHA256(key), isEncryptThenMAC: false) }, |
415 |
| - { "hmac-sha2-512", new HashInfo(64*8, key => CryptoAbstraction.CreateHMACSHA512(key), isEncryptThenMAC: false) }, |
416 |
| - { "hmac-sha2-512-96", new HashInfo(64*8, key => CryptoAbstraction.CreateHMACSHA512(key, 96), isEncryptThenMAC: false) }, |
417 |
| - { "hmac-sha2-256-96", new HashInfo(32*8, key => CryptoAbstraction.CreateHMACSHA256(key, 96), isEncryptThenMAC: false) }, |
418 |
| - { "hmac-sha1", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key), isEncryptThenMAC: false) }, |
419 |
| - { "hmac-sha1-96", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key, 96), isEncryptThenMAC: false) }, |
420 |
| - { "hmac-md5", new HashInfo(16*8, key => CryptoAbstraction.CreateHMACMD5(key), isEncryptThenMAC: false) }, |
421 |
| - { "hmac-md5-96", new HashInfo(16*8, key => CryptoAbstraction.CreateHMACMD5(key, 96), isEncryptThenMAC: false) }, |
| 403 | + { "hmac-sha2-256", new HashInfo(32*8, key => new HMACSHA256(key)) }, |
| 404 | + { "hmac-sha2-512", new HashInfo(64*8, key => new HMACSHA512(key)) }, |
| 405 | + { "hmac-sha1", new HashInfo(20*8, key => new HMACSHA1(key)) }, |
422 | 406 | /* Encrypt-then-MAC variants */
|
423 |
| - { "hmac-sha2-256-etm@openssh.com", new HashInfo(32*8, key => CryptoAbstraction.CreateHMACSHA256(key), isEncryptThenMAC: true) }, |
424 |
| - { "hmac-sha2-512-etm@openssh.com", new HashInfo(64*8, key => CryptoAbstraction.CreateHMACSHA512(key), isEncryptThenMAC: true) }, |
425 |
| - { "hmac-sha1-etm@openssh.com", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key), isEncryptThenMAC: true) }, |
426 |
| - { "hmac-sha1-96-etm@openssh.com", new HashInfo(20*8, key => CryptoAbstraction.CreateHMACSHA1(key, 96), isEncryptThenMAC: true) }, |
427 |
| - { "hmac-md5-etm@openssh.com", new HashInfo(16*8, key => CryptoAbstraction.CreateHMACMD5(key), isEncryptThenMAC: true) }, |
428 |
| - { "hmac-md5-96-etm@openssh.com", new HashInfo(16*8, key => CryptoAbstraction.CreateHMACMD5(key, 96), isEncryptThenMAC: true) }, |
| 407 | + { "hmac-sha2-256-etm@openssh.com", new HashInfo(32*8, key => new HMACSHA256(key), isEncryptThenMAC: true) }, |
| 408 | + { "hmac-sha2-512-etm@openssh.com", new HashInfo(64*8, key => new HMACSHA512(key), isEncryptThenMAC: true) }, |
| 409 | + { "hmac-sha1-etm@openssh.com", new HashInfo(20*8, key => new HMACSHA1(key), isEncryptThenMAC: true) }, |
429 | 410 | };
|
430 |
| -#pragma warning restore IDE0200 // Remove unnecessary lambda expression |
431 | 411 |
|
432 | 412 | HostKeyAlgorithms = new Dictionary<string, Func<byte[], KeyHostAlgorithm>>
|
433 | 413 | {
|
|
0 commit comments