[IOT-2961] save doxm section 05/24005/5
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Tue, 9 Jan 2018 15:38:13 +0000 (17:38 +0200)
committerMats Wichmann <mats@linux.com>
Fri, 9 Feb 2018 00:02:09 +0000 (00:02 +0000)
add json2cbor save doxm section

Change-Id: I2578ebd8162978b489833edc7e6159b30cb851ec
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
(cherry picked from commit 2a46516cf905d3931862b252db84e0d727c9b2ce)
Origin: https://gerrit.iotivity.org/gerrit/#/c/23903/

resource/csdk/security/tool/json2cbor.c

index 7942120..f6630ea 100644 (file)
@@ -926,6 +926,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)