From 3e24a446b9c5a472369906bd94b3484f24fd12b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Guimar=C3=A3es?= Date: Tue, 24 Dec 2013 15:34:17 -0300 Subject: [PATCH] fixing SNI_GetFromBuffer return code on success. --- src/tls.c | 2 +- tests/api.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tls.c b/src/tls.c index b8f6b1d8a..5acc8e648 100644 --- a/src/tls.c +++ b/src/tls.c @@ -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 diff --git a/tests/api.c b/tests/api.c index 677cfd3f7..e37d5e686 100644 --- a/tests/api.c +++ b/tests/api.c @@ -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));