forked from wolfSSL/wolfssl
make suites at context level on demand only
This commit is contained in:
14
src/ssl.c
14
src/ssl.c
@@ -4898,7 +4898,19 @@ int CM_GetCertCacheMemSize(WOLFSSL_CERT_MANAGER* cm)
|
||||
int wolfSSL_CTX_set_cipher_list(WOLFSSL_CTX* ctx, const char* list)
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_CTX_set_cipher_list");
|
||||
return (SetCipherList(&ctx->suites, list)) ? SSL_SUCCESS : SSL_FAILURE;
|
||||
|
||||
/* alloc/init on demand only */
|
||||
if (ctx->suites == NULL) {
|
||||
ctx->suites = (Suites*)XMALLOC(sizeof(Suites), ctx->heap,
|
||||
DYNAMIC_TYPE_SUITES);
|
||||
if (ctx->suites == NULL) {
|
||||
WOLFSSL_MSG("Memory alloc for Suites failed");
|
||||
return SSL_FAILURE;
|
||||
}
|
||||
XMEMSET(ctx->suites, 0, sizeof(Suites));
|
||||
}
|
||||
|
||||
return (SetCipherList(ctx->suites, list)) ? SSL_SUCCESS : SSL_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user