From b1d18d8455204f6fc026bfe030a679f3574ae70d Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 2 Dec 2015 19:43:05 -0800 Subject: [PATCH] Fixed issue with "WOLFSSL_SMALL_STACK" and pre TLS 1.2 in "SendServerKeyExchange" where "encodedSig" is allocated and not used. --- src/internal.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/internal.c b/src/internal.c index 1d19e9b36..14f5337a2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -14158,17 +14158,17 @@ int DoSessionTicket(WOLFSSL* ssl, doUserRsa = 1; #endif - #ifdef WOLFSSL_SMALL_STACK - encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, - DYNAMIC_TYPE_TMP_BUFFER); - if (encodedSig == NULL) - ERROR_OUT(MEMORY_E, done_b); - #endif - if (IsAtLeastTLSv1_2(ssl)) { byte* digest = &hash[MD5_DIGEST_SIZE]; int typeH = SHAh; int digestSz = SHA_DIGEST_SIZE; + + #ifdef WOLFSSL_SMALL_STACK + encodedSig = (byte*)XMALLOC(MAX_ENCODED_SIG_SZ, NULL, + DYNAMIC_TYPE_TMP_BUFFER); + if (encodedSig == NULL) + ERROR_OUT(MEMORY_E, done_b); + #endif if (ssl->suites->hashAlgo == sha256_mac) { #ifndef NO_SHA256