Use 2.1 version for RO doxm.owned 16/29516/2 feat-owned-readonly
authorAleksey Volkov <a.volkov@samsung.com>
Tue, 21 May 2019 15:26:08 +0000 (18:26 +0300)
committerAleksey Volkov <a.volkov@samsung.com>
Tue, 21 May 2019 15:31:21 +0000 (18:31 +0300)
Change-Id: I8845a2551a18b54ccd064333c1fe867e95ebfb94
Signed-off-by: Aleksey Volkov <a.volkov@samsung.com>
resource/csdk/security/include/experimental/securevirtualresourcetypes.h
resource/csdk/security/provisioning/src/ownershiptransfermanager.c

index 301d952..5a67cf9 100644 (file)
@@ -712,6 +712,9 @@ struct OicSecPdAcl
 
 #define GET_OCF_MAJOR_VER(specVer) ((int)((specVer)[4] - '0'))
 
+#define GET_OCF_MINOR_VER(specVer) ((int)((specVer)[6] - '0'))
+
+
 #ifdef __cplusplus
 }
 #endif
index 6b8fb4e..60fabe5 100644 (file)
@@ -2271,9 +2271,12 @@ static OCStackResult PostOwnershipInformation(OTMContext_t* otmCtx)
     bool propertiesToInclude[DOXM_PROPERTY_COUNT];
     memset(propertiesToInclude, 0, sizeof(propertiesToInclude));
     if ( ! ( IS_OCF(otmCtx->selectedDeviceInfo->specVer)
-            && GET_OCF_MAJOR_VER(otmCtx->selectedDeviceInfo->specVer) > 2) )
+              && ( GET_OCF_MAJOR_VER(otmCtx->selectedDeviceInfo->specVer) > 2
+              || ( GET_OCF_MAJOR_VER(otmCtx->selectedDeviceInfo->specVer) == 2 
+              && GET_OCF_MINOR_VER(otmCtx->selectedDeviceInfo->specVer) >= 1) ) )
+        )
     {
-        OIC_LOG_V(DEBUG, TAG, "%s: Pre ocf.3.x version detected", __func__);
+        OIC_LOG_V(DEBUG, TAG, "%s: Pre ocf.2.1.x version detected", __func__);
         propertiesToInclude[DOXM_OWNED] = true;
     }
     //include rowner uuid