Fixed after second review

pull/1656/head
Daniele Lacamera 2018-07-11 08:20:01 +02:00
parent b74869a61a
commit 7bd16a2582
4 changed files with 7 additions and 27 deletions

View File

@ -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

View File

@ -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 <uip.h>
#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 */

View File

@ -226,7 +226,8 @@
#if defined(WOLFSSL_CONTIKI)
#include <contiki.h>
#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)

View File

@ -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 {