Commit 60138901 authored by Kishen Maloor's avatar Kishen Maloor

oc_cloud:fix cloud_deregistered_internal()

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parent 45b46ab3
Pipeline #743 passed with stage
in 6 minutes and 33 seconds
......@@ -231,7 +231,8 @@ cloud_deregistered_internal(oc_client_response_t *data)
{
cloud_api_param_t *p = (cloud_api_param_t *)data->user_data;
oc_cloud_context_t *ctx = p->ctx;
if (data->code >= OC_STATUS_SERVICE_UNAVAILABLE) {
if (data->code < OC_STATUS_BAD_REQUEST ||
data->code >= OC_STATUS_SERVICE_UNAVAILABLE) {
ctx->store.status = OC_CLOUD_DEREGISTERED;
} else if (data->code >= OC_STATUS_BAD_REQUEST) {
cloud_set_last_error(ctx, CLOUD_ERROR_RESPONSE);
......
......@@ -1086,12 +1086,14 @@ oc_sec_decode_cred(oc_rep_t *rep, oc_sec_cred_t **owner, bool from_storage,
oc_sec_cred_t *cr = oc_sec_get_cred_by_credid(credid, device);
if (cr) {
cr->owner_cred = owner_cred;
}
/* Obtain a handle to the owner credential entry where that applies
*/
if (credtype == OC_CREDTYPE_PSK && privatedata_size == 0 && owner) {
*owner = cr;
(*owner)->owner_cred = true;
/* Obtain a handle to the owner credential entry where that
* applies
*/
if (credtype == OC_CREDTYPE_PSK && privatedata_size == 0 &&
owner) {
*owner = cr;
(*owner)->owner_cred = true;
}
}
}
creds_array = creds_array->next;
......
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