Change doxm.deviceuuid from R-only to RW in doxm entity handler.
authorNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Fri, 4 Nov 2016 21:13:00 +0000 (14:13 -0700)
committerRandeep Singh <randeep.s@samsung.com>
Tue, 15 Nov 2016 08:08:31 +0000 (08:08 +0000)
CTT testing revealed a bug in 1.2 (and a matching bug in the 1.1
schema) that had marked deviceuuid as R-only.  However this is
not correct: deviceuuid must be Writeable to allow the OBT
to update with a new UUID during onboarding.  This has been
verified by SecWG and needs to be fixed in 1.2.

Patch #2: added a line to also copy deviceuuid in updateWriteableProperty() function

Change-Id: Icff6d978f5a12af021d557a5c71f25a4e9957ba2
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14053
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/doxmresource.c

index 819a6b9..28f9e38 100644 (file)
@@ -543,11 +543,6 @@ static OCStackResult CBORPayloadToDoxmBin(const uint8_t *cborPayload, size_t siz
         VERIFY_SUCCESS(TAG, OC_STACK_OK == ret, ERROR);
         OICFree(strUuid);
         strUuid  = NULL;
-
-        if (roParsed)
-        {
-            *roParsed = true;
-        }
     }
     else
     {
@@ -873,6 +868,9 @@ static void updateWriteableProperty(const OicSecDoxm_t* src, OicSecDoxm_t* dst)
         //update rowner
         memcpy(&(dst->rownerID), &(src->rownerID), sizeof(OicUuid_t));
 
+        //update deviceuuid
+        memcpy(&(dst->deviceID), &(src->deviceID), sizeof(OicUuid_t));
+
         //Update owned status
         if(dst->owned != src->owned)
         {