Added default security_version definition for |oic/sec/ver| resource
authorKyungsun Cho <goodsun.cho@samsung.com>
Sun, 27 Mar 2016 10:39:55 +0000 (19:39 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 28 Mar 2016 05:54:47 +0000 (05:54 +0000)
- patch #1: initial commit
- patch #2: fixed multiple definition

Change-Id: I08572a6020653f99ea7f5922d82b51e4fd31bb22
Signed-off-by: Kyungsun Cho <goodsun.cho@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7367
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-by: Jongsung Lee <js126.lee@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/include/internal/srmresourcestrings.h
resource/csdk/security/provisioning/src/pmutility.c
resource/csdk/security/src/srmresourcestrings.c

index d87d2ee..c1900ac 100644 (file)
@@ -163,5 +163,8 @@ extern const char * OIC_SEC_FALSE;
 extern const char * OIC_SEC_REST_QUERY_SEPARATOR;
 extern char OIC_SEC_REST_QUERY_DELIMETER;
 
+//Security Version
+extern const char * DEFAULT_SEC_VERSION;
+
 #endif //IOTVT_SRM_RSRC_STRINGS_H
 
index b58d5af..a4d63cb 100644 (file)
@@ -179,7 +179,7 @@ OCStackResult AddDevice(OCProvisionDev_t **ppDevicesList, const char* addr, cons
         ptr->next = NULL;
         ptr->connType = connType;
         ptr->devStatus = DEV_STATUS_ON; //AddDevice is called when discovery(=alive)
-        OICStrcpy(ptr->secVer, strlen("0.0.0"), "0.0.0"); // version initialization
+        OICStrcpy(ptr->secVer, MAX_VERSION_LEN, DEFAULT_SEC_VERSION); // version initialization
 
         LL_PREPEND(*ppDevicesList, ptr);
     }
@@ -304,7 +304,7 @@ OCProvisionDev_t* PMCloneOCProvisionDev(const OCProvisionDev_t* src)
 
     if (0 == strlen(src->secVer))
     {
-        OICStrcpy(newDev->secVer, strlen("0.0.0"), "0.0.0");
+        OICStrcpy(newDev->secVer, MAX_VERSION_LEN, DEFAULT_SEC_VERSION);
     }
     else
     {
index 6398cf3..d7b3c77 100644 (file)
@@ -162,3 +162,6 @@ const char * OIC_SEC_FALSE = "false";
 const char * OIC_SEC_REST_QUERY_SEPARATOR = ";";
 char OIC_SEC_REST_QUERY_DELIMETER = '=';
 
+//Security Version
+const char * DEFAULT_SEC_VERSION = "0.0.0";
+