Commit Graph

1715 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] 7366401af6 Fix: reinitialize server MAC HashAlgorithm after each packet verification
Co-authored-by: WojciechNagorski <17333903+WojciechNagorski@users.noreply.github.com>
2026-09-01 11:45:46 +00:00
copilot-swe-agent[bot] 679f733103 Initial plan 2026-09-01 11:34:31 +00:00
Hai Vo ace38009ee Always let the OS auto-tune the socket send/receive buffer size (#1821)
Remove the explicit SendBufferSize/ReceiveBufferSize assignment
from both SocketConnect and SocketConnectAsync. This lets the
operating system auto-tune the buffer for every connection by
default, and resolves the sync/async multiplier mismatch.
2026-08-22 19:33:11 +02:00
Stefan Rinkes f7d2ac173b Trim the leading zero from PuTTY ECDSA private keys (#1827)
Fixes #1825
2026-08-17 22:31:00 +02:00
Rob Hague 2257640f62 Update CONTRIBUTING.md for new/AI contributions (#1822) 2026-08-17 08:58:28 +02:00
mus65 c96e1327fd Remove some dead internal code (#1824)
* Drop some dead internal code

* remove some more unused events and their callbacks

* more

---------

Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
2026-08-17 08:58:13 +02:00
Rob Hague 5e71944ed7 Set version to '2026.0.1-prerelease.{height}' (#1820) 2026-08-09 21:17:23 +02:00
dependabot[bot] 7b2fd3dbf2 Bump dependencies (#1818)
* Bump the dependencies group with 8 updates

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2026.0.0
2026-08-09 19:50:13 +02:00
Nadav0077 600be0de54 Reject unsafe server-supplied names in SCP recursive download
A malicious or compromised SCP server could return file or directory names containing
path separators, drive qualifiers, or parent-directory references.
ScpClient.Download(string, DirectoryInfo) combined these into a local path without
validation, allowing writes outside the destination directory. Server-supplied C and D
record names are now validated before being combined into a local path.

Signed-off-by: Nadav0077 <18245584+Nadav0077@users.noreply.github.com>
2026-08-09 18:32:00 +02:00
Rob Hague c66b9f8fb0 Require an explicit IRemotePathTransformation for ScpClient
SCP performs a transfer by running scp on the server with the remote path
embedded in a command. On a shell-based server that command is interpreted
by a shell, so a path that is not quoted to suit that shell can be executed
as a command on the server (GHSA-mggc-4xg6-vcxf); on a non-shell-based
server the path is used literally and must not be quoted at all. The right
encoding therefore depends on the server, and no single transformation is
safe for every server.

Rather than default this choice, obsolete the ScpClient constructors that
implicitly used DoubleQuote and add constructors that take an
IRemotePathTransformation explicitly, so callers must choose one suited to
their server and trust environment. DoubleQuote remains the default for the
obsolete constructors, so existing behaviour is unchanged. Document the
consideration on ScpClient and IRemotePathTransformation, and recommend
using SFTP.
2026-08-09 18:31:07 +02:00
Robert Hague 11e7a52cb3 Cap data received during the protocol version exchange
Add upper bounds on the number of banner lines and line length before the SSH identification
string, analogous to OpenSSH. Also don't buffer all the data unnecessarily.
2026-08-09 18:25:04 +02:00
Rob Hague 6ee878f331 Merge commit from fork 2026-08-09 18:15:19 +02:00
Chathulanka Gamage 6cb3cd9b5e docs: add missing SftpPathNotFoundException exception documentation for ListDirectory, ListDirectoryAsync (#1810) 2026-07-06 18:46:12 +02:00
Rob Hague dc8d2db122 Bump testcontainers to 4.13 (#1809)
* Downgrade testcontainers to 4.11

Running the .NET Framework integration tests locally (not CI since we don't use the library
there) is broken in 4.12. Also add .dockerignore since the image was including 200MB of
stuff under bin/.

* bump to 4.13
2026-07-04 14:38:32 +02:00
Rob Hague 89f378a0ab Keep APM and sync UploadFile/DownloadFile callbacks on the threadpool (#1805)
* Tweak internal IProgress usage for APM and sync UploadFile/DownloadFile

Changes to support IProgress<> callback on UploadAsync/DownloadAsync meant wrapping
the Action<> callback on existing methods in a Progress<>, which posts the callback
onto the current synchronisation context rather than the threadpool. For the legacy
APM methods (Begin[..]), let's just preserve their old behaviour.

For the synchronous methods, posting to the synchronisation context is probably the
worst choice (because if there is one, the method itself is running there). We can
either revert to the threadpool as well, or take the opportunity to invoke the
callback synchronously, which is a behavioural change but probably the least
surprising behaviour for a synchronous method.

* keep callbacks on the threadpool

Actually, we could call the Download callback synchronously easily enough, but the Upload progress
reports are being made on the message listener thread upon request ack. A more involved
scheme could drain callbacks to fire during the read loop. For now just make it all the
same behaviour as in 2025.1.0.
2026-06-26 19:02:09 +02:00
Rob Hague fa98d59384 Use the read buffer in UploadFile for the SFTP write packets (#1798)
* Use the read buffer in UploadFile for the SFTP write packets

In SftpClient.UploadFile, a buffer is allocated to read from the given stream, and for
each read, another array is allocated for the SFTP write packet (which consists of that
data prepended with headers). This change effectively leaves space at the start of the
buffer for the headers such that it can be used to assemble the packets without that
per-packet array allocation.

There are cleaner/more general ways to do this (e.g. for all packet types, leave space
for the SSH headers as well), but this gets the most impact for about as much effort as
I can be bothered with.

* Rent from pool
2026-06-26 18:20:53 +02:00
Copilot 41053cb80f Replace Assert.IsTrue with CollectionAssert.AreEqual for collection comparisons (#1730)
* Initial plan

* Refactor collection assertions to use CollectionAssert.AreEqual

Replace Assert.IsTrue(xxx.IsEqualTo(yyy)) and Assert.IsTrue(xxx.SequenceEqual(yyy))
with CollectionAssert.AreEqual(expected, actual) across 55 test files

Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>

* Fix argument order in CollectionAssert.AreEqual and remove unnecessary using directives

- Fixed argument order in KeyExchangeDhGroupExchangeReplyTest.cs (expected first, actual second)
- Fixed argument order in KeyExchangeInitMessageTest.cs (expected first, actual second)
- Removed unnecessary 'using System.Linq' directives from all affected test files

Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2026-06-26 17:44:36 +02:00
dependabot[bot] f5e6ce710c Bump the dependencies group with 11 updates (#1808)
* Bump the dependencies group with 11 updates

Bumps coverlet.collector from 6.0.4 to 10.0.1
Bumps coverlet.msbuild from 6.0.4 to 10.0.1
Bumps GitHubActionsTestLogger from 3.0.1 to 3.0.4
Bumps Meziantou.Analyzer from 3.0.18 to 3.0.114
Bumps Microsoft.Bcl.Cryptography from 10.0.3 to 10.0.9
Bumps Microsoft.Extensions.Logging.Console from 10.0.3 to 10.0.9
Bumps MSTest from 4.1.0 to 4.2.3
Bumps PolySharp from 1.15.0 to 1.16.0
Bumps SonarAnalyzer.CSharp from 10.20.0.135146 to 10.27.0.140913
Bumps System.Formats.Asn1 from 10.0.3 to 10.0.9
Bumps Testcontainers from 4.10.0 to 4.12.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
2026-06-26 17:20:18 +02:00
dependabot[bot] a6b6615026 Bump actions/checkout from 6.0.2 to 7.0.0 (#1807)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-26 13:14:23 +02:00
dependabot[bot] cd3160add9 Bump actions/upload-pages-artifact from 4.0.0 to 5.0.0 (#1789)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/7b1f4a764d45c48632c6b24a0339c27f5614fb0b...fc324d3547104276b827a68afc52ff2a11cc49c9)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-26 12:58:01 +02:00
dependabot[bot] 24c4aa416a Bump NuGet/login from 1.1.0 to 1.2.0 (#1790)
Bumps [NuGet/login](https://github.com/nuget/login) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/nuget/login/releases)
- [Commits](https://github.com/nuget/login/compare/d22cc5f58ff5b88bf9bd452535b4335137e24544...8d196754b4036150537f80ac539e15c2f1028841)

---
updated-dependencies:
- dependency-name: NuGet/login
  dependency-version: 1.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-26 12:57:34 +02:00
dependabot[bot] 2b01ff3558 Bump actions/setup-dotnet from 5.2.0 to 5.3.0 (#1802)
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7...9a946fdbd5fb07b82b2f5a4466058b876ab72bb2)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: 5.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-26 12:43:46 +02:00
dependabot[bot] 855c3e29ae Bump alpine from 3.23 to 3.24 in /test/Renci.SshNet.IntegrationTests (#1806)
Bumps alpine from 3.23 to 3.24.

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: '3.24'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-26 12:42:43 +02:00
Rob Hague 5b8382de26 Serialise packets into a buffer (#1792)
A byte array is allocated to hold each plaintext packet. This removes that by adding
a buffer for that purpose.
2026-05-05 13:41:35 +02:00
Rob Hague b6217cb763 Remove plaintext receive buffer (#1788)
#1752 added a persistent buffer into which to decrypt packets, rather than allocating
a new array for each packet. This was on the back of #1733 which added support in the
cipher types for decrypting into a given buffer, but for the case of AES-CTR, not into
the same buffer in-place. #1787 adds that missing support, meaning we can now decrypt
in-place, and the plaintext buffer becomes unnecessary.
2026-05-05 12:59:01 +02:00
Rob Hague 8ed8d38fa8 Encrypt packets in-place (#1787)
Support in-place encryption in the cipher types, then use it on the plaintext packets
instead of allocating a new array each time. Removes 2 of 4 bytes allocated for each
byte uploaded over SFTP.

For AES-CTR, supporting in-place encryption in this case means adding a persistent buffer
for the keystream and encrypting in chunks. The performance difference is ~1-2% i.e.
marginal versus one-shotting it. The variance is similar also for different choices of
buffer size (here 4096 is used).
2026-05-05 12:57:13 +02:00
Rob Hague 45d8631266 Add SECURITY.md (#1785)
Point to GH private vulnerability reporting
2026-04-12 18:15:31 +02:00
Rob Hague 04a6dc04c2 Harden actions (#1784)
* Harden actions

- Pin remaining actions
- Specify top-level/default `permissions: contents: read` in build.yml
- Set `persist-credentials: false` on checkout
- Add an environment for nuget publish job and use `release` event trigger
- Add dependabot cooldown

* Update .github/workflows/build.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-12 18:15:16 +02:00
mus65 25a931cafe ScpClient: allow disabling the -d flag (#1751)
* ScpClient: allow disabling the -d flag

fixes #1746

* Apply suggestion from @Rob-Hague

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2026-03-22 10:26:37 +01:00
mus65 0ff2c50765 SftpClient: add IProgress to DownloadFileAsync and UploadFileAsync (#1771)
* SftpClient: add DownloadFileAsync overload with downloadCallback

fixes #1765

* Change to IProgress and also add to UploadFileAsync
2026-03-16 19:47:59 +01:00
mus65 8cd6ad65b1 fix Build with newer .NET 10 SDKs (#1772)
* fix Build with newer .NET 10 SDKs

The IDE0370 are a mess since they only affect certain target frameworks.
Maybe we should disable this one completely instead?

Also set a fixed SDK Version in CI so this doesn't randomly break again.

* Remove IDE0370

* global.json: use latestMinor

to make sure that dotnet-setup installs the
exact version, see https://github.com/sshnet/SSH.NET/pull/1772#discussion_r2941495945

* Update global.json

Co-authored-by: Rob Hague <rob.hague00@gmail.com>

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2026-03-16 19:31:32 +01:00
Copilot c3da85d011 Add GitHub Copilot instructions for SSH.NET (#1767)
* Initial plan

* Add GitHub Copilot instructions for SSH.NET

Co-authored-by: WojciechNagorski <17333903+WojciechNagorski@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: WojciechNagorski <17333903+WojciechNagorski@users.noreply.github.com>
2026-03-16 11:06:15 +01:00
dependabot[bot] 4a6f7fd5fe Bump the dependencies group (#1761)
* Bump the dependencies group

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2026-03-02 20:53:52 +01:00
Copilot 41dde35d74 Replace custom TestMethodForPlatformAttribute with MSTest OSCondition (#1766)
* Initial plan

* Replace TestMethodForPlatformAttribute with OSCondition attribute

Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Rob-Hague <5132141+Rob-Hague@users.noreply.github.com>
2026-03-01 18:02:08 +01:00
Rob Hague 085dead8f5 Add a plaintext receive buffer (#1752)
Continuing from previous changes, add a persistent buffer into which the message
payload is decrypted, rather than allocating a new array each time.
2026-02-10 19:47:43 +01:00
dependabot[bot] 1a977495a5 Bump actions/upload-artifact from 5 to 6 (#1757)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-08 16:59:02 +01:00
dependabot[bot] dc9082d9e2 Bump actions/download-artifact from 6 to 7 (#1756)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-08 16:58:33 +01:00
dependabot[bot] 6b19cbfcb1 Bump alpine from 3.22 to 3.23 in /test/Renci.SshNet.IntegrationTests (#1755)
Bumps alpine from 3.22 to 3.23.

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: '3.23'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-08 16:57:44 +01:00
dependabot[bot] 89ea230750 Bump the dependencies group with 6 updates (#1743)
* Bump the dependencies group with 6 updates

Bumps BenchmarkDotNet from 0.15.3 to 0.15.8
Bumps GitHubActionsTestLogger from 2.4.1 to 3.0.1
Bumps Meziantou.Analyzer from 2.0.220 to 2.0.257
Bumps Nerdbank.GitVersioning from 3.7.115 to 3.9.50
Bumps SonarAnalyzer.CSharp from 10.15.0.120848 to 10.16.0.128591
Bumps Testcontainers from 4.7.0 to 4.9.0

---
updated-dependencies:
- dependency-name: BenchmarkDotNet
  dependency-version: 0.15.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: GitHubActionsTestLogger
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: dependencies
- dependency-name: Meziantou.Analyzer
  dependency-version: 2.0.257
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: dependencies
- dependency-name: Nerdbank.GitVersioning
  dependency-version: 3.9.50
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: SonarAnalyzer.CSharp
  dependency-version: 10.16.0.128591
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
- dependency-name: Testcontainers
  dependency-version: 4.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>

* TimeSpan.Zero

* bump

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
Co-authored-by: Robert Hague <rh@johnstreetcapital.com>
2025-12-23 11:22:32 +00:00
mus65 adbb68e6e8 Add UploadFileAsync override with canOverride (#1750)
fixes #1734
2025-12-23 11:04:27 +00:00
dependabot[bot] 4648e0a614 Bump actions/checkout from 5 to 6 (#1744)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-23 10:30:22 +00:00
mus65 e1520eda21 Migrate solution to slnx format (#1749)
see https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/
2025-12-23 10:29:37 +00:00
Rob Hague 8712c99377 Add a socket receive buffer (#1733)
Currently an array is allocated to read each packet from the socket, followed by
decryption which allocates another array for the plaintext payload. We can save one
of these two allocations by adding a persistent buffer for socket receives, and
allowing the cipher implementations to decrypt into the given payload array.

We can save the other allocation similarly, but in a separate change.
2025-11-21 21:21:25 +01:00
Rob Hague cbbbddecf9 Write into the underlying buffer in SshDataStream (#1739)
Several commonly used Write methods on SshDataStream end up calling Write(ReadOnlySpan)
on the base MemoryStream. But since SshDataStream is a derived type, that method just
rents a buffer and hands it to Write(byte[], int, int), which defeats any stackalloc'ing
or renting that SshDataStream does itself. Instead, with a bit extra accounting we can
just write directly into the underlying buffer.
2025-11-21 20:13:33 +01:00
Rob Hague bafd867c12 Rent buffers used in SFTP reads (#1738)
An SFTP download performs several reads from the server in parallel, allocating an array
to store each result until it's ready to be consumed. Since these buffers are short-lived
and normally of the same large-ish size (32KB), it seems like a good candidate for pooling.
2025-11-21 19:54:25 +01:00
Rob Hague 330e9331e9 Truncate local file in ScpClient.Download (#1729)
Similar to #1686 but for the local side of SCP: opening the file should use
Create not OpenWrite.

closes #648
2025-11-21 19:53:44 +01:00
Rob Hague 391065830a Enable nullable in ConnectionInfo (#1728) 2025-11-21 19:53:29 +01:00
mus65 4e02502bdf Add .NET 10 target and make use of C#14 extension members (#1672)
* Add .NET 10 target

* fix IDE0031

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0031

* fix ca5399

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5399

* fix ca1515

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1515

* fix ca2002

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2002

* fix ca1508

new false positives.

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1508

* fix ca2000

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2000

* fix ca2025

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2025

* fix ca1849

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1849

* fix Reverse() overloads

because of https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/10.0/csharp-overload-resolution

* supress CA2002

* Use extension members for ThrowHelpers

* use extension members for CryptoAbstractions

* use extension member for DateTime.UnixEpoch

* use extension members for string.Join etc

* use extension members for Convert.To/FromHexString

* disable CA1508

* Update .NET 10 RC2

* Workaround Build Regression in .NET 10 RC2

https://github.com/dotnet/sdk/issues/51265

* suppress new warnings introduced by merge

* Update to .NET 10 final release

* Revert "Workaround Build Regression in .NET 10 RC2"

This is fixed in the final release.

This reverts commit 5a59ac9aa8.

* fix new warnings with MSTest 4 + .NET 10

* use same Randomizer instance

* disable CA2000

* reduce CA1849 suppressions

and disable duplicate S6966

* disable preview analyzers

reverts 6c3c06d95a
2025-11-15 12:21:49 +01:00
mus65 933613e31c Update to MSTest 4 (#1721)
* Update to MSTest 4

* fix TestMethodForPlatformAttribute

replace Execute with ExecuteAsync and fix MSTEST0057

https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0057 (link currently dead)

* fix compilation error

* fix MSTEST0037

https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0037

* fix MSTEST0052

https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0052

* fix MSTEST0045

Fixing this properly would require the tests to respect
testContext.CancellationToken. I'm not sure this is worth fixing
or how to even do it for the sync methods.

https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0045

* fix MSTEST0001

I assume that parallelization would break a lot of stuff.

https://learn.microsoft.com/en-us/dotnet/core/testing/mstest-analyzers/mstest0001

* Workaround for new Sonar warnings because of MSTest4

* revert analyzer fixes in OrderedDictionaryTest

* use custom sync console logger for MSTest

to work around https://github.com/microsoft/testfx/issues/6457

* remove redundant args

---------

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2025-11-14 22:09:13 +01:00
Scott Xu bf976d595a Use native AesGcm for .NET Framework from nuget (#1619)
* Use native AesGcm for .NET Framework from nuget

* drop mono exception

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2025-11-14 21:41:31 +01:00