Commit 882e39d8 authored by Kishen Maloor's avatar Kishen Maloor

oc_cloud_deregister:send "di" as query param

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 273c3a98
......@@ -408,25 +408,32 @@ cloud_access_deregister(oc_endpoint_t *endpoint, const char *uid,
OC_ERR("Error of input parameters");
return false;
}
oc_string_t d;
(void)device;
oc_string_t at_uid;
oc_string_t at;
oc_concat_strings(&at, "accesstoken=", access_token);
oc_string_t u_id;
oc_concat_strings(&u_id, "&uid=", uid);
oc_concat_strings(&d, oc_string(at), oc_string(u_id));
oc_concat_strings(&at_uid, oc_string(at), oc_string(u_id));
char uuid[OC_UUID_LEN] = { 0 };
oc_uuid_to_str(oc_core_get_device_id(device), uuid, OC_UUID_LEN);
oc_string_t di;
oc_concat_strings(&di, "&di=", uuid);
oc_string_t at_uid_di;
oc_concat_strings(&at_uid_di, oc_string(at_uid), oc_string(di));
#ifdef OC_SECURITY
if (!oc_tls_connected(endpoint)) {
oc_tls_select_cloud_ciphersuite();
}
#endif /* OC_SECURITY */
bool s = oc_do_delete(OC_RSRVD_ACCOUNT_URI, endpoint, oc_string(d), handler,
HIGH_QOS, user_data);
oc_free_string(&d);
bool s = oc_do_delete(OC_RSRVD_ACCOUNT_URI, endpoint, oc_string(at_uid_di),
handler, HIGH_QOS, user_data);
oc_free_string(&at_uid);
oc_free_string(&at);
oc_free_string(&u_id);
oc_free_string(&di);
oc_free_string(&at_uid_di);
return s;
}
......
......@@ -146,6 +146,13 @@ oc_pstat_handle_state(oc_sec_pstat_t *ps, size_t device, bool from_storage,
ps->tm = 2;
ps->om = 3;
ps->sm = 4;
#ifdef OC_SERVER
#ifdef OC_CLIENT
#ifdef OC_CLOUD
oc_cloud_reset_context(device);
#endif /* OC_CLOUD */
#endif /* OC_CLIENT */
#endif /* OC_SERVER */
memset(ps->rowneruuid.id, 0, 16);
oc_sec_doxm_default(device);
oc_sec_cred_default(device);
......@@ -159,13 +166,6 @@ oc_pstat_handle_state(oc_sec_pstat_t *ps, size_t device, bool from_storage,
#endif /* OC_PKI */
oc_sec_sp_default(device);
#ifdef OC_SERVER
#ifdef OC_CLIENT
#ifdef OC_CLOUD
oc_cloud_reset_context(device);
#endif /* OC_CLOUD */
#endif /* OC_CLIENT */
#endif /* OC_SERVER */
#ifdef OC_SERVER
#if defined(OC_COLLECTIONS) && defined(OC_COLLECTIONS_IF_CREATE)
oc_rt_factory_free_created_resources(device);
#endif /* OC_COLLECTIONS && OC_COLLECTIONS_IF_CREATE */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment