diff --git a/Makefile b/Makefile index 3af715f09..c2c2469f5 100644 --- a/Makefile +++ b/Makefile @@ -28,17 +28,17 @@ OBJ_FILES := \ ssl/tls1_clnt.o \ ssl/tls1_svr.o \ ssl/x509.o \ - crypto/crypto_misc.o \ +# crypto/crypto_misc.o \ CPPFLAGS += -I$(XTENSA_LIBS)/include \ - -I$(SDK_BASE)/include \ -Icrypto \ - -Issl + -Issl \ + -I. LDFLAGS += -L$(XTENSA_LIBS)/lib \ -L$(XTENSA_LIBS)/arch/lib \ - -L$(SDK_BASE)/lib + CFLAGS+=-std=c99 -DESP8266 diff --git a/ssl/os_port.h b/ssl/os_port.h index d63a48ddc..f2195eed7 100644 --- a/ssl/os_port.h +++ b/ssl/os_port.h @@ -62,8 +62,17 @@ extern "C" { #if defined(ESP8266) - - +#include "util/time.h" +#define alloca(size) __builtin_alloca(size) +#define TTY_FLUSH() +#ifdef putc +#undef putc +#endif +#define putc(x, f) ets_putc(x) +#ifdef printf +#undef printf +#endif +#define printf(...) ets_printf(__VA_ARGS__) #elif defined(WIN32) diff --git a/ssl/tls1.c b/ssl/tls1.c index 428c9ea56..2aaeb5b75 100644 --- a/ssl/tls1.c +++ b/ssl/tls1.c @@ -943,6 +943,7 @@ static void *crypt_new(SSL *ssl, uint8_t *key, uint8_t *iv, int is_decrypt) return NULL; /* its all gone wrong */ } +#ifndef ESP8266 /** * Send a packet over the socket. */ @@ -1004,6 +1005,7 @@ static int send_raw_packet(SSL *ssl, uint8_t protocol) return ret; } +#endif /** * Send an encrypted packet with padding bytes if necessary. @@ -1190,6 +1192,7 @@ static int set_key_block(SSL *ssl, int is_write) return 0; } +#ifndef ESP8266 /** * Read the SSL connection. */ @@ -1385,6 +1388,7 @@ error: return ret; } +#endif /** * Do some basic checking of data and then perform the appropriate handshaking. diff --git a/util/time.h b/util/time.h new file mode 100644 index 000000000..78e37b1d3 --- /dev/null +++ b/util/time.h @@ -0,0 +1,11 @@ +#ifndef TIME_H +#define TIME_H + +struct timeval +{ + time_t tv_sec; + long tv_usec; +}; + + +#endif //TIME_H