Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.201'

- name: Build Unit Tests .NET
run: dotnet build -f net10.0 test/Renci.SshNet.Tests/
Expand Down Expand Up @@ -63,6 +65,8 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.201'

- name: Build Solution
run: dotnet build Renci.SshNet.slnx
Expand Down Expand Up @@ -114,6 +118,8 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.201'

- name: Setup WSL2
uses: Vampire/setup-wsl@6a8db447be7ed35f2f499c02c6e60ff77ef11278 # v6.0.0
Expand Down Expand Up @@ -156,6 +162,8 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.201'

- name: Setup WSL2
uses: Vampire/setup-wsl@6a8db447be7ed35f2f499c02c6e60ff77ef11278 # v6.0.0
Expand Down
5 changes: 1 addition & 4 deletions src/Renci.SshNet/ForwardedPort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ protected virtual void StopPort(TimeSpan timeout)
RaiseClosing();

var session = Session;
if (session is not null)
{
session.ErrorOccured -= Session_ErrorOccurred;
}
session?.ErrorOccured -= Session_ErrorOccurred;
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Renci.SshNet/OrderedDictionary.netstandard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public bool Remove(TKey key, [MaybeNullWhen(false)] out TValue value)
}

AssertConsistency();
value = default!;
value = default;
return false;
}

Expand Down
12 changes: 12 additions & 0 deletions src/Renci.SshNet/ScpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ public void Upload(Stream source, string path)
using (var input = ServiceFactory.CreatePipeStream())
using (var channel = Session.CreateChannelSession())
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
channel.Closed += (sender, e) => input.Dispose();
channel.Open();

Expand Down Expand Up @@ -297,7 +299,9 @@ public void Upload(FileInfo fileInfo, string path)
using (var input = ServiceFactory.CreatePipeStream())
using (var channel = Session.CreateChannelSession())
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
channel.Closed += (sender, e) => input.Dispose();
channel.Open();

Expand Down Expand Up @@ -343,7 +347,9 @@ public void Upload(DirectoryInfo directoryInfo, string path)
using (var input = ServiceFactory.CreatePipeStream())
using (var channel = Session.CreateChannelSession())
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
channel.Closed += (sender, e) => input.Dispose();
channel.Open();

Expand Down Expand Up @@ -386,7 +392,9 @@ public void Download(string filename, FileInfo fileInfo)
using (var input = ServiceFactory.CreatePipeStream())
using (var channel = Session.CreateChannelSession())
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
channel.Closed += (sender, e) => input.Dispose();
channel.Open();

Expand Down Expand Up @@ -426,7 +434,9 @@ public void Download(string directoryName, DirectoryInfo directoryInfo)
using (var input = ServiceFactory.CreatePipeStream())
using (var channel = Session.CreateChannelSession())
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
channel.Closed += (sender, e) => input.Dispose();
channel.Open();

Expand Down Expand Up @@ -466,7 +476,9 @@ public void Download(string filename, Stream destination)
using (var input = ServiceFactory.CreatePipeStream())
using (var channel = Session.CreateChannelSession())
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
channel.DataReceived += (sender, e) => input.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
channel.Closed += (sender, e) => input.Dispose();
channel.Open();

Expand Down
2 changes: 2 additions & 0 deletions src/Renci.SshNet/Security/Cryptography/EcdsaKey.BclImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ public override bool Verify(byte[] input, byte[] signature)
public override void Export(out byte[] qx, out byte[] qy)
{
var parameter = Ecdsa.ExportParameters(includePrivateParameters: false);
#pragma warning disable IDE0370 // Remove unnecessary suppression
qx = parameter.Q.X!;
qy = parameter.Q.Y!;
#pragma warning restore IDE0370 // Remove unnecessary suppression
}

protected override void Dispose(bool disposing)
Expand Down
6 changes: 6 additions & 0 deletions src/Renci.SshNet/SshCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ public Task ExecuteAsync(CancellationToken cancellationToken = default)
{
try
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
((SshCommand)cmd!).CancelAsync();
#pragma warning restore IDE0370 // Remove unnecessary suppression
}
catch
{
Expand Down Expand Up @@ -583,7 +585,9 @@ private void Channel_RequestReceived(object? sender, ChannelRequestEventArgs e)

private void Channel_ExtendedDataReceived(object? sender, ChannelExtendedDataEventArgs e)
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
ExtendedOutputStream.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression

if (e.DataTypeCode == 1)
{
Expand All @@ -593,7 +597,9 @@ private void Channel_ExtendedDataReceived(object? sender, ChannelExtendedDataEve

private void Channel_DataReceived(object? sender, ChannelDataEventArgs e)
{
#pragma warning disable IDE0370 // Remove unnecessary suppression
OutputStream.Write(e.Data.Array!, e.Data.Offset, e.Data.Count);
#pragma warning restore IDE0370 // Remove unnecessary suppression
}

/// <summary>
Expand Down
6 changes: 4 additions & 2 deletions test/Renci.SshNet.Tests/Classes/AbstractionsTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Renci.SshNet.Abstractions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Renci.SshNet.Abstractions;

using System;
using System.Threading;
using System.Security.Cryptography;
Expand Down
Loading