Files
ssh.net/test/Renci.SshNet.TestTools.OpenSSH/Cipher.cs
Gert Driesen 508fc87d2a Fix analyzer errors in Renci.SshNet and Renci.SshNet.TestTools.OpenSSH (#1229)
* Fix analyzer errors in Renci.SshNet and Renci.SshNet.TestTools.OpenSSH.
Suppress all errors in unit tests and integration tests.

* Update unit tests now that we pass 'mode' as argument name when we throw ArgumentException.

* Remove stale comment and add unit tests for SshData.ReadBytes(int length).

* Remove unnessary suppression.

* Remove Visual Studio magic.

* Removed duplicate source file.

* Clarified that suppression hides a false positive.

* Remove suppressions for S2372.

* Update ReadExtensionPair() to return concrete dictionary.
2023-11-01 11:33:42 +01:00

55 lines
1.9 KiB
C#

namespace Renci.SshNet.TestTools.OpenSSH
{
public sealed class Cipher
{
public static readonly Cipher TripledesCbc = new Cipher("3des-cbc");
public static readonly Cipher Aes128Cbc = new Cipher("aes128-cbc");
public static readonly Cipher Aes192Cbc = new Cipher("aes192-cbc");
public static readonly Cipher Aes256Cbc = new Cipher("aes256-cbc");
public static readonly Cipher RijndaelCbc = new Cipher("rijndael-cbc@lysator.liu.se");
public static readonly Cipher Aes128Ctr = new Cipher("aes128-ctr");
public static readonly Cipher Aes192Ctr = new Cipher("aes192-ctr");
public static readonly Cipher Aes256Ctr = new Cipher("aes256-ctr");
public static readonly Cipher Aes128Gcm = new Cipher("aes128-gcm@openssh.com");
public static readonly Cipher Aes256Gcm = new Cipher("aes256-gcm@openssh.com");
public static readonly Cipher Arcfour = new Cipher("arcfour");
public static readonly Cipher Arcfour128 = new Cipher("arcfour128");
public static readonly Cipher Arcfour256 = new Cipher("arcfour256");
public static readonly Cipher BlowfishCbc = new Cipher("blowfish-cbc");
public static readonly Cipher Cast128Cbc = new Cipher("cast128-cbc");
public static readonly Cipher Chacha20Poly1305 = new Cipher("chacha20-poly1305@openssh.com");
public Cipher(string name)
{
Name = name;
}
public string Name { get; }
public override bool Equals(object? obj)
{
if (obj == null)
{
return false;
}
if (obj is Cipher otherCipher)
{
return otherCipher.Name == Name;
}
return false;
}
public override int GetHashCode()
{
return Name.GetHashCode();
}
public override string ToString()
{
return Name;
}
}
}