Fixed build issue with SECURED=0 option 19/211019/2
authorVitalii Irkha <v.irkha@samsung.com>
Tue, 16 Jul 2019 10:00:53 +0000 (13:00 +0300)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 1 Aug 2019 23:09:50 +0000 (08:09 +0900)
Moved common APIs from secure definition section

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/543/commits/4612b9818aa6b21a8dc1e07b1b1522d69b1206e0
(cherry-picked from 4612b9818aa6b21a8dc1e07b1b1522d69b1206e0)

Change-Id: I47418a8488c774bb343a845d828f6a56999a20d7
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
Signed-off-by: Sudipto Bal <sudipto.bal@samsung.com>
resource/csdk/security/src/srmutility.c

index 80b836f..1b8cd21 100644 (file)
@@ -234,6 +234,48 @@ OCStackResult ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid)
     return OC_STACK_OK;
 }
 
+const OicUuid_t THE_NIL_UUID = {.id={0000000000000000}};
+
+/**
+ * Compares two OicUuid_t structs.
+ *
+ * @return true if the two OicUuid_t structs are equal, else false.
+ */
+bool UuidCmp(const OicUuid_t *firstId, const OicUuid_t *secondId)
+{
+    bool ret = false;
+    VERIFY_NON_NULL(TAG, firstId, ERROR);
+    VERIFY_NON_NULL(TAG, secondId, ERROR);
+
+    if (0 == memcmp(firstId, secondId, sizeof(OicUuid_t)))
+    {
+        ret = true;
+    }
+
+exit:
+    OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
+    return ret;
+}
+
+/**
+ * Compares OicUuid_t to Nil UUID {.id={0000000000000000}}
+ *
+ * @return true if the OicUuid_t is the Nil UUID.
+ */
+bool IsNilUuid(const OicUuid_t *uuid)
+{
+#if !defined(NDEBUG)
+    char *strUuid = NULL;
+    ConvertUuidToStr(uuid, &strUuid);
+    if (strUuid)
+    {
+        OIC_LOG_V(DEBUG, TAG, "%s: uuid: %s.", __func__, strUuid);
+        OICFree(strUuid);
+    }
+#endif
+    return UuidCmp(uuid, &THE_NIL_UUID);
+}
+
 #if defined(__WITH_DTLS__) || defined (__WITH_TLS__)
 OCStackResult SetDeviceIdSeed(const uint8_t* seed, size_t seedSize)
 {
@@ -379,46 +421,4 @@ exit:
     OIC_LOG_V(DEBUG, TAG, "Out %s", __func__);
 }
 
-const OicUuid_t THE_NIL_UUID = {.id={0000000000000000}};
-
-/**
- * Compares two OicUuid_t structs.
- *
- * @return true if the two OicUuid_t structs are equal, else false.
- */
-bool UuidCmp(const OicUuid_t *firstId, const OicUuid_t *secondId)
-{
-    bool ret = false;
-    VERIFY_NON_NULL(TAG, firstId, ERROR);
-    VERIFY_NON_NULL(TAG, secondId, ERROR);
-
-    if (0 == memcmp(firstId, secondId, sizeof(OicUuid_t)))
-    {
-        ret = true;
-    }
-
-exit:
-    OIC_LOG_V(DEBUG, TAG, "%s: returning %s.", __func__, ret?"true":"false");
-    return ret;
-}
-
-/**
- * Compares OicUuid_t to Nil UUID {.id={0000000000000000}}
- *
- * @return true if the OicUuid_t is the Nil UUID.
- */
-bool IsNilUuid(const OicUuid_t *uuid)
-{
-#if !defined(NDEBUG)
-    char *strUuid = NULL;
-    ConvertUuidToStr(uuid, &strUuid);
-    if (strUuid)
-    {
-        OIC_LOG_V(DEBUG, TAG, "%s: uuid: %s.", __func__, strUuid);
-        OICFree(strUuid);
-    }
-#endif
-    return UuidCmp(uuid, &THE_NIL_UUID);
-}
-
 #endif