internal.c: refactoring DoServerHello to reduce stack usage:

--- variable clSuites removed (sizeof(Suites) saved)

ps.: TLSX_Parse() does not requires the suites parameter at client side.
This commit is contained in:
Moisés Guimarães 2014-10-17 16:44:42 -03:00
parent a7e585b63d
commit 845e49781f
2 changed files with 2 additions and 3 deletions

View File

@ -9275,7 +9275,6 @@ static void PickHashSigAlgo(CYASSL* ssl,
if (TLSX_SupportExtensions(ssl)) {
int ret = 0;
word16 totalExtSz;
Suites clSuites; /* just for compatibility right now */
if ((i - begin) + OPAQUE16_LEN > helloSz)
return BUFFER_ERROR;
@ -9287,7 +9286,7 @@ static void PickHashSigAlgo(CYASSL* ssl,
return BUFFER_ERROR;
if ((ret = TLSX_Parse(ssl, (byte *) input + i,
totalExtSz, 0, &clSuites)))
totalExtSz, 0, NULL)))
return ret;
i += totalExtSz;

View File

@ -2149,7 +2149,7 @@ int TLSX_Parse(CYASSL* ssl, byte* input, word16 length, byte isRequest,
int ret = 0;
word16 offset = 0;
if (!ssl || !input || !suites)
if (!ssl || !input || (isRequest && !suites))
return BAD_FUNC_ARG;
while (ret == 0 && offset < length) {