49 Commits

Author SHA1 Message Date
Rob Hague 1de33c469e Documentation updates (#1395)
- Update README to point to https://sshnet.github.io/SSH.NET rather than the CHM file
- Add a CONTRIBUTING.md with some how-tos

For https://sshnet.github.io/SSH.NET:

- Use the repo README as the landing page to keep them in sync
- Combine the API-per-TFM pages to just one "API" page
- Add a couple more examples
- Add a GitHub link in the header.
2024-05-10 11:38:47 +02:00
Scott Xu 3dc3fc8b1c Add support for AEAD AES 128/256 GCM Ciphers (.NET 6.0 onward only) (#1369)
* Init AeadCipher

* Move AeadCipher to parent folder. Move EncryptBlock/DecryptBlock from SymmetricCipher to BlockCipher

* simplify parameter name

* Implement AesGcmCipher

* Update README

* Remove protected IV from AeadCipher; Set offset to outbound sequence just like other ciphers

* Rename associatedData to packetLengthField

* Use Span<byte> to avoid unnecessary allocations

* Use `Span` to improve performance when `IncrementCounter()`

* Add `IsAead` property to `CipherInfo`. Include packet length field and tag field in offset and length when call AesGcm's `Decrypt(...)` method. Do not determine HMAC if cipher is AesGcm during kex.

* Fix build

* Fix UT

* Check `AesGcm.IsSupported` before add to the `Encryptions` collection.
Guard AES-GCM with `NET6_0_OR_GREATER`.
Insert AES-GCM ciphers right after AES-CTR ciphers but before AES-CBC ciphers, which is similar with OpenSSH:
```
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
```
Although Dictionary's order is not defined, from observation, it is in the same order with add. Anyway that would be another topic.

* Suppress CA1859 "Use concrete types when possible for improved performance" for `ConnectionInfo.Encryptions`.
Test `Aes128Gcm` and `Aes256Gcm` only when `NET6_0_OR_GREATER`

* Update xml doc comments. Do not treat AesGcmCipher separately in Session.cs

* Fix build

* Fix build

* Update the comment as ChaCha20Poly1305 uses a separated key to encypt the packet length and the size it 4.

* Update src/Renci.SshNet/Security/Cryptography/Cipher.cs

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

* Make `AesGcmCipher` internal.
Assert offset when decrypt.

* Fix nullable error in build

* typos

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2024-04-18 20:06:19 +02:00
Scott Xu b553f81f8a Add support for Zlib compression (.NET 6.0 onward only) (#1326)
* Integrate `ZLibStream` from .NET 6.0+ with SSH.NET.

* OpenSSH server does not support zlib (pre-auth); OpenSSH client still supports zlib (pre-auth)

* Correct compression algorithm name; Update README.md

* Integrate `ZLibStream` from .NET 6.0+ with SSH.NET.

* OpenSSH server does not support zlib (pre-auth); OpenSSH client still supports zlib (pre-auth)

* Correct compression algorithm name; Update README.md

* Test the compression by upload/download file

* Refactor compression.

* Move delayed compression logic to base class.

* seal Zlib

* update unit test

* update unit test to see if it can trigger integration test

* Flush zlibStream

* Fix integration test

* update test

* Update ConnectionInfo.cs

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

* Update README.md

---------

Co-authored-by: Rob Hague <rob.hague00@gmail.com>
2024-04-17 21:39:27 +02:00
Jean-Sebastien Carle dd36d5b98a Added support for GitHub pages using docfx (#1358)
* Added support for GitHub pages using docfx

* Fixed StyleCop warning.

* Fixed other StyleCop warnings.
2024-04-17 21:32:54 +02:00
mus65 c044fd40c6 fix link to tests in README (#1338) 2024-02-24 12:45:49 +01:00
Wojciech Nagórski 5b9c669f1b Update README.md 2024-02-21 20:29:26 +01:00
Scott Xu 59a0f9030a Drop RIPEMD160 (#1324) 2024-02-18 05:20:57 +01:00
Scott Xu 7cfe62b9f1 Support ETM (Encrypt-then-MAC) variants for HMAC (#1316)
* Support ETM (Encrypt-then-MAC) variants for HMAC

* Support ETM (Encrypt-then-MAC) variants for HMAC

* Remove `ETM` property from `HashInfo`

* Add support for HmacMd5Etm, HmacMd5_96_Etm, HmacSha1Etm and HmacSha1_96_Etm
Explicitly specify etm even if false

* Add Encrypt-then-MAC variants to README.md

* Add back empty span to prevent auto link

* Store ETM in `HashInfo`;
Change `HMAC Create[...]Hash()` to `HashAlgorithm Create[...]Hash(out bool isEncryptThenMAC)`
2024-02-16 13:24:54 +01: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
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
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
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 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
Stefan Rinkes f072c5f1a1 OPENSSH KeyReader for more keys (#614)
* OPENSSH KeyReader for more keys

Add support to parse OpenSSH Keys with ECDSA 256/384/521 and RSA.

https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key

Change-Id: Iaa9cce0f2522e5fee377a82cb252f81f0b7cc563

* Fix ED25519Key KeyLength

* Fix ED25519 PubKey-auth

LeadingZeros of BigInteger-Conversion have to be removed
before sending the Key.
2021-04-18 18:49:01 +02:00
Gert Driesen d62594c03f Update README.md 2020-12-31 14:46:08 +01:00
Gert Driesen 9c25cf65ca Update README.md 2020-12-31 14:45:50 +01:00
Gert Driesen b2c36b5e2c Update README.md 2020-12-31 14:45:16 +01:00
Gert Driesen c10277f4d7 Fix typo. 2020-06-07 15:45:45 +02:00
Gert Driesen bde751eb48 Add sponsor info. 2020-06-07 10:26:32 +02:00
drieseng ab827c2eb1 Document support for .NET Standard 2.0. 2020-05-03 20:15:32 +02:00
Gert Driesen 516d982add Fix typo 2020-04-26 10:35:04 +02:00
Mark Moore f262b4aa7b Added documentation section to README (#656) 2020-04-19 14:28:49 +02:00
drieseng 34df3dd725 Support diffie-hellman-group14-sha256 and diffie-hellman-group16-sha512 key exchange methods. 2020-03-15 19:43:45 +01:00
Gert Driesen bc59db5ff4 Avoid autolink 2020-03-06 19:57:26 +01:00
drieseng 982ef10ae7 Update readme for the new key exchange methods, host key algorithms and private key formats. 2020-01-11 17:05:32 +01:00
Gert Driesen 19167e7c80 Fix links 2017-10-09 19:33:00 +02:00
Gert Driesen 5d664bd667 Include NuGet download count 2017-10-09 19:30:25 +02:00
Gert Driesen 5852a96d02 Fix typo. 2017-09-09 13:44:15 +02:00
Gert Driesen 4e9ceadfd3 Add example for host key validation. 2017-09-09 13:35:53 +02:00
Gert Driesen 46966d37cb Precise that we only support SSH-2. 2017-07-21 14:23:30 +02:00
Gert Driesen bdec2d22f9 Update markdown after recent Github changes 2017-03-20 22:16:35 +01:00
Gert Driesen 6cb91f600d Update README.md 2017-03-06 21:52:53 +01:00
Gert Driesen d95276d861 Document the fact that we now use VS 2017 to build the .NET Standard 1.3 flavor of SSH.NET. 2017-01-04 18:53:45 +01:00
Gert Driesen 7f8f3121f0 Added netstandard1.3 TFM. 2016-08-02 10:41:42 +02:00
drieseng 68d9e4fc90 Moved into on conditional compilation symbols to wiki. 2016-07-27 14:16:26 +02:00
drieseng 6cf058a312 Add support for .NET Core 1.0 (.NETStandard 1.3).
Introduce FileSystemAbstraction.
2016-07-02 16:31:37 +02:00
Gert Driesen 1eb4574e37 Add CI build badge
Add CI build badge
2016-06-21 06:15:57 +02:00
Gert Driesen 905023e4d4 Added SSH.NET title, and downgrade other headings,
Added SSH.NET title, and downgrade other headings,
2016-06-19 17:50:35 +02:00
Gert Driesen 906dd9eb66 Added nuget badge 2016-06-19 17:48:18 +02:00
Gert Driesen e5304c3d3e We now use VS 2015update 2 2016-04-22 23:36:14 +02:00
Gert Driesen 29080fd2d1 Add FEATURE_DIAGNOSTICS_TRACESOURCE symbol. 2016-04-05 18:08:09 +02:00
Gert Driesen 7a8135fd0c Added FEATURE_SOCKET_POLL symbol. 2016-04-04 14:21:24 +02:00
Gert Driesen ec86cd8869 Remove FEATURE_STREAM_EAP 2016-04-01 21:21:52 +02:00
Gert Driesen b0e3612b95 Added FEATURE_MEMORYSTREAM_TRYGETBUFFER symbol 2016-04-01 20:36:11 +02:00
Gert Driesen 765da0cb3e Document our conditional compilation symbols. 2016-04-01 19:15:30 +02:00
drieseng 83d21d44c8 Sync with new developments.
Move HMAC and key exchange method support to separate sections.
Added hmac-sha2-512 and hmac-sha2-512-96 HMACs.
Added Universal Windows Platform 10 (UAP10) as support target framework.
Added VS 2015 Update 2 RC as requirement for building UAP10.
2016-03-24 11:14:51 +01:00
Gert Driesen 9d5f234d64 Add draft section on building SSH.NET 2016-02-07 10:33:01 +01:00
Gert Driesen e87a05a488 Attempt to add link to NDepend image. 2016-02-06 19:41:04 +01:00
Gert Driesen bff4d387fa Draft of readme 2016-02-06 19:03:16 +01:00