diff --git a/IDE/ECLIPSE/DEOS/README.md b/IDE/ECLIPSE/DEOS/README.md index 5c67896d0..711846a38 100644 --- a/IDE/ECLIPSE/DEOS/README.md +++ b/IDE/ECLIPSE/DEOS/README.md @@ -1,71 +1,64 @@ - - # Deos Port + ## Overview -You can enable the wolfSSL support for Deos RTOS available [here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using the `#define WOLFSSL_DEOS`. -Deos is a time & space partitioned, multi-core enabled, DO-178C DAL A certifiable RTOS. + +You can enable the wolfSSL support for Deos RTOS available +[here](https://www.ddci.com/products_deos_do_178c_arinc_653/) using +the `#define WOLFSSL_DEOS`. Deos is a time & space partitioned, +multi-core enabled, DO-178C DAL A certifiable RTOS. + ## Usage -You can start with your OpenArbor IDE-based example project for Deos with the network stack (lwip) to integrate wolfSSL source code. +You can start with your OpenArbor IDE-based example project for Deos +with the network stack (lwip) to integrate wolfSSL source code. -wolfSSL supports a compile-time user configurable options in the `IDE/ECLIPSE/DEOS/user_settings.h` file. +wolfSSL supports a compile-time user configurable options in the +`IDE/ECLIPSE/DEOS/user_settings.h` file. -The `tls_wolfssl.c` example application provides a simple function to run the selected examples at compile time through the following four #defines in user_settings.h. You can undefine any of these macro options to run a test. -``` - 1. #undef NO_CRYPT_TEST - 2. #undef NO_CRYPT_BENCHMARK - 3. #undef NO_WOLFSSL_CLIENT - 4. #undef NO_WOLFSSL_SERVER -``` -Do one of the following steps for building and running wolfSSL with the Deos kernel examples, which are included in the DDS release: -If you want to create a project from scratch, skip the Importing the project section and follow the steps in the other sections. +### Importing the project -If you want to use an pre-configured example project, go to the Importing the project section, skip the other sections and follow the Building and Running section. - -#### Importing the project In this section you will import a pre-configured example project. + +Note: To work wolfssl directory must not be under the workspace directory. + 1. Launch the OpenArbor IDE as an administrator -2. In the Workspace Launcher dialog, in the Workspace field, enter your -workspace +2. In the Workspace Launcher dialog, in the Workspace field, enter + your workspace 3. Right-click in the Project Explorer view and select Import -4. In the Import dialog, select General > Existing Projects into Workspace, then click Next. -5. In the Import Projects dialog, select Select archive file, then browse to `IDE/ECLIPSE/DEOS/` and double-click `deosWolfssl.zip` file +4. In the Import dialog, select General > Existing Projects into + Workspace, then click Next. +5. In the Import Projects dialog, select `Select root directory` and + browse to `IDE/ECLIPSE/DEOS/deos_wolfssl` and select the wolfssl + project 6. In the Import Projects dialog, click Finish +#### Dependencies + +* ansi +* gnu-language +* deos-time + +### Setting up a Deos project with wolfSSL + +The `tls_wolfssl.c` example application provides a simple function to +run the selected examples at compile time through the following four +`#defines` in `user_settings.h`. You can undefine any of these macro +options to run a test. -#### Setting up a Deos project with wolfSSL - 1. Download the wolfSSL source code or a zip file from GitHub. You can remove all of the files except for these folders and its contents. The top folder for this example is wolfsslPort. ``` -wolfsslPort - |-- IDE - | -- ECLIPSE - | -- DEOS - |-- src - |-- wolfcrypt - | -- benchmark - | -- src - | -- test - |-- wolfssl - |-- openssl - |-- wolfcrypt - |-- port +#undef NO_CRYPT_TEST +#undef NO_CRYPT_BENCHMARK +#undef NO_WOLFSSL_CLIENT +#undef NO_WOLFSSL_SERVER ``` - 2. Remove these two platform specific assembly source files: - - wolfsslPort/wolfcrypt/src/aes_asm.asm - - wolfsslPort/wolfcrypt/src/aes_asm.S - 3. Launch the OpenArbor IDE as an administrator - 4. Create a DDC-I Deos example project. In the main menu, go to File >DDC-I Deos example project > socket > udp-vs-tcp - 5. Import the `wolfSSLPort` source code into your project. - - Right-click the ` udp-vs-tcp` project and choose File -> Import. - - Expand the General folder and select File System, then click Next. You should now see the Import File system dialog. - - Browse to the location containing the wolfSSL code and choose OK. Select the `wolfsslPort` folder and check the `Create top-level folder` button, then select Finish. You should see the folder hierarchy the same as wolfSSL folder structures. -6. Review the configuration in $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h +1. Launch the OpenArbor IDE -7. Review the custom malloc/realloc/free configuration $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/deos_malloc.c . Memory allocated with malloc() is never freed. +2. Create a DDC-I Deos example project. In the main menu, go to File > + DDC-I Deos example project > socket > udp-vs-tcp + +3. Customize your config/udp-vs-tcp.pd.xml with the following changes: -#### Configuring the Deos Project - 1. Customize your config/udp-vs-tcp.pd.xml with the following changes: ``` ``` -Depending on your configuration, wolfSSL uses upto four mutexes. You also need to configure enough memory for the stack of each threads and the process logical memory pool. +Depending on your configuration, wolfSSL uses upto four mutexes. You +also need to configure enough memory for the stack of each threads and +the process logical memory pool. + +4. Right click on the `udp-vs-tcp` project, select properties and add + the following macros in the DDC-I Options > C Compile > + Preprocessor + + * WOLFSSL_USER_SETTINGS + +5. Add the following directory paths in the DDC-I Options > C Compile > + Directories and in the DDC-I Options > C++ Compile > Directories + + * $(PROJECT_DIR.wolfssl)/../../../.. + * $(PROJECT_DIR.wolfssl)/.. + * $(PROJECT_DIR.printx)/code + +6. Add the following library dependencies in the + DDC-I Options > Deos > Dependencies + + * math + * ansi + * deos-time + + For benchmark and test code: + + * printx - You must add printx into your workspace, File >DDC-I + Deos example project > training > printx + +7. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to + customize your configuration. For example, you can undef or define + these tests. + + * `#undef NO_CRYPT_TEST` + * `#undef NO_CRYPT_BENCHMARK` + * `#undef NO_WOLFSSL_CLIENT` + * `#undef NO_WOLFSSL_SERVER` + +8. Edit your application source file where main() thread is defined +and add the following: + + * #include "printx.h" + * #include "tls_wolfssl.h" + * and a call to `wolfsslRunTests()` - 2. Right click on the `udp-vs-tcp` project, select properties and add the following macros in the DDC-I Options > C Compile > Preprocessor - - DEOS_ALLOW_OBSOLETE_DEFINITIONS - - WOLFSSL_USER_SETTINGS - 3. Add the following directory paths in the DDC-I Options > C Compile > Directories and in the DDC-I Options > C++ Compile > Directories - - $(PROJECT_DIR)/wolfsslPort - - $(PROJECT_DIR)/wolfsslPort/wolfssl - - $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS - - $(PROJECT_DIR.printx)/code - 4. Change the optimization level in the DDC-I Options > C Compile > Code Generation > Optimization level:g - - g - 5. Add the following library dependencies in the DDC-I Options > Deos > Dependencies - - math - - dart - - ansi - - printx - - You must add printx into your workspace, File >DDC-I Deos example project > training > printx - 6. Edit $(PROJECT_DIR)/wolfsslPort/IDE/ECLIPSE/DEOS/user_setting.h to customize your configuration. For example, you can undef or define these tests. - - #undef NO_CRYPT_TEST - - #undef NO_CRYPT_BENCHMARK - - #undef NO_WOLFSSL_CLIENT - - #undef NO_WOLFSSL_SERVER - 7. Edit your application source file where main() thread is defined and add the following: - - #include "printx.h" - - #include "tls_wolfssl.h" - - and a call to `wolfsslRunTests()` Here's an example: + ``` #include #include @@ -137,7 +149,10 @@ int main(void) } ``` - 8. Review $(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config configuration. + +9. Review `$(PROJECT_DIR)/udp-vs-tcp/mailbox-transport.config` + configuration. + ``` transportConfigurationId 2 # Client thread quota - for client and server TCP @@ -166,45 +181,62 @@ userServiceThread # Server thread template name / ``` - #### Building and Running - 1. Build your project, then load and run your image on a target platform. Review the test results on the console output. +#### Building and Running + +1. Build your project, then load and run your image on a target + platform. Review the test results on the console output. ### `wolfcrypt_test()` -wolfcrypt_test() prints a message on the target console similar to the following output: + +`wolfcrypt_test()` prints a message on similar to the following: + ``` error test passed! base64 test passed! asn test passed! ... ``` + This example doesn't show the whole output. ### `benchmark_test()` -benchmark_test() prints a message on the target console similar to the following output. + +`benchmark_test()` prints a message on the similar to the following: ``` ------------------------------------------------------------------------------ - wolfSSL version 3.15.5 +wolfSSL version 4.6.0 ------------------------------------------------------------------------------ wolfCrypt Benchmark (block bytes 1024, min 1.0 sec each) -RNG 225 KB tooks 1.026 seconds, 219.313 KB/s -AES-128-CBC-enc 250 KB toks 1.105 seconds 226.210 KB/s -AES-128-CBC-dec 225 KB tooks 1.005 seconds, 223.922 KB/s +RNG 2 MB took 1.000 seconds, 2.124 MB/s +AES-128-CBC-enc 5 MB took 1.000 seconds, 5.127 MB/s +AES-128-CBC-dec 5 MB took 1.000 seconds, 4.907 MB/s +AES-192-CBC-enc 5 MB took 1.000 seconds, 4.736 MB/s +AES-192-CBC-dec 5 MB took 1.000 seconds, 4.761 MB/s ... ``` + This example doesn't show the whole output. ### `wolfssl_client_test()` -You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros in the `tls_wolfssl.c` file to configure the host address and port. You will also need to define the server certificate. The example client uses the GET request to get a web resource from the server at https://google.com. +You can modify the `TCP_SERVER_IP_ADDR` and `TCP_SERVER_PORT` macros +in the `tls_wolfssl.c` file to configure the host address and +port. You will also need to define the server certificate. The example +client uses the GET request to get a web resource from the server at +https://google.com. ### `wolfssl_server_test()` -You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to configure the port number to listen on a local-host. -Once you start the TLS server and `Listening for client connection` displays on the serial console, the server is ready to accept client connections. +You can modify the `TLS_SERVER_PORT` in the `tls_wolfssl.c` file to +configure the port number to listen on a local-host. Once you start +the TLS server and `Listening for client connection` displays on the +serial console, the server is ready to accept client connections. + +You can connect to the server using the wolfssl TLS client example +from your Linux or Windows host as follows: -You can connect to the server using the wolfssl TLS client example from your Linux or Windows host as follows: ``` $ ./examples/client/client.exe -h TLS_SERVER_IP_ADDRESS @@ -218,8 +250,10 @@ I hear ya fa shizzle! ## References -The test results were collected from the qemu-x86 reference platform target with the following software and tool chains: -- OpenArbor, eclipse based IDE, toolVersion = "3.31.0" +The following software and tool chains were used for testing: + +- OpenArbor 7.0.0 - wolfssl [latest version](https://github.com/wolfSSL/wolfssl) -For more information or questions, please email [support@wolfssl.com](mailto:support@wolfssl.com) +For more information or questions, please email +[support@wolfssl.com](mailto:support@wolfssl.com) diff --git a/IDE/ECLIPSE/DEOS/deos_malloc.c b/IDE/ECLIPSE/DEOS/deos_malloc.c index 3a9c140a2..f56dd5620 100644 --- a/IDE/ECLIPSE/DEOS/deos_malloc.c +++ b/IDE/ECLIPSE/DEOS/deos_malloc.c @@ -19,27 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ #include -#include - -#define ROUND_UP(x, align) (((int) (x) + (align - 1)) & ~(align - 1)) -#define SIZEOF_HEADER sizeof(size_t) /* tracks size of allocated block */ - -#define HEAP_SIZE_MAX (1*1024*1024) - -static size_t allocatedMemory = 0; - -size_t getMemAllocatedSize_deos(size_t* size){ - - if (size) - *size = allocatedMemory; - - return allocatedMemory; -} - -/* Simply returns without freeing any memory. */ +#include +#include void free_deos(void *ptr) { - //printf("fake free_deos()\n"); + free(ptr); return; } @@ -51,10 +35,6 @@ void *realloc_deos(void *ptr, size_t size) { newptr = malloc_deos(size); if (ptr != NULL && newptr != NULL) { - - if ( *((char *)ptr - SIZEOF_HEADER) < *((char *)newptr - SIZEOF_HEADER)) - size = *((char *)ptr - SIZEOF_HEADER); - XMEMCPY((char *) newptr, (const char *) ptr, size); free_deos(ptr); } @@ -63,46 +43,5 @@ void *realloc_deos(void *ptr, size_t size) { } void *malloc_deos(size_t size) { - PDEOS_SYSTEM_INFO systemInfoPtr; - static VirtualAddressTYP heapAddr = NULL; - static VirtualAddressTYP freeAddr = NULL; - VirtualAddressTYP retAddr = NULL; - DWORD allocationSize = 0; - static int initialized = 0; - - if (size <= 0) - return NULL; - - if (!initialized) { - systemInfoPtr = (PDEOS_SYSTEM_INFO)getSystemInfoDEOS(); - freeAddr = (VirtualAddressTYP)getNextLibraryStartAddress(); - allocationSize = (((HEAP_SIZE_MAX - 1) / systemInfoPtr->dwPageSize) + 1) * - systemInfoPtr->dwPageSize; - - if (virtualAllocDEOS(freeAddr, allocationSize) != allocSuccess){ - printf("ERROR: virtualAllocDEOS failed\n"); - return NULL; - } - - setNextLibraryStartAddress(freeAddr + allocationSize); - heapAddr = freeAddr; - - initialized = 1; - } - - size = ROUND_UP(size, sizeof(size_t)); - - if ((size + SIZEOF_HEADER) > (HEAP_SIZE_MAX - (freeAddr - heapAddr))){ - printf("ERROR: malloc_deos cannot allocate from heap memory anymore\n"); - return NULL; - } - - *freeAddr = size; - freeAddr += SIZEOF_HEADER; - retAddr = freeAddr; - XMEMSET(retAddr, 0, size); - freeAddr += size; - allocatedMemory += size; - - return retAddr; + return malloc(size); } diff --git a/IDE/ECLIPSE/DEOS/deos_wolfssl/.cproject b/IDE/ECLIPSE/DEOS/deos_wolfssl/.cproject new file mode 100644 index 000000000..48ac73bc1 --- /dev/null +++ b/IDE/ECLIPSE/DEOS/deos_wolfssl/.cproject @@ -0,0 +1,344 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IDE/ECLIPSE/DEOS/deos_wolfssl/.options b/IDE/ECLIPSE/DEOS/deos_wolfssl/.options new file mode 100644 index 000000000..eb9d4aeb7 --- /dev/null +++ b/IDE/ECLIPSE/DEOS/deos_wolfssl/.options @@ -0,0 +1,36 @@ + + + 26 + ppc + diagnostic + kernel + video + ansi + math + deos-time + sal + mtl + printx + gnu-language + lib$(PROJECT_NAME).so + $(BINARY) + $(BINARY).dbg + $(DESK_DIR)/arm/include + $(DESK_DIR)/ppc/include + $(DESK_DIR)/x86/include + $(DESK_DIR)/include + $(PROJECT_DIR)/../../../.. + $(PROJECT_DIR)/../../../../fips + $(PROJECT_DIR)/.. + $(PROJECT_DIR.printx)/code + WOLFSSL_USER_SETTINGS + $(DESK_DIR)/arm/appbin + $(DESK_DIR)/ppc/appbin + $(DESK_DIR)/x86/appbin + true + -L $(PROJECT_DIR.printx)/output/powerpc-motorola-elf/diagnostic + none + fips.c + fips_test.c + selftest.c + diff --git a/IDE/ECLIPSE/DEOS/deos_wolfssl/.project b/IDE/ECLIPSE/DEOS/deos_wolfssl/.project new file mode 100644 index 000000000..769c9630e --- /dev/null +++ b/IDE/ECLIPSE/DEOS/deos_wolfssl/.project @@ -0,0 +1,629 @@ + + + wolfssl + + + + + + com.ddci.common.ide.Builder + + + + + + com.ddci.common.ide.DdciNature + com.ddci.common.ide.ExecutableNature + com.ddci.deos.common.deosLoadListNature + com.ddci.common.ide.DEOS_SHARED_OBJECT + org.eclipse.cdt.core.cnature + + + + deos_malloc.c + 1 + WOLFSSL_ROOT/IDE/ECLIPSE/DEOS/deos_malloc.c + + + fips.c + 1 + WOLFSSL_ROOT/fips/fips.c + + + fips_test.c + 1 + WOLFSSL_ROOT/fips/fips_test.c + + + selftest.c + 1 + WOLFSSL_ROOT/fips/selftest.c + + + user_settings.h + 1 + WOLFSSL_ROOT/IDE/ECLIPSE/DEOS/user_settings.h + + + wolfssl + 2 + WOLFSSL_ROOT/wolfssl + + + src/crl.c + 1 + WOLFSSL_ROOT/src/crl.c + + + src/internal.c + 1 + WOLFSSL_ROOT/src/internal.c + + + src/keys.c + 1 + WOLFSSL_ROOT/src/keys.c + + + src/ocsp.c + 1 + WOLFSSL_ROOT/src/ocsp.c + + + src/sniffer.c + 1 + WOLFSSL_ROOT/src/sniffer.c + + + src/ssl.c + 1 + WOLFSSL_ROOT/src/ssl.c + + + src/tls.c + 1 + WOLFSSL_ROOT/src/tls.c + + + src/tls13.c + 1 + WOLFSSL_ROOT/src/tls13.c + + + src/wolfio.c + 1 + WOLFSSL_ROOT/src/wolfio.c + + + wolfcrypt/benchmark + 2 + WOLFSSL_ROOT/wolfcrypt/benchmark + + + wolfcrypt/test + 2 + WOLFSSL_ROOT/wolfcrypt/test + + + wolfcrypt/src/aes.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/aes.c + + + wolfcrypt/src/arc4.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/arc4.c + + + wolfcrypt/src/asm.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/asm.c + + + wolfcrypt/src/asn.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/asn.c + + + wolfcrypt/src/blake2b.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/blake2b.c + + + wolfcrypt/src/blake2s.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/blake2s.c + + + wolfcrypt/src/camellia.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/camellia.c + + + wolfcrypt/src/chacha.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/chacha.c + + + wolfcrypt/src/chacha20_poly1305.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/chacha20_poly1305.c + + + wolfcrypt/src/cmac.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/cmac.c + + + wolfcrypt/src/coding.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/coding.c + + + wolfcrypt/src/compress.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/compress.c + + + wolfcrypt/src/cpuid.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/cpuid.c + + + wolfcrypt/src/cryptocb.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/cryptocb.c + + + wolfcrypt/src/curve25519.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/curve25519.c + + + wolfcrypt/src/curve448.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/curve448.c + + + wolfcrypt/src/des3.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/des3.c + + + wolfcrypt/src/dh.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/dh.c + + + wolfcrypt/src/dsa.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/dsa.c + + + wolfcrypt/src/ecc.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ecc.c + + + wolfcrypt/src/ecc_fp.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ecc_fp.c + + + wolfcrypt/src/ed25519.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ed25519.c + + + wolfcrypt/src/ed448.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ed448.c + + + wolfcrypt/src/error.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/error.c + + + wolfcrypt/src/fe_448.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/fe_448.c + + + wolfcrypt/src/fe_low_mem.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/fe_low_mem.c + + + wolfcrypt/src/fe_operations.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/fe_operations.c + + + wolfcrypt/src/fe_x25519_128.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fe_x25519_128.i + + + wolfcrypt/src/fp_mont_small.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mont_small.i + + + wolfcrypt/src/fp_mul_comba_12.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_12.i + + + wolfcrypt/src/fp_mul_comba_17.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_17.i + + + wolfcrypt/src/fp_mul_comba_20.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_20.i + + + wolfcrypt/src/fp_mul_comba_24.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_24.i + + + wolfcrypt/src/fp_mul_comba_28.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_28.i + + + wolfcrypt/src/fp_mul_comba_3.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_3.i + + + wolfcrypt/src/fp_mul_comba_32.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_32.i + + + wolfcrypt/src/fp_mul_comba_4.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_4.i + + + wolfcrypt/src/fp_mul_comba_48.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_48.i + + + wolfcrypt/src/fp_mul_comba_6.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_6.i + + + wolfcrypt/src/fp_mul_comba_64.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_64.i + + + wolfcrypt/src/fp_mul_comba_7.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_7.i + + + wolfcrypt/src/fp_mul_comba_8.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_8.i + + + wolfcrypt/src/fp_mul_comba_9.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_9.i + + + wolfcrypt/src/fp_mul_comba_small_set.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_mul_comba_small_set.i + + + wolfcrypt/src/fp_sqr_comba_12.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_12.i + + + wolfcrypt/src/fp_sqr_comba_17.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_17.i + + + wolfcrypt/src/fp_sqr_comba_20.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_20.i + + + wolfcrypt/src/fp_sqr_comba_24.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_24.i + + + wolfcrypt/src/fp_sqr_comba_28.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_28.i + + + wolfcrypt/src/fp_sqr_comba_3.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_3.i + + + wolfcrypt/src/fp_sqr_comba_32.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_32.i + + + wolfcrypt/src/fp_sqr_comba_4.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_4.i + + + wolfcrypt/src/fp_sqr_comba_48.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_48.i + + + wolfcrypt/src/fp_sqr_comba_6.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_6.i + + + wolfcrypt/src/fp_sqr_comba_64.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_64.i + + + wolfcrypt/src/fp_sqr_comba_7.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_7.i + + + wolfcrypt/src/fp_sqr_comba_8.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_8.i + + + wolfcrypt/src/fp_sqr_comba_9.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_9.i + + + wolfcrypt/src/fp_sqr_comba_small_set.i + 1 + WOLFSSL_ROOT/wolfcrypt/src/fp_sqr_comba_small_set.i + + + wolfcrypt/src/ge_448.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ge_448.c + + + wolfcrypt/src/ge_low_mem.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ge_low_mem.c + + + wolfcrypt/src/ge_operations.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ge_operations.c + + + wolfcrypt/src/hash.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/hash.c + + + wolfcrypt/src/hc128.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/hc128.c + + + wolfcrypt/src/hmac.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/hmac.c + + + wolfcrypt/src/idea.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/idea.c + + + wolfcrypt/src/integer.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/integer.c + + + wolfcrypt/src/logging.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/logging.c + + + wolfcrypt/src/md2.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/md2.c + + + wolfcrypt/src/md4.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/md4.c + + + wolfcrypt/src/md5.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/md5.c + + + wolfcrypt/src/memory.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/memory.c + + + wolfcrypt/src/pkcs12.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/pkcs12.c + + + wolfcrypt/src/pkcs7.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/pkcs7.c + + + wolfcrypt/src/poly1305.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/poly1305.c + + + wolfcrypt/src/pwdbased.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/pwdbased.c + + + wolfcrypt/src/rabbit.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/rabbit.c + + + wolfcrypt/src/random.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/random.c + + + wolfcrypt/src/rc2.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/rc2.c + + + wolfcrypt/src/ripemd.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/ripemd.c + + + wolfcrypt/src/rsa.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/rsa.c + + + wolfcrypt/src/sha.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sha.c + + + wolfcrypt/src/sha256.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sha256.c + + + wolfcrypt/src/sha3.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sha3.c + + + wolfcrypt/src/sha512.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sha512.c + + + wolfcrypt/src/signature.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/signature.c + + + wolfcrypt/src/sp_arm32.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_arm32.c + + + wolfcrypt/src/sp_arm64.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_arm64.c + + + wolfcrypt/src/sp_armthumb.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_armthumb.c + + + wolfcrypt/src/sp_c32.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_c32.c + + + wolfcrypt/src/sp_c64.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_c64.c + + + wolfcrypt/src/sp_cortexm.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_cortexm.c + + + wolfcrypt/src/sp_dsp32.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_dsp32.c + + + wolfcrypt/src/sp_int.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_int.c + + + wolfcrypt/src/sp_x86_64.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/sp_x86_64.c + + + wolfcrypt/src/srp.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/srp.c + + + wolfcrypt/src/tfm.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/tfm.c + + + wolfcrypt/src/wc_dsp.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/wc_dsp.c + + + wolfcrypt/src/wc_encrypt.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/wc_encrypt.c + + + wolfcrypt/src/wc_pkcs11.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/wc_pkcs11.c + + + wolfcrypt/src/wc_port.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/wc_port.c + + + wolfcrypt/src/wolfevent.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/wolfevent.c + + + wolfcrypt/src/wolfmath.c + 1 + WOLFSSL_ROOT/wolfcrypt/src/wolfmath.c + + + + + WOLFSSL_ROOT + $%7BPARENT-4-PROJECT_LOC%7D + + + diff --git a/IDE/ECLIPSE/DEOS/include.am b/IDE/ECLIPSE/DEOS/include.am index 14a71c89b..88dc9a3ff 100644 --- a/IDE/ECLIPSE/DEOS/include.am +++ b/IDE/ECLIPSE/DEOS/include.am @@ -7,4 +7,7 @@ EXTRA_DIST += \ IDE/ECLIPSE/DEOS/user_settings.h \ IDE/ECLIPSE/DEOS/tls_wolfssl.h \ IDE/ECLIPSE/DEOS/tls_wolfssl.c \ - IDE/ECLIPSE/DEOS/deos_malloc.c \ No newline at end of file + IDE/ECLIPSE/DEOS/deos_malloc.c \ + IDE/ECLIPSE/DEOS/deos_wolfssl/.cproject \ + IDE/ECLIPSE/DEOS/deos_wolfssl/.options \ + IDE/ECLIPSE/DEOS/deos_wolfssl/.project diff --git a/IDE/ECLIPSE/DEOS/user_settings.h b/IDE/ECLIPSE/DEOS/user_settings.h index dbfe4f03a..5f74bc563 100644 --- a/IDE/ECLIPSE/DEOS/user_settings.h +++ b/IDE/ECLIPSE/DEOS/user_settings.h @@ -65,6 +65,8 @@ You can get the current time from https://www.unixtimestamp.com/ #define HAVE_ED25519 #define ED25519_SMALL +#define WOLFSSL_DTLS + /* TLS 1.3 */ #if 0 #define WOLFSSL_TLS13 @@ -103,8 +105,6 @@ You can get the current time from https://www.unixtimestamp.com/ #endif -#define printf printx - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/src/internal.c b/src/internal.c index fcf5a49f3..8507b8592 100644 --- a/src/internal.c +++ b/src/internal.c @@ -7757,7 +7757,7 @@ ProtocolVersion MakeDTLSv1_2(void) word32 LowResTimer(void) { const word32 systemTickTimeInHz = 1000000 / systemTickInMicroseconds(); - word32 *systemTickPtr = systemTickPointer(); + const volatile word32 *systemTickPtr = systemTickPointer(); return (word32) *systemTickPtr/systemTickTimeInHz; } diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 3260d02fc..75069d192 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -61,6 +61,7 @@ #define printf PRINTF #elif defined(WOLFSSL_DEOS) #include + #include #undef printf #define printf printx #elif defined(MICRIUM) @@ -6681,7 +6682,7 @@ void bench_sakke(void) double current_time(int reset) { const uint32_t systemTickTimeInHz = 1000000 / systemTickInMicroseconds(); - uint32_t *systemTickPtr = systemTickPointer(); + const volatile uint32_t *systemTickPtr = systemTickPointer(); (void)reset; diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index 79e742919..434f92faf 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -2252,14 +2252,14 @@ time_t pic32_time(time_t* timer) time_t deos_time(time_t* timer) { const word32 systemTickTimeInHz = 1000000 / systemTickInMicroseconds(); - word32 *systemTickPtr = systemTickPointer(); + const volatile word32 *systemTickPtr = systemTickPointer(); if (timer != NULL) *timer = *systemTickPtr/systemTickTimeInHz; #if defined(CURRENT_UNIX_TIMESTAMP) /* CURRENT_UNIX_TIMESTAMP is seconds since Jan 01 1970. (UTC) */ - return (time_t) *systemTickPtr/systemTickTimeInHz + CURRENT_UNIX_TIMESTAMP; + return (time_t) (*systemTickPtr/systemTickTimeInHz) + CURRENT_UNIX_TIMESTAMP; #else return (time_t) *systemTickPtr/systemTickTimeInHz; #endif diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index e5381cce1..2ba6650ac 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -176,6 +176,10 @@ _Pragma("GCC diagnostic ignored \"-Wunused-function\""); __android_log_print(ANDROID_LOG_DEBUG, "TAG", __VA_ARGS__) #define fprintf(fp, ...) \ __android_log_print(ANDROID_LOG_DEBUG, "TAG", __VA_ARGS__) +#elif defined(WOLFSSL_DEOS) + #include + #undef printf + #define printf printx #else #ifdef XMALLOC_USER #include /* we're using malloc / free direct here */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index a882dff66..aeaa6bfdf 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1382,7 +1382,6 @@ extern void uITRON4_free(void *p) ; #define WC_RSA_BLINDING #define HAVE_ECC - #define ALT_ECC_SIZE #define TFM_ECC192 #define TFM_ECC224 #define TFM_ECC256 diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 81616e3a7..1adf896ad 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -522,8 +522,6 @@ WOLFSSL_API int wolfCrypt_Cleanup(void); #elif defined(WOLFSSL_DEOS) #define NO_FILESYSTEM #warning "TODO - DDC-I Certifiable Fast File System for Deos is not integrated" - /* #define XFILE bfd * */ - #elif defined(MICRIUM) #include #define XFILE FS_FILE* @@ -863,10 +861,7 @@ WOLFSSL_API int wolfCrypt_Cleanup(void); #define XGMTIME(c, t) rtpsys_gmtime((c)) #elif defined(WOLFSSL_DEOS) - #define XTIME(t1) deos_time((t1)) - #define WOLFSSL_GMTIME - #define USE_WOLF_TM - #define USE_WOLF_TIME_T + #include #elif defined(MICRIUM) #include diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index c92f44b31..a9b59b253 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -248,13 +248,17 @@ #define SOCKET_ECONNREFUSED NU_CONNECTION_REFUSED #define SOCKET_ECONNABORTED NU_NOT_CONNECTED #elif defined(WOLFSSL_DEOS) - #define SOCKET_EWOULDBLOCK EAGAIN - #define SOCKET_EAGAIN EAGAIN - #define SOCKET_ECONNRESET EINTR - #define SOCKET_EINTR EINTR - #define SOCKET_EPIPE EPIPE - #define SOCKET_ECONNREFUSED SOCKET_ERROR - #define SOCKET_ECONNABORTED SOCKET_ERROR + /* `sockaddr_storage` is not defined in DEOS. This workaround will + * work for IPV4, but not IPV6 + */ + #define sockaddr_storage sockaddr_in + #define SOCKET_EWOULDBLOCK EAGAIN + #define SOCKET_EAGAIN EAGAIN + #define SOCKET_ECONNRESET EINTR + #define SOCKET_EINTR EINTR + #define SOCKET_EPIPE EPIPE + #define SOCKET_ECONNREFUSED SOCKET_ERROR + #define SOCKET_ECONNABORTED SOCKET_ERROR #elif defined(HAVE_NETX) #define SOCKET_EWOULDBLOCK NX_NOT_CONNECTED #define SOCKET_EAGAIN NX_NOT_CONNECTED