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) {
|
if (sniType != type) {
|
||||||
offset += sniLen;
|
offset += sniLen;
|
||||||
listLen -= MIN(ENUM_LEN + OPAQUE16_LEN + sniLen, listLen);
|
listLen -= min(ENUM_LEN + OPAQUE16_LEN + sniLen, listLen);
|
||||||
continue;
|
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;
|
return len16 ? BUFFER_ERROR : SSL_SUCCESS;
|
||||||
|
@@ -440,6 +440,8 @@ void test_CyaSSL_UseSNI(void)
|
|||||||
CyaSSL_free(ssl);
|
CyaSSL_free(ssl);
|
||||||
CyaSSL_CTX_free(ctx);
|
CyaSSL_CTX_free(ctx);
|
||||||
|
|
||||||
|
#if !defined(NO_FILESYSTEM) && !defined(NO_CERTS)
|
||||||
|
|
||||||
/* Testing success case at ctx */
|
/* Testing success case at ctx */
|
||||||
client_callbacks.ctx_ready = server_callbacks.ctx_ready = use_SNI_at_ctx;
|
client_callbacks.ctx_ready = server_callbacks.ctx_ready = use_SNI_at_ctx;
|
||||||
server_callbacks.on_result = verify_SNI_real_matching;
|
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);
|
test_CyaSSL_client_server(&client_callbacks, &server_callbacks);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
test_CyaSSL_SNI_GetFromBuffer();
|
test_CyaSSL_SNI_GetFromBuffer();
|
||||||
}
|
}
|
||||||
#endif /* HAVE_SNI */
|
#endif /* HAVE_SNI */
|
||||||
|
Reference in New Issue
Block a user