Skip to content

Commit 03aa776

Browse files
Rob-HagueJason Larke
andcommitted
Merge remote-tracking branch 'upstream/develop' into fix_netconf_framing_protocol
Adding co-author credit from sshnet#639: Co-authored-by: Jason Larke <[email protected]>
2 parents 99ec4ab + 6d9d032 commit 03aa776

File tree

1,254 files changed

+41167
-37472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,254 files changed

+41167
-37472
lines changed

.editorconfig

Lines changed: 1461 additions & 0 deletions
Large diffs are not rendered by default.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515
*.nupkg binary
1616
*.pdf binary
1717
*.snk binary
18+
19+
# Ensure key files have LF endings for easier usage with ssh-keygen
20+
test/Data/* eol=lf

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ src/TestResults/
1515
packages/
1616

1717
# Visual Studio 2015 cache/options directory
18-
src/.vs/
18+
.vs/
1919

2020
# Expanded/resolved project.json files
2121
project.lock.json
2222

2323
# Build outputs
2424
build/target/
25+
26+
# Benchmark results
27+
BenchmarkDotNet.Artifacts/

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @drieseng
1+
* @drieseng @WojciechNagorski

Directory.Build.props

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Project>
2+
<Import Project="$(MSBuildThisFileFullPath).user" Condition="Exists('$(MSBuildThisFileFullPath).user')" />
3+
4+
<!--
5+
Assembly Info properties that apply to all projects/assemblies.
6+
-->
7+
<PropertyGroup>
8+
<SignAssembly>true</SignAssembly>
9+
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Renci.SshNet.snk</AssemblyOriginatorKeyFile>
10+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
11+
<LangVersion>latest</LangVersion>
12+
<WarningLevel>9999</WarningLevel>
13+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
14+
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
15+
</PropertyGroup>
16+
17+
<!--
18+
Code analysis properties.
19+
-->
20+
<PropertyGroup>
21+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
22+
<AnalysisLevel>preview-All</AnalysisLevel>
23+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
24+
</PropertyGroup>
25+
26+
<!--
27+
Add the stylecop config to each project.
28+
-->
29+
<ItemGroup>
30+
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
31+
</ItemGroup>
32+
33+
<!--
34+
Use fixed version of analyzers.
35+
-->
36+
<ItemGroup>
37+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview1.23165.1" PrivateAssets="all" />
38+
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
39+
<PackageReference Include="Meziantou.Analyzer" Version="2.0.103" PrivateAssets="all" />
40+
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982" PrivateAssets="all" />
41+
</ItemGroup>
42+
</Project>

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
The MIT License (MIT)
22

3+
Copyright (c) Renci, Oleg Kapeljushnik, Gert Driesen and contributors
4+
35
Permission is hereby granted, free of charge, to any person obtaining a copy
46
of this software and associated documentation files (the "Software"), to deal
57
in the Software without restriction, including without limitation the rights

README.md

100755100644
Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ Private keys can be encrypted using one of the following cipher methods:
9797
* ecdsa-sha2-nistp256
9898
* ecdsa-sha2-nistp384
9999
* ecdsa-sha2-nistp521
100+
* rsa-sha2-512
101+
* rsa-sha2-256
100102
* ssh-rsa
101103
* ssh-dss
102104

@@ -116,15 +118,9 @@ Private keys can be encrypted using one of the following cipher methods:
116118

117119
## Framework Support
118120
**SSH.NET** supports the following target frameworks:
119-
* .NET Framework 3.5
120-
* .NET Framework 4.0 (and higher)
121-
* .NET Standard 1.3
122-
* .NET Standard 2.0
123-
* Silverlight 4
124-
* Silverlight 5
125-
* Windows Phone 7.1
126-
* Windows Phone 8.0
127-
* Universal Windows Platform 10
121+
* .NETFramework 4.6.2 (and higher)
122+
* .NET Standard 2.0 and 2.1
123+
* .NET 6 (and higher)
128124

129125
## Usage
130126

@@ -149,45 +145,18 @@ using (var client = new SftpClient(connectionInfo))
149145
Establish a SSH connection using user name and password, and reject the connection if the fingerprint of the server does not match the expected fingerprint:
150146

151147
```cs
152-
byte[] expectedFingerPrint = new byte[] {
153-
0x66, 0x31, 0xaf, 0x00, 0x54, 0xb9, 0x87, 0x31,
154-
0xff, 0x58, 0x1c, 0x31, 0xb1, 0xa2, 0x4c, 0x6b
155-
};
148+
string expectedFingerPrint = "LKOy5LvmtEe17S4lyxVXqvs7uPMy+yF79MQpHeCs/Qo";
156149

157150
using (var client = new SshClient("sftp.foo.com", "guest", "pwd"))
158151
{
159152
client.HostKeyReceived += (sender, e) =>
160153
{
161-
if (expectedFingerPrint.Length == e.FingerPrint.Length)
162-
{
163-
for (var i = 0; i < expectedFingerPrint.Length; i++)
164-
{
165-
if (expectedFingerPrint[i] != e.FingerPrint[i])
166-
{
167-
e.CanTrust = false;
168-
break;
169-
}
170-
}
171-
}
172-
else
173-
{
174-
e.CanTrust = false;
175-
}
154+
e.CanTrust = expectedFingerPrint.Equals(e.FingerPrintSHA256);
176155
};
177156
client.Connect();
178157
}
179158
```
180159

181-
## Building SSH.NET
182-
183-
Software | net35 | net40 | netstandard1.3 | netstandard2.0 | sl4 | sl5 | wp71 | wp8 | uap10.0 |
184-
--------------------------------- | :---: | :---: | :------------: | :------------: | :-: | :-: | :--: | :-: | :-----: |
185-
Windows Phone SDK 8.0 | | | | | x | x | x | x |
186-
Visual Studio 2012 Update 5 | x | x | | | x | x | x | x |
187-
Visual Studio 2015 Update 3 | x | x | | | | x | | x | x
188-
Visual Studio 2017 | x | x | x | x | | | | |
189-
Visual Studio 2019 | x | x | x | x | | | | |
190-
191160
## Supporting SSH.NET
192161

193162
Do you or your company rely on **SSH.NET** in your projects? If you want to encourage us to keep on going and show us that you appreciate our work, please consider becoming a [sponsor](https://github.com/sponsors/sshnet) through GitHub Sponsors.

0 commit comments

Comments
 (0)