
|
My Project
|
Right click on the project and go to Import > General > Filesystem. Click Next. 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
Uncheck "Create top level folder". Click Finish.
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>/
Click "OK" then "OK" again.
<path_to_wolfssl>/wolfssl/wolfcrypt/settings.h, uncomment #define WOLFSSL_VXWORKS
Note: pthreads defined by default
If using the VxWorks simulator add the following to EXTRA_DEFINE:
-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.
<path_to_wolfssl>/ to the Wind River Workbench workspace folder. This is where the simulator looks for the filesystem.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.
#include <wolfcrypt/test/test.h> #include <wolfssl/ssl.h> #include <wolfssl/wolfcrypt/settings.h> #include <wolfssl/test.h> extern int benchmark_test(void* args);
typedef struct func_args {
int argc;
char** argv;
int return_code;
tcp_ready* signal;
callback_functions *callbacks;
} func_args;
func_args args;
wolfcrypt_test(&args);
benchmark_test(&args);
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.The wolfSSL example client.c file can be found in <path_to_wolfssl>/wolfssl/examples/client.
#include <examples/client/client.h>
client_test(&args);
examples/client/client.c will need to be changed to the IP address to connect to. For example: char* host = "192.168.15.1";
<path_to_wolfssl> that can be used for testing the client. wolfSSL will first need to be built. Follow the instructions here to do so. See the wolfSSL manual 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
SSL version is TLSv1.2 SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 Server response: I hear you fa shizzle!
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.
#include </examples/server/server.h>
func_args args; call, add: tcp_ready ready; ready.ready = 0; ready.port = 0; args.signal = &ready; server_test(&args);
Start the server and complete the following: Go to "Open Connection Details" under VxWorks Simulator which is in the connections 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 machine's terminal from any directory (for Ubuntu 14.04):
sudo openvpn --mktun --dev tap0
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.
<path_to_wolfssl>/wolfssl/examples . Again, wolfSSL will first need to be built. Follow the instructions here to do so. See the wolfSSL manual 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
SSL version is TLSv1.2 SSL cipher suite is TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 Client message: hello wolfssl!
The following files are required to replicate this build:
Note: This project was tested with a pre-built image in the VxWorks distribution called vip_vxsim_linux_gnu.