diff --git a/src/tls.c b/src/tls.c index 5acc8e648..482271ba6 100644 --- a/src/tls.c +++ b/src/tls.c @@ -974,7 +974,7 @@ int TLSX_SNI_GetFromBuffer(const byte* clientHello, word32 helloSz, if (sniType != type) { offset += sniLen; - listLen -= MIN(ENUM_LEN + OPAQUE16_LEN + sniLen, listLen); + listLen -= min(ENUM_LEN + OPAQUE16_LEN + sniLen, listLen); continue; } @@ -985,7 +985,7 @@ int TLSX_SNI_GetFromBuffer(const byte* clientHello, word32 helloSz, } } - len16 -= MIN(2 * OPAQUE16_LEN + extLen, len16); + len16 -= min(2 * OPAQUE16_LEN + extLen, len16); } return len16 ? BUFFER_ERROR : SSL_SUCCESS; diff --git a/tests/api.c b/tests/api.c index e37d5e686..3dadad7a1 100644 --- a/tests/api.c +++ b/tests/api.c @@ -440,6 +440,8 @@ void test_CyaSSL_UseSNI(void) CyaSSL_free(ssl); CyaSSL_CTX_free(ctx); +#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) + /* Testing success case at ctx */ client_callbacks.ctx_ready = server_callbacks.ctx_ready = use_SNI_at_ctx; server_callbacks.on_result = verify_SNI_real_matching; @@ -473,6 +475,8 @@ void test_CyaSSL_UseSNI(void) test_CyaSSL_client_server(&client_callbacks, &server_callbacks); +#endif + test_CyaSSL_SNI_GetFromBuffer(); } #endif /* HAVE_SNI */