From 775487cab1fc95d7438ad22fa6cddbbc973039ec Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 6 Nov 2017 09:45:12 +0100 Subject: [PATCH] Support for ChibiOS. --- wolfcrypt/src/random.c | 2 +- wolfssl/ssl.h | 3 ++- wolfssl/test.h | 2 +- wolfssl/wolfcrypt/settings.h | 5 +++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 420f254db..1f0d64185 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1638,7 +1638,7 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) defined(WOLFSSL_uITRON4) || defined(WOLFSSL_uTKERNEL2) || \ defined(WOLFSSL_LPC43xx) || defined(WOLFSSL_STM32F2xx) || \ defined(MBED) || defined(WOLFSSL_EMBOS) || \ - defined(WOLFSSL_GENSEED_FORTEST) + defined(WOLFSSL_GENSEED_FORTEST) || defined(WOLFSSL_CHIBIOS) /* these platforms do not have a default random seed and you'll need to implement your own wc_GenerateSeed or define via diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 5dbead9d1..912d50711 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1447,7 +1447,8 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, #include #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) && \ !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \ - !defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) + !defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) && \ + !defined(WOLFSSL_CHIBIOS) #include #endif /* allow writev style writing */ diff --git a/wolfssl/test.h b/wolfssl/test.h index cad7e38bc..659ccb52c 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -1111,7 +1111,7 @@ static INLINE unsigned int my_psk_server_cb(WOLFSSL* ssl, const char* identity, extern double current_time(); #else -#if !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_TCP_NET) +#if !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_TCP_NET) && !defined(WOLFSSL_CHIBIOS) #include static INLINE double current_time(int reset) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index b23b838df..5d5f49410 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -442,6 +442,11 @@ #define USE_CERT_BUFFERS_2048 #endif +#ifdef WOLFSSL_CHIBIOS + /* ChibiOS definitions. This file is distributed with chibiOS. */ + #include "wolfssl_chibios.h" +#endif + #ifdef WOLFSSL_NRF5x #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8