[IOT-2961] save doxm section 03/23903/5
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Tue, 9 Jan 2018 15:38:13 +0000 (17:38 +0200)
committerNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Wed, 31 Jan 2018 17:57:59 +0000 (17:57 +0000)
add json2cbor save doxm section

Change-Id: I2578ebd8162978b489833edc7e6159b30cb851ec
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
resource/csdk/security/tool/json2cbor.c

index 5c75ec1..05c3bba 100644 (file)
@@ -925,6 +925,9 @@ OicSecDoxm_t *JSONToDoxmBin(const char *jsonStr)
     jsonRoot = cJSON_Parse(jsonStr);
     VERIFY_NOT_NULL(TAG, jsonRoot, ERROR);
 
+    jsonDoxm = cJSON_GetObjectItem(jsonRoot, OIC_JSON_DOXM_NAME);
+    VERIFY_NOT_NULL(TAG, jsonDoxm, ERROR);
+
     //Oxm -- not Mandatory
     jsonObj = cJSON_GetObjectItem(jsonDoxm, OIC_JSON_OXMS_NAME);
     if (jsonObj && cJSON_Array == jsonObj->type)