forked from wolfSSL/wolfssl
add SNI_UNSUPPORTED for better handling SSL 3.0 buffers on CyaSSL_SNI_GetFromBuffer()
This commit is contained in:
@ -126,6 +126,7 @@ enum CyaSSL_ErrorCodes {
|
|||||||
NO_CHANGE_CIPHER_E = -393, /* Finished before change cipher */
|
NO_CHANGE_CIPHER_E = -393, /* Finished before change cipher */
|
||||||
SANITY_MSG_E = -394, /* Sanity check on msg order error */
|
SANITY_MSG_E = -394, /* Sanity check on msg order error */
|
||||||
DUPLICATE_MSG_E = -395, /* Duplicate message error */
|
DUPLICATE_MSG_E = -395, /* Duplicate message error */
|
||||||
|
SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */
|
||||||
|
|
||||||
/* add strings to SetErrorString !!!!! */
|
/* add strings to SetErrorString !!!!! */
|
||||||
|
|
||||||
|
@ -1108,7 +1108,7 @@ int TLSX_SNI_GetFromBuffer(const byte* clientHello, word32 helloSz,
|
|||||||
return BUFFER_ERROR;
|
return BUFFER_ERROR;
|
||||||
|
|
||||||
if (clientHello[offset++] < TLSv1_MINOR)
|
if (clientHello[offset++] < TLSv1_MINOR)
|
||||||
return BUFFER_ERROR;
|
return SNI_UNSUPPORTED;
|
||||||
|
|
||||||
ato16(clientHello + offset, &len16);
|
ato16(clientHello + offset, &len16);
|
||||||
offset += OPAQUE16_LEN;
|
offset += OPAQUE16_LEN;
|
||||||
|
@ -921,8 +921,8 @@ static void test_CyaSSL_SNI_GetFromBuffer(void)
|
|||||||
0, result, &length));
|
0, result, &length));
|
||||||
buffer[1] = 0x03;
|
buffer[1] = 0x03;
|
||||||
|
|
||||||
AssertIntEQ(BUFFER_ERROR, CyaSSL_SNI_GetFromBuffer(buffer, sizeof(buffer),
|
AssertIntEQ(SNI_UNSUPPORTED, CyaSSL_SNI_GetFromBuffer(buffer,
|
||||||
0, result, &length));
|
sizeof(buffer), 0, result, &length));
|
||||||
buffer[2] = 0x03;
|
buffer[2] = 0x03;
|
||||||
|
|
||||||
AssertIntEQ(INCOMPLETE_DATA, CyaSSL_SNI_GetFromBuffer(buffer,
|
AssertIntEQ(INCOMPLETE_DATA, CyaSSL_SNI_GetFromBuffer(buffer,
|
||||||
|
Reference in New Issue
Block a user