Skip to content

Commit

Permalink
Merge pull request #277 from sshnet/develop
Browse files Browse the repository at this point in the history
Merge develop changes into master to prepare for 2016.1.0-beta2
  • Loading branch information
drieseng authored Aug 16, 2017
2 parents 7da9b86 + b34e1c0 commit bc154e6
Show file tree
Hide file tree
Showing 240 changed files with 14,511 additions and 3,704 deletions.
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
SSH.NET
=======
SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.
SSH.NET is a Secure Shell (SSH-2) library for .NET, optimized for parallelism.

[![Version](https://img.shields.io/nuget/vpre/SSH.NET.svg)](https://www.nuget.org/packages/SSH.NET)
[![Build status](https://ci.appveyor.com/api/projects/status/ih77qu6tap3o92gu/branch/develop?svg=true)](https://ci.appveyor.com/api/projects/status/ih77qu6tap3o92gu/branch/develop)

##Introduction
## Introduction
This project was inspired by **Sharp.SSH** library which was ported from java and it seems like was not supported for quite some time. This library is a complete rewrite, without any third party dependencies, using parallelism to achieve the best performance possible.

##Features
## Features
* Execution of SSH command using both synchronous and asynchronous methods
* Return command execution exit status and other information
* Provide SFTP functionality for both synchronous and asynchronous operations
Expand All @@ -25,15 +25,15 @@ This project was inspired by **Sharp.SSH** library which was ported from java an
* Supports two-factor or higher authentication
* Supports SOCKS4, SOCKS5 and HTTP Proxy

##Key Exchange Method
## Key Exchange Method

**SSH.NET** supports the following key exchange methods:
* diffie-hellman-group-exchange-sha256
* diffie-hellman-group-exchange-sha1
* diffie-hellman-group14-sha1
* diffie-hellman-group1-sha1

##Message Authentication Code
## Message Authentication Code

**SSH.NET** supports the following MAC algorithms:
* hmac-md5
Expand All @@ -47,23 +47,39 @@ This project was inspired by **Sharp.SSH** library which was ported from java an
* hmac-ripemd160
* [email protected]

##Framework Support
## Framework Support
**SSH.NET** supports the following target frameworks:
* .NET Framework 3.5
* .NET Framework 4.0 (and higher)
* .NET Platform Standard 1.3
* .NET Standard 1.3
* Silverlight 4
* Silverlight 5
* Windows Phone 7.1
* Windows Phone 8.0
* Universal Windows Platform 10

##Building SSH.NET
## Usage
Establish an SFTP connection using both password and public-key authentication:

```cs
var connectionInfo = new ConnectionInfo("sftp.foo.com",
"guest",
new PasswordAuthenticationMethod("guest", "pwd"),
new PrivateKeyAuthenticationMethod("rsa.key"));
using (var client = new SftpClient(connectionInfo))
{
client.Connect();
}

```

## Building SSH.NET

Software | net35 | net40 | netstandard1.3 | sl4 | sl5 | wp71 | wp8 | uap10.0 |
--------------------------------- | :---: | :---: | :------------: | :-: | :-: | :--: | :-: | :-----: |
Windows Phone SDK 8.0 | | | | x | x | x | x |
Visual Studio 2012 Update 5 | x | x | | x | x | x | x |
Visual Studio 2015 Update 3 | x | x | x | | x | | x | x
Visual Studio 2015 Update 3 | x | x | | | x | | x | x
Visual Studio 2017 | | x | x | | | | |

[![NDepend](http://download-codeplex.sec.s-msft.com/Download?ProjectName=sshnet&DownloadId=629750)](http://ndepend.com)
11 changes: 5 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ build:
project: src\Renci.SshNet.VS2015.sln
verbosity: minimal

test:
assemblies: src\Renci.SshNet.Tests\bin\Debug\Renci.SshNet.Tests.dll
categories:
except:
- integration
- LongRunning
test_script:
- cmd: >-
vstest.console /logger:Appveyor src\Renci.SshNet.Tests\bin\Debug\Renci.SshNet.Tests.dll /TestCaseFilter:"TestCategory!=integration&TestCategory!=LongRunning"
vstest.console /logger:Appveyor src\Renci.SshNet.Tests.NET35\bin\Debug\Renci.SshNet.Tests.NET35.dll /TestCaseFilter:"TestCategory!=integration&TestCategory!=LongRunning"
12 changes: 12 additions & 0 deletions build/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off

set MSBUILD14_EXE=%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe
set MSBUILD15_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\\MSBuild\15.0\bin\MSBuild.exe

call "%MSBUILD14_EXE%" build.proj /t:Clean
call "%MSBUILD15_EXE%" build.proj /t:Clean

call "%MSBUILD14_EXE%" build.proj /t:Build
call "%MSBUILD15_EXE%" build.proj /t:Build

call "%MSBUILD15_EXE%" build.proj /t:Package /p:ReleaseVersion=%1
27 changes: 18 additions & 9 deletions build/build.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Clean;CreateNuGetPackage;CreateBinPackage;GenerateHelpFile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Zip" AssemblyFile="$(MSBuildThisFileDirectory)target\nuget\packages\$(MSBuildTasksPackageId).$(MSBuildTasksPackageVersion)\tools\MSBuild.Community.Tasks.dll"/>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
Expand All @@ -11,9 +11,17 @@
<ItemGroup>
<VisualStudioVersion Include="2012">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2012.sln</SolutionFile>
<MSBuildToolsVersion>14.0</MSBuildToolsVersion>
<NuGetPackageRestore>true</NuGetPackageRestore>
</VisualStudioVersion>
<VisualStudioVersion Include="2015">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2015.sln</SolutionFile>
<MSBuildToolsVersion>14.0</MSBuildToolsVersion>
<NuGetPackageRestore>true</NuGetPackageRestore>
</VisualStudioVersion>
<VisualStudioVersion Include="2017">
<SolutionFile>$(MSBuildThisFileDirectory)..\src\Renci.SshNet.VS2017.sln</SolutionFile>
<MSBuildToolsVersion>15.0</MSBuildToolsVersion>
</VisualStudioVersion>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -54,11 +62,11 @@
<RemoveDir Directories="$(MSBuildThisFileDirectory)target"/>
<ItemGroup>
<ProjectToBuild Remove="@(ProjectToBuild)"/>
<ProjectToBuild Include="%(VisualStudioVersion.SolutionFile)">
<ProjectToBuild Include="%(VisualStudioVersion.SolutionFile)" Condition="'%(VisualStudioVersion.MSBuildToolsVersion)'=='$(MSBuildToolsVersion)'">
<Properties>Configuration=Release</Properties>
</ProjectToBuild>
</ItemGroup>
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean"/>
<MSBuild Projects="@(ProjectToBuild)" Targets="Clean" />
</Target>
<Target Name="DownloadNuGet">
<MakeDir Directories="$(MSBuildThisFileDirectory)target\nuget"/>
Expand All @@ -67,35 +75,36 @@
FileName="$(MSBuildThisFileDirectory)target\nuget\nuget.exe"/>
</Target>
<Target Name="RestoreNuGetPackages" DependsOnTargets="DownloadNuGet" Outputs="%(VisualStudioVersion.Identity)">
<Message Text="Restoring nuget packages for '%(VisualStudioVersion.SolutionFile)'..." Importance="High"/>
<Exec Command="$(NuGetExe) restore &quot;%(VisualStudioVersion.SolutionFile)&quot;"/>
<Message Text="Restoring nuget packages for '%(VisualStudioVersion.SolutionFile)'..." Importance="High" Condition="'%(VisualStudioVersion.MSBuildToolsVersion)'=='$(MSBuildToolsVersion)' and '%(VisualStudioVersion.NuGetPackageRestore)'=='true'"/>
<Exec Command="$(NuGetExe) restore &quot;%(VisualStudioVersion.SolutionFile)&quot;" Condition="'%(VisualStudioVersion.MSBuildToolsVersion)'=='$(MSBuildToolsVersion)' and '%(VisualStudioVersion.NuGetPackageRestore)'=='true'"/>
</Target>
<Target Name="Build" DependsOnTargets="RestoreNuGetPackages" Outputs="%(VisualStudioVersion.Identity)">
<ItemGroup>
<ProjectToBuild Remove="@(ProjectToBuild)"/>
<ProjectToBuild Include="%(VisualStudioVersion.SolutionFile)">
<ProjectToBuild Include="%(VisualStudioVersion.SolutionFile)" Condition="'%(VisualStudioVersion.MSBuildToolsVersion)'=='$(MSBuildToolsVersion)'">
<Properties>Configuration=Release</Properties>
</ProjectToBuild>
</ItemGroup>
<MSBuild Projects="@(ProjectToBuild)" Targets="Rebuild"/>
</Target>
<Target Name="Package" DependsOnTargets="CreateNuGetPackage;CreateBinPackage;GenerateHelpFile"/>
<Target Name="CreateNuGetPackage" DependsOnTargets="CopyBuildOutputToPackage">
<Exec Command="$(NuGetExe) pack $(MSBuildThisFileDirectory)nuget\SSH.NET.nuspec -OutputDirectory &quot;$(MSBuildThisFileDirectory)target&quot; -BasePath &quot;$(MSBuildThisFileDirectory)target\package&quot; -NonInteractive"/>
</Target>
<Target Name="CopyBuildOutputToPackage" DependsOnTargets="Build" Outputs="%(TargetFramework.Identity)">
<Target Name="CopyBuildOutputToPackage" Outputs="%(TargetFramework.Identity)">
<ItemGroup>
<BuildOutput Remove="@(BuildOutput)"/>
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFramework.OutputDirectory)\Renci.SshNet.dll"/>
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFramework.OutputDirectory)\Renci.SshNet.xml"/>
</ItemGroup>
<Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(MSBuildThisFileDirectory)target\package\lib\%(TargetFramework.Moniker)"/>
</Target>
<Target Name="GenerateHelpFile" DependsOnTargets="Build;CheckReleaseVersion">
<Target Name="GenerateHelpFile" DependsOnTargets="CheckReleaseVersion">
<Error Text="Please install Sandcastle, and ensure the SHFBFolder environment variable is set." Condition="'$(SHFBFolder)'==''"/>
<MSBuild Projects="$(MSBuildThisFileDirectory)sandcastle\SSH.NET.shfbproj"/>
<Move SourceFiles="$(MSBuildThisFileDirectory)target\help\SshNet.Help.chm" DestinationFiles="$(MSBuildThisFileDirectory)target\SSH.NET-$(ReleaseVersion)-help.chm"/>
</Target>
<Target Name="CopyBuildOutputToBin" DependsOnTargets="Build" Outputs="%(TargetFramework.Identity)">
<Target Name="CopyBuildOutputToBin" Outputs="%(TargetFramework.Identity)">
<ItemGroup>
<BuildOutput Remove="@(BuildOutput)"/>
<BuildOutput Include="$(MSBuildThisFileDirectory)..\src\%(TargetFramework.OutputDirectory)\*.dll"/>
Expand Down
32 changes: 32 additions & 0 deletions src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>bin\Debug\Renci.SshNet.xml</DocumentationFile>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand All @@ -35,6 +36,7 @@
<NoWarn>
</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<LangVersion>5</LangVersion>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
Expand Down Expand Up @@ -186,6 +188,9 @@
<Compile Include="..\Renci.SshNet\Common\ObjectIdentifier.cs">
<Link>Common\ObjectIdentifier.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Common\Pack.cs">
<Link>Common\Pack.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Common\PipeStream.cs">
<Link>Common\PipeStream.cs</Link>
</Compile>
Expand Down Expand Up @@ -735,6 +740,12 @@
<Compile Include="..\Renci.SshNet\Sftp\Flags.cs">
<Link>Sftp\Flags.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\ISftpFileReader.cs">
<Link>Sftp\ISftpFileReader.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\ISftpResponseFactory.cs">
<Link>Sftp\ISftpResponseFactory.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\ISftpSession.cs">
<Link>Sftp\ISftpSession.cs</Link>
</Compile>
Expand Down Expand Up @@ -852,6 +863,9 @@
<Compile Include="..\Renci.SshNet\Sftp\Responses\SftpVersionResponse.cs">
<Link>Sftp\Responses\SftpVersionResponse.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpCloseAsyncResult.cs">
<Link>Sftp\SftpCloseAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpDownloadAsyncResult.cs">
<Link>Sftp\SftpDownloadAsyncResult.cs</Link>
</Compile>
Expand All @@ -861,6 +875,9 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpFileAttributes.cs">
<Link>Sftp\SftpFileAttributes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpFileReader.cs">
<Link>Sftp\SftpFileReader.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpFileStream.cs">
<Link>Sftp\SftpFileStream.cs</Link>
</Compile>
Expand All @@ -876,9 +893,24 @@
<Compile Include="..\Renci.SshNet\Sftp\SftpMessageTypes.cs">
<Link>Sftp\SftpMessageTypes.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpOpenAsyncResult.cs">
<Link>Sftp\SftpOpenAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpReadAsyncResult.cs">
<Link>Sftp\SftpReadAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpRealPathAsyncResult.cs">
<Link>Sftp\SftpRealPathAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpResponseFactory.cs">
<Link>Sftp\SftpResponseFactory.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSession.cs">
<Link>Sftp\SftpSession.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SFtpStatAsyncResult.cs">
<Link>Sftp\SFtpStatAsyncResult.cs</Link>
</Compile>
<Compile Include="..\Renci.SshNet\Sftp\SftpSynchronizeDirectoriesAsyncResult.cs">
<Link>Sftp\SftpSynchronizeDirectoriesAsyncResult.cs</Link>
</Compile>
Expand Down
113 changes: 113 additions & 0 deletions src/Renci.SshNet.NETCore/Renci.SshNet.NETCore.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<AssemblyTitle>SSH.NET</AssemblyTitle>
<TargetFramework>netstandard1.3</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Renci.SshNet</AssemblyName>
<AssemblyOriginatorKeyFile>../Renci.SshNet.snk</AssemblyOriginatorKeyFile>
<LangVersion>5</LangVersion>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Renci.SshNet\**\*.cs" Exclude="..\Renci.SshNet\Properties\AssemblyInfo.cs">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="NETStandard.Library">
<Version>1.6.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="Microsoft.CSharp">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="SshNet.Security.Cryptography">
<Version>[1.2.0]</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Debug">
<Version>4.0.11</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.Tools">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Diagnostics.TraceSource">
<Version>4.0.0</Version>
</PackageReference>
<PackageReference Include="System.Globalization">
<Version>4.0.11</Version>
</PackageReference>
<PackageReference Include="System.IO">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="System.IO.FileSystem">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.IO.FileSystem.Primitives">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Linq">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="System.Net.NameResolution">
<Version>4.0.0</Version>
</PackageReference>
<PackageReference Include="System.Net.Sockets">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="System.Reflection.Extensions">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Runtime.Extensions">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.Algorithms">
<Version>4.2.0</Version>
</PackageReference>
<PackageReference Include="System.Text.RegularExpressions">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="System.Threading">
<Version>4.0.11</Version>
</PackageReference>
<PackageReference Include="System.Threading.Thread">
<Version>4.0.0</Version>
</PackageReference>
<PackageReference Include="System.Threading.ThreadPool">
<Version>4.0.10</Version>
</PackageReference>
<PackageReference Include="System.Threading.Timer">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Xml.XmlDocument">
<Version>4.0.1</Version>
</PackageReference>
<PackageReference Include="System.Xml.XPath.XmlDocument">
<Version>4.0.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Update="..\Renci.SshNet\Sftp\ISftpMessageFactory.cs" Link="Sftp\ISftpResponseFactory.cs" />
<Compile Update="..\Renci.SshNet\Sftp\SftpMessageFactory.cs" Link="Sftp\SftpResponseFactory.cs" />
</ItemGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>FEATURE_ENCODING_ASCII;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_DIRECTORYINFO_ENUMERATEFILES;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_REFLECTION_TYPEINFO;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_SOCKET_EAP;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_SETSOCKETOPTION;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_DNS_TAP;FEATURE_STREAM_TAP;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
</PropertyGroup>
</Project>
Loading

0 comments on commit bc154e6

Please sign in to comment.