Skip to content

Commit a6ab749

Browse files
authored
Merge pull request #80 from ejohnstown/wolfssh-update
wolfSSH Update
2 parents 15cf4e6 + 40255b6 commit a6ab749

File tree

6 files changed

+197
-39
lines changed

6 files changed

+197
-39
lines changed

wolfSSH/src/chapter01.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,33 @@ SSH is a layered set of protocols that provide multiplexed streams of data betwe
1010

1111
## Why Choose wolfSSH?
1212

13-
The wolfSSH library is a lightweight SSHv2 server library written in ANSI C and targeted for embedded, RTOS, and resource-constrained environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating environments as well because of its royalty-free pricing and excellent cross platform support. wolfSSH supports the industry standard SSH v2 and offers progressive ciphers such as Poly1305, ChaCha20, NTRU, and SHA-3. wolfSSH is powered by the wolfCrypt library. A version of the wolfCrypt cryptography library has been FIPS 140-2 validated (Certificate #2425). For additional information, visit the wolfCrypt FIPS FAQ or contact [email protected]
13+
The wolfSSH library is a lightweight SSHv2 server library written in ANSI C and targeted for embedded, RTOS, and resource-constrained environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating environments as well because of its royalty-free pricing and excellent cross platform support. wolfSSH supports the industry standard SSH v2. wolfSSH is powered by the wolfCrypt library. A version of the wolfCrypt cryptography library has been FIPS 140-2 validated (Certificate #3389), and is a module in process for FIPS 140-3. For additional information, visit the wolfCrypt FIPS FAQ or contact [email protected].
1414

1515
### Features
1616

1717

18-
- SSH v2.0 (server)
18+
- SSH v2.0 (server and client)
1919

2020
- Minimum footprint size of 33kB
2121

2222
- Runtime memory usage between 1.4 and 2kB, not including a configurable receive buffer
2323

24-
- Multiple Hashing Functions: SHA-1, SHA-2 (SHA-256, SHA-384, SHA-512), BLAKE2b, Poly
24+
- Multiple hashing functions: SHA-1, SHA-2 (SHA-256, SHA-384, SHA-512)
2525

26-
- Block, Stream, and Authenticated Ciphers: AES (CBC, CTR, GCM, CCM), Camellia, ChaCha
26+
- Block and authenticated ciphers: AES-CBC, AES-CTR, AES-GCM
2727

28-
- Public Key Options: RSA, DH, EDH, NTRU
28+
- Key exchange options: DHE and ECDHE (with curves NISTP256, NISTP384, NISTP521)
2929

30-
- ECC Support (ECDH and ECDSA with curves: NISTP256, NISTP384, NISTP
30+
- Public key authentication options: RSA and ECDSA (with curves NISTP256, NISTP384, NISTP521)
3131

32-
- Curve25519 and Ed
33-
34-
- Client authentication support (RSA key, password)
32+
- User authentication support (password and public key authentication)
3533

3634
- Simple API
3735

38-
- PEM and DER certificate support
39-
40-
- Hardware Cryptography Support: Intel AES-NI support, Intel AVX1/2, RDRAND
36+
- PEM and DER X.509 certificate support
4137

42-
- RDSEED, Cavium NITROX support, STM32F2/F4 hardware crypto support
38+
- Hardware Cryptography Support: Intel AES-NI support, Intel AVX1/2, RDRAND, RDSEED, Cavium NITROX support, STM32F2/F4 hardware crypto support, Freescale CAU / mmCAU / SEC, Microchip PIC32MZ
4339

44-
- Freescale CAU / mmCAU / SEC, Microchip PIC32MZ
40+
- Post quantum hybrid key exchange with Hybrid ECDH-P256 Kyber-Level1
4541

42+
- Support for SFTP, SCP, SSH-AGENT, local and remote port forwarding

wolfSSH/src/chapter02.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,40 @@
22

33
wolfSSH is written with portability in mind and should generally be easy to build on most systems. If you have difficulty building, please don’t hesitate to seek support through our support forums, https://www.wolfssl.com/forums, or contact us directly at [email protected].
44

5-
This section explains how to build wolfSSH on *nix-like and Windows environments, and provides guidance for building in a non-standard environment. You will find a getting started guide and example in section 3.
5+
This section explains how to build wolfSSH on Linux, un\*x-like (BSD, macOS) and Windows environments, and provides guidance for building in a non-standard environment. You will find a getting started guide and example in section 3.
66

7-
When using the autoconf/automake system to build, wolfSSH uses a single Makefile to build all parts and examples of the library, which is both simpler and faster than using Makefiles recursively.
7+
When using the autotools system to build, wolfSSH uses a single Makefile to build all parts and examples of the library, which is both simpler and faster than using Makefiles recursively.
88

99
## Getting the Source Code
1010

11-
The most recent, up to date version can be downloaded from the GitHub website here: https://github.com/wolfSSL/wolfSSH
11+
The most recent, up to date version can be downloaded from the GitHub website here: [https://github.com/wolfSSL/wolfssh](https://github.com/wolfSSL/wolfssh).
1212

1313
Either click the “Download ZIP” button or use the following command in your terminal:
1414
```
1515
$ git clone https://github.com/wolfSSL/wolfssh.git
1616
```
1717
## wolfSSH Dependencies
1818

19-
Since wolfSSH is dependent on wolfCrypt, a configuration of wolfSSL is necessary. wolfSSL can be downloaded here: https://github.com/wolfSSL/wolfssl. The simplest configuration of wolfSSL required for wolfSSH is the default build that can be built from the root directory of wolfSSL with the following commands:
19+
Since wolfSSH is dependent on wolfCrypt, a configuration of wolfSSL is necessary. wolfSSL can be downloaded here: [https://github.com/wolfSSL/wolfssl](https://github.com/wolfSSL/wolfssl). The simplest configuration of wolfSSL required for wolfSSH is the default build that can be built from the root directory of wolfSSL with the following commands:
2020

2121
```
2222
$ ./autogen.sh (only if you cloned from GitHub)
23-
$ ./configure --enable-ssh
23+
$ ./configure --enable-wolfssh
2424
$ make check
2525
$ sudo make install
2626
```
27-
To use the key generation function in wolfSSH, wolfSSL will need to be configured with keygen:` --enable-keygen`.
28-
29-
If the bulk of wolfSSL code isn't desired, wolfSSL can be configured with the crypto only option: `--enable-cryptonly`.
27+
To use the key generation function in wolfSSH, wolfSSL will need to be configured with keygen:
28+
```
29+
--enable-keygen
30+
```
31+
If the bulk of wolfSSL code isn't desired, wolfSSL can be configured with the crypto only option:
32+
```
33+
--enable-cryptonly
34+
```
3035

31-
## Building on *nix
36+
## Building with autotools
3237

33-
When building on Linux, *BSD, OS X, Solaris, or other *nix-like environments, use the autoconf system. To build wolfSSH run the following commands:
38+
When building on Linux, BSD, macOS, Solaris, or other un\*x-like environments, use the autotools system. To build wolfSSH run the following commands:
3439
```
3540
$ ./autogen.sh (only if you cloned from GitHub)
3641
$ ./configure
@@ -68,7 +73,7 @@ $ make src/libwolfssh.la
6873
```
6974
## Building on Windows
7075

71-
The visual studio project file can be found at: https://github.com/wolfSSL/wolfssh/blob/master/ide/winvs/wolfssh.sln
76+
The Visual Studio project file can be found in the directory *ide\\winvs*.
7277

7378
The solution file, 'wolfssh.sln', facilitates building wolfSSH and its example and test programs. The solution provides both Debug and Release builds of Static and Dynamic 32- or 64-bit libraries. The file user_settings.h should be used in the wolfSSL build to configure it.
7479

wolfSSH/src/chapter03.md

Lines changed: 161 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ $ chmod 0600 ./keys/gretel-key-rsa.pem ./keys/hansel-key-rsa.pem \
2929

3030
Authentication against the example echoserver can be done with a password or public key. To use a password the command line:
3131
```
32-
$ ssh_client -p 22222 USER@localhost
32+
$ ssh -p 22222 USER@localhost
3333
```
3434

35-
Where the USER and password pairs are:
35+
Where the _USER_ and password pairs are:
3636
```
3737
jill:upthehill
3838
jack:fetchapail
3939
```
4040

4141
To use public key authentication use the command line:
4242
```
43-
$ ssh_client -i ./keys/USER-key-TYPE.pem -p 22222 USER@localhost
43+
$ ssh -i ./keys/USER-key-TYPE.pem -p 22222 USER@localhost
4444
```
4545

4646
Where the _USER_ can be gretel or hansel, and TYPE is rsa or ecc.
@@ -58,7 +58,7 @@ The echoserver is the workhorse of wolfSSH. It originally only allowed one to au
5858

5959
The option `-f` enables echo-only mode. From another terminal run:
6060
```
61-
$ ssh_client jill@localhost -p 22222
61+
$ ssh jill@localhost -p 22222
6262
```
6363

6464
When prompted for a password, enter "upthehill". The server will send a canned
@@ -148,7 +148,7 @@ The scpclient tool accepts the following command line options:
148148
-S <from>:<to> copy from server to local
149149
```
150150

151-
# wolfSSH sftpclient
151+
### wolfSSH sftpclient
152152

153153
The sftpclient, wolfsftp, establishes a connection to an SSH server and
154154
allows directory navigation, getting and putting files, making and removing
@@ -218,6 +218,55 @@ To recursively copy a directory FROM the server to the local client:
218218

219219
$ scp -P 22222 -r [email protected]:<remote_dir> <local_path>
220220

221+
## SFTP
222+
223+
wolfSSH provides server and client side support for SFTP version 3. This
224+
allows the user to set up an encrypted connection for managing file systems.
225+
226+
To compile wolfSSH with SFTP support, use the `--enable-sftp` build option or
227+
define `WOLFSSH_SFTP`:
228+
229+
```
230+
$ ./configure --enable-sftp
231+
$ make
232+
```
233+
234+
For full API usage and implementation details, please see the wolfSSH User
235+
Manual.
236+
237+
The SFTP client created is located in the directory examples/sftpclient/ and the
238+
server is ran using the same echoserver as with wolfSSH.
239+
240+
```
241+
src/wolfssh$ ./examples/sftpclient/wolfsftp
242+
```
243+
244+
A full list of supported commands can be seen with typeing "help" after a
245+
connection.
246+
247+
```
248+
wolfSSH sftp> help
249+
250+
Commands :
251+
cd <string> change directory
252+
chmod <mode> <path> change mode
253+
get <remote file> <local file> pulls file(s) from server
254+
ls list current directory
255+
mkdir <dir name> creates new directory on server
256+
put <local file> <remote file> push file(s) to server
257+
pwd list current path
258+
quit exit
259+
rename <old> <new> renames remote file
260+
reget <remote file> <local file> resume pulling file
261+
reput <remote file> <local file> resume pushing file
262+
<crtl + c> interrupt get/put cmd
263+
```
264+
An example of connecting to another system would be
265+
266+
```
267+
src/wolfssh$ ./examples/sftpclient/wolfsftp -p 22 -u user -h 192.168.1.111
268+
```
269+
221270
## Shell Support
222271

223272
wolfSSH's example echoserver can now fork a shell for the user trying to log in. This currently has only been tested on Linux and macOS. The file echoserver.c must be modified to have the user's credentials in the user authentication callback, or the user authentication callback needs to be changed to verify the provided password.
@@ -232,3 +281,110 @@ By default, the echoserver will try to start a shell. To use the echo testing be
232281
```
233282
$ ./examples/echoserver/echoserver -f
234283
```
284+
285+
## Post-Quantum
286+
287+
wolfSSH now supports the post-quantum algorithm Kyber. It uses the NIST
288+
submission's Level 1 parameter set implemented by liboqs via an integration
289+
with wolfSSH. It is hybridized with ECDHE over the P-256 ECC curve.
290+
291+
In order be able to use liboqs, you must have it built and installed on your
292+
system. We support the 0.7.0 release of liboqs. You can download it from the
293+
following link:
294+
295+
```
296+
https://github.com/open-quantum-safe/liboqs/archive/refs/tags/0.7.0.tar.gz
297+
```
298+
299+
Once unpacked, this would be sufficient:
300+
301+
```
302+
$ cd liboqs-0.7.0
303+
$ mkdir build
304+
$ cd build
305+
$ cmake -DOQS_USE_OPENSSL=0 ..
306+
$ make all
307+
$ sudo make install
308+
```
309+
310+
311+
In order to enable support for Kyber Level1 hybridized with ECDHE over the P-256
312+
ECC curve in wolfSSH, use the `--with-liboqs` build option during configuration:
313+
314+
```
315+
$ ./configure --with-liboqs
316+
```
317+
318+
The wolfSSH client and server will automatically negotiate using Kyber Level1
319+
hybridized with ECDHE over the P-256 ECC curve if this feature is enabled.
320+
321+
```
322+
$ ./examples/echoserver/echoserver -f
323+
324+
$ ./examples/client/client -u jill -P upthehill
325+
```
326+
327+
On the client side, you will see the following output:
328+
329+
```
330+
Server said: Hello, wolfSSH!
331+
```
332+
333+
If you want to see inter-operability with OpenQauntumSafe's fork of OpenSSH, you
334+
can build and execute the fork while the echoserver is running. Download the
335+
release from here:
336+
337+
```
338+
https://github.com/open-quantum-safe/openssh/archive/refs/tags/OQS-OpenSSH-snapshot-2021-08.tar.gz
339+
```
340+
341+
The following is sufficient for build and execution:
342+
343+
```
344+
$ tar xmvf openssh-OQS-OpenSSH-snapshot-2021-08.tar.gz
345+
$ cd openssh-OQS-OpenSSH-snapshot-2021-08/
346+
$ ./configure --with-liboqs-dir=/usr/local
347+
$ make all
348+
$ ./ssh -o"KexAlgorithms +ecdh-nistp256-kyber-512-sha256" \
349+
-o"PubkeyAcceptedAlgorithms +ssh-rsa" \
350+
-o"HostkeyAlgorithms +ssh-rsa" \
351+
jill@localhost -p 22222
352+
```
353+
354+
NOTE: when prompted, enter the password which is "upthehill".
355+
356+
You can type a line of text and when you press enter, the line will be echoed
357+
back. Use CTRL-C to terminate the connection.
358+
359+
360+
## Certificate Support
361+
362+
wolfSSH can accept X.509 certificates in place of just public keys when
363+
authenticating a user.
364+
365+
To compile wolfSSH with X.509 support, use the `--enable-certs` build option
366+
or define `WOLFSSH_CERTS`:
367+
368+
```
369+
$ ./configure --enable-certs
370+
$ make
371+
```
372+
373+
To provide a CA root certificate to validate a user's certificate, give the
374+
echoserver the command line option `-a`.
375+
376+
```
377+
$ ./examples/echoserver/echoserver -a ./keys/ca-cert-ecc.pem
378+
```
379+
380+
The echoserver and client have a fake user named "john" whose certificate
381+
will be used for authentication.
382+
383+
An example echoserver/client connection using the example certificate
384+
john-cert.der would be:
385+
386+
```
387+
$ ./examples/echoserver/echoserver -a ./keys/ca-cert-ecc.pem -K john:./keys/john-cert.der
388+
389+
$ ./examples/client/client -u john -J ./keys/john-cert.der -i ./keys/john-key.der
390+
```

wolfSSH/src/chapter10.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Open Source
44

5-
wolfSSL (formerly CyaSSL), yaSSL, wolfCrypt, yaSSH and TaoCrypt software are free software downloads and may be modified to the needs of the user as long as the user adheres to version two of the GPL License. The GPLv2 license can be found on the gnu.org website (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
5+
wolfSSL, yaSSL, wolfCrypt, yaSSH and TaoCrypt software are free software downloads and may be modified to the needs of the user as long as the user adheres to version two of the GPL License. The GPLv2 license can be found on the gnu.org website: [http://www.gnu.org/licenses/old-licenses/gpl-2.0.html](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
66

77
wolfSSH software is a free software download and may be modified to the needs of the user as long as the user adheres to version three of the GPL license. The GPLv3 license can be found on the gnu.org website (https://www.gnu.org/licenses/gpl.html).
88

wolfSSH/src/chapter11.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
## How to Get Support
44

5-
For general product support, wolfSSL (formerly CyaSSL) maintains an online forum for the wolfSSL product family. Please post to the forums or contact wolfSSL directly with any questions.
5+
For general product support, wolfSSL maintains an online forum for the wolfSSL product family. Please post to the forums or contact wolfSSL directly with any questions.
66

7-
**wolfSSL (yaSSL) Forums:** https://www.wolfssl.com/forums
8-
**Email Support:** [email protected]
7+
- wolfSSL Forums: [https://www.wolfssl.com/forums](https://www.wolfssl.com/forums)
8+
- Email Support: [email protected]
99

1010
For information regarding wolfSSL products, questions regarding licensing, or general comments, please contact wolfSSL by emailing **[email protected]**.
1111

wolfSSH/src/chapter12.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
We regularly post update information on Twitter. For additional release information, you can keep track of our projects on GitHub, follow us on Facebook, or follow our daily blog.
66

7-
wolfSSH on GitHub https://www.github.com/wolfssl/wolfssh
8-
wolfSSL on Twitter [http://twitter.com/wolfSSL](http://twitter.com/wolfSSL)
9-
wolfSSL on Facebook [http://www.facebook.com/wolfSSL](http://www.facebook.com/wolfSSL)
10-
wolfSSL on Reddit https://www.reddit.com/r/wolfssl/
11-
Daily Blog https://wolfssl.com/wolfSSL/Blog/Blog.html
7+
- wolfSSH on GitHub [https://www.github.com/wolfssl/wolfssh](https://www.github.com/wolfssl/wolfssh)
8+
- wolfSSL on Twitter [https://twitter.com/wolfSSL](https://twitter.com/wolfSSL)
9+
- wolfSSL on Facebook [https://www.facebook.com/wolfSSL](https://www.facebook.com/wolfSSL)
10+
- wolfSSL on Reddit [https://www.reddit.com/r/wolfssl/](https://www.reddit.com/r/wolfssl/)
11+
- Daily Blog [https://wolfssl.com/wolfSSL/Blog/Blog.html](https://wolfssl.com/wolfSSL/Blog/Blog.html)
1212

0 commit comments

Comments
 (0)