Thanks to visit codestin.com
Credit goes to github.com

Skip to content

2025.0.0

Latest
Compare
Choose a tag to compare
@Rob-Hague Rob-Hague released this 18 Apr 19:44

Highlights

  • Add support for post-quantum key exchange methods sntrup761x25519-sha512 and mlkem768x25519-sha256
  • Add support for PuTTY private key files
  • Add logging capability via Microsoft.Extensions.Logging

Breaking changes

  • Support for DSA was dropped in #1558
  • CipherPadding was deleted in #1546 and uses replaced with Org.BouncyCastle.Crypto.Paddings.IBlockCipherPadding
  • See the full API diff at the end

What's Changed

New Contributors

Full Changelog: 2024.2.0...2025.0.0

API diff
  namespace Renci.SshNet
  {
      public abstract class AuthenticationMethod
      {
+         public void Dispose();
+         protected virtual void Dispose(bool disposing);
      }
      public class ConnectionInfo
      {
-         public System.Collections.Generic.IDictionary<string, System.Func<Renci.SshNet.Compression.Compressor>> CompressionAlgorithms { get; }
+         public Renci.SshNet.IOrderedDictionary<string, System.Func<Renci.SshNet.Compression.Compressor>> CompressionAlgorithms { get; }
-         public System.Collections.Generic.IDictionary<string, Renci.SshNet.CipherInfo> Encryptions { get; }
+         public Renci.SshNet.IOrderedDictionary<string, Renci.SshNet.CipherInfo> Encryptions { get; }
-         public System.Collections.Generic.IDictionary<string, Renci.SshNet.HashInfo> HmacAlgorithms { get; }
+         public Renci.SshNet.IOrderedDictionary<string, Renci.SshNet.HashInfo> HmacAlgorithms { get; }
-         public System.Collections.Generic.IDictionary<string, System.Func<byte[], Renci.SshNet.Security.KeyHostAlgorithm>> HostKeyAlgorithms { get; }
+         public Renci.SshNet.IOrderedDictionary<string, System.Func<byte[], Renci.SshNet.Security.KeyHostAlgorithm>> HostKeyAlgorithms { get; }
-         public System.Collections.Generic.IDictionary<string, System.Func<Renci.SshNet.Security.IKeyExchange>> KeyExchangeAlgorithms { get; }
+         public Renci.SshNet.IOrderedDictionary<string, System.Func<Renci.SshNet.Security.IKeyExchange>> KeyExchangeAlgorithms { get; }
      }
      public interface ISftpClient : Renci.SshNet.IBaseClient
      {
+         System.Threading.Tasks.Task<bool> ExistsAsync(string path, System.Threading.CancellationToken cancellationToken = null);
+         System.Threading.Tasks.Task<Renci.SshNet.Sftp.ISftpFile> GetAsync(string path, System.Threading.CancellationToken cancellationToken);
      }
      public class KeyboardInteractiveAuthenticationMethod : Renci.SshNet.AuthenticationMethod
      {
-         public void Dispose();
-         protected virtual void Dispose(bool disposing);
+         protected override void Dispose(bool disposing);
      }
      public class NoneAuthenticationMethod : Renci.SshNet.AuthenticationMethod
      {
-         public void Dispose();
-         protected virtual void Dispose(bool disposing);
+         protected override void Dispose(bool disposing);
      }
      public class PasswordAuthenticationMethod : Renci.SshNet.AuthenticationMethod
      {
-         public void Dispose();
-         protected virtual void Dispose(bool disposing);
+         protected override void Dispose(bool disposing);
      }
      public class PrivateKeyAuthenticationMethod : Renci.SshNet.AuthenticationMethod
      {
-         public void Dispose();
-         protected virtual void Dispose(bool disposing);
+         protected override void Dispose(bool disposing);
      }
+     public interface IOrderedDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>
+     {
+         bool ContainsKey(TKey key);
+         bool ContainsValue(TValue value);
+         System.Collections.Generic.KeyValuePair<TKey, TValue> GetAt(int index);
+         int IndexOf(TKey key);
+         void Insert(int index, TKey key, TValue value);
+         bool Remove(TKey key, out TValue value);
+         void RemoveAt(int index);
+         void SetAt(int index, TKey key, TValue value);
+         void SetAt(int index, TValue value);
+         void SetPosition(TKey key, int newIndex);
+         void SetPosition(int index, int newIndex);
+         bool TryAdd(TKey key, TValue value, out int index);
+         bool TryAdd(TKey key, TValue value);
+         bool TryGetValue(TKey key, out TValue value, out int index);
+         bool TryGetValue(TKey key, out TValue value);
+         int Count { get; }
+         TValue this[TKey key] { get; set; }
+         System.Collections.Generic.ICollection<TKey> Keys { get; }
+         System.Collections.Generic.ICollection<TValue> Values { get; }
+     }
+     public static class SshNetLoggingConfiguration
+     {
+         public static void InitializeLogging(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
+     }
  }
  namespace Renci.SshNet.Messages.Transport
  {
+     public class KeyExchangeHybridReplyMessage : Renci.SshNet.Messages.Message
+     {
+         public KeyExchangeHybridReplyMessage();
+         protected override void LoadData();
+         protected override void SaveData();
+         protected override int BufferCapacity { get; }
+         public byte[] KS { get; }
+         public override string MessageName { get; }
+         public override byte MessageNumber { get; }
+         public byte[] Signature { get; }
+         public byte[] SReply { get; }
+     }
  }
  namespace Renci.SshNet.Security
  {
-     public class DsaKey : Renci.SshNet.Security.Key
-     {
-         public DsaKey(Renci.SshNet.Security.SshKeyData publicKeyData);
-         public DsaKey(byte[] privateKeyData);
-         public DsaKey(System.Numerics.BigInteger p, System.Numerics.BigInteger q, System.Numerics.BigInteger g, System.Numerics.BigInteger y, System.Numerics.BigInteger x);
-         public void Dispose();
-         protected virtual void Dispose(bool disposing);
-         protected internal override Renci.SshNet.Security.Cryptography.DigitalSignature DigitalSignature { get; }
-         public System.Numerics.BigInteger G { get; }
-         public override int KeyLength { get; }
-         public System.Numerics.BigInteger P { get; }
-         public override System.Numerics.BigInteger[] Public { get; }
-         public System.Numerics.BigInteger Q { get; }
-         public System.Numerics.BigInteger X { get; }
-         public System.Numerics.BigInteger Y { get; }
-     }
  }
  namespace Renci.SshNet.Security.Cryptography
  {
      public abstract class BlockCipher : Renci.SshNet.Security.Cryptography.SymmetricCipher
      {
-         protected BlockCipher(byte[] key, byte blockSize, Renci.SshNet.Security.Cryptography.Ciphers.CipherMode mode, Renci.SshNet.Security.Cryptography.Ciphers.CipherPadding padding)
+         protected BlockCipher(byte[] key, byte blockSize, Renci.SshNet.Security.Cryptography.Ciphers.CipherMode mode, Org.BouncyCastle.Crypto.Paddings.IBlockCipherPadding padding)
      }
-     public class DsaDigitalSignature : Renci.SshNet.Security.Cryptography.DigitalSignature
-     {
-         public DsaDigitalSignature(Renci.SshNet.Security.DsaKey key);
-         public void Dispose();
-         protected virtual void Dispose(bool disposing);
-         public override byte[] Sign(byte[] input);
-         public override bool Verify(byte[] input, byte[] signature);
-     }
  }
  namespace Renci.SshNet.Security.Cryptography.Ciphers
  {
      public sealed class AesCipher : Renci.SshNet.Security.Cryptography.BlockCipher
      {
-         public void Dispose(bool disposing);
      }
-     public abstract class CipherPadding
-     {
-         protected CipherPadding();
-         public abstract byte[] Pad(byte[] input, int offset, int length, int paddinglength);
-         public byte[] Pad(byte[] input, int paddinglength);
-         public abstract byte[] Pad(int blockSize, byte[] input, int offset, int length);
-         public byte[] Pad(int blockSize, byte[] input);
-     }
-     public class DesCipher : Renci.SshNet.Security.Cryptography.BlockCipher
-     {
-         public DesCipher(byte[] key, Renci.SshNet.Security.Cryptography.Ciphers.CipherMode mode, Renci.SshNet.Security.Cryptography.Ciphers.CipherPadding padding) : base(default(byte[])!, default(byte)!, default(Renci.SshNet.Security.Cryptography.Ciphers.CipherMode)!, default(Renci.SshNet.Security.Cryptography.Ciphers.CipherPadding)!);
-         public override int DecryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
-         protected static void DesFunc(int[] wKey, byte[] input, int inOff, byte[] outBytes, int outOff);
-         public override int EncryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
-         protected int[] GenerateWorkingKey(bool encrypting, byte[] key);
-         protected virtual void ValidateKey();
-     }
      public sealed class TripleDesCipher : Renci.SshNet.Security.Cryptography.BlockCipher
      {
-         public TripleDesCipher(byte[] key, Renci.SshNet.Security.Cryptography.Ciphers.CipherMode mode, Renci.SshNet.Security.Cryptography.Ciphers.CipherPadding padding);
-         protected override void ValidateKey();
+         public TripleDesCipher(byte[] key, byte[] iv, System.Security.Cryptography.CipherMode mode, bool pkcs7Padding);
+         public override byte[] Decrypt(byte[] input, int offset, int length);
+         public void Dispose();
+         public override byte[] Encrypt(byte[] input, int offset, int length);
      }
  }
- namespace Renci.SshNet.Security.Cryptography.Ciphers.Paddings
- {
-     public class PKCS7Padding : Renci.SshNet.Security.Cryptography.Ciphers.CipherPadding
-     {
-         public PKCS7Padding();
-         public override byte[] Pad(byte[] input, int offset, int length, int paddinglength);
-         public override byte[] Pad(int blockSize, byte[] input, int offset, int length);
-     }
- }