wolfssl/IDE/WORKBENCH
2015-10-29 13:41:17 -06:00
..
include.am fixup WORKBENCH autoconf 2015-09-29 11:57:52 -07:00
README.md Workbench readme update 2015-10-29 13:41:17 -06:00

Wind River Workbench using VxWorks with wolfSSL

###1 SETUP: ####1.1 Steps

  1. Start by creating a new VxWorks image in Workbench by going to File > New > Project and then select VxWorks Image Project.
  2. Include the path to the wolfSSL header files(wolfssl/wolfssl): Right click the project and go to Properties > Build Properties > Paths. Choose Browse and select the wolfssl directory. Click ok.
  3. Add preprocessor definitions: Right click on project, go to Properties > Build Properties > Variables. Highlight EXTRA_DEFINE. Click Edit and add the following to this line: -DWOLFSSL_VXWORKS. This can also be done in wolfssl/wolfcrypt/settings.h by uncommenting the #define WOLFSSL_VXWORKS line. If there is not a filesystem set up, add -DUSE_CERT_BUFFERS_2048 and -DNO_FILESYSTEM to the variables or #define USE_CERT_BUFFERS_2048 and #define NO_FILESYSTEM at the top of settings.h. If there is a filesystem, paths may need to be changed to the path of filesystem for certificate files in wolfssl/test.h.
  4. Right click on the project and go to Import > Filesystem. Choose the path to the wolfSSL library here. Uncheck everything except the src and wolfcrypt directories. In the wolfcrypt/src folder, uncheck aes_asm.asm and aes_asm.s.
  5. If NO__DEV_RANDOM remains defined in wolfssl/wolfcrypt/settings.h under #ifdef WOLFSSL_VXWORKS, a new GenerateSeed() function will need to be defined in wolfcrypt/src/random.c.

####1.2 Testing wolfSSL with VxWorks: #####1.2.1 wolfCrypt Test Application The wolfCrypt test application will test each of the cryptographic algorithms and output the status for each. This should return success for each algorithm if everything is working.

  1. In usrAppInit.c, make a call to the wolfCrypt test application by adding the following to the usrAppInit() function:

    typedef struct func_args { int argc; char** argv; int return_code; } func_args;

    func_args args;

    wolfcrypt_test(&args);

  2. Include these header files in usrAppInit.c: #include <wolfcrypt/test/test.h> #include <wolfssl/ssl.h> #include <wolfssl/wolfcrypt/settings.h> #include <wolfssl/test.h>

  3. Start the simulator and check that all wolfCrypt tests pass. If there is a certificate file error, adjust the caCert file locations in wolfcrypt/test/test.c or wolfssl/test.h to those of the filesystem in use.

#####1.2.2 Example Client The wolfSSL example client can be found in wolfssl/examples/client.

  1. Add client.c and client.h from the examples/client folder to the Workbench project.
  2. In usrAppInit.c, inlucde the func_args as described in the Test Application section, and add a call to the client function: client_test(&args);
  3. Add the client.h header file to the includes at the top of usrAppInit.c.
  4. The wolfSSLIP will need to be changed to the IP address the server is running on. If using the VxWorks Simulator, localhost will not work. NAT should be selected in the Simulator Connection Advanced setup.
  5. Start the example server from within the wolfSSL directory on the host machine: ./examples/server/server -d -b The -d option disables peer checks, -b allows for binding to any interface.
  6. Start the example client in Workbench.

#####1.2.3 Example Server The example server requires more configuration than the client if using the VxWorks simulator.

  1. Add server.c and server.h from the wolfssl/examples/server folder to the Workbench project.
  2. In usrAppInit.c, inlcude the func\args as described in the Test and Client applications and add a call to the server function: server_test(&args);
  3. Add the server.h header file to the includes at the top of usrAppInit.c.
  4. Start the server by following the directions in Section 2 for setting up the VxWorks Simulator.
  5. Start the client on the host machine: ./examples/client/client -d The -d option disables peer checks. Note: If there are certificate file errors, the file paths in wolfssl/test.h will need to be adjusted to follow the paths located on the filesystem used by the VxWorks project. ####1.3 Necessary Files The following files are required to replicate this build:
  • vxsim_linux_1_0_2_2 (directory)
  • Includes
    • 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
  • usrAppInit.c (should be created when with new VxWorks image)
    • Include this at the top: #include <wolfssl/wolfcrypt/settings.h> #include <wolfcrypt/test/test.h> #include <wolfssl/ssl.h> /* name change portability layer / #include <wolfssl/test.h> extern int benchmark_test(void args); extern THREAD_RETURN WOLFSSL_THREAD client_test(void* args); extern THREAD_RETURN WOLFSSL_THREAD server_test(void* args);
    • Inside main function UsrAppInit (void): func_args args = { 0 }; tcp_ready ready; InitTcpReady(&ready); args.signal = &ready; benchmark_test(NULL); wolfcrypt_test(NULL); /* client_test(NULL); */ /server_test(&args);/
  • usrRtpAppInit.c (should be created when with new VxWorks image) Leave unchanged
  • This project was tested with a pre-built image in the VxWorks distribution called vsb_vxsim_linux.

###2 VXWORKS SIMULATOR: ######The VxWorks simulator was used for testing the wolfSSL example applications (server, client, benchmark, and test). ######These are the steps to reproduce this testing method.

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 192.168.200.1 as the IP address.

To connect to a server running on the VxWorks Simulator, enter these commands into the host terminal (for Ubuntu 14.04): sudo openvpn --mktun --dev tap0 In Wind River directory: sudo vxworks-7/host/x86-linux2/bin/vxsimnetd This will start the vxsimnetd application. Leave it open. The IP address to connect to the server is the same as above.