From 9d2244e1a4c31ec465236e31f0d1407196db3085 Mon Sep 17 00:00:00 2001 From: Roy Sprowl Date: Fri, 19 Jan 2018 18:07:30 -0800 Subject: [PATCH] Updated Espressif SDK no longer needs this hack. --- pal/src/tlsio_openssl_compact.c | 4 +++- sdk_tests/tlsio_openssl_compact_ut/ssl_impl.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pal/src/tlsio_openssl_compact.c b/pal/src/tlsio_openssl_compact.c index 76307b2..480117d 100644 --- a/pal/src/tlsio_openssl_compact.c +++ b/pal/src/tlsio_openssl_compact.c @@ -649,7 +649,9 @@ static void dowork_poll_open_ssl(TLS_IO_INSTANCE* tls_io_instance) // but by experiment, 0 is the success result, at least when using // SSL_set_fd instead of custom BIO. // https://www.openssl.org/docs/man1.0.2/ssl/SSL_connect.html - if (connect_result == 1 || connect_result == 0) + // Update: Later versions of the Espressif SDK seem to adhere to the + // documentation. + if (connect_result == 1) { /* Codes_SRS_TLSIO_30_080: [ The tlsio_dowork shall establish a TLS connection using the hostName and port provided during tlsio_open. ]*/ // Connect succeeded diff --git a/sdk_tests/tlsio_openssl_compact_ut/ssl_impl.h b/sdk_tests/tlsio_openssl_compact_ut/ssl_impl.h index baf3125..95d45c6 100644 --- a/sdk_tests/tlsio_openssl_compact_ut/ssl_impl.h +++ b/sdk_tests/tlsio_openssl_compact_ut/ssl_impl.h @@ -16,7 +16,7 @@ #define SSL_Good_Ptr (void*)22 #define SSL_Good_Context_Ptr (SSL_CTX*)33 #define SSL_Good_Socket 44 -#define SSL_CONNECT_SUCCESS 0 +#define SSL_CONNECT_SUCCESS 1 #define SSL_SET_FD_SUCCESS 1 #define SSL_SET_FD_FAILURE 0 #define SSL_READ_NO_DATA 0