Browse Source

Remove ASCIIEncoding class and replace ASCII to UTF-8
Refresh Silverlight and WindowsPhone projects

olegkap_cp 14 years ago
parent
commit
4b1f991c9e

+ 0 - 9
Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj

@@ -70,12 +70,6 @@
     <Compile Include="..\Renci.SshNet\CipherInfo.cs">
       <Link>CipherInfo.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Common\ASCIIEncoding.cs">
-      <Link>Common\ASCIIEncoding.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Common\ASCIIEncoding.NET40.cs">
-      <Link>Common\ASCIIEncoding.NET40.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Common\AsyncResult.cs">
       <Link>Common\AsyncResult.cs</Link>
     </Compile>
@@ -445,9 +439,6 @@
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CastCipher.cs">
       <Link>Security\Cryptography\Ciphers\CastCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherBase.cs">
-      <Link>Security\Cryptography\Ciphers\CipherBase.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherMode.cs">
       <Link>Security\Cryptography\Ciphers\CipherMode.cs</Link>
     </Compile>

+ 70 - 0
Renci.SshClient/Renci.SshNet.Silverlight/Common/Extensions.Silverlight.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Net.Sockets;
+using System.Threading;
+using System.Security.Cryptography;
+using System.Diagnostics;
+
+namespace Renci.SshNet.Common
+{
+    /// <summary>
+    /// Collection of different extension method specific for Silverlight
+    /// </summary>
+    public static partial class Extensions
+    {
+        /// <summary>
+        /// Determines whether [is null or white space] [the specified value].
+        /// </summary>
+        /// <param name="value">The value.</param>
+        /// <returns>
+        ///   <c>true</c> if [is null or white space] [the specified value]; otherwise, <c>false</c>.
+        /// </returns>
+        internal static bool IsNullOrWhiteSpace(this string value)
+        {
+            if (string.IsNullOrEmpty(value)) return true;
+
+            return value.All(char.IsWhiteSpace);
+        }
+
+        /// <summary>
+        /// Disposes the specified socket.
+        /// </summary>
+        /// <param name="socket">The socket.</param>
+        [DebuggerNonUserCode]
+        internal static void Dispose(this Socket socket)
+        {
+            if (socket == null)
+                throw new NullReferenceException();
+
+            socket.Close();
+        }
+
+        /// <summary>
+        /// Disposes the specified handle.
+        /// </summary>
+        /// <param name="handle">The handle.</param>
+        [DebuggerNonUserCode]
+        internal static void Dispose(this WaitHandle handle)
+        {
+            if (handle == null)
+                throw new NullReferenceException();
+
+            handle.Close();
+        }
+
+        /// <summary>
+        /// Disposes the specified algorithm.
+        /// </summary>
+        /// <param name="algorithm">The algorithm.</param>
+        [DebuggerNonUserCode]
+        internal static void Dispose(this HashAlgorithm algorithm)
+        {
+            if (algorithm == null)
+                throw new NullReferenceException();
+
+            algorithm.Clear();
+        }
+    }
+}

+ 81 - 81
Renci.SshClient/Renci.SshNet.Silverlight/Renci.SshNet.Silverlight.csproj

@@ -81,8 +81,8 @@
     <Compile Include="..\Renci.SshNet\Channels\ChannelTypes.cs">
       <Link>Channels\ChannelTypes.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Common\ASCIIEncoding.cs">
-      <Link>Common\ASCIIEncoding.cs</Link>
+    <Compile Include="..\Renci.SshNet\CipherInfo.cs">
+      <Link>CipherInfo.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Common\AsyncResult.cs">
       <Link>Common\AsyncResult.cs</Link>
@@ -117,12 +117,18 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelRequestEventArgs.cs">
       <Link>Common\ChannelRequestEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\DerData.cs">
+      <Link>Common\DerData.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ExceptionEventArgs.cs">
       <Link>Common\ExceptionEventArgs.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Common\Extensions.cs">
       <Link>Common\Extensions.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ObjectIdentifier.cs">
+      <Link>Common\ObjectIdentifier.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\PipeStream.cs">
       <Link>Common\PipeStream.cs</Link>
     </Compile>
@@ -270,6 +276,9 @@
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\ChannelRequestMessage.cs">
       <Link>Messages\Connection\ChannelRequest\ChannelRequestMessage.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\EndOfWriteRequestInfo.cs">
+      <Link>Messages\Connection\ChannelRequest\EndOfWriteRequestInfo.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\EnvironmentVariableRequestInfo.cs">
       <Link>Messages\Connection\ChannelRequest\EnvironmentVariableRequestInfo.cs</Link>
     </Compile>
@@ -282,6 +291,9 @@
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\ExitStatusRequestInfo.cs">
       <Link>Messages\Connection\ChannelRequest\ExitStatusRequestInfo.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\KeepAliveRequestInfo.cs">
+      <Link>Messages\Connection\ChannelRequest\KeepAliveRequestInfo.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\PseudoTerminalInfo.cs">
       <Link>Messages\Connection\ChannelRequest\PseudoTerminalInfo.cs</Link>
     </Compile>
@@ -393,48 +405,60 @@
     <Compile Include="..\Renci.SshNet\Security\Algorithm.cs">
       <Link>Security\Algorithm.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cipher.cs">
-      <Link>Security\Cipher.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherAesCbc.cs">
-      <Link>Security\CipherAesCbc.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherAesCtr.cs">
-      <Link>Security\CipherAesCtr.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherBlowfish.cs">
-      <Link>Security\CipherBlowfish.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherCastCbc.cs">
-      <Link>Security\CipherCastCbc.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\CertificateHostAlgorithm.cs">
+      <Link>Security\CertificateHostAlgorithm.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherDesCbc.cs">
-      <Link>Security\CipherDesCbc.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\AsymmetricCipher.cs">
+      <Link>Security\Cryptography\AsymmetricCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherSerpent.cs">
-      <Link>Security\CipherSerpent.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\BlockCipher.cs">
+      <Link>Security\Cryptography\BlockCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherTripleDesCbc.cs">
-      <Link>Security\CipherTripleDesCbc.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Cipher.cs">
+      <Link>Security\Cryptography\Cipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\AsymmetricCipher.cs">
-      <Link>Security\Cryptography\AsymmetricCipher.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\CipherDigitalSignature.cs">
+      <Link>Security\Cryptography\CipherDigitalSignature.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\AesCipher.cs">
       <Link>Security\Cryptography\Ciphers\AesCipher.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Arc4Cipher.cs">
+      <Link>Security\Cryptography\Ciphers\Arc4Cipher.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\BlowfishCipher.cs">
       <Link>Security\Cryptography\Ciphers\BlowfishCipher.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CastCipher.cs">
       <Link>Security\Cryptography\Ciphers\CastCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherBase.cs">
-      <Link>Security\Cryptography\Ciphers\CipherBase.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\CipherMode.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherPadding.cs">
+      <Link>Security\Cryptography\Ciphers\CipherPadding.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\DesCipher.cs">
       <Link>Security\Cryptography\Ciphers\DesCipher.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\CbcCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\CbcCipherMode.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\CfbCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\CfbCipherMode.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\CtrCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\CtrCipherMode.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\OfbCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\OfbCipherMode.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Paddings\PKCS7Padding.cs">
+      <Link>Security\Cryptography\Ciphers\Paddings\PKCS7Padding.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\RsaCipher.cs">
+      <Link>Security\Cryptography\Ciphers\RsaCipher.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\SerpentCipher.cs">
       <Link>Security\Cryptography\Ciphers\SerpentCipher.cs</Link>
     </Compile>
@@ -447,71 +471,41 @@
     <Compile Include="..\Renci.SshNet\Security\Cryptography\DigitalSignature.cs">
       <Link>Security\Cryptography\DigitalSignature.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\HMAC.cs">
-      <Link>Security\Cryptography\HMAC.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\MD5Hash.cs">
-      <Link>Security\Cryptography\MD5Hash.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CbcMode.cs">
-      <Link>Security\Cryptography\Modes\CbcMode.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CfbMode.cs">
-      <Link>Security\Cryptography\Modes\CfbMode.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CipherModeEx.cs">
-      <Link>Security\Cryptography\Modes\CipherModeEx.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\DsaDigitalSignature.cs">
+      <Link>Security\Cryptography\DsaDigitalSignature.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CtrMode.cs">
-      <Link>Security\Cryptography\Modes\CtrMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\DsaKey.cs">
+      <Link>Security\Cryptography\DsaKey.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\ModeBase.cs">
-      <Link>Security\Cryptography\Modes\ModeBase.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Hashes\MD5Hash.cs">
+      <Link>Security\Cryptography\Hashes\MD5Hash.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\OfbMode.cs">
-      <Link>Security\Cryptography\Modes\OfbMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Hashes\SHA1Hash.cs">
+      <Link>Security\Cryptography\Hashes\SHA1Hash.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\RSACipher.cs">
-      <Link>Security\Cryptography\RSACipher.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Hashes\SHA256Hash.cs">
+      <Link>Security\Cryptography\Hashes\SHA256Hash.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\RSADigitalSignature.cs">
-      <Link>Security\Cryptography\RSADigitalSignature.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\HMac.cs">
+      <Link>Security\Cryptography\HMac.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\RSAPrivateKey.cs">
-      <Link>Security\Cryptography\RSAPrivateKey.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Key.cs">
+      <Link>Security\Cryptography\Key.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\RSAPublicKey.cs">
-      <Link>Security\Cryptography\RSAPublicKey.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\RsaDigitalSignature.cs">
+      <Link>Security\Cryptography\RsaDigitalSignature.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\SHA1Hash.cs">
-      <Link>Security\Cryptography\SHA1Hash.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\RsaKey.cs">
+      <Link>Security\Cryptography\RsaKey.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\SHA256Hash.cs">
-      <Link>Security\Cryptography\SHA256Hash.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\StreamCipher.cs">
+      <Link>Security\Cryptography\StreamCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoKey.cs">
-      <Link>Security\CryptoKey.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\SymmetricCipher.cs">
+      <Link>Security\Cryptography\SymmetricCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPrivateKey.cs">
-      <Link>Security\CryptoPrivateKey.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPrivateKeyRsa.cs">
-      <Link>Security\CryptoPrivateKeyRsa.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPublicKey.cs">
-      <Link>Security\CryptoPublicKey.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPublicKeyRsa.cs">
-      <Link>Security\CryptoPublicKeyRsa.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\HMac.cs">
-      <Link>Security\HMac.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\HMacMD5.cs">
-      <Link>Security\HMacMD5.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\HMacSha1.cs">
-      <Link>Security\HMacSha1.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\HostAlgorithm.cs">
+      <Link>Security\HostAlgorithm.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\KeyExchange.cs">
       <Link>Security\KeyExchange.cs</Link>
@@ -531,6 +525,9 @@
     <Compile Include="..\Renci.SshNet\Security\KeyExchangeDiffieHellmanGroupExchangeSha256.cs">
       <Link>Security\KeyExchangeDiffieHellmanGroupExchangeSha256.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Security\KeyHostAlgorithm.cs">
+      <Link>Security\KeyHostAlgorithm.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Session.cs">
       <Link>Session.cs</Link>
     </Compile>
@@ -666,7 +663,10 @@
     <Compile Include="..\Renci.SshNet\SshCommand.cs">
       <Link>SshCommand.cs</Link>
     </Compile>
-    <Compile Include="Common\ASCIIEncoding.Silverlight.cs" />
+    <Compile Include="..\Renci.SshNet\SubsystemSession.cs">
+      <Link>SubsystemSession.cs</Link>
+    </Compile>
+    <Compile Include="Common\Extensions.Silverlight.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />

+ 70 - 0
Renci.SshClient/Renci.SshNet.WindowsPhone/Common/Extensions.WP.cs

@@ -0,0 +1,70 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Net.Sockets;
+using System.Threading;
+using System.Security.Cryptography;
+using System.Diagnostics;
+
+namespace Renci.SshNet.Common
+{
+    /// <summary>
+    /// Collection of different extension method specific for Windows Phone
+    /// </summary>
+    public static partial class Extensions
+    {
+        /// <summary>
+        /// Determines whether [is null or white space] [the specified value].
+        /// </summary>
+        /// <param name="value">The value.</param>
+        /// <returns>
+        ///   <c>true</c> if [is null or white space] [the specified value]; otherwise, <c>false</c>.
+        /// </returns>
+        internal static bool IsNullOrWhiteSpace(this string value)
+        {
+            if (string.IsNullOrEmpty(value)) return true;
+
+            return value.All(char.IsWhiteSpace);
+        }
+
+        /// <summary>
+        /// Disposes the specified socket.
+        /// </summary>
+        /// <param name="socket">The socket.</param>
+        [DebuggerNonUserCode]
+        internal static void Dispose(this Socket socket)
+        {
+            if (socket == null)
+                throw new NullReferenceException();
+
+            socket.Close();
+        }
+
+        /// <summary>
+        /// Disposes the specified handle.
+        /// </summary>
+        /// <param name="handle">The handle.</param>
+        [DebuggerNonUserCode]
+        internal static void Dispose(this WaitHandle handle)
+        {
+            if (handle == null)
+                throw new NullReferenceException();
+
+            handle.Close();
+        }
+
+        /// <summary>
+        /// Disposes the specified algorithm.
+        /// </summary>
+        /// <param name="algorithm">The algorithm.</param>
+        [DebuggerNonUserCode]
+        internal static void Dispose(this HashAlgorithm algorithm)
+        {
+            if (algorithm == null)
+                throw new NullReferenceException();
+
+            algorithm.Clear();
+        }
+    }
+}

+ 90 - 83
Renci.SshClient/Renci.SshNet.WindowsPhone/Renci.SshNet.WindowsPhone.csproj

@@ -74,6 +74,9 @@
     <Compile Include="..\Renci.SshNet\Channels\ChannelTypes.cs">
       <Link>Channels\ChannelTypes.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\CipherInfo.cs">
+      <Link>CipherInfo.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\AsyncResult.cs">
       <Link>Common\AsyncResult.cs</Link>
     </Compile>
@@ -92,6 +95,9 @@
     <Compile Include="..\Renci.SshNet\Common\AuthenticationPromptEventArgs.cs">
       <Link>Common\AuthenticationPromptEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\BigInteger.cs">
+      <Link>Common\BigInteger.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ChannelDataEventArgs.cs">
       <Link>Common\ChannelDataEventArgs.cs</Link>
     </Compile>
@@ -104,18 +110,27 @@
     <Compile Include="..\Renci.SshNet\Common\ChannelRequestEventArgs.cs">
       <Link>Common\ChannelRequestEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\DerData.cs">
+      <Link>Common\DerData.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\ExceptionEventArgs.cs">
       <Link>Common\ExceptionEventArgs.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Common\Extensions.cs">
       <Link>Common\Extensions.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\ObjectIdentifier.cs">
+      <Link>Common\ObjectIdentifier.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\PipeStream.cs">
       <Link>Common\PipeStream.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Common\PortForwardEventArgs.cs">
       <Link>Common\PortForwardEventArgs.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Common\SemaphoreLight.cs">
+      <Link>Common\SemaphoreLight.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Common\SftpPathNotFoundException.cs">
       <Link>Common\SftpPathNotFoundException.cs</Link>
     </Compile>
@@ -152,9 +167,6 @@
     <Compile Include="..\Renci.SshNet\ConnectionInfo.cs">
       <Link>ConnectionInfo.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\ExceptionEventArgs.cs">
-      <Link>ExceptionEventArgs.cs</Link>
-    </Compile>
     <Compile Include="..\Renci.SshNet\ForwardedPort.cs">
       <Link>ForwardedPort.cs</Link>
     </Compile>
@@ -257,6 +269,9 @@
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\ChannelRequestMessage.cs">
       <Link>Messages\Connection\ChannelRequest\ChannelRequestMessage.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\EndOfWriteRequestInfo.cs">
+      <Link>Messages\Connection\ChannelRequest\EndOfWriteRequestInfo.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\EnvironmentVariableRequestInfo.cs">
       <Link>Messages\Connection\ChannelRequest\EnvironmentVariableRequestInfo.cs</Link>
     </Compile>
@@ -269,6 +284,9 @@
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\ExitStatusRequestInfo.cs">
       <Link>Messages\Connection\ChannelRequest\ExitStatusRequestInfo.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\KeepAliveRequestInfo.cs">
+      <Link>Messages\Connection\ChannelRequest\KeepAliveRequestInfo.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Messages\Connection\ChannelRequest\PseudoTerminalInfo.cs">
       <Link>Messages\Connection\ChannelRequest\PseudoTerminalInfo.cs</Link>
     </Compile>
@@ -380,125 +398,107 @@
     <Compile Include="..\Renci.SshNet\Security\Algorithm.cs">
       <Link>Security\Algorithm.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cipher.cs">
-      <Link>Security\Cipher.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\CertificateHostAlgorithm.cs">
+      <Link>Security\CertificateHostAlgorithm.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherAESCBC.cs">
-      <Link>Security\CipherAESCBC.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\AsymmetricCipher.cs">
+      <Link>Security\Cryptography\AsymmetricCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherAESCTR.cs">
-      <Link>Security\CipherAESCTR.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\BlockCipher.cs">
+      <Link>Security\Cryptography\BlockCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherBlowfish.cs">
-      <Link>Security\CipherBlowfish.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Cipher.cs">
+      <Link>Security\Cryptography\Cipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherCast.cs">
-      <Link>Security\CipherCast.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherDES.cs">
-      <Link>Security\CipherDES.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherSerpent.cs">
-      <Link>Security\CipherSerpent.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CipherTripleDES.cs">
-      <Link>Security\CipherTripleDES.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Aes.cs">
-      <Link>Security\Cryptography\Aes.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Blowfish.cs">
-      <Link>Security\Cryptography\Blowfish.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Cast.cs">
-      <Link>Security\Cryptography\Cast.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\CipherDigitalSignature.cs">
+      <Link>Security\Cryptography\CipherDigitalSignature.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\AesCipher.cs">
       <Link>Security\Cryptography\Ciphers\AesCipher.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Arc4Cipher.cs">
+      <Link>Security\Cryptography\Ciphers\Arc4Cipher.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\BlowfishCipher.cs">
       <Link>Security\Cryptography\Ciphers\BlowfishCipher.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CastCipher.cs">
       <Link>Security\Cryptography\Ciphers\CastCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherBase.cs">
-      <Link>Security\Cryptography\Ciphers\CipherBase.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\CipherMode.cs</Link>
+    </Compile>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\CipherPadding.cs">
+      <Link>Security\Cryptography\Ciphers\CipherPadding.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\DesCipher.cs">
       <Link>Security\Cryptography\Ciphers\DesCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\SerpentCipher.cs">
-      <Link>Security\Cryptography\Ciphers\SerpentCipher.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\TripleDesCipher.cs">
-      <Link>Security\Cryptography\Ciphers\TripleDesCipher.cs</Link>
-    </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\TwofishCipher.cs">
-      <Link>Security\Cryptography\Ciphers\TwofishCipher.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\CbcCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\CbcCipherMode.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\CipherTransform.cs">
-      <Link>Security\Cryptography\CipherTransform.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\CfbCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\CfbCipherMode.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Des.cs">
-      <Link>Security\Cryptography\Des.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\CtrCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\CtrCipherMode.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CbcMode.cs">
-      <Link>Security\Cryptography\Modes\CbcMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Modes\OfbCipherMode.cs">
+      <Link>Security\Cryptography\Ciphers\Modes\OfbCipherMode.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CfbMode.cs">
-      <Link>Security\Cryptography\Modes\CfbMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\Paddings\PKCS7Padding.cs">
+      <Link>Security\Cryptography\Ciphers\Paddings\PKCS7Padding.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CipherModeEx.cs">
-      <Link>Security\Cryptography\Modes\CipherModeEx.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\RsaCipher.cs">
+      <Link>Security\Cryptography\Ciphers\RsaCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\CtrMode.cs">
-      <Link>Security\Cryptography\Modes\CtrMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\SerpentCipher.cs">
+      <Link>Security\Cryptography\Ciphers\SerpentCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\ModeBase.cs">
-      <Link>Security\Cryptography\Modes\ModeBase.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\TripleDesCipher.cs">
+      <Link>Security\Cryptography\Ciphers\TripleDesCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Modes\OfbMode.cs">
-      <Link>Security\Cryptography\Modes\OfbMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Ciphers\TwofishCipher.cs">
+      <Link>Security\Cryptography\Ciphers\TwofishCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\Serpent.cs">
-      <Link>Security\Cryptography\Serpent.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\DigitalSignature.cs">
+      <Link>Security\Cryptography\DigitalSignature.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\TransformMode.cs">
-      <Link>Security\Cryptography\TransformMode.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\DsaDigitalSignature.cs">
+      <Link>Security\Cryptography\DsaDigitalSignature.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\Cryptography\TripleDes.cs">
-      <Link>Security\Cryptography\TripleDes.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\DsaKey.cs">
+      <Link>Security\Cryptography\DsaKey.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoKey.cs">
-      <Link>Security\CryptoKey.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Hashes\MD5Hash.cs">
+      <Link>Security\Cryptography\Hashes\MD5Hash.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPrivateKey.cs">
-      <Link>Security\CryptoPrivateKey.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Hashes\SHA1Hash.cs">
+      <Link>Security\Cryptography\Hashes\SHA1Hash.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPrivateKeyDss.cs">
-      <Link>Security\CryptoPrivateKeyDss.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Hashes\SHA256Hash.cs">
+      <Link>Security\Cryptography\Hashes\SHA256Hash.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPrivateKeyRsa.cs">
-      <Link>Security\CryptoPrivateKeyRsa.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\HMac.cs">
+      <Link>Security\Cryptography\HMac.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPublicKey.cs">
-      <Link>Security\CryptoPublicKey.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\Key.cs">
+      <Link>Security\Cryptography\Key.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPublicKeyDss.cs">
-      <Link>Security\CryptoPublicKeyDss.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\RsaDigitalSignature.cs">
+      <Link>Security\Cryptography\RsaDigitalSignature.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\CryptoPublicKeyRsa.cs">
-      <Link>Security\CryptoPublicKeyRsa.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\RsaKey.cs">
+      <Link>Security\Cryptography\RsaKey.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\HMac.cs">
-      <Link>Security\HMac.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\StreamCipher.cs">
+      <Link>Security\Cryptography\StreamCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\HMacMD5.cs">
-      <Link>Security\HMacMD5.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\Cryptography\SymmetricCipher.cs">
+      <Link>Security\Cryptography\SymmetricCipher.cs</Link>
     </Compile>
-    <Compile Include="..\Renci.SshNet\Security\HMacSha1.cs">
-      <Link>Security\HMacSha1.cs</Link>
+    <Compile Include="..\Renci.SshNet\Security\HostAlgorithm.cs">
+      <Link>Security\HostAlgorithm.cs</Link>
     </Compile>
     <Compile Include="..\Renci.SshNet\Security\KeyExchange.cs">
       <Link>Security\KeyExchange.cs</Link>
@@ -518,6 +518,9 @@
     <Compile Include="..\Renci.SshNet\Security\KeyExchangeDiffieHellmanGroupExchangeSha256.cs">
       <Link>Security\KeyExchangeDiffieHellmanGroupExchangeSha256.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\Security\KeyHostAlgorithm.cs">
+      <Link>Security\KeyHostAlgorithm.cs</Link>
+    </Compile>
     <Compile Include="..\Renci.SshNet\Session.cs">
       <Link>Session.cs</Link>
     </Compile>
@@ -653,6 +656,10 @@
     <Compile Include="..\Renci.SshNet\SshCommand.cs">
       <Link>SshCommand.cs</Link>
     </Compile>
+    <Compile Include="..\Renci.SshNet\SubsystemSession.cs">
+      <Link>SubsystemSession.cs</Link>
+    </Compile>
+    <Compile Include="Common\Extensions.WP.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />

+ 16 - 1
Renci.SshClient/Renci.SshNet.sln

@@ -20,9 +20,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.NET35", "Renci
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.Tests.NET35", "Renci.SshNet.Tests.NET35\Renci.SshNet.Tests.NET35.csproj", "{007CE8B3-7827-4AD0-AACD-860505638ABE}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Renci.SshNet.WindowsPhone", "Renci.SshNet.WindowsPhone\Renci.SshNet.WindowsPhone.csproj", "{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}"
+EndProject
 Global
 	GlobalSection(TeamFoundationVersionControl) = preSolution
-		SccNumberOfProjects = 6
+		SccNumberOfProjects = 7
 		SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
 		SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs11
 		SccLocalPath0 = .
@@ -41,6 +43,9 @@ Global
 		SccProjectUniqueName5 = Renci.SshNet.Tests.NET35\\Renci.SshNet.Tests.NET35.csproj
 		SccProjectName5 = Renci.SshNet.Tests.NET35
 		SccLocalPath5 = Renci.SshNet.Tests.NET35
+		SccProjectUniqueName6 = Renci.SshNet.WindowsPhone\\Renci.SshNet.WindowsPhone.csproj
+		SccProjectName6 = Renci.SshNet.WindowsPhone
+		SccLocalPath6 = Renci.SshNet.WindowsPhone
 	EndGlobalSection
 	GlobalSection(TestCaseManagementSettings) = postSolution
 		CategoryFile = Renci.SshNet1.vsmdi
@@ -114,6 +119,16 @@ Global
 		{007CE8B3-7827-4AD0-AACD-860505638ABE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
 		{007CE8B3-7827-4AD0-AACD-860505638ABE}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{007CE8B3-7827-4AD0-AACD-860505638ABE}.Release|x86.ActiveCfg = Release|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{3AD3EDF0-702E-4A91-8735-DCE4659AA54C}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 0 - 73
Renci.SshClient/Renci.SshNet/Common/ASCIIEncoding.NET40.cs

@@ -1,73 +0,0 @@
-/*
- * ASCIIEncoding.cs - Implementation of the "System.Text.ASCIIEncoding" class.
- *
- * Copyright (C) 2001  Southern Storm Software, Pty Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-using System;
-using System.Text;
-
-namespace Renci.SshNet.Common
-{
-    [Serializable]
-    public partial class ASCIIEncoding : Encoding
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="ASCIIEncoding"/> class.
-        /// </summary>
-        public ASCIIEncoding()
-            : base(ASCII_CODE_PAGE)
-        {
-        }
-
-        /// <summary>
-        /// Decodes all the bytes in the specified byte array into a string.
-        /// </summary>
-        /// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
-        /// <returns>
-        /// A <see cref="T:System.String"/> containing the results of decoding the specified sequence of bytes.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentException">The byte array contains invalid Unicode code points.</exception>
-        ///   
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="bytes"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.Text.DecoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.DecoderFallback"/> is set to <see cref="T:System.Text.DecoderExceptionFallback"/>.</exception>
-        public override String GetString(byte[] bytes)
-        {
-            if (bytes == null)
-            {
-                throw new ArgumentNullException("bytes");
-            }
-            if (bytes.Length == 0)
-            {
-                return String.Empty;
-            }
-            int count = bytes.Length;
-            int posn = 0;
-
-            char[] chars = new char[count];
-
-            while (count-- > 0)
-            {
-                chars[posn] = (char)(bytes[posn]);
-                ++posn;
-            }
-            return new string(chars);
-        }    
-    }; 
-}

+ 0 - 405
Renci.SshClient/Renci.SshNet/Common/ASCIIEncoding.cs

@@ -1,405 +0,0 @@
-/*
- * ASCIIEncoding.cs - Implementation of the "System.Text.ASCIIEncoding" class.
- *
- * Copyright (C) 2001  Southern Storm Software, Pty Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-using System;
-using System.Text;
-
-namespace Renci.SshNet.Common
-{
-    /// <summary>
-    /// Represents an ASCII character encoding of Unicode characters.
-    /// </summary>
-    public partial class ASCIIEncoding : Encoding
-    {
-        // Magic number used by Windows for "ASCII".
-        internal const int ASCII_CODE_PAGE = 20127;
-
-        private static ASCIIEncoding _current = new ASCIIEncoding();
-        /// <summary>
-        /// Gets the current encoding.
-        /// </summary>
-        public static ASCIIEncoding Current
-        {
-            get
-            {
-                return _current;
-            }
-        }
-
-        /// <summary>
-        /// Calculates the number of bytes produced by encoding a set of characters from the specified character array.
-        /// </summary>
-        /// <param name="chars">The character array containing the set of characters to encode.</param>
-        /// <param name="index">The index of the first character to encode.</param>
-        /// <param name="count">The number of characters to encode.</param>
-        /// <returns>
-        /// The number of bytes produced by encoding the specified characters.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="chars"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="index"/> or <paramref name="count"/> is less than zero.-or- <paramref name="index"/> and <paramref name="count"/> do not denote a valid range in <paramref name="chars"/>. </exception>
-        ///   
-        /// <exception cref="T:System.Text.EncoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.EncoderFallback"/> is set to <see cref="T:System.Text.EncoderExceptionFallback"/>.</exception>
-        public override int GetByteCount(char[] chars, int index, int count)
-        {
-            if (chars == null)
-            {
-                throw new ArgumentNullException("chars");
-            }
-            if (index < 0 || index > chars.Length)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            if (count < 0 || count > (chars.Length - index))
-            {
-                throw new ArgumentOutOfRangeException("count");
-            }
-            return count;
-        }
-
-        /// <summary>
-        /// Gets the byte count.
-        /// </summary>
-        /// <param name="chars">The chars.</param>
-        /// <returns></returns>
-        public override int GetByteCount(string chars)
-        {
-            if (chars == null)
-            {
-                throw new ArgumentNullException("chars");
-            }
-            return chars.Length;
-        }
-
-        /// <summary>
-        /// Encodes a set of characters from the specified character array into the specified byte array.
-        /// </summary>
-        /// <param name="chars">The character array containing the set of characters to encode.</param>
-        /// <param name="charIndex">The index of the first character to encode.</param>
-        /// <param name="charCount">The number of characters to encode.</param>
-        /// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
-        /// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
-        /// <returns>
-        /// The actual number of bytes written into <paramref name="bytes"/>.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="chars"/> is null.-or- <paramref name="bytes"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="charIndex"/> or <paramref name="charCount"/> or <paramref name="byteIndex"/> is less than zero.-or- <paramref name="charIndex"/> and <paramref name="charCount"/> do not denote a valid range in <paramref name="chars"/>.-or- <paramref name="byteIndex"/> is not a valid index in <paramref name="bytes"/>. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentException">
-        ///   <paramref name="bytes"/> does not have enough capacity from <paramref name="byteIndex"/> to the end of the array to accommodate the resulting bytes. </exception>
-        ///   
-        /// <exception cref="T:System.Text.EncoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.EncoderFallback"/> is set to <see cref="T:System.Text.EncoderExceptionFallback"/>.</exception>
-        public override int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
-        {
-            if (chars == null)
-            {
-                throw new ArgumentNullException("chars");
-            }
-            if (bytes == null)
-            {
-                throw new ArgumentNullException("bytes");
-            }
-            if (charIndex < 0 || charIndex > chars.Length)
-            {
-                throw new ArgumentOutOfRangeException("charIndex");
-            }
-            if (charCount < 0 || charCount > (chars.Length - charIndex))
-            {
-                throw new ArgumentOutOfRangeException("charCount");
-            }
-            if (byteIndex < 0 || byteIndex > bytes.Length)
-            {
-                throw new ArgumentOutOfRangeException("byteIndex");
-            }
-            if ((bytes.Length - byteIndex) < charCount)
-            {
-                throw new ArgumentException();
-            }
-            int count = charCount;
-            char ch;
-            while (count-- > 0)
-            {
-                ch = chars[charIndex++];
-                if (ch < (char)0x80)
-                {
-                    bytes[byteIndex++] = (byte)ch;
-                }
-                else
-                {
-                    bytes[byteIndex++] = (byte)'?';
-                }
-            }
-            return charCount;
-        }
-
-        /// <summary>
-        /// Encodes a set of characters from the specified <see cref="T:System.String"/> into the specified byte array.
-        /// </summary>
-        /// <param name="s">The <see cref="T:System.String"/> containing the set of characters to encode.</param>
-        /// <param name="charIndex">The index of the first character to encode.</param>
-        /// <param name="charCount">The number of characters to encode.</param>
-        /// <param name="bytes">The byte array to contain the resulting sequence of bytes.</param>
-        /// <param name="byteIndex">The index at which to start writing the resulting sequence of bytes.</param>
-        /// <returns>
-        /// The actual number of bytes written into <paramref name="bytes"/>.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="s"/> is null.-or- <paramref name="bytes"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="charIndex"/> or <paramref name="charCount"/> or <paramref name="byteIndex"/> is less than zero.-or- <paramref name="charIndex"/> and <paramref name="charCount"/> do not denote a valid range in <paramref name="bytes"/>.-or- <paramref name="byteIndex"/> is not a valid index in <paramref name="bytes"/>. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentException">
-        ///   <paramref name="bytes"/> does not have enough capacity from <paramref name="byteIndex"/> to the end of the array to accommodate the resulting bytes. </exception>
-        ///   
-        /// <exception cref="T:System.Text.EncoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.EncoderFallback"/> is set to <see cref="T:System.Text.EncoderExceptionFallback"/>.</exception>
-        public override int GetBytes(String s, int charIndex, int charCount, byte[] bytes, int byteIndex)
-        {
-            if (s == null)
-            {
-                throw new ArgumentNullException("s");
-            }
-            if (bytes == null)
-            {
-                throw new ArgumentNullException("bytes");
-            }
-            if (charIndex < 0 || charIndex > s.Length)
-            {
-                throw new ArgumentOutOfRangeException("charIndex");
-            }
-            if (charCount < 0 || charCount > (s.Length - charIndex))
-            {
-                throw new ArgumentOutOfRangeException("charCount");
-            }
-            if (byteIndex < 0 || byteIndex > bytes.Length)
-            {
-                throw new ArgumentOutOfRangeException("byteIndex");
-            }
-            if ((bytes.Length - byteIndex) < charCount)
-            {
-                throw new ArgumentException();
-            }
-            int count = charCount;
-            char ch;
-            while (count-- > 0)
-            {
-                ch = s[charIndex++];
-                if (ch < (char)0x80)
-                {
-                    bytes[byteIndex++] = (byte)ch;
-                }
-                else
-                {
-                    bytes[byteIndex++] = (byte)'?';
-                }
-            }
-            return charCount;
-        }
-
-        /// <summary>
-        /// Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array.
-        /// </summary>
-        /// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
-        /// <param name="index">The index of the first byte to decode.</param>
-        /// <param name="count">The number of bytes to decode.</param>
-        /// <returns>
-        /// The number of characters produced by decoding the specified sequence of bytes.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="bytes"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="index"/> or <paramref name="count"/> is less than zero.-or- <paramref name="index"/> and <paramref name="count"/> do not denote a valid range in <paramref name="bytes"/>. </exception>
-        ///   
-        /// <exception cref="T:System.Text.DecoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.DecoderFallback"/> is set to <see cref="T:System.Text.DecoderExceptionFallback"/>.</exception>
-        public override int GetCharCount(byte[] bytes, int index, int count)
-        {
-            if (bytes == null)
-            {
-                throw new ArgumentNullException("bytes");
-            }
-            if (index < 0 || index > bytes.Length)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            if (count < 0 || count > (bytes.Length - index))
-            {
-                throw new ArgumentOutOfRangeException("count");
-            }
-            return count;
-        }
-
-        /// <summary>
-        /// Decodes a sequence of bytes from the specified byte array into the specified character array.
-        /// </summary>
-        /// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
-        /// <param name="byteIndex">The index of the first byte to decode.</param>
-        /// <param name="byteCount">The number of bytes to decode.</param>
-        /// <param name="chars">The character array to contain the resulting set of characters.</param>
-        /// <param name="charIndex">The index at which to start writing the resulting set of characters.</param>
-        /// <returns>
-        /// The actual number of characters written into <paramref name="chars"/>.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="bytes"/> is null.-or- <paramref name="chars"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="byteIndex"/> or <paramref name="byteCount"/> or <paramref name="charIndex"/> is less than zero.-or- <paramref name="byteIndex"/> and <paramref name="byteCount"/> do not denote a valid range in <paramref name="bytes"/>.-or- <paramref name="charIndex"/> is not a valid index in <paramref name="chars"/>. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentException">
-        ///   <paramref name="chars"/> does not have enough capacity from <paramref name="charIndex"/> to the end of the array to accommodate the resulting characters. </exception>
-        ///   
-        /// <exception cref="T:System.Text.DecoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.DecoderFallback"/> is set to <see cref="T:System.Text.DecoderExceptionFallback"/>.</exception>
-        public override int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
-        {
-            if (bytes == null)
-            {
-                throw new ArgumentNullException("bytes");
-            }
-            if (chars == null)
-            {
-                throw new ArgumentNullException("chars");
-            }
-            if (byteIndex < 0 || byteIndex > bytes.Length)
-            {
-                throw new ArgumentOutOfRangeException("byteIndex");
-            }
-            if (byteCount < 0 || byteCount > (bytes.Length - byteIndex))
-            {
-                throw new ArgumentOutOfRangeException("byteCount");
-            }
-            if (charIndex < 0 || charIndex > chars.Length)
-            {
-                throw new ArgumentOutOfRangeException("charIndex");
-            }
-            if ((chars.Length - charIndex) < byteCount)
-            {
-                throw new ArgumentException();
-            }
-            int count = byteCount;
-            byte ch;
-            while (count-- > 0)
-            {
-                ch = bytes[byteIndex++];
-                if (ch < 0x80)
-                {
-                    chars[charIndex++] = (char)ch;
-                }
-                else
-                {
-                    chars[charIndex++] = '?';
-                }
-            }
-            return byteCount;
-        }
-
-        /// <summary>
-        /// Calculates the maximum number of bytes produced by encoding the specified number of characters.
-        /// </summary>
-        /// <param name="charCount">The number of characters to encode.</param>
-        /// <returns>
-        /// The maximum number of bytes produced by encoding the specified number of characters.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="charCount"/> is less than zero. </exception>
-        ///   
-        /// <exception cref="T:System.Text.EncoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.EncoderFallback"/> is set to <see cref="T:System.Text.EncoderExceptionFallback"/>.</exception>
-        public override int GetMaxByteCount(int charCount)
-        {
-            if (charCount < 0)
-            {
-                throw new ArgumentOutOfRangeException("charCount");
-            }
-
-            return charCount;
-        }
-
-        /// <summary>
-        /// Calculates the maximum number of characters produced by decoding the specified number of bytes.
-        /// </summary>
-        /// <param name="byteCount">The number of bytes to decode.</param>
-        /// <returns>
-        /// The maximum number of characters produced by decoding the specified number of bytes.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="byteCount"/> is less than zero. </exception>
-        ///   
-        /// <exception cref="T:System.Text.DecoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.DecoderFallback"/> is set to <see cref="T:System.Text.DecoderExceptionFallback"/>.</exception>
-        public override int GetMaxCharCount(int byteCount)
-        {
-            if (byteCount < 0)
-            {
-                throw new ArgumentOutOfRangeException("byteCount");
-            }
-            return byteCount;
-        }
-
-        /// <summary>
-        /// Decodes a sequence of bytes from the specified byte array into a string.
-        /// </summary>
-        /// <param name="bytes">The byte array containing the sequence of bytes to decode.</param>
-        /// <param name="index">The index of the first byte to decode.</param>
-        /// <param name="count">The number of bytes to decode.</param>
-        /// <returns>
-        /// A <see cref="T:System.String"/> containing the results of decoding the specified sequence of bytes.
-        /// </returns>
-        /// <exception cref="T:System.ArgumentException">The byte array contains invalid Unicode code points.</exception>
-        ///   
-        /// <exception cref="T:System.ArgumentNullException">
-        ///   <paramref name="bytes"/> is null. </exception>
-        ///   
-        /// <exception cref="T:System.ArgumentOutOfRangeException">
-        ///   <paramref name="index"/> or <paramref name="count"/> is less than zero.-or- <paramref name="index"/> and <paramref name="count"/> do not denote a valid range in <paramref name="bytes"/>. </exception>
-        ///   
-        /// <exception cref="T:System.Text.DecoderFallbackException">A fallback occurred (see Understanding Encodings for complete explanation)-and-<see cref="P:System.Text.Encoding.DecoderFallback"/> is set to <see cref="T:System.Text.DecoderExceptionFallback"/>.</exception>
-        public override String GetString(byte[] bytes, int index, int count)
-        {
-            if (bytes == null)
-            {
-                throw new ArgumentNullException("bytes");
-            }
-            if (index < 0 || index > bytes.Length)
-            {
-                throw new ArgumentOutOfRangeException("index");
-            }
-            if (count < 0 || count > (bytes.Length - index))
-            {
-                throw new ArgumentOutOfRangeException("count");
-            }
-            if (count == 0)
-            {
-                return String.Empty;
-            }
-
-            char[] chars = new char[count];
-            int posn = 0;
-            while (count-- > 0)
-            {
-                chars[posn++] = (char)(bytes[index++]);
-            }
-            return new string(chars);
-        }
-    }; 
-}

+ 2 - 2
Renci.SshClient/Renci.SshNet/Common/SshData.cs

@@ -220,7 +220,7 @@ namespace Renci.SshNet.Common
                 throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Strings longer than {0} is not supported.", int.MaxValue));
             }
 
-            return Renci.SshNet.Common.ASCIIEncoding.Current.GetString(this.ReadBytes((int)length));
+            return Encoding.UTF8.GetString(this.ReadBytes((int)length));
         }
 
         /// <summary>
@@ -370,7 +370,7 @@ namespace Renci.SshNet.Common
         /// <param name="data">string data to write.</param>
         protected void Write(string data)
         {
-            this.Write(data, Renci.SshNet.Common.ASCIIEncoding.Current);
+            this.Write(data, Encoding.UTF8);
         }
 
         /// <summary>

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Authentication/RequestMessage.cs

@@ -66,7 +66,7 @@ namespace Renci.SshNet.Messages.Authentication
                 default:
                     throw new NotSupportedException("Not supported service name");
             }
-            this.Write(this.MethodName, Renci.SshNet.Common.ASCIIEncoding.Current);
+            this.Write(this.MethodName);
         }
     }
 }

+ 1 - 1
Renci.SshClient/Renci.SshNet/Messages/Authentication/RequestMessageHost.cs

@@ -85,7 +85,7 @@ namespace Renci.SshNet.Messages.Authentication
 
             this.Write(this.PublicKeyAlgorithm);
             this.WriteBinaryString(this.PublicHostKey);
-            this.Write(this.ClientHostName, Renci.SshNet.Common.ASCIIEncoding.Current);
+            this.Write(this.ClientHostName);
             this.Write(this.ClientUsername, Encoding.UTF8);
 
             if (this.Signature != null)

+ 172 - 152
Renci.SshClient/Renci.SshNet/Renci.SshNet.csproj

@@ -62,19 +62,22 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="BaseClient.cs" />
+    <Compile Include="ChannelAsyncResult.cs" />
+    <Compile Include="Channels\Channel.cs" />
+    <Compile Include="Channels\ChannelDirectTcpip.cs" />
     <Compile Include="Channels\ChannelDirectTcpip.NET40.cs" />
+    <Compile Include="Channels\ChannelForwardedTcpip.cs" />
     <Compile Include="Channels\ChannelForwardedTcpip.NET40.cs" />
+    <Compile Include="Channels\ChannelSession.cs" />
+    <Compile Include="Channels\ChannelTypes.cs" />
     <Compile Include="CipherInfo.cs" />
-    <Compile Include="Common\ASCIIEncoding.cs" />
-    <Compile Include="Common\ASCIIEncoding.NET40.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="Common\AsyncResult.cs" />
     <Compile Include="Common\AuthenticationBannerEventArgs.cs" />
     <Compile Include="Common\AuthenticationEventArgs.cs" />
     <Compile Include="Common\AuthenticationPasswordChangeEventArgs.cs" />
-    <Compile Include="Common\AuthenticationPromptEventArgs.cs" />
     <Compile Include="Common\AuthenticationPrompt.cs" />
+    <Compile Include="Common\AuthenticationPromptEventArgs.cs" />
     <Compile Include="Common\BigInteger.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -83,44 +86,153 @@
     <Compile Include="Common\ChannelOpenFailedEventArgs.cs" />
     <Compile Include="Common\ChannelRequestEventArgs.cs" />
     <Compile Include="Common\DerData.cs" />
-    <Compile Include="Common\Extensions.NET40.cs" />
+    <Compile Include="Common\ExceptionEventArgs.cs" />
+    <Compile Include="Common\Extensions.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Common\Extensions.NET40.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="Common\ObjectIdentifier.cs" />
+    <Compile Include="Common\PipeStream.cs" />
+    <Compile Include="Common\PortForwardEventArgs.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="Common\SemaphoreLight.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="Common\SftpPathNotFoundException.cs" />
     <Compile Include="Common\SftpPathNotFoundException.NET40.cs" />
+    <Compile Include="Common\SftpPermissionDeniedException.cs" />
     <Compile Include="Common\SftpPermissionDeniedException.NET40.cs" />
+    <Compile Include="Common\SshAuthenticationException.cs" />
     <Compile Include="Common\SshAuthenticationException.NET40.cs" />
+    <Compile Include="Common\SshConnectionException.cs" />
     <Compile Include="Common\SshConnectionException.NET40.cs" />
+    <Compile Include="Common\SshData.cs" />
+    <Compile Include="Common\SshException.cs" />
     <Compile Include="Common\SshException.NET40.cs" />
-    <Compile Include="Common\SshPassPhraseNullOrEmptyException.NET40.cs" />
-    <Compile Include="Common\ExceptionEventArgs.cs" />
-    <Compile Include="Common\PipeStream.cs" />
-    <Compile Include="Common\PortForwardEventArgs.cs" />
-    <Compile Include="Common\SshAuthenticationException.cs" />
-    <Compile Include="Common\SshConnectionException.cs" />
-    <Compile Include="Common\SftpPathNotFoundException.cs" />
     <Compile Include="Common\SshOperationTimeoutException.cs" />
     <Compile Include="Common\SshOperationTimeoutException.NET40.cs" />
     <Compile Include="Common\SshPassPhraseNullOrEmptyException.cs" />
-    <Compile Include="Common\SftpPermissionDeniedException.cs" />
+    <Compile Include="Common\SshPassPhraseNullOrEmptyException.NET40.cs" />
+    <Compile Include="Compression\Compressor.cs" />
+    <Compile Include="Compression\Zlib.cs" />
+    <Compile Include="Compression\ZlibOpenSsh.cs" />
+    <Compile Include="ConnectionInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ForwardedPort.cs" />
     <Compile Include="ForwardedPortLocal.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="ForwardedPortLocal.NET40.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ForwardedPortRemote.cs" />
+    <Compile Include="ForwardedPortRemote.NET40.cs" />
+    <Compile Include="KeyboardInteractiveConnectionInfo.cs" />
+    <Compile Include="KeyboardInteractiveConnectionInfo.NET40.cs" />
+    <Compile Include="MessageEventArgs.cs" />
+    <Compile Include="Messages\Authentication\BannerMessage.cs" />
+    <Compile Include="Messages\Authentication\FailureMessage.cs" />
+    <Compile Include="Messages\Authentication\InformationRequestMessage.cs" />
+    <Compile Include="Messages\Authentication\InformationResponseMessage.cs" />
+    <Compile Include="Messages\Authentication\PasswordChangeRequiredMessage.cs" />
+    <Compile Include="Messages\Authentication\PublicKeyMessage.cs" />
+    <Compile Include="Messages\Authentication\RequestMessage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\Authentication\RequestMessageHost.cs" />
+    <Compile Include="Messages\Authentication\RequestMessageKeyboardInteractive.cs" />
+    <Compile Include="Messages\Authentication\RequestMessageNone.cs" />
+    <Compile Include="Messages\Authentication\RequestMessagePassword.cs" />
+    <Compile Include="Messages\Authentication\RequestMessagePublicKey.cs" />
+    <Compile Include="Messages\Authentication\SuccessMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelCloseMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelDataMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelEofMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelExtendedDataMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelFailureMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelOpenConfirmationMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelOpenFailureMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelOpenFailureReasons.cs" />
+    <Compile Include="Messages\Connection\ChannelOpen\ChannelOpenInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelOpen\ChannelOpenMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelOpen\DirectTcpipChannelInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelOpen\ForwardedTcpipChannelInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelOpen\SessionChannelOpenInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelOpen\X11ChannelOpenInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\ChannelRequestMessage.cs" />
     <Compile Include="Messages\Connection\ChannelRequest\EndOfWriteRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\EnvironmentVariableRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\ExecRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\ExitSignalRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\ExitStatusRequestInfo.cs" />
     <Compile Include="Messages\Connection\ChannelRequest\KeepAliveRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\PseudoTerminalInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\RequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\ShellRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\SignalRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\SubsystemRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\WindowChangeRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\X11ForwardingRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelRequest\XonXoffRequestInfo.cs" />
+    <Compile Include="Messages\Connection\ChannelSuccessMessage.cs" />
+    <Compile Include="Messages\Connection\ChannelWindowAdjustMessage.cs" />
+    <Compile Include="Messages\Connection\GlobalRequestMessage.cs" />
+    <Compile Include="Messages\Connection\GlobalRequestName.cs" />
+    <Compile Include="Messages\Connection\RequestFailureMessage.cs" />
+    <Compile Include="Messages\Connection\RequestSuccessMessage.cs" />
+    <Compile Include="Messages\Message.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\MessageAttribute.cs" />
+    <Compile Include="Messages\ServiceName.cs" />
+    <Compile Include="Messages\Transport\DebugMessage.cs" />
+    <Compile Include="Messages\Transport\DisconnectMessage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\Transport\DisconnectReason.cs" />
+    <Compile Include="Messages\Transport\IgnoreMessage.cs" />
+    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeGroup.cs" />
+    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeInit.cs" />
+    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeReply.cs" />
+    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeRequest.cs" />
+    <Compile Include="Messages\Transport\KeyExchangeDhInitMessage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\Transport\KeyExchangeDhReplyMessage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\Transport\KeyExchangeInitMessage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\Transport\NewKeysMessage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Messages\Transport\ServiceAcceptMessage.cs" />
+    <Compile Include="Messages\Transport\ServiceRequestMessage.cs" />
+    <Compile Include="Messages\Transport\UnimplementedMessage.cs" />
+    <Compile Include="NoneConnectionInfo.cs" />
+    <Compile Include="PasswordConnectionInfo.cs" />
+    <Compile Include="PasswordConnectionInfo.NET40.cs" />
+    <Compile Include="PrivateKeyConnectionInfo.cs" />
+    <Compile Include="PrivateKeyFile.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Security\Algorithm.cs">
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="Security\CertificateHostAlgorithm.cs" />
+    <Compile Include="Security\Cryptography\AsymmetricCipher.cs" />
+    <Compile Include="Security\Cryptography\BlockCipher.cs" />
+    <Compile Include="Security\Cryptography\Cipher.cs" />
     <Compile Include="Security\Cryptography\CipherDigitalSignature.cs" />
     <Compile Include="Security\Cryptography\Ciphers\AesCipher.cs" />
     <Compile Include="Security\Cryptography\Ciphers\Arc4Cipher.cs" />
-    <Compile Include="Security\Cryptography\AsymmetricCipher.cs" />
-    <Compile Include="Security\Cryptography\BlockCipher.cs" />
     <Compile Include="Security\Cryptography\Ciphers\BlowfishCipher.cs" />
     <Compile Include="Security\Cryptography\Ciphers\CastCipher.cs" />
-    <Compile Include="Security\Cryptography\Cipher.cs" />
     <Compile Include="Security\Cryptography\Ciphers\CipherMode.cs" />
     <Compile Include="Security\Cryptography\Ciphers\CipherPadding.cs" />
     <Compile Include="Security\Cryptography\Ciphers\DesCipher.cs" />
@@ -129,40 +241,44 @@
     <Compile Include="Security\Cryptography\Ciphers\Modes\CtrCipherMode.cs" />
     <Compile Include="Security\Cryptography\Ciphers\Modes\OfbCipherMode.cs" />
     <Compile Include="Security\Cryptography\Ciphers\Paddings\PKCS7Padding.cs" />
-    <Compile Include="Security\Cryptography\Ciphers\RsaCipher.cs" />
+    <Compile Include="Security\Cryptography\Ciphers\RsaCipher.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="Security\Cryptography\Ciphers\SerpentCipher.cs" />
-    <Compile Include="Security\Cryptography\DsaDigitalSignature.cs" />
+    <Compile Include="Security\Cryptography\Ciphers\TripleDesCipher.cs" />
+    <Compile Include="Security\Cryptography\Ciphers\TwofishCipher.cs" />
+    <Compile Include="Security\Cryptography\DigitalSignature.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="Security\Cryptography\DsaDigitalSignature.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Include="Security\Cryptography\DsaKey.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Security\Cryptography\Key.cs">
+    <Compile Include="Security\Cryptography\Hashes\MD5Hash.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Security\Cryptography\RsaKey.cs">
+    <Compile Include="Security\Cryptography\Hashes\SHA1Hash.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Security\Cryptography\StreamCipher.cs" />
-    <Compile Include="Security\Cryptography\SymmetricCipher.cs" />
-    <Compile Include="Security\Cryptography\Ciphers\TripleDesCipher.cs" />
-    <Compile Include="Security\Cryptography\Ciphers\TwofishCipher.cs" />
-    <Compile Include="Security\Cryptography\DigitalSignature.cs">
+    <Compile Include="Security\Cryptography\Hashes\SHA256Hash.cs">
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="Security\Cryptography\HMac.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Security\Cryptography\Hashes\MD5Hash.cs">
+    <Compile Include="Security\Cryptography\Key.cs">
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="Security\Cryptography\RsaDigitalSignature.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Security\Cryptography\Hashes\SHA1Hash.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Security\Cryptography\Hashes\SHA256Hash.cs">
+    <Compile Include="Security\Cryptography\RsaKey.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="Security\Cryptography\StreamCipher.cs" />
+    <Compile Include="Security\Cryptography\SymmetricCipher.cs" />
     <Compile Include="Security\HostAlgorithm.cs" />
     <Compile Include="Security\KeyExchange.cs">
       <SubType>Code</SubType>
@@ -183,51 +299,20 @@
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="Security\KeyHostAlgorithm.cs" />
-    <Compile Include="SubsystemSession.cs" />
-    <Compile Include="Shell.NET40.cs" />
-    <Compile Include="SftpClient.NET40.cs" />
-    <Compile Include="PasswordConnectionInfo.NET40.cs" />
-    <Compile Include="KeyboardInteractiveConnectionInfo.NET40.cs" />
-    <Compile Include="ForwardedPortRemote.NET40.cs" />
-    <Compile Include="ForwardedPortLocal.NET40.cs" />
-    <Compile Include="SshCommand.NET40.cs" />
-    <Compile Include="Session.NET40.cs" />
-    <Compile Include="KeyboardInteractiveConnectionInfo.cs" />
-    <Compile Include="Messages\Authentication\RequestMessageKeyboardInteractive.cs" />
-    <Compile Include="Messages\Authentication\RequestMessageNone.cs" />
-    <Compile Include="Messages\Connection\ChannelOpen\ChannelOpenInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelOpen\DirectTcpipChannelInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelOpen\ForwardedTcpipChannelInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelOpen\SessionChannelOpenInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelOpen\X11ChannelOpenInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\EnvironmentVariableRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\ExecRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\ExitSignalRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\ExitStatusRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\PseudoTerminalInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\RequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\ShellRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\SignalRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\SubsystemRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\WindowChangeRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\X11ForwardingRequestInfo.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\XonXoffRequestInfo.cs" />
-    <Compile Include="Messages\MessageAttribute.cs" />
-    <Compile Include="NoneConnectionInfo.cs" />
-    <Compile Include="Sftp\Flags.cs" />
-    <Compile Include="Sftp\SftpDataMessage.cs">
+    <Compile Include="Session.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Sftp\SftpDownloadAsyncResult.cs" />
-    <Compile Include="Sftp\SftpListDirectoryAsyncResult.cs" />
-    <Compile Include="Sftp\SftpMessage.cs" />
-    <Compile Include="Sftp\SftpMessageTypes.cs">
+    <Compile Include="Session.NET.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Sftp\SftpUploadAsyncResult.cs" />
-    <Compile Include="Sftp\StatusCodes.cs">
+    <Compile Include="Session.NET40.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="SftpClient.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="SftpClient.NET40.cs" />
+    <Compile Include="Sftp\Flags.cs" />
     <Compile Include="Sftp\Requests\SftpCloseRequest.cs" />
     <Compile Include="Sftp\Requests\SftpFSetStatRequest.cs" />
     <Compile Include="Sftp\Requests\SftpFStatRequest.cs" />
@@ -242,109 +327,45 @@
     <Compile Include="Sftp\Requests\SftpRealPathRequest.cs" />
     <Compile Include="Sftp\Requests\SftpRemoveRequest.cs" />
     <Compile Include="Sftp\Requests\SftpRenameRequest.cs" />
+    <Compile Include="Sftp\Requests\SftpRequest.cs" />
     <Compile Include="Sftp\Requests\SftpRmDirRequest.cs" />
     <Compile Include="Sftp\Requests\SftpSetStatRequest.cs" />
     <Compile Include="Sftp\Requests\SftpStatRequest.cs" />
     <Compile Include="Sftp\Requests\SftpSymLinkRequest.cs" />
-    <Compile Include="Sftp\Responses\SftpVersionResponse.cs" />
     <Compile Include="Sftp\Requests\SftpWriteRequest.cs" />
     <Compile Include="Sftp\Responses\SftpAttrsResponse.cs" />
     <Compile Include="Sftp\Responses\SftpDataResponse.cs" />
     <Compile Include="Sftp\Responses\SftpExtendedReplyResponse.cs" />
     <Compile Include="Sftp\Responses\SftpHandleResponse.cs" />
-    <Compile Include="Sftp\Requests\SftpRequest.cs" />
     <Compile Include="Sftp\Responses\SftpNameResponse.cs" />
     <Compile Include="Sftp\Responses\SftpResponse.cs" />
     <Compile Include="Sftp\Responses\SftpStatusResponse.cs" />
-    <Compile Include="Sftp\SftpFileAttributes.cs" />
-    <Compile Include="Sftp\SftpFileStream.cs" />
-    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeGroup.cs" />
-    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeInit.cs" />
-    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeReply.cs" />
-    <Compile Include="Messages\Transport\KeyExchangeDhGroupExchangeRequest.cs" />
-    <Compile Include="PasswordConnectionInfo.cs" />
-    <Compile Include="PrivateKeyConnectionInfo.cs" />
-    <Compile Include="SftpClient.cs" />
-    <Compile Include="Sftp\SftpFile.cs" />
-    <Compile Include="Sftp\SftpSession.cs" />
-    <Compile Include="BaseClient.cs" />
-    <Compile Include="SshCommand.cs" />
-    <Compile Include="MessageEventArgs.cs" />
-    <Compile Include="ChannelAsyncResult.cs" />
-    <Compile Include="Channels\ChannelDirectTcpip.cs" />
-    <Compile Include="Channels\ChannelForwardedTcpip.cs" />
-    <Compile Include="Channels\ChannelSession.cs" />
-    <Compile Include="Common\SshException.cs" />
-    <Compile Include="ForwardedPort.cs" />
-    <Compile Include="ForwardedPortRemote.cs" />
-    <Compile Include="Messages\Connection\GlobalRequestName.cs" />
-    <Compile Include="Compression\Compressor.cs" />
-    <Compile Include="Compression\Zlib.cs" />
-    <Compile Include="Compression\ZlibOpenSsh.cs" />
-    <Compile Include="PrivateKeyFile.cs" />
-    <Compile Include="Messages\Connection\ChannelMessage.cs" />
-    <Compile Include="Channels\Channel.cs" />
-    <Compile Include="Channels\ChannelTypes.cs" />
-    <Compile Include="ConnectionInfo.cs" />
-    <Compile Include="Common\Extensions.cs" />
-    <Compile Include="Messages\Connection\ChannelCloseMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelDataMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelEofMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelExtendedDataMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelFailureMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelOpenConfirmationMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelOpenFailureMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelOpenFailureReasons.cs" />
-    <Compile Include="Messages\Connection\ChannelOpen\ChannelOpenMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelRequest\ChannelRequestMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelSuccessMessage.cs" />
-    <Compile Include="Messages\Connection\ChannelWindowAdjustMessage.cs" />
-    <Compile Include="Messages\Connection\GlobalRequestMessage.cs" />
-    <Compile Include="Messages\Connection\RequestFailureMessage.cs" />
-    <Compile Include="Messages\Connection\RequestSuccessMessage.cs" />
-    <Compile Include="Messages\ServiceName.cs" />
-    <Compile Include="Messages\Transport\ServiceRequestMessage.cs" />
-    <Compile Include="Messages\Transport\DebugMessage.cs" />
-    <Compile Include="Messages\Transport\IgnoreMessage.cs" />
-    <Compile Include="Messages\Transport\ServiceAcceptMessage.cs" />
-    <Compile Include="Messages\Transport\DisconnectMessage.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Messages\Transport\KeyExchangeInitMessage.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Messages\Transport\KeyExchangeDhInitMessage.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="Messages\Transport\KeyExchangeDhReplyMessage.cs">
+    <Compile Include="Sftp\Responses\SftpVersionResponse.cs" />
+    <Compile Include="Sftp\SftpDataMessage.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Messages\Message.cs">
+    <Compile Include="Sftp\SftpDownloadAsyncResult.cs" />
+    <Compile Include="Sftp\SftpFile.cs" />
+    <Compile Include="Sftp\SftpFileAttributes.cs" />
+    <Compile Include="Sftp\SftpFileStream.cs" />
+    <Compile Include="Sftp\SftpListDirectoryAsyncResult.cs" />
+    <Compile Include="Sftp\SftpMessage.cs" />
+    <Compile Include="Sftp\SftpMessageTypes.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Messages\Transport\NewKeysMessage.cs">
+    <Compile Include="Sftp\SftpSession.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Messages\Transport\DisconnectReason.cs" />
-    <Compile Include="Messages\Transport\UnimplementedMessage.cs" />
-    <Compile Include="Messages\Authentication\BannerMessage.cs" />
-    <Compile Include="Messages\Authentication\FailureMessage.cs" />
-    <Compile Include="Messages\Authentication\RequestMessageHost.cs" />
-    <Compile Include="Messages\Authentication\InformationRequestMessage.cs" />
-    <Compile Include="Messages\Authentication\InformationResponseMessage.cs" />
-    <Compile Include="Messages\Authentication\PasswordChangeRequiredMessage.cs" />
-    <Compile Include="Messages\Authentication\RequestMessagePassword.cs" />
-    <Compile Include="Messages\Authentication\PublicKeyMessage.cs" />
-    <Compile Include="Messages\Authentication\RequestMessagePublicKey.cs" />
-    <Compile Include="Messages\Authentication\RequestMessage.cs">
+    <Compile Include="Sftp\SftpUploadAsyncResult.cs" />
+    <Compile Include="Sftp\StatusCodes.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Messages\Authentication\SuccessMessage.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Session.cs" />
-    <Compile Include="Common\SshData.cs" />
     <Compile Include="Shell.cs" />
+    <Compile Include="Shell.NET40.cs" />
     <Compile Include="SshClient.cs" />
+    <Compile Include="SshCommand.cs" />
+    <Compile Include="SshCommand.NET40.cs" />
+    <Compile Include="SubsystemSession.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="Documentation\Content\About.aml" />
@@ -369,7 +390,6 @@
     <None Include="Documentation\Content\HowTo.Connect.aml" />
     <None Include="Documentation\Content\Reference.aml" />
     <None Include="Documentation\Renci.SshClient.content" />
-    <Compile Include="Session.NET.cs" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="Documentation\SshClient.shfbproj" />

+ 0 - 280
Renci.SshClient/Renci.SshNet/Security/Cryptography/Ciphers/CipherBase.cs

@@ -1,280 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace Renci.SshNet.Security.Cryptography
-{
-    /// <summary>
-    /// Represents abstract class for all Block Cipher implementations.
-    /// </summary>
-    public abstract class CipherBase
-    {
-        /// <summary>
-        /// Gets the cipher key.
-        /// </summary>
-        public byte[] Key { get; private set; }
-
-        /// <summary>
-        /// Gets the initialization vector.
-        /// </summary>
-        public byte[] IV { get; private set; }
-
-        /// <summary>
-        /// Gets the size of the block.
-        /// </summary>
-        /// <value>
-        /// The size of the block.
-        /// </value>
-        public abstract int BlockSize { get; }
-
-        /// <summary>
-        /// Initializes a new instance of the <see cref="CipherBase"/> class.
-        /// </summary>
-        /// <param name="key">The key.</param>
-        /// <param name="iv">The iv.</param>
-        public CipherBase(byte[] key, byte[] iv)
-        {
-            this.Key = key;
-            this.IV = iv;
-        }
-
-        /// <summary>
-        /// Encrypts the specified region of the input byte array and copies the encrypted data to the specified region of the output byte array.
-        /// </summary>
-        /// <param name="inputBuffer">The input data to encrypt.</param>
-        /// <param name="inputOffset">The offset into the input byte array from which to begin using data.</param>
-        /// <param name="inputCount">The number of bytes in the input byte array to use as data.</param>
-        /// <param name="outputBuffer">The output to which to write encrypted data.</param>
-        /// <param name="outputOffset">The offset into the output byte array from which to begin writing data.</param>
-        /// <returns>
-        /// The number of bytes encrypted.
-        /// </returns>
-        public abstract int EncryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
-
-        /// <summary>
-        /// Decrypts the specified region of the input byte array and copies the decrypted data to the specified region of the output byte array.
-        /// </summary>
-        /// <param name="inputBuffer">The input data to decrypt.</param>
-        /// <param name="inputOffset">The offset into the input byte array from which to begin using data.</param>
-        /// <param name="inputCount">The number of bytes in the input byte array to use as data.</param>
-        /// <param name="outputBuffer">The output to which to write decrypted data.</param>
-        /// <param name="outputOffset">The offset into the output byte array from which to begin writing data.</param>
-        /// <returns>
-        /// The number of bytes decrypted.
-        /// </returns>
-        public abstract int DecryptBlock(byte[] inputBuffer, int inputOffset, int inputCount, byte[] outputBuffer, int outputOffset);
-
-        #region Packing functions
-
-        /// <summary>
-        /// Populates buffer with big endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        protected static void UInt32ToBigEndian(uint number, byte[] buffer)
-        {
-            buffer[0] = (byte)(number >> 24);
-            buffer[1] = (byte)(number >> 16);
-            buffer[2] = (byte)(number >> 8);
-            buffer[3] = (byte)(number);
-        }
-
-        /// <summary>
-        /// Populates buffer with big endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        protected static void UInt32ToBigEndian(uint number, byte[] buffer, int offset)
-        {
-            buffer[offset] = (byte)(number >> 24);
-            buffer[++offset] = (byte)(number >> 16);
-            buffer[++offset] = (byte)(number >> 8);
-            buffer[++offset] = (byte)(number);
-        }
-
-        /// <summary>
-        /// Converts big endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <returns></returns>
-        protected static uint BigEndianToUInt32(byte[] buffer)
-        {
-            uint n = (uint)buffer[0] << 24;
-            n |= (uint)buffer[1] << 16;
-            n |= (uint)buffer[2] << 8;
-            n |= (uint)buffer[3];
-            return n;
-        }
-
-        /// <summary>
-        /// Converts big endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        /// <returns></returns>
-        protected static uint BigEndianToUInt32(byte[] buffer, int offset)
-        {
-            uint n = (uint)buffer[offset] << 24;
-            n |= (uint)buffer[++offset] << 16;
-            n |= (uint)buffer[++offset] << 8;
-            n |= (uint)buffer[++offset];
-            return n;
-        }
-
-        /// <summary>
-        /// Converts big endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <returns></returns>
-        protected static ulong BigEndianToUInt64(byte[] buffer)
-        {
-            uint hi = BigEndianToUInt32(buffer);
-            uint lo = BigEndianToUInt32(buffer, 4);
-            return ((ulong)hi << 32) | (ulong)lo;
-        }
-
-        /// <summary>
-        /// Converts big endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        /// <returns></returns>
-        protected static ulong BigEndianToUInt64(byte[] buffer, int offset)
-        {
-            uint hi = BigEndianToUInt32(buffer, offset);
-            uint lo = BigEndianToUInt32(buffer, offset + 4);
-            return ((ulong)hi << 32) | (ulong)lo;
-        }
-
-        /// <summary>
-        /// Populates buffer with big endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        protected static void UInt64ToBigEndian(ulong number, byte[] buffer)
-        {
-            UInt32ToBigEndian((uint)(number >> 32), buffer);
-            UInt32ToBigEndian((uint)(number), buffer, 4);
-        }
-
-        /// <summary>
-        /// Populates buffer with big endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        protected static void UInt64ToBigEndian(ulong number, byte[] buffer, int offset)
-        {
-            UInt32ToBigEndian((uint)(number >> 32), buffer, offset);
-            UInt32ToBigEndian((uint)(number), buffer, offset + 4);
-        }
-
-        /// <summary>
-        /// Populates buffer with little endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        protected static void UInt32ToLittleEndian(uint number, byte[] buffer)
-        {
-            buffer[0] = (byte)(number);
-            buffer[1] = (byte)(number >> 8);
-            buffer[2] = (byte)(number >> 16);
-            buffer[3] = (byte)(number >> 24);
-        }
-
-        /// <summary>
-        /// Populates buffer with little endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        protected static void UInt32ToLittleEndian(uint number, byte[] buffer, int offset)
-        {
-            buffer[offset] = (byte)(number);
-            buffer[++offset] = (byte)(number >> 8);
-            buffer[++offset] = (byte)(number >> 16);
-            buffer[++offset] = (byte)(number >> 24);
-        }
-
-        /// <summary>
-        /// Converts little endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <returns></returns>
-        protected static uint LittleEndianToUInt32(byte[] buffer)
-        {
-            uint n = (uint)buffer[0];
-            n |= (uint)buffer[1] << 8;
-            n |= (uint)buffer[2] << 16;
-            n |= (uint)buffer[3] << 24;
-            return n;
-        }
-
-        /// <summary>
-        /// Converts little endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        /// <returns></returns>
-        protected static uint LittleEndianToUInt32(byte[] buffer, int offset)
-        {
-            uint n = (uint)buffer[offset];
-            n |= (uint)buffer[++offset] << 8;
-            n |= (uint)buffer[++offset] << 16;
-            n |= (uint)buffer[++offset] << 24;
-            return n;
-        }
-
-        /// <summary>
-        /// Converts little endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <returns></returns>
-        protected static ulong LittleEndianToUInt64(byte[] buffer)
-        {
-            uint lo = LittleEndianToUInt32(buffer);
-            uint hi = LittleEndianToUInt32(buffer, 4);
-            return ((ulong)hi << 32) | (ulong)lo;
-        }
-
-        /// <summary>
-        /// Converts little endian bytes into number.
-        /// </summary>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        /// <returns></returns>
-        protected static ulong LittleEndianToUInt64(byte[] buffer, int offset)
-        {
-            uint lo = LittleEndianToUInt32(buffer, offset);
-            uint hi = LittleEndianToUInt32(buffer, offset + 4);
-            return ((ulong)hi << 32) | (ulong)lo;
-        }
-
-        /// <summary>
-        /// Populates buffer with little endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        protected static void UInt64ToLittleEndian(ulong number, byte[] buffer)
-        {
-            UInt32ToLittleEndian((uint)(number), buffer);
-            UInt32ToLittleEndian((uint)(number >> 32), buffer, 4);
-        }
-
-        /// <summary>
-        /// Populates buffer with little endian number representation.
-        /// </summary>
-        /// <param name="number">The number to convert.</param>
-        /// <param name="buffer">The buffer.</param>
-        /// <param name="offset">The buffer offset.</param>
-        protected static void UInt64ToLittleEndian(ulong number, byte[] buffer, int offset)
-        {
-            UInt32ToLittleEndian((uint)(number), buffer, offset);
-            UInt32ToLittleEndian((uint)(number >> 32), buffer, offset + 4);
-        }
-
-        #endregion
-    }
-}

+ 1 - 1
Renci.SshClient/Renci.SshNet/Security/KeyExchangeDiffieHellman.cs

@@ -75,7 +75,7 @@ namespace Renci.SshNet.Security
 
             var length = (uint)(this._hostKey[0] << 24 | this._hostKey[1] << 16 | this._hostKey[2] << 8 | this._hostKey[3]);
 
-            var algorithmName = Renci.SshNet.Common.ASCIIEncoding.Current.GetString(this._hostKey, 4, (int)length);
+            var algorithmName = Encoding.UTF8.GetString(this._hostKey, 4, (int)length);
 
             var key = this.Session.ConnectionInfo.HostKeyAlgorithms[algorithmName](this._hostKey);
 

+ 1 - 1
Renci.SshClient/Renci.SshNet/Session.cs

@@ -457,7 +457,7 @@ namespace Renci.SshNet
                         throw new SshConnectionException(string.Format(CultureInfo.CurrentCulture, "Server version '{0}' is not supported.", version), DisconnectReason.ProtocolVersionNotSupported);
                     }
 
-                    this.Write(Renci.SshNet.Common.ASCIIEncoding.Current.GetBytes(string.Format(CultureInfo.InvariantCulture, "{0}\x0D\x0A", this.ClientVersion)));
+                    this.Write(Encoding.UTF8.GetBytes(string.Format(CultureInfo.InvariantCulture, "{0}\x0D\x0A", this.ClientVersion)));
 
                     //  Register Transport response messages
                     this.RegisterMessage("SSH_MSG_DISCONNECT");

+ 1 - 1
Renci.SshClient/Renci.SshNet/SshClient.cs

@@ -201,7 +201,7 @@ namespace Renci.SshNet
         /// <returns><see cref="SshCommand"/> object.</returns>
         public SshCommand CreateCommand(string commandText)
         {
-            return this.CreateCommand(commandText, Renci.SshNet.Common.ASCIIEncoding.Current);
+            return this.CreateCommand(commandText, Encoding.UTF8);
         }
 
         /// <summary>