Update README.md
This commit is contained in:
parent
01e649210d
commit
ba92b2db7b
@ -21,13 +21,20 @@ Project and then selecting VxWorks Image Project.
|
||||
|
||||
2. Right click on the project and go to Import > General > Filesystem. Choose the path
|
||||
to the wolfSSL library here. Uncheck everything except the examples, src and
|
||||
wolfcrypt directories.
|
||||
In the wolfcrypt/src folder, uncheck aes\_asm.asm and aes\_asm.s.
|
||||
wolfcrypt directories. Uncheck the following:
|
||||
|
||||
wolfcrypt/src/aes\_asm.asm
|
||||
wolfcrypt/src/aes\_asm.s
|
||||
examples/echoclient/
|
||||
examples/echoserver/
|
||||
wolcrypt/user-crypto
|
||||
|
||||
Leave "Create top level folder" unchecked. Click Finish.
|
||||
|
||||
3. To include the path to the wolfSSL header files, right click on the project and go to Properties > Build Properties > Paths.
|
||||
Choose Browse and select:
|
||||
|
||||
<path_to_wolfssl>/wolfssl
|
||||
<path_to_wolfssl>/
|
||||
|
||||
Click ok.
|
||||
|
||||
@ -40,10 +47,14 @@ Highlight EXTRA\_DEFINE. Click Edit and add the following to this line:
|
||||
-DUSE_CERT_BUFFERS_2048 -DNO_FILESYSTEM
|
||||
|
||||
USE\_CERT\_BUFFERS is only necessary for the wolfCrypt test and benchmark applications.
|
||||
|
||||
6. If using a filesystem and running the wolfCrypt test and benchmark applications, copy the certs folder in \<path\_to\_wolfssl\>/wolfssl to the Wind River Workbench workspace folder. This is where the simulator looks for the filesystem.
|
||||
|
||||
6. If using the VxWorks simulator add the following to EXTRA\_DEFINE:
|
||||
|
||||
7. If NO\_DEV\_RANDOM is defined in \<path\_to\_wolfssl\>wolfssl/wolfcrypt/settings.h inside the
|
||||
-DVXWORKS_SIM /* only if using the VxWorks simulator */
|
||||
|
||||
7. If using a filesystem and running the wolfCrypt test and benchmark applications, copy the certs folder in \<path\_to\_wolfssl\>/wolfssl to the Wind River Workbench workspace folder. This is where the simulator looks for the filesystem.
|
||||
|
||||
8. If NO\_DEV\_RANDOM is defined in \<path\_to\_wolfssl\>wolfssl/wolfcrypt/settings.h inside the
|
||||
\#ifdef WOLFSSL\_VXWORKS block, a new GenerateSeed() function will need to be defined
|
||||
in wolfcrypt/src/random.c.
|
||||
|
||||
@ -53,36 +64,40 @@ The wolfCrypt test application will test each of the cryptographic algorithms
|
||||
and output the status for each as a success or failure. The benchmark application will output the runtime of
|
||||
the cryptographic algorithms in milliseconds.
|
||||
|
||||
1. Include these header files in usrAppInit.c:
|
||||
1. Include the following at the top of usrAppInit.c:
|
||||
|
||||
#include <wolfcrypt/test/test.h>
|
||||
#include <wolfcrypt/benchmark/benchmark.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:
|
||||
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
char** argv;
|
||||
int return_code;
|
||||
} 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);
|
||||
wolfcrypt_benchmark(&args);
|
||||
3. Right click on the project and select "Build Project".
|
||||
|
||||
3. Start the simulator by clicking the "Connect 'VxWorks Simulator'" button to the right of the "VxWorks Simulator" dropdown. 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.
|
||||
|
||||
#####3.2 Example 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:
|
||||
|
||||
#include </examples/client/client.h>
|
||||
#include <examples/client/client.h>
|
||||
|
||||
2. In usrAppInit.c, include the func\_args as described in the Test Application
|
||||
section, and add a call to the client function:
|
||||
@ -93,15 +108,17 @@ section, and add a call to the client function:
|
||||
|
||||
char* host = "192.168.15.1";
|
||||
|
||||
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 image file is selected for you project: <Project\_Dir>/default/VxWorks. Then click Advanced and select NAT as the Network Config. Click OK and Apply.
|
||||
4. Right click on the project and select "Build Project".
|
||||
|
||||
4. 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:
|
||||
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:
|
||||
|
||||
./examples/server/server -d -b
|
||||
|
||||
5. Start the example client in Workbench by following step 3 in section 3.1.
|
||||
7. Start the example client in Workbench by following step 3 in section 3.1.
|
||||
|
||||
6. The following output should be expected in the simulator terminal:
|
||||
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
|
||||
@ -109,42 +126,48 @@ section, and add a call to the client function:
|
||||
|
||||
#####3.3 Example Server
|
||||
The example server requires more configuration than the client if using the
|
||||
VxWorks simulator.
|
||||
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.
|
||||
|
||||
1. Add the following include to usrAppInit.c:
|
||||
|
||||
#include </examples/server/server.h>
|
||||
|
||||
2. In usrAppInit.c, add:
|
||||
2. In usrAppInit.c, after the ```func_args args;``` call, add:
|
||||
|
||||
func_args args = { 0 };
|
||||
tcp_ready ready;
|
||||
InitTcpReady(&ready);
|
||||
args.signal = &ready;
|
||||
tcp_ready ready;
|
||||
ready.ready = 0;
|
||||
ready.port = 0;
|
||||
args.signal = &ready;
|
||||
|
||||
server_test(&args);
|
||||
|
||||
3. Start the server and complete the following:
|
||||
3. Right click on the project and select "Build Project".
|
||||
|
||||
4. Start the server and complete the following:
|
||||
Go to "Open Connection Details" under VxWorks Simulator which is in the connections
|
||||
dropdown. Choose the corresponding kernel image, typically called
|
||||
project/default/VxWorks. Select simnetd from the dropdown and enter
|
||||
dropdown. Follow step 4 of section 3.1 to select the correct kernel image for the simulator. In "Open Connection Details" of the simulator, go to "Advanced...". Select simnetd from the Network Config dropdown and enter
|
||||
192.168.200.1 as the IP address. To connect to the server running on the VxWorks Simulator, enter these commands
|
||||
into the host terminal from any directory (for Ubuntu 14.04):
|
||||
into the host machine's terminal from any directory (for Ubuntu 14.04):
|
||||
|
||||
sudo openvpn --mktun --dev tap0
|
||||
|
||||
In Wind River directory:
|
||||
Note: openvpn may need to be installed first.
|
||||
|
||||
In Wind River directory on the host machine:
|
||||
|
||||
sudo vxworks-7/host/x86-linux2/bin/vxsimnetd
|
||||
|
||||
This will start the vxsimnetd application. Leave it running in the background.
|
||||
|
||||
4. 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 -d
|
||||
|
||||
The -d option disables peer checks.
|
||||
|
||||
5. The following output should be expected in the simulator terminal:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user