From bebb6862176538fb4504935d8b72d422845de259 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 13 Sep 2022 11:10:59 +0200 Subject: [PATCH] Fixes for different build scenarios: - fix the type cast in SMALL_STACK builds - only use new behviour when wolfSSL_set_groups() is available --- src/ssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 5d02aff17..84ef9c160 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -33939,8 +33939,8 @@ static int set_curves_list(WOLFSSL* ssl, WOLFSSL_CTX *ctx, const char* names) #endif #ifdef WOLFSSL_SMALL_STACK - groups = (byte*)XMALLOC(sizeof(int)*WOLFSSL_MAX_GROUP_COUNT, - heap, DYNAMIC_TYPE_TMP_BUFFER); + groups = (int*)XMALLOC(sizeof(int)*WOLFSSL_MAX_GROUP_COUNT, + heap, DYNAMIC_TYPE_TMP_BUFFER); if (groups == NULL) { ret = MEMORY_E; goto leave; @@ -34042,7 +34042,7 @@ static int set_curves_list(WOLFSSL* ssl, WOLFSSL_CTX *ctx, const char* names) curve = (word16)groups[i]; disabled &= ~(1U << curve); - #ifndef WOLFSSL_OLD_SET_CURVES_LIST + #if defined(HAVE_SUPPORTED_CURVES) && !defined(WOLFSSL_OLD_SET_CURVES_LIST) /* using the wolfSSL API to set the groups, this will populate * (ssl|ctx)->groups and reset any TLSX_SUPPORTED_GROUPS. * The order in (ssl|ctx)->groups will then be respected