Commit 46f5a3b1 authored by Oleksandr Dmytrenko's avatar Oleksandr Dmytrenko Committed by Aleksey

ca ssl unittests

ca ssl unittests and fix in ca adapter

Change-Id: I76208f7f55d8ef06f66ede67a521c5317657182a
Signed-off-by: default avatarOleksandr Dmytrenko <o.dmytrenko@samsung.com>
parent a13861a0
......@@ -124,7 +124,9 @@
* @def UUID_LENGTHPSK_LENGTH
* @brief Identity max length
*/
#if !defined(UUID_LENGTH)
#define UUID_LENGTH (128/8)
#endif
/**
* @def MASTER_SECRET_LEN
* @brief TLS master secret length
......@@ -267,7 +269,7 @@ static const int tlsCipher[SSL_CIPHER_MAX][2] =
static int g_cipherSuitesList[SSL_CIPHER_MAX];
mbedtls_ecp_group_id curve[ADAPTER_CURVE_MAX][2] =
static mbedtls_ecp_group_id curve[ADAPTER_CURVE_MAX][2] =
{
{MBEDTLS_ECP_DP_SECP256R1, MBEDTLS_ECP_DP_NONE}
};
......@@ -982,7 +984,7 @@ bool SetCASecureEndpointAttribute(const CAEndpoint_t* peer, uint32_t newAttribut
bool result = false;
OIC_LOG_V(DEBUG, NET_SSL_TAG, "In %s(peer = %s:%u, attribute = %#x)", __func__,
peer->addr, (uint32_t)peer->port, newAttribute);
peer? peer->addr : "null", peer ? (uint32_t)peer->port : 0, newAttribute);
// In the current implementation, the caller already owns g_sslContextMutex.
oc_mutex_assert_owner(g_sslContextMutex, true);
......
......@@ -109,11 +109,12 @@ tests_src = [
if 'IP' in target_transport or 'ALL' in target_transport:
tests_src.append('cablocktransfertest.cpp')
if catest_env.get('SECURED') == '1' and catest_env.get('WITH_TCP') == True:
tests_src.append('ssladapter_test.cpp')
if catest_env.get('SECURED') == '1':
tests_src.append('cacertprofiletest.cpp')
tests_src += ['cacertprofiletest.cpp']
if target_os in ('linux'):
tests_src += ['ca_adapter_net_ssl.cpp']
if catest_env.get('WITH_TCP') == True:
tests_src += ['ssladapter_test.cpp']
catests = [catest_env.Program('catests', tests_src)]
......
This diff is collapsed.
......@@ -902,10 +902,7 @@ size_t OC_CALL calcDimTotal(const size_t dimensions[MAX_REP_ARRAY_DEPTH])
}
size_t total = 1;
for(uint8_t i = 0; i < MAX_REP_ARRAY_DEPTH && dimensions[i] != 0; ++i)
{
total *= dimensions[i];
}
for(; total < MAX_REP_ARRAY_DEPTH && dimensions[total] != 0; ++total);
return total;
}
......@@ -1211,7 +1208,7 @@ bool OC_CALL OCRepPayloadSetStringArray(OCRepPayload* payload, const char* name,
return false;
}
char** newArray = (char**)OICMalloc(dimTotal * sizeof(char*));
char** newArray = (char**)OICCalloc(dimTotal, sizeof(char*));
if (!newArray)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment