Merge pull request #4470 from LinuxJedi/md-cleanups
Cleanup markdown documentation
This commit is contained in:
@@ -1,35 +1,31 @@
|
||||
# DEMO program with ATECC608A on ESP-WROOM-32SE
|
||||
## Overview
|
||||
Running demo programs with ATECC608A on 32SE by setting *WOLFSSL_ESPWROOM32SE* definition
|
||||
Running demo programs with ATECC608A on 32SE by setting `WOLFSSL_ESPWROOM32SE` definition
|
||||
|
||||
Including the following examples:
|
||||
|
||||
* simple tls_client/tls_server
|
||||
* simple `tls_client`/`tls_server`
|
||||
* crypt benchmark
|
||||
|
||||
The *user_settings.h* file enables some of the hardened settings.
|
||||
|
||||
## Requirements
|
||||
1. ESP-IDF development framework
|
||||
[https://docs.espressif.com/projects/esp-idf/en/latest/get-started/]
|
||||
The `user_settings.h` file enables some of the hardened settings.
|
||||
|
||||
## Requirements
|
||||
1. ESP-IDF development framework: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/
|
||||
|
||||
2. Microchip CryptoAuthentication Library: https://github.com/MicrochipTech/cryptoauthlib
|
||||
|
||||
2. Microchip CryptoAuthentication Library
|
||||
[https://github.com/MicrochipTech/cryptoauthlib]
|
||||
|
||||
## Setup
|
||||
1. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
|
||||
2. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
|
||||
|
||||
3. Uncomment out #define WOLFSSL_ESPWROOM32SE in /path/to/wolfssl/wolfssl/wolfcrypt/settings.h
|
||||
|
||||
Note : Need to enable WOLFSSL_ESPIDF
|
||||
Note : crypt test will fail if enabled WOLFSSL_ESPWROOM32SE
|
||||
|
||||
1. wolfSSL under ESP-IDF. Please see [README.md](https://github.com/wolfSSL/wolfssl/blob/master/IDE/Espressif/ESP-IDF/README.md)
|
||||
2. CryptoAuthentication Library under ESP-IDF. Please see [README.md](https://github.com/miyazakh/cryptoauthlib_esp_idf/blob/master/README.md)
|
||||
3. Uncomment out `#define WOLFSSL_ESPWROOM32SE` in `/path/to/wolfssl/wolfssl/wolfcrypt/settings.h`
|
||||
* **Note:** Need to enable `WOLFSSL_ESPIDF`
|
||||
* **Note:** crypt test will fail if enabled `WOLFSSL_ESPWROOM32SE`
|
||||
|
||||
## Configuration
|
||||
1. The *user_settings.h* can be found in /path/to/esp-idf/components/wolfssl/include/user_settings.h
|
||||
1. The `user_settings.h` can be found in `/path/to/esp-idf/components/wolfssl/include/user_settings.h`
|
||||
|
||||
## Build examples
|
||||
1. See README in each example folder
|
||||
1. See `README` in each example folder
|
||||
|
||||
## Benchmark
|
||||
w/o atecc608a
|
||||
@@ -48,11 +44,11 @@ ECDSA 256 verify 14 ops took 1.079 sec, avg 77.071 ms, 12.975 ops/sec
|
||||
```
|
||||
|
||||
## Support
|
||||
For question please email [support@wolfssl.com]
|
||||
For question please email [support@wolfssl.com](mailto:support@wolfssl.com)
|
||||
|
||||
Note: This is tested with the following condition:
|
||||
|
||||
- Model : ESP32-WROOM-32SE
|
||||
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
|
||||
Note: This is tested with the following condition:
|
||||
|
||||
- Model : ESP32-WROOM-32SE
|
||||
- ESP-IDF : v3.3-beta1-39-g6cb37ecc5(commit hash : 6cb37ecc5)
|
||||
- CryptAuthLib: commit hash : c6b176e
|
||||
- OS : Ubuntu 18.04.1 LTS (Bionic Beaver)
|
||||
|
||||
@@ -7,37 +7,43 @@ Project and then selecting VxWorks Image Project.
|
||||
Choose the path to the wolfSSL library here. Uncheck everything except the examples,
|
||||
src and wolfcrypt directories. Uncheck the following:
|
||||
|
||||
wolfcrypt/src/aes_asm.asm
|
||||
wolfcrypt/src/aes_asm.s
|
||||
examples/echoclient/
|
||||
examples/echoserver/
|
||||
wolfcrypt/user-crypto
|
||||
|
||||
```
|
||||
wolfcrypt/src/aes_asm.asm
|
||||
wolfcrypt/src/aes_asm.s
|
||||
examples/echoclient/
|
||||
examples/echoserver/
|
||||
wolfcrypt/user-crypto
|
||||
```
|
||||
Uncheck "Create top level folder". Click Finish.
|
||||
|
||||
3. To include the path to the wolfSSL header files, right click on the project
|
||||
and go to Properties > Build Properties and select the "Paths" tab. Click "Add"
|
||||
then "Browse" and select:
|
||||
|
||||
<path_to_wolfssl>/
|
||||
|
||||
```
|
||||
<path_to_wolfssl>/
|
||||
```
|
||||
Click "OK" then "OK" again.
|
||||
|
||||
4. In ```<path_to_wolfssl>/wolfssl/wolfcrypt/settings.h```, uncomment
|
||||
4. In `<path_to_wolfssl>/wolfssl/wolfcrypt/settings.h`, uncomment
|
||||
|
||||
#define WOLFSSL_VXWORKS
|
||||
```c
|
||||
#define WOLFSSL_VXWORKS
|
||||
```
|
||||
|
||||
Note: pthreads defined by default
|
||||
**Note:** pthreads defined by default
|
||||
|
||||
5. If using the VxWorks simulator add the following to EXTRA\_DEFINE:
|
||||
5. If using the VxWorks simulator add the following to `EXTRA_DEFINE`:
|
||||
|
||||
-DVXWORKS_SIM /* only if using the VxWorks simulator */
|
||||
```
|
||||
-DVXWORKS_SIM /* only if using the VxWorks simulator */
|
||||
```
|
||||
|
||||
This can be done by right clicking on the project in Project Explorer, going to
|
||||
Build Properties and selecting the "Variables" tab. Highlight EXTRA\_DEFINE and
|
||||
click "Edit". Enter the above define to the end of the line.
|
||||
|
||||
6. Copy the certs folder in ```<path_to_wolfssl>/``` to the Wind River Workbench
|
||||
6. Copy the certs folder in `<path_to_wolfssl>/` to the Wind River Workbench
|
||||
workspace folder. This is where the simulator looks for the filesystem.
|
||||
|
||||
7. Include Entropy:
|
||||
@@ -59,83 +65,99 @@ and output the status for each as a success or failure. The benchmark applicatio
|
||||
|
||||
1. Include the following at the top of usrAppInit.c:
|
||||
|
||||
#include <wolfcrypt/test/test.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/test.h>
|
||||
extern int benchmark_test(void* args);
|
||||
```c
|
||||
#include <wolfcrypt/test/test.h>
|
||||
#include <wolfssl/ssl.h>
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/test.h>
|
||||
extern int benchmark_test(void* args);
|
||||
```
|
||||
2. In `usrAppInit.c`, make a call to the wolfCrypt test and benchmark applications
|
||||
by adding the following to the `usrAppInit()` function:
|
||||
|
||||
2. In usrAppInit.c, make a call to the wolfCrypt test and benchmark applications
|
||||
by adding the following to the usrAppInit() function:
|
||||
```c
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
tcp_ready* signal;
|
||||
callback_functions *callbacks;
|
||||
} func_args;
|
||||
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
tcp_ready* signal;
|
||||
callback_functions *callbacks;
|
||||
} func_args;
|
||||
func_args args;
|
||||
|
||||
func_args args;
|
||||
|
||||
wolfcrypt_test(&args);
|
||||
benchmark_test(&args);
|
||||
wolfcrypt_test(&args);
|
||||
benchmark_test(&args);
|
||||
```
|
||||
|
||||
3. Right click on the project and select "Build Project".
|
||||
|
||||
4. To run the VxWorks simulator, click the dropdown list next to "VxWorks Simulator" at the top of Workbench and go to "Open Connection Details". Add the correct Kernel Image file. This will be located in ```workspace/<project_name>/default/vxWorks```. Click Apply. Start the simulator by clicking the green, "Connect 'VxWorks Simulator'" button to the right of the "VxWorks Simulator" dropdown list. Verify in the simulator terminal that all wolfCrypt tests pass.
|
||||
4. To run the VxWorks simulator, click the dropdown list next to "VxWorks Simulator" at the top of Workbench and go to "Open Connection Details". Add the correct Kernel Image file. This will be located in `workspace/<project_name>/default/vxWorks`. Click Apply. Start the simulator by clicking the green, "Connect 'VxWorks Simulator'" button to the right of the "VxWorks Simulator" dropdown list. Verify in the simulator terminal that all wolfCrypt tests pass.
|
||||
|
||||
##### 2.2 Example Client
|
||||
The wolfSSL example client.c file can be found in ```<path_to_wolfssl>/wolfssl/examples/client```.
|
||||
The wolfSSL example client.c file can be found in `<path_to_wolfssl>/wolfssl/examples/client`.
|
||||
|
||||
1. Add the following include to usrAppInit.c:
|
||||
1. Add the following include to `usrAppInit.c`:
|
||||
|
||||
#include <examples/client/client.h>
|
||||
```c
|
||||
#include <examples/client/client.h>
|
||||
```
|
||||
|
||||
2. In usrAppInit.c, include the func\_args as described in the Test Application
|
||||
2. In `usrAppInit.c`, include the `func_args` as described in the Test Application
|
||||
section, and add a call to the client function:
|
||||
|
||||
client_test(&args);
|
||||
```c
|
||||
client_test(&args);
|
||||
```
|
||||
|
||||
3. The char* host in ```examples/client/client.c``` will need to be changed to the IP address to connect to. For example:
|
||||
3. The `char*` host in `examples/client/client.c` will need to be changed to the IP address to connect to. For example:
|
||||
|
||||
char* host = "192.168.15.1";
|
||||
```c
|
||||
char* host = "192.168.15.1";
|
||||
```
|
||||
|
||||
4. Right click on the project and select "Build Project".
|
||||
|
||||
5. If using the VxWorks Simulator, localhost will not work. NAT should be selected in the Simulator Connection Advanced setup. To do this, click the dropdown button next to VxWorks Simulator at the top of Workbench and select "Open Connection Details". Make sure the correct kernel image file is selected for you project as stated in section 3.1 step 4. Then click Advanced and select NAT as the Network Config. Click OK and Apply.
|
||||
|
||||
6. There is an example server in ```<path_to_wolfssl>``` that can be used for testing the client. wolfSSL will first need to be built. Follow the instructions [here](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html) to do so. See the [wolfSSL manual]( https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-3-getting-started.html) for instructions on setting up the example server. From within ```<path_to_wolfssl>/wolfssl```, the following command can be used to run the server on the host machine:
|
||||
6. There is an example server in `<path_to_wolfssl>` that can be used for testing the client. wolfSSL will first need to be built. Follow the instructions [here](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html) to do so. See the [wolfSSL manual]( https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-3-getting-started.html) for instructions on setting up the example server. From within `<path_to_wolfssl>/wolfssl`, the following command can be used to run the server on the host machine:
|
||||
|
||||
./examples/server/server -d -b
|
||||
```sh
|
||||
./examples/server/server -d -b
|
||||
```
|
||||
|
||||
7. Start the example client in Workbench by following step 3 in section 3.1.
|
||||
|
||||
8. The following output should be expected in the simulator terminal:
|
||||
|
||||
SSL version is TLSv1.2
|
||||
SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
||||
Server response: I hear you fa shizzle!
|
||||
```
|
||||
SSL version is TLSv1.2
|
||||
SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
||||
Server response: I hear you fa shizzle!
|
||||
```
|
||||
|
||||
##### 2.3 Example Server
|
||||
The example server requires more configuration than the client if using the
|
||||
VxWorks simulator.
|
||||
|
||||
Note: The wolfSSL example server and client cannot run at the same time on the VxWorks simulator. Either remove or comment out the ```client_test(&args);``` line.
|
||||
Note: The wolfSSL example server and client cannot run at the same time on the VxWorks simulator. Either remove or comment out the `client_test(&args);` line.
|
||||
|
||||
1. Add the following include to usrAppInit.c:
|
||||
1. Add the following include to `usrAppInit.c`:
|
||||
|
||||
#include </examples/server/server.h>
|
||||
```c
|
||||
#include </examples/server/server.h>
|
||||
```
|
||||
|
||||
2. In usrAppInit.c, after the ```func_args args;``` call, add:
|
||||
2. In `usrAppInit.c`, after the `func_args args;` call, add:
|
||||
|
||||
tcp_ready ready;
|
||||
ready.ready = 0;
|
||||
ready.port = 0;
|
||||
args.signal = &ready;
|
||||
|
||||
server_test(&args);
|
||||
```c
|
||||
tcp_ready ready;
|
||||
ready.ready = 0;
|
||||
ready.port = 0;
|
||||
args.signal = &ready;
|
||||
|
||||
server_test(&args);
|
||||
```
|
||||
3. Right click on the project and select "Build Project".
|
||||
|
||||
4. Start the server and complete the following:
|
||||
@@ -144,39 +166,47 @@ Note: The wolfSSL example server and client cannot run at the same time on the V
|
||||
192.168.200.1 as the IP address. To connect to the server running on the VxWorks Simulator, enter these commands
|
||||
into the host machine's terminal from any directory (for Ubuntu 14.04):
|
||||
|
||||
sudo openvpn --mktun --dev tap0
|
||||
```sh
|
||||
sudo openvpn --mktun --dev tap0
|
||||
```
|
||||
|
||||
Note: openvpn may need to be installed first.
|
||||
**Note:** openvpn may need to be installed first.
|
||||
|
||||
In Wind River directory on the host machine:
|
||||
|
||||
sudo vxworks-7/host/x86-linux2/bin/vxsimnetd
|
||||
```sh
|
||||
sudo vxworks-7/host/x86-linux2/bin/vxsimnetd
|
||||
```
|
||||
|
||||
This will start the vxsimnetd application. Leave it running in the background.
|
||||
|
||||
5. There is an example client in ```<path_to_wolfssl>/wolfssl/examples``` . Again, wolfSSL will first need to be built. Follow the instructions [here](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html) to do so. See the [wolfSSL manual]( https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-3-getting-started.html) for instructions on how to set up the client. From within ```<path_to_wolfssl>/wolfssl``` , the following command can be used to run the client on the host machine:
|
||||
5. There is an example client in `<path_to_wolfssl>/wolfssl/examples` . Again, wolfSSL will first need to be built. Follow the instructions [here](https://www.wolfssl.com/wolfSSL/Docs-wolfssl-manual-2-building-wolfssl.html) to do so. See the [wolfSSL manual]( https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-3-getting-started.html) for instructions on how to set up the client. From within `<path_to_wolfssl>/wolfssl` , the following command can be used to run the client on the host machine:
|
||||
|
||||
./examples/client/client -h 192.168.200.1
|
||||
```sh
|
||||
./examples/client/client -h 192.168.200.1
|
||||
```
|
||||
|
||||
6. The following output should be expected in the simulator terminal:
|
||||
|
||||
SSL version is TLSv1.2
|
||||
SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
||||
Client message: hello wolfssl!
|
||||
```
|
||||
SSL version is TLSv1.2
|
||||
SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
|
||||
Client message: hello wolfssl!
|
||||
```
|
||||
|
||||
#### 3 Necessary Files if Using VxWorks Simulator
|
||||
The following files are required to replicate this build:
|
||||
* vxsim\_linux\_1\_0\_2\_2 (directory)
|
||||
* compilers/gnu-4.8.1.5/include/c++/4.8
|
||||
* compilers/gnu-4.8.1.5/include/c++/4.8/i586-wrs-vxworks
|
||||
* compilers/gnu-4.8.1.5/lib/gcc/i586-wrs-vxworks/4.8.1/include
|
||||
* compilers/gnu-4.8.1.5/lib/gcc/i586-wrs-vxworks/4.8.1/include-fixed
|
||||
* vsb\_vxsim\_linux/share/h
|
||||
* vsb\_vxsim\_linux/krnl/h/system
|
||||
* vsb\_vxsim\_linux/krnl/h/public
|
||||
* vsb\_vxsim\_linux/krnl/configlette
|
||||
* vsb\_vxsim\_linux/h
|
||||
* `vxsim_linux_1_0_2_2` (directory)
|
||||
* `compilers/gnu-4.8.1.5/include/c++/4.8`
|
||||
* `compilers/gnu-4.8.1.5/include/c++/4.8/i586-wrs-vxworks`
|
||||
* `compilers/gnu-4.8.1.5/lib/gcc/i586-wrs-vxworks/4.8.1/include`
|
||||
* `compilers/gnu-4.8.1.5/lib/gcc/i586-wrs-vxworks/4.8.1/include-fixed`
|
||||
* `vsb_vxsim_linux/share/h`
|
||||
* `vsb_vxsim_linux/krnl/h/system`
|
||||
* `vsb_vxsim_linux/krnl/h/public`
|
||||
* `vsb_vxsim_linux/krnl/configlette`
|
||||
* `vsb_vxsim_linux/h`
|
||||
|
||||
Note: This project was tested with a pre-built image in the VxWorks distribution
|
||||
called vip\_vxsim\_linux\_gnu.
|
||||
called `vip_vxsim_linux_gnu`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user