fixing SNI_GetFromBuffer return code on success.

This commit is contained in:
Moisés Guimarães 2013-12-24 15:34:17 -03:00
parent 4ce2e59adf
commit 3e24a446b9
2 changed files with 5 additions and 5 deletions

View File

@ -988,7 +988,7 @@ int TLSX_SNI_GetFromBuffer(const byte* clientHello, word32 helloSz,
len16 -= MIN(2 * OPAQUE16_LEN + extLen, len16);
}
return len16 ? BUFFER_ERROR : 0;
return len16 ? BUFFER_ERROR : SSL_SUCCESS;
}
#endif

View File

@ -379,11 +379,11 @@ static void test_CyaSSL_SNI_GetFromBuffer(void)
byte result[32] = {0};
word32 length = 32;
AssertIntEQ(0, CyaSSL_SNI_GetFromBuffer(buffer3, sizeof(buffer3), 0,
result, &length));
AssertIntEQ(SSL_SUCCESS, CyaSSL_SNI_GetFromBuffer(buffer3, sizeof(buffer3),
0, result, &length));
AssertIntEQ(0, CyaSSL_SNI_GetFromBuffer(buffer2, sizeof(buffer2), 1,
result, &length));
AssertIntEQ(SSL_SUCCESS, CyaSSL_SNI_GetFromBuffer(buffer2, sizeof(buffer2),
1, result, &length));
AssertIntEQ(-228, CyaSSL_SNI_GetFromBuffer(buffer, sizeof(buffer), 0,
result, &length));