forked from wolfSSL/wolfssl
added protection to test_CyaSSL_client_server
fixed min macro
This commit is contained in:
@@ -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;
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user