diff --git a/IDE/ECLIPSE/MICRIUM/server_wolfssl.c b/IDE/ECLIPSE/MICRIUM/server_wolfssl.c index ea58f4b62..527c74dce 100644 --- a/IDE/ECLIPSE/MICRIUM/server_wolfssl.c +++ b/IDE/ECLIPSE/MICRIUM/server_wolfssl.c @@ -12,6 +12,8 @@ #define RX_BUF_SIZE 1024 #define TCP_SERVER_CONN_Q_SIZE 1 +/* derived from wolfSSL/certs/server-ecc.der */ + static const unsigned char server_ecc_der_256[] = { 0x30, 0x82, 0x03, 0x10, 0x30, 0x82, 0x02, 0xB5, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x09, 0x00, 0xEF, 0x46, 0xC7, 0xA4, 0x9B, 0xBB, 0x60, 0xD3, 0x30, 0x0A, 0x06, 0x08, @@ -80,6 +82,8 @@ static const unsigned char server_ecc_der_256[] = { 0x30, 0x82, 0x03, 0x10, 0x25, 0x7D, 0xCA, 0x7A, 0x5D, 0xBA, 0xC4, 0xB2, 0xF6, 0x7D, 0x04, 0xC7, 0xBD, 0x62, 0xC9, 0x20 }; +/* derived from wolfSSL/certs/ecc-key.der */ + static const unsigned char ecc_key_der_256[] = { 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x45, 0xB6, 0x69, 0x02, 0x73, 0x9C, 0x6C, 0x85, 0xA1, 0x38, 0x5B, 0x72, 0xE8, 0xE8, 0xC7, 0xAC, 0xC4, 0x03, 0x8D, 0x53, 0x35, 0x04, diff --git a/IDE/ECLIPSE/MICRIUM/user_settings.h b/IDE/ECLIPSE/MICRIUM/user_settings.h index 45063c96d..2704394dd 100644 --- a/IDE/ECLIPSE/MICRIUM/user_settings.h +++ b/IDE/ECLIPSE/MICRIUM/user_settings.h @@ -6,38 +6,45 @@ #endif #define MICRIUM - #define WOLFSSL_MICRIUM_3_0 -/*for test.h to include platform dependent socket related header files.*/ -#define USE_WINDOWS_API +#define WOLFSSL_BENCHMARK_TEST +/* +#define WOLFSSL_MICRIUM_CRYPTO_TEST +#define WOLFSSL_MICRIUM_CLIENT_TEST +#define WOLFSSL_MICRIUM_SERVER_TEST +*/ -#define SIZEOF_LONG_LONG 8 +/* test.h includes platform dependent header files. +When using Windows simulator, you must define USE_WINDOWS_API */ +#ifdef _WIN32 +define USE_WINDOWS_API +#endif #define NO_FILESYSTEM +#define SIZEOF_LONG_LONG 8 +/* prevents from including multiple definition of main() */ #define NO_MAIN_DRIVER - #define NO_TESTSUITE_MAIN_DRIVER -// wolfSSL_dtls_get_current_timeout is called from MicriumReceiveFrom +/* wolfSSL_dtls_get_current_timeout is called from MicriumReceiveFrom */ #define WOLFSSL_DTLS -/* include certificate test buffers via header files */ +/* includes certificate test buffers via header files */ #define USE_CERT_BUFFERS_2048 - /*use kB instead of mB for embedded benchmarking*/ #define BENCH_EMBEDDED - #define NO_ECC_VECTOR_TEST - #define NO_WRITE_TEMP_FILES -// no pow, no math.h +/* no pow, no math.h */ #define WOLFSSL_DH_CONST #define XSNPRINTF snprintf +//#define NO_ASN_TIME + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfcrypt/src/wc_port.c b/wolfcrypt/src/wc_port.c index c3ece65cf..c5b8ddd95 100644 --- a/wolfcrypt/src/wc_port.c +++ b/wolfcrypt/src/wc_port.c @@ -1517,6 +1517,9 @@ time_t micrium_time(time_t* timer) Clk_GetTS_Unix(&sec); + if (timer != NULL) + *timer = sec; + return (time_t) sec; } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 3a9ec6805..d01a5e20b 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -202,12 +202,10 @@ #ifdef MICRIUM -#if (BSP_SER_COMM_EN == DEF_ENABLED) #include void BSP_Ser_Printf (CPU_CHAR* format, ...); #undef printf #define printf BSP_Ser_Printf -#endif #elif defined(WOLFSSL_PB) #include int wolfssl_pb_print(const char*, ...); diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index f3144d4e0..58e9cbe7f 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1161,13 +1161,6 @@ extern void uITRON4_free(void *p) ; #define CUSTOM_RAND_TYPE RAND_NBR #define CUSTOM_RAND_GENERATE Math_Rand #endif - #ifndef WOLFSSL_MICRIUM_3_0 - #define WOLFSSL_TYPES - #endif - typedef CPU_INT08U byte; - typedef CPU_INT16U word16; - typedef CPU_INT32U word32; - #define STRING_USER #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) #define XSTRNCPY(pstr_dest, pstr_src, len_max) \