From 3d27a8dc532ddae8fc8d9588409f4e59ba62abd4 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Fri, 15 Jun 2018 12:45:21 +0200 Subject: [PATCH 1/7] Contiki port --- wolfcrypt/src/random.c | 4 ++-- wolfssl/ssl.h | 2 +- wolfssl/wolfcrypt/settings.h | 7 +++++++ wolfssl/wolfio.h | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 54097f758..7e9efec2e 100755 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1938,7 +1938,8 @@ 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_CHIBIOS) + defined(WOLFSSL_GENSEED_FORTEST) || defined(WOLFSSL_CHIBIOS) || \ + defined(WOLFSSL_CONTIKI) /* these platforms do not have a default random seed and you'll need to implement your own wc_GenerateSeed or define via @@ -2038,6 +2039,5 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) #endif /* End wc_GenerateSeed */ - #endif /* WC_NO_RNG */ #endif /* HAVE_FIPS */ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index bbe6ae910..54ba2baf6 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -1669,7 +1669,7 @@ WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) && \ !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \ !defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) && \ - !defined(WOLFSSL_CHIBIOS) + !defined(WOLFSSL_CHIBIOS) && !defined(WOLFSSL_CONTIKI) #include #endif /* allow writev style writing */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 1b7b5eae2..2f1c53cf4 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -224,6 +224,13 @@ #define NO_FILESYSTEM #endif +#if defined(WOLFSSL_CONTIKI) + #define NO_WRITEV + #define SINGLE_THREADED + #define WOLFSSL_USER_IO + #define NO_FILESYSTEM +#endif + #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM) #define NO_MAIN_DRIVER #define SINGLE_THREADED diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index 2662f943b..75a03f457 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -39,7 +39,7 @@ #if !defined(WOLFSSL_USER_IO) /* Micrium uses NetSock I/O callbacks in wolfio.c */ - #if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM) + #if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM) && !defined(CONTIKI) #define USE_WOLFSSL_IO #endif #endif @@ -122,7 +122,7 @@ #elif defined(EBSNET) #include "rtipapi.h" /* errno */ #include "socket.h" - #elif !defined(DEVKITPRO) && !defined(WOLFSSL_PICOTCP) + #elif !defined(DEVKITPRO) && !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_CONTIKI) #include #include #include From 79a7518fdd65d45927ce7d9c50523cdf08644b49 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 2 Jul 2018 11:32:57 +0200 Subject: [PATCH 2/7] Using inline functions for XMALLOC/XFREE/XREALLOC in contiki This is necessary to avoid the "unused variable" warnings --- wolfssl/wolfcrypt/settings.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 2f1c53cf4..a00c67552 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -229,6 +229,27 @@ #define SINGLE_THREADED #define WOLFSSL_USER_IO #define NO_FILESYSTEM + + static inline void* XREALLOC(void *p, size_t n, void* heap, int type) + { + (void)heap; + (void)type; + return realloc(p,n); + } + + static inline void *XMALLOC(size_t n, void* heap, int type) + { + (void)heap; + (void)type; + return malloc(n); + } + + static inline void XFREE(void *p, void* heap, int type) + { + (void)heap; + (void)type; + free(p); + } #endif #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM) @@ -516,6 +537,9 @@ #define NO_SESSION_CACHE #endif +#ifdef WOLFSSL_CONTIKI +#endif + /* Micrium will use Visual Studio for compilation but not the Win32 API */ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \ From b7385476f0e1f7adf90e22a05d4364290dfc1190 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 2 Jul 2018 11:34:39 +0200 Subject: [PATCH 3/7] Removed empty ifdef section --- wolfssl/wolfcrypt/settings.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index a00c67552..401195cc4 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -537,9 +537,6 @@ #define NO_SESSION_CACHE #endif -#ifdef WOLFSSL_CONTIKI -#endif - /* Micrium will use Visual Studio for compilation but not the Win32 API */ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \ From b74869a61a63f2d33928ec232c249ebd90c7b4c0 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 10 Jul 2018 18:32:03 +0200 Subject: [PATCH 4/7] Moved contiki + uIP support in the library --- src/internal.c | 9 ++++ src/wolfio.c | 79 ++++++++++++++++++++++++++++++++++++ wolfssl/wolfcrypt/settings.h | 8 ++++ wolfssl/wolfio.h | 34 ++++++++++++++++ 4 files changed, 130 insertions(+) diff --git a/src/internal.c b/src/internal.c index a5d8be466..ef51a3937 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1410,6 +1410,15 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap) #error Micrium port does not support DTLS session export yet #endif #endif + #elif defined UIP + ctx->CBIORecv = uIPReceive; + ctx->CBIOSend = uIPSend; + #ifdef WOLFSSL_DTLS + if (method->version.major == DTLS_MAJOR) { + ctx->CBIOSendTo = uIPSendTo; + ctx->CBIORecvFrom = uIPRecvFrom; + } + #endif #else ctx->CBIORecv = EmbedReceive; ctx->CBIOSend = EmbedSend; diff --git a/src/wolfio.c b/src/wolfio.c index da6683e5e..3c90d5184 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -2068,4 +2068,83 @@ void wolfSSL_SetIO_Mynewt(WOLFSSL* ssl, struct mn_socket* mnSocket, struct mn_so #endif /* defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) */ +#ifdef UIP +#include + +#define SOCKLEN_UIP sizeof(struct sockaddr_uip) + +/* uIP TCP/IP port, using the native tcp/udp socket api. + * TCP and UDP are currently supported with the callbacks below. + * + */ +/* The uIP tcp send callback + * return : bytes sent, or error + */ +int uIPSend(WOLFSSL* ssl, char* buf, int sz, void* _ctx) +{ + uip_wolfssl_ctx *ctx = (struct uip_wolfssl_ctx *)_ctx; + int ret; + (void)ssl; + ret = tcp_socket_send(&ctx->conn.tcp, (unsigned char *)buf, sz); + if (ret <= 0) + return WOLFSSL_CBIO_ERR_WANT_WRITE; + return ret; +} + +int uIPSendTo(WOLFSSL* ssl, char* buf, int sz, void* _ctx) +{ + uip_wolfssl_ctx *ctx = (struct uip_wolfssl_ctx *)_ctx; + int ret = 0; + (void)ssl; + ret = udp_socket_sendto(&ctx->conn.udp, (unsigned char *)buf, sz, &ctx->peer_addr, ctx->peer_port ); + if (ret <= 0) + return WOLFSSL_CBIO_ERR_WANT_WRITE; + return ret; +} + +/* The uIP uTCP/IP receive callback + * return : nb bytes read, or error + */ +int uIPReceive(WOLFSSL *ssl, char *buf, int sz, void *_ctx) +{ + uip_wolfssl_ctx *ctx = (uip_wolfssl_ctx *)_ctx; + (void)ssl; + if (ctx->ssl_rb_len > 0) { + if (sz > ctx->ssl_rb_len - ctx->ssl_rb_off) + sz = ctx->ssl_rb_len - ctx->ssl_rb_off; + memcpy(buf, ctx->ssl_recv_buffer + ctx->ssl_rb_off, sz); + ctx->ssl_rb_off += sz; + if (ctx->ssl_rb_off >= ctx->ssl_rb_len) { + ctx->ssl_rb_len = 0; + ctx->ssl_rb_off = 0; + } + return sz; + } else { + return WOLFSSL_CBIO_ERR_WANT_READ; + } +} + +/* uIP DTLS Generate Cookie callback + * return : number of bytes copied into buf, or error + */ +int uIPGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *_ctx) +{ + uip_wolfssl_ctx *ctx = (uip_wolfssl_ctx *)ctx; + byte token[32]; + byte digest[WC_SHA_DIGEST_SIZE]; + int ret = 0; + XMEMSET(token, 0, sizeof(token)); + XMEMCPY(token, &ctx->peer_addr, sizeof(uip_ipaddr_t)); + XMEMCPY(token + sizeof(uip_ipaddr_t), &ctx->peer_port, sizeof(word16)); + ret = wc_ShaHash(token, sizeof(uip_ipaddr_t) + sizeof(word16), digest); + if (ret != 0) + return ret; + if (sz > WC_SHA_DIGEST_SIZE) + sz = WC_SHA_DIGEST_SIZE; + XMEMCPY(buf, digest, sz); + return sz; +} + +#endif /* UIP */ + #endif /* WOLFCRYPT_ONLY */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 401195cc4..5f4cc38b6 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -225,10 +225,18 @@ #endif #if defined(WOLFSSL_CONTIKI) + #include + #define UIP #define NO_WRITEV #define SINGLE_THREADED #define WOLFSSL_USER_IO #define NO_FILESYSTEM + #define CUSTOM_RAND_TYPE uint16_t + #define CUSTOM_RAND_GENERATE random_rand + static inline unsigned int LowResTimer(void) + { + return clock_seconds(); + } static inline void* XREALLOC(void *p, size_t n, void* heap, int type) { diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index 75a03f457..b6136f84e 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -423,6 +423,40 @@ WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags); struct mn_sockaddr_in* mnSockAddrIn); #endif /* defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) */ +#ifdef UIP +#define SSL_DATABUF_LEN 1460 + +struct uip_wolfssl_ctx { + union socket_connector { + struct tcp_socket tcp; + struct udp_socket udp; + } conn; + WOLFSSL_CTX *ctx; + WOLFSSL *ssl; + uint8_t input_databuf[SSL_DATABUF_LEN]; + uint8_t output_databuf[SSL_DATABUF_LEN]; + uint8_t ssl_recv_buffer[SSL_DATABUF_LEN]; + int ssl_rb_len; + int ssl_rb_off; + struct process *process; + tcp_socket_data_callback_t input_callback; + tcp_socket_event_callback_t event_callback; + int closing; + uip_ipaddr_t peer_addr; + uint16_t peer_port; +}; + +typedef struct uip_wolfssl_ctx uip_wolfssl_ctx; + + WOLFSSL_LOCAL int uIPSend(WOLFSSL* ssl, char* buf, int sz, void* ctx); + WOLFSSL_LOCAL int uIPReceive(WOLFSSL* ssl, char* buf, int sz, + void* ctx); + WOLFSSL_LOCAL int uIPReceiveFrom(WOLFSSL* ssl, char* buf, int sz, + void* ctx); + WOLFSSL_LOCAL int uIPSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx); + +#endif + #ifdef WOLFSSL_DTLS typedef int (*CallbackGenCookie)(WOLFSSL* ssl, unsigned char* buf, int sz, void* ctx); From 7bd16a258254050d38e157a414c736339c41e409 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 11 Jul 2018 08:20:01 +0200 Subject: [PATCH 5/7] Fixed after second review --- src/internal.c | 2 +- src/wolfio.c | 6 +++--- wolfssl/wolfcrypt/settings.h | 24 ++---------------------- wolfssl/wolfio.h | 2 +- 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/src/internal.c b/src/internal.c index ef51a3937..60f838f82 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1410,7 +1410,7 @@ int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap) #error Micrium port does not support DTLS session export yet #endif #endif - #elif defined UIP + #elif defined WOLFSSL_UIP ctx->CBIORecv = uIPReceive; ctx->CBIOSend = uIPSend; #ifdef WOLFSSL_DTLS diff --git a/src/wolfio.c b/src/wolfio.c index 3c90d5184..f927cd9bc 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -2068,7 +2068,7 @@ void wolfSSL_SetIO_Mynewt(WOLFSSL* ssl, struct mn_socket* mnSocket, struct mn_so #endif /* defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) */ -#ifdef UIP +#ifdef WOLFSSL_UIP #include #define SOCKLEN_UIP sizeof(struct sockaddr_uip) @@ -2112,7 +2112,7 @@ int uIPReceive(WOLFSSL *ssl, char *buf, int sz, void *_ctx) if (ctx->ssl_rb_len > 0) { if (sz > ctx->ssl_rb_len - ctx->ssl_rb_off) sz = ctx->ssl_rb_len - ctx->ssl_rb_off; - memcpy(buf, ctx->ssl_recv_buffer + ctx->ssl_rb_off, sz); + XMEMCPY(buf, ctx->ssl_recv_buffer + ctx->ssl_rb_off, sz); ctx->ssl_rb_off += sz; if (ctx->ssl_rb_off >= ctx->ssl_rb_len) { ctx->ssl_rb_len = 0; @@ -2145,6 +2145,6 @@ int uIPGenerateCookie(WOLFSSL* ssl, byte *buf, int sz, void *_ctx) return sz; } -#endif /* UIP */ +#endif /* WOLFSSL_UIP */ #endif /* WOLFCRYPT_ONLY */ diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 5f4cc38b6..66391e009 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -226,7 +226,8 @@ #if defined(WOLFSSL_CONTIKI) #include - #define UIP + #define WOLFSSL_UIP + #define NO_WOLFSSL_MEMORY #define NO_WRITEV #define SINGLE_THREADED #define WOLFSSL_USER_IO @@ -237,27 +238,6 @@ { return clock_seconds(); } - - static inline void* XREALLOC(void *p, size_t n, void* heap, int type) - { - (void)heap; - (void)type; - return realloc(p,n); - } - - static inline void *XMALLOC(size_t n, void* heap, int type) - { - (void)heap; - (void)type; - return malloc(n); - } - - static inline void XFREE(void *p, void* heap, int type) - { - (void)heap; - (void)type; - free(p); - } #endif #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM) diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index b6136f84e..e95ccc47a 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -423,7 +423,7 @@ WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags); struct mn_sockaddr_in* mnSockAddrIn); #endif /* defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) */ -#ifdef UIP +#ifdef WOLFSSL_UIP #define SSL_DATABUF_LEN 1460 struct uip_wolfssl_ctx { From bdb5d3c191f9a0c88888425d4147b94e057b1b58 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 18 Jul 2018 13:53:47 +0200 Subject: [PATCH 6/7] Improved support for contiki/uIP. --- src/wolfio.c | 32 ++++++++++++++++++++++++-------- wolfssl/wolfio.h | 41 ++++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/wolfio.c b/src/wolfio.c index f927cd9bc..eb59ea43e 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -2070,8 +2070,7 @@ void wolfSSL_SetIO_Mynewt(WOLFSSL* ssl, struct mn_socket* mnSocket, struct mn_so #ifdef WOLFSSL_UIP #include - -#define SOCKLEN_UIP sizeof(struct sockaddr_uip) +#include /* uIP TCP/IP port, using the native tcp/udp socket api. * TCP and UDP are currently supported with the callbacks below. @@ -2084,11 +2083,26 @@ int uIPSend(WOLFSSL* ssl, char* buf, int sz, void* _ctx) { uip_wolfssl_ctx *ctx = (struct uip_wolfssl_ctx *)_ctx; int ret; + unsigned int max_sendlen; + int total_written = 0; (void)ssl; - ret = tcp_socket_send(&ctx->conn.tcp, (unsigned char *)buf, sz); - if (ret <= 0) - return WOLFSSL_CBIO_ERR_WANT_WRITE; - return ret; + do { + unsigned int bytes_left = sz - total_written; + max_sendlen = tcp_socket_max_sendlen(&ctx->conn.tcp); + if (bytes_left > max_sendlen) { + printf("Send limited by buffer\r\n"); + bytes_left = max_sendlen; + } + if (bytes_left == 0) { + printf("Buffer full!\r\n"); + break; + } + ret = tcp_socket_send(&ctx->conn.tcp, (unsigned char *)buf + total_written, bytes_left); + if (ret <= 0) + break; + total_written += ret; + } while(total_written < sz); + return total_written; } int uIPSendTo(WOLFSSL* ssl, char* buf, int sz, void* _ctx) @@ -2098,7 +2112,7 @@ int uIPSendTo(WOLFSSL* ssl, char* buf, int sz, void* _ctx) (void)ssl; ret = udp_socket_sendto(&ctx->conn.udp, (unsigned char *)buf, sz, &ctx->peer_addr, ctx->peer_port ); if (ret <= 0) - return WOLFSSL_CBIO_ERR_WANT_WRITE; + return 0; return ret; } @@ -2108,11 +2122,13 @@ int uIPSendTo(WOLFSSL* ssl, char* buf, int sz, void* _ctx) int uIPReceive(WOLFSSL *ssl, char *buf, int sz, void *_ctx) { uip_wolfssl_ctx *ctx = (uip_wolfssl_ctx *)_ctx; + if (!ctx || !ctx->ssl_rx_databuf) + return -1; (void)ssl; if (ctx->ssl_rb_len > 0) { if (sz > ctx->ssl_rb_len - ctx->ssl_rb_off) sz = ctx->ssl_rb_len - ctx->ssl_rb_off; - XMEMCPY(buf, ctx->ssl_recv_buffer + ctx->ssl_rb_off, sz); + XMEMCPY(buf, ctx->ssl_rx_databuf + ctx->ssl_rb_off, sz); ctx->ssl_rb_off += sz; if (ctx->ssl_rb_off >= ctx->ssl_rb_len) { ctx->ssl_rb_len = 0; diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index e95ccc47a..9d8fce6f0 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -424,29 +424,28 @@ WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags); #endif /* defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) */ #ifdef WOLFSSL_UIP -#define SSL_DATABUF_LEN 1460 -struct uip_wolfssl_ctx { - union socket_connector { - struct tcp_socket tcp; - struct udp_socket udp; - } conn; - WOLFSSL_CTX *ctx; - WOLFSSL *ssl; - uint8_t input_databuf[SSL_DATABUF_LEN]; - uint8_t output_databuf[SSL_DATABUF_LEN]; - uint8_t ssl_recv_buffer[SSL_DATABUF_LEN]; - int ssl_rb_len; - int ssl_rb_off; - struct process *process; - tcp_socket_data_callback_t input_callback; - tcp_socket_event_callback_t event_callback; - int closing; - uip_ipaddr_t peer_addr; - uint16_t peer_port; -}; + struct uip_wolfssl_ctx { + union socket_connector { + struct tcp_socket tcp; + struct udp_socket udp; + } conn; + WOLFSSL_CTX *ctx; + WOLFSSL *ssl; + uint8_t *input_databuf; + uint8_t *output_databuf; + uint8_t *ssl_rx_databuf; + int ssl_rb_len; + int ssl_rb_off; + struct process *process; + tcp_socket_data_callback_t input_callback; + tcp_socket_event_callback_t event_callback; + int closing; + uip_ipaddr_t peer_addr; + uint16_t peer_port; + }; -typedef struct uip_wolfssl_ctx uip_wolfssl_ctx; + typedef struct uip_wolfssl_ctx uip_wolfssl_ctx; WOLFSSL_LOCAL int uIPSend(WOLFSSL* ssl, char* buf, int sz, void* ctx); WOLFSSL_LOCAL int uIPReceive(WOLFSSL* ssl, char* buf, int sz, From d7d2fb34af51f12f87276927cdcf43b36f70664a Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 22 Aug 2018 17:37:47 +0200 Subject: [PATCH 7/7] fixed ifdef WOLFSSL_CONTIKI --- wolfssl/wolfio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfssl/wolfio.h b/wolfssl/wolfio.h index 9d8fce6f0..a9120c7d1 100644 --- a/wolfssl/wolfio.h +++ b/wolfssl/wolfio.h @@ -39,7 +39,7 @@ #if !defined(WOLFSSL_USER_IO) /* Micrium uses NetSock I/O callbacks in wolfio.c */ - #if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM) && !defined(CONTIKI) + #if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM) && !defined(WOLFSSL_CONTIKI) #define USE_WOLFSSL_IO #endif #endif