Added a WOLFSSL_CIPHER_LIST_MAX_SIZE macro

This commit is contained in:
Tesfa Mael
2019-04-22 16:30:38 -07:00
parent 393ca1b30c
commit f8c9285b92
4 changed files with 6 additions and 6 deletions

View File

@ -1230,7 +1230,7 @@ static void Usage(void)
static void ShowCiphers(void)
{
char ciphers[4096];
char ciphers[WOLFSSL_CIPHER_LIST_MAX_SIZE];
int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));
@ -1368,12 +1368,11 @@ int bench_tls(void* args)
}
else {
/* Run for each cipher */
const int ciphersSz = 4096;
ciphers = (char*)XMALLOC(ciphersSz, NULL, DYNAMIC_TYPE_TMP_BUFFER);
ciphers = (char*)XMALLOC(WOLFSSL_CIPHER_LIST_MAX_SIZE, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (ciphers == NULL) {
goto exit;
}
wolfSSL_get_ciphers(ciphers, ciphersSz);
wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));
cipher = ciphers;
}

View File

@ -195,7 +195,7 @@ static int NonBlockingSSL_Connect(WOLFSSL* ssl)
static void ShowCiphers(void)
{
static char ciphers[4096];
static char ciphers[WOLFSSL_CIPHER_LIST_MAX_SIZE];
int ret = wolfSSL_get_ciphers(ciphers, (int)sizeof(ciphers));

View File

@ -180,7 +180,7 @@ int testsuite_test(int argc, char** argv)
/* show ciphers */
{
char ciphers[1024*2];
char ciphers[WOLFSSL_CIPHER_LIST_MAX_SIZE];
XMEMSET(ciphers, 0, sizeof(ciphers));
wolfSSL_get_ciphers(ciphers, sizeof(ciphers)-1);
printf("ciphers = %s\n", ciphers);

View File

@ -155,6 +155,7 @@
#pragma warning(disable:4244 4996)
#endif
#define WOLFSSL_CIPHER_LIST_MAX_SIZE 4096
/* Buffer for benchmark tests */
#ifndef TEST_BUFFER_SIZE
#define TEST_BUFFER_SIZE 16384