Since this API is used externally,
moved it to the cautil header instead of the security header.
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/577
(cherry-picked from
991775c94943140fd72ee564f142aee55df058ac)
Change-Id: I5d3221dcdb69d720fbd77bcbda878c2b20cba9dc
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
*/
const CASecureEndpoint_t *CAGetSecureEndpointData(const CAEndpoint_t *peer);
#endif //MULTIPLE_OWNER
-
-/**
- * API to set a secure endpoint identity with uuid
- *
- * @param[in] peer peer information includs IP address and port
- * @param[in] uuid UUID of target device
- *
- * @return ::CA_STATUS_OK or appropriate error code
- */
-CAResult_t CASetSecureEndpointUuid(const CAEndpoint_t *peer, const char *uuid);
#endif
/**
*/
void CAUtilSkipTCPCloseOnInterfaceDown(bool state);
+
+/**
+ * Set a secure endpoint identity with uuid.
+ *
+ * @param[in] peer peer information includs IP address and port.
+ * @param[in] uuid UUID of target device.
+ *
+ * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
+ */
+CAResult_t CASetSecureEndpointUuid(const CAEndpoint_t *peer, const char *uuid);
+
CAResult_t CAUtilStartGattServer();
CAResult_t CAUtilStopGattServer();
}
#endif //MULTIPLE_OWNER
-CAResult_t CASetSecureEndpointUuid(const CAEndpoint_t *peer, const char *uuid)
-{
- OIC_LOG(DEBUG, TAG, "IN CASetSecureEndpointUuid");
-
- if (!g_isInitialized)
- {
- OIC_LOG(DEBUG, TAG, "CA is not initialized");
- return CA_STATUS_NOT_INITIALIZED;
- }
-
- OIC_LOG(DEBUG, TAG, "OUT CASetSecureEndpointUuid");
- return SetCASecureEndpointUuid(peer, uuid);
-}
-
CAResult_t CAregisterSslHandshakeCallback(CAErrorCallback tlsHandshakeCallback)
{
OIC_LOG(DEBUG, TAG, "CAregisterSslHandshakeCallback");
#ifdef TCP_ADAPTER
#include "catcpadapter.h"
#endif
+#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
+#include "ca_adapter_net_ssl.h"
+#endif
#define TAG "OIC_CA_COMMON_UTILS"
#endif
}
+CAResult_t CASetSecureEndpointUuid(const CAEndpoint_t *peer, const char *uuid)
+{
+ OIC_LOG(DEBUG, TAG, "CASetSecureEndpointUuid");
+#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
+ return SetCASecureEndpointUuid(peer, uuid);
+#else
+ (void) peer;
+ (void) uuid;
+ OIC_LOG(DEBUG, TAG, "it is not supported");
+ return CA_NOT_SUPPORTED;
+#endif
+}
+
CAResult_t CAUtilStartGattServer()
{
OIC_LOG(DEBUG, TAG, "CAUtilStartGattServer");