1396 Commits

Author SHA1 Message Date
Gert Driesen 1c7166a002 Update tests for SetLastAccessTime(Utc) to also verify the time component and the Kind of the DateTime value returned by GetLastAccessTime(Utc). (#1198) 2023.0.0 2023-10-09 05:45:16 +02:00
Rob Hague 70f58b7660 Add/migrate hmac+cipher integration tests (#1189)
* Add/migrate hmac+cipher integration tests

* fix integration tests

---------

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-29 14:38:32 +02:00
Wojciech Nagórski 5803ada7cf Implement set last write and access time (#1194) 2023-09-29 10:07:18 +02:00
Wojciech Nagórski cd1151deca Update ISftpClient for #120 (#1193) 2023-09-29 09:05:45 +02:00
Patrick Yates f28c2c2dd0 Fix for channel session semaphore from thread blocking (#1071)
* Merging fix from @clivetong into our own SSH.NET fork
- The following article describes some of the issues with the double check lock that we have seen issues with: https://www.sudhanshutheone.com/posts/double-check-lock-csharp

* Merging fix from @clivetong into our own SSH.NET fork
- The following article describes some of the issues with the double check lock that we have seen issues with: https://www.sudhanshutheone.com/posts/double-check-lock-csharp

* Update Channel to fix AppVeyor failure (field should be readonly)
2023-09-28 21:01:18 +02:00
Dmitry Tsarevich dd2e55209b Use OS-agnostic socket error codes to allow tests run on different OSes (#1179)
SocketErrorCode is OS agnostic, ErrorCode is OS specific.

On Windows ErrorCode = (int) SocketErrorCode, but on Mac and Unix it is not.

For example ExitCode for HostNotFound (11001) on Windows is 11001, on Mac & Unix is -131073. So testing for ExitCode == 11001 fails on Mac & Unix.

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-26 21:29:45 +02:00
Wojciech Nagórski 4ba591ee0b FingerPrints (#1186) 2023-09-26 21:00:20 +02:00
Rob Hague fdd113022b Enable DSA tests (#1181)
Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-25 22:22:15 +02:00
Rob Hague 51e0c67f40 Try to "fix" the flaky test (#1185) 2023-09-25 21:35:14 +02:00
Rob Hague aade354748 Use ExceptionDispatchInfo in more places (#1182)
Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-23 17:20:59 +02:00
Wojciech Nagórski 18e6673031 Improvements after #1177 (#1180) 2023-09-23 08:33:10 +02:00
Rob Hague 8732d3d7ef Add support for RSA SHA-2 public key algorithms (#1177)
* Abstract out the hash algorithm from RsaDigitalSignature

* Add integration tests

* Add DigitalSignature property to KeyHostAlgorithm

* Add IHostAlgorithmsProvider interface

* Verify the host signature

* Fix HostKeyEventArgsTest after merge

* Remove PubkeyAcceptedAlgorithms ssh-rsa

* Add test coverage for RSA keys in PrivateKeyFile

* Obsolete IPrivateKeySource

---------

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-23 07:09:41 +02:00
Dāvis Mošenkovs 43329eef28 Support SHA256 fingerprints for host key validation (#1098)
* Add tests for HostKeyEventArgs

* Add SHA256 fingerprint support
2023-09-17 22:44:26 +02:00
Igor Milavec dcc596a774 Use ExceptionDispatchInfo to retain call stack in Session.WaitOnHandle() (#936)
* Use ExceptionDispatchInfo to retain call stack in Session.WaitOnHandle()

* merge

* Update src/Renci.SshNet/Session.cs

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

---------

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2023-09-15 09:45:17 +02:00
Rob Hague 60de8a41a4 Add a benchmarks project (#1151)
* Add a benchmarks project

* Small improvements

---------

Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-15 05:32:13 +02:00
Wojciech Nagórski 9593e87e54 Move Integration tests (#1173)
* Renci.SshNet.IntegrationTests

* Renci.SshNet.TestTools.OpenSSH

* Move integration tests to main repo

* Move old tests to new integration tests

* Move old integration tests to new integration tests

* Move more tests

* Move authentication tests

* Move SshClientTests

* Fix some tests

* Remove duplicated test

* Poc of ProcessDisruptor

* Rename

* Some fixes

* Remove performance tests

* Small improvements
2023-09-12 13:34:43 +02:00
Rob Hague 9f1699b560 Delete performance/longrunning tests (#1143)
Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
2023-09-06 16:18:25 +02:00
Rob Hague 004b57ae9e Fix the assembly resolution build warning (#1165) 2023-08-30 14:56:49 +02:00
Wojciech Nagórski 7cd0487785 ListDirectoryAsync return IAsyncEnumerable (#1126)
* ListDirectoryAsync return IAsyncEnumerable

* Fix documentation

* Update README.md

* Fix

* Add Sftp ListDirectoryAsync test

* Revert

* Integration tests for ListDirectoryAsync with IAsyncEnumerable
2023-08-30 10:22:10 +02:00
Wojciech Nagórski 1b46264bd3 Merge pull request #1148 from WojciechNagorski/integration-tests-mstests
MSTest Integration tests
2023-08-30 07:14:02 +02:00
Wojciech Nagórski bfef6aa2a7 Merge branch 'develop' of https://github.com/sshnet/SSH.NET into integration-tests-mstests 2023-08-30 06:10:53 +02:00
Wojciech Nagórski 82dc77a2f8 Use correct SSH.NET 2023-08-30 06:10:28 +02:00
Wojciech Nagórski 77b27e570d Merge branch 'master' of https://github.com/sshnet/SSH.NET into integration-tests-mstests 2023-08-26 05:56:15 +02:00
Wojciech Nagórski 592c86c6d0 Merge pull request #1146 from mus65/nuget_license
Use License Expression for NuGet Package
2023-08-25 11:22:08 +02:00
Wojciech Nagórski 3d36f88abb Update CODEOWNERS 2023-08-25 11:21:30 +02:00
Wojciech Nagórski 6f567ec7bb Remove todos 2023-06-29 06:31:15 +02:00
Wojciech Nagórski 69a42d3b70 Integration tests 2023-06-29 06:29:17 +02:00
Marius Thesing a3dbbc5231 Use License Expression for NuGet Package
licenseUrl is deprecated, see https://github.com/NuGet/Announcements/issues/32
2023-06-25 10:52:04 +02:00
Rob Hague 457789947c Replace IsNullOrWhiteSpace extension (#1142) 2023-06-12 23:21:25 +02:00
Rob Hague a4dbf7763a Replace Array<T>.Empty with Array.Empty<T>() (#1137) 2023-06-06 23:09:12 +02:00
Gert Driesen 27976bb927 Analyzer fixes round 3. (#1135) 2023-05-31 09:52:52 +02:00
Gert Driesen c04cdbcb97 Round 2 of analyzer fixes and general cleanup. (#1132) 2023-05-29 17:16:08 +02:00
Gert Driesen 3ecbd1071d Fix some (lots of) issues reported by analyzers. (#1125)
Fix some (lots of) issues reported by analyzers.
2023-05-24 20:37:46 +02:00
Wojciech Nagórski 072ba7e013 Remove FEATURE_DIRECTORYINFO_ENUMERATEFILES (#1119)
* Remove FEATURE_DIRECTORYINFO_ENUMERATEFILES
* Add exception documentation
2023-05-22 09:47:09 +02:00
Wojciech Nagórski 8c932fb1e8 Remove old features [Part 1] (#1117)
Remove obsolete feature switches (now that we've remove support for legacy target frameworks) and remove corresponding conditional code.
2023-05-09 21:21:13 +02:00
Wojciech Nagórski cf8510013d Removing old target frameworks (#1109)
Remove support for legacy / deprecated target frameworks while adding support for .NET 6.0 (and higher).
The supported target frameworks are now:
* .NETFramework 4.6.2 (and higher)
* .NET Standard 2.0
* .NET 6.0 (and higher)
2023-05-06 22:32:10 +02:00
Gert Driesen ab2ccc40bc Add back copyright to license. (#1060)
Fixes #1059.
2022-12-20 16:24:20 +01:00
LemonPi314 f3ebc290e2 Fix Seek Operations in SftpFileStream (#910)
* Fix offset operations in SftpFileStream.Seek
* Fix seek exception message and add default case for invalid seek origin
* Use named params when throwing ArgumentException
* Add tests for seeking from end of file
2022-11-29 21:33:47 +01:00
Masuri b9bc4750ab fix typo (#999) 2022-08-26 20:54:30 +02:00
Owen Krueger 34ce2bd1d0 Add IBaseClient for BaseClient and ISftpClient to inherit from (#975)
Add IBaseClient for BaseClient and ISftpClient to inherit from
2022-07-03 21:11:46 +02:00
drieseng bd7c02f6e4 Remove unused import. 2022-05-29 17:00:12 +02:00
drieseng 4cdedf6524 Use cryptographically secure random number generator.
Fixes CVE-2022-29245.
2022-05-29 16:59:38 +02:00
drieseng c728fba850 Merge branch 'develop' of https://github.com/sshnet/SSH.NET into develop 2022-05-29 16:58:22 +02:00
drieseng 03c6d60736 Use cryptographically secure random number generator.
Fixes CVE-2022-29245.
2022-05-29 16:58:07 +02:00
Stefan Rinkes bc99ada7da Agent auth and Keygen (#794)
* Allow to set PrivateKeyFile Key directly
   So you can add your own Key-Classes to SSH.NET
* Add ED25519 ctor for just pub key part.
* Make ECDSA Key Bits accessible
   You cant export imported CngKeys. To be able to export them to agent or Key-Files make the private bits also accessible.
* Better NETFRAMEWORK vs NETSTANDARD handling
* Add Comment Property to Key
* Add IPrivateKeySource
  So Extension can add own PrivateKeyFiles, e.g. PuttyKeyFile.
2022-03-05 17:05:02 +01:00
Maximiliano Jabase b30b11af4f correct 'Documenation' to 'Documentation' (#838)
in the documentation's window title
2022-02-15 22:54:02 +01:00
Igor Milavec 4dfc126ace Add unit tests for task-based asynchronous API (#906)
* Fix runtime and culture dependant tests.
* Set C# 7.3 in Tests.csproj to limit intellisense's suggestions under different targets
* Add SftpClientTest.*Async
* Add SftpFileStreamTest_OpenAsync_*
* Add SftpFileStreamTest_WriteAsync_*
* Add SftpFileStreamTest_ReadAsync_*
* Align AppVeyor script with Test project target frameworks
2022-02-15 20:46:34 +01:00
Pedro Fonseca 37fb864663 Fix virus false-positive by Defender on Renci.SSHNet.Tests.dll (#867)
Co-authored-by: Pedro Fonseca <pfonseca@qti.qualcomm.com>
2022-02-14 20:27:52 +01:00
drieseng cad943343b Add CODEOWNERS file. 2022-02-11 22:00:48 +01:00
Igor Milavec 7bdfc9e615 Add async support to SftpClient and SftpFileStream (#819)
* Add FEATURE_TAP and net472 target
* Add TAP async support to SftpClient and SftpFileStream
* Add async support to DnsAbstraction and SocketAbstraction
* Add async support to *Connector and refactor the hierarchy
* Add ConnectAsync to BaseClient
2021-12-14 21:58:10 +01:00