From c08fe6d2ac9e1ba5626e4f9ea829311dd8ce5ecc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Grzegorz=20=C5=BBakiewicz?= Date: Tue, 12 Mar 2019 16:47:05 +0100 Subject: [PATCH] wrap CAcloseSslConnectionFreeEndpoint method with __TIZEN__ flag [Model] IoTivity [BinType] AP [Customer] iot-core [Issue#] CONPRO-1392 [Request] r.chudek [Occurrence Version] n/a [Problem] pthread might be not available on other platforms [Cause & Measure] n/a [Checking Method] n/a [Team] IoTConnection [Developer] g.zakiewicz [Solution company] Samsung [Change Type] fix https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/414 (cherry picked from 9dc9af2eabffb1d46c1671baa4b0decfeb173a1e) Change-Id: Idac05cde4018b6b064721c2ada5706601c2cb0c3 Signed-off-by: Abhishek Sansanwal --- resource/csdk/connectivity/api/casecurityinterface.h | 2 ++ resource/csdk/connectivity/inc/ca_adapter_net_ssl.h | 2 ++ resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c | 3 ++- resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/resource/csdk/connectivity/api/casecurityinterface.h b/resource/csdk/connectivity/api/casecurityinterface.h index 117ab18..5e628d4 100644 --- a/resource/csdk/connectivity/api/casecurityinterface.h +++ b/resource/csdk/connectivity/api/casecurityinterface.h @@ -323,6 +323,7 @@ CAResult_t CAinitiateSslHandshake(const CAEndpoint_t *endpoint); */ CAResult_t CAcloseSslConnection(const CAEndpoint_t *endpoint); +#ifdef __TIZEN__ /** * Close the DTLS session and free endpoint. * @@ -333,6 +334,7 @@ CAResult_t CAcloseSslConnection(const CAEndpoint_t *endpoint); * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAcloseSslConnectionFreeEndpoint(CAEndpoint_t *endpoint); +#endif //__TIZEN__ /** * Close the TLS session using UUID diff --git a/resource/csdk/connectivity/inc/ca_adapter_net_ssl.h b/resource/csdk/connectivity/inc/ca_adapter_net_ssl.h index 4dd2510..1bfdecc 100644 --- a/resource/csdk/connectivity/inc/ca_adapter_net_ssl.h +++ b/resource/csdk/connectivity/inc/ca_adapter_net_ssl.h @@ -89,6 +89,7 @@ void CAsetSslCredentialsCallback(CAgetPskCredentialsHandler credCallback); */ CAResult_t CAcloseSslConnection(const CAEndpoint_t *endpoint); +#ifdef __TIZEN__ /** * Close the DTLS session and free endpoint. * @@ -99,6 +100,7 @@ CAResult_t CAcloseSslConnection(const CAEndpoint_t *endpoint); * @retval ::CA_STATUS_FAILED Operation failed. */ CAResult_t CAcloseSslConnectionFreeEndpoint(CAEndpoint_t *endpoint); +#endif //__TIZEN__ /** * initialize mbedTLS library and other necessary initialization. diff --git a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c index 2553e5b..c3c3580 100644 --- a/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c +++ b/resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c @@ -1505,6 +1505,7 @@ CAResult_t CAcloseSslConnection(const CAEndpoint_t *endpoint) return CA_STATUS_OK; } +#ifdef __TIZEN__ CAResult_t CAcloseSslConnectionFreeEndpoint(CAEndpoint_t *endpoint) { OIC_LOG_V(INFO, NET_SSL_TAG, "In %s", __func__); @@ -1516,7 +1517,7 @@ CAResult_t CAcloseSslConnectionFreeEndpoint(CAEndpoint_t *endpoint) OIC_LOG_V(INFO, NET_SSL_TAG, "Out %s", __func__); return ret; } - +#endif //__TIZEN__ CAResult_t CAcloseSslConnectionUsingUuid(const uint8_t *identity, size_t idLength) { diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 93c8bde..01c80b2 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -3194,7 +3194,7 @@ static void CALEConnectionStateChangedCb(CATransportAdapter_t adapter, const cha #endif #ifdef __WITH_DTLS__ -#ifndef SINGLE_THREAD +#if defined(__TIZEN__) && !defined(SINGLE_THREAD) // CAcloseSslConnection returns CAResult_t instead of void*, but the size is the same and crash shouldn't occur pthread_t ccThread; pthread_attr_t attr; -- 2.7.4