[IOT-3150] Remove doxm.owned from OT 47/27847/3
authorAleksey Volkov <a.volkov@samsung.com>
Thu, 10 Jan 2019 07:23:37 +0000 (09:23 +0200)
committerAleksey Volkov <a.volkov@samsung.com>
Thu, 10 Jan 2019 07:34:36 +0000 (09:34 +0200)
Don't change doxm.owned flag at the
ownership transfer process from the
client side.
BZ 2692

Change-Id: Ia26a44d757a675697f5714d939e6c33145958344
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
resource/csdk/security/include/experimental/securevirtualresourcetypes.h
resource/csdk/security/provisioning/src/ownershiptransfermanager.c

index 0473d4e..301d952 100644 (file)
@@ -708,6 +708,10 @@ struct OicSecPdAcl
                              OIC_SEC_ACL_V2 : OIC_SEC_ACL_V1)
 #define IS_OIC(specVer) ((specVer)[0] == 'c' && (specVer)[1] == 'o' && (specVer)[2] == 'r' && (specVer)[3] == 'e')
 
+#define IS_OCF(specVer) ((specVer)[0] == 'o' && (specVer)[1] == 'c' && (specVer)[2] == 'f')
+
+#define GET_OCF_MAJOR_VER(specVer) ((int)((specVer)[4] - '0'))
+
 #ifdef __cplusplus
 }
 #endif
index 21dae06..6b8fb4e 100644 (file)
@@ -2270,7 +2270,12 @@ static OCStackResult PostOwnershipInformation(OTMContext_t* otmCtx)
     uint8_t numOptions = 0;
     bool propertiesToInclude[DOXM_PROPERTY_COUNT];
     memset(propertiesToInclude, 0, sizeof(propertiesToInclude));
-    propertiesToInclude[DOXM_OWNED] = true;
+    if ( ! ( IS_OCF(otmCtx->selectedDeviceInfo->specVer)
+            && GET_OCF_MAJOR_VER(otmCtx->selectedDeviceInfo->specVer) > 2) )
+    {
+        OIC_LOG_V(DEBUG, TAG, "%s: Pre ocf.3.x version detected", __func__);
+        propertiesToInclude[DOXM_OWNED] = true;
+    }
     //include rowner uuid
     propertiesToInclude[DOXM_ROWNERUUID] = true;
     //doxm.rowneruuid set to the provisioningclient's /doxm.deviceuuid.