Modify the SetDoxmDeviceID API to provide the variability of UUID on the client side.
authorChul Lee <chuls.lee@samsung.com>
Wed, 26 Oct 2016 06:00:57 +0000 (15:00 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 28 Oct 2016 03:34:56 +0000 (03:34 +0000)
Change-Id: Ia3488c67935166d17e65da11f27d25b88be59959
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13691
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 2704cda8385fd6c974cccaa58c588c6298809326)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13795

resource/csdk/security/src/doxmresource.c

index fdcb7de..0a960f6 100644 (file)
@@ -1599,7 +1599,8 @@ OCStackResult SetDoxmDeviceID(const OicUuid_t *deviceID)
 
 #ifdef __WITH_DTLS__
     //for normal device.
-    if(true == gDoxm->owned)
+    if(true == gDoxm->owned &&
+       memcmp(gDoxm->deviceID.id, gDoxm->owner.id, sizeof(gDoxm->owner.id)) != 0)
     {
         OIC_LOG(ERROR, TAG, "This device owned by owner's device.");
         OIC_LOG(ERROR, TAG, "Device UUID cannot be changed to guarantee the reliability of the connection.");