static oc_thread g_waitConfirmThreadId;
oc_cond g_condWait;
static InformOxmSelectedCallback_t g_InformOxmSelectedCallback = NULL;
+static bool g_isConfirmResult;
static OicSecOxm_t gOicSecDoxmJustWorks = OIC_JUST_WORKS;
static OicSecDoxm_t gDefaultDoxm =
oc_mutex_lock(g_mutexWait);
oc_cond_wait(g_condWait, g_mutexWait);
oc_cond_free(g_condWait);
+ g_condWait = NULL;
+
+ oc_mutex_unlock(g_mutexWait);
oc_mutex_free(g_mutexWait);
+ g_mutexWait = NULL;
+ g_isConfirmResult = true;
GetAsyncVerifyUserResult(&confirmResult, &confirmState);
if (confirmResult == true)
{
gConfirmState = CONFIRM_STATE_ACCEPTED;
HandleDoxmPostRequest(ehRequest);
- return NULL;
+ g_isConfirmResult = false;
}
else
{
gConfirmState = CONFIRM_STATE_DENIED;
HandleDoxmPostRequest(ehRequest);
- return NULL;
+ g_isConfirmResult = false;
}
DestroyEntityHandlerRequest(ehRequest);
copyOfRequest->numRcvdVendorSpecificHeaderOptions = 0;
copyOfRequest->rcvdVendorSpecificHeaderOptions = NULL;
- if (copyOfRequest)
- {
- OIC_LOG(INFO, TAG, "Copied client request");
- }
- else
- {
- OIC_LOG(ERROR, TAG, "Error copying client request");
- }
+ OIC_LOG(INFO, TAG, "Copied client request");
+
return copyOfRequest;
}
#endif // defined(__WITH_DTLS__) || defined (__WITH_TLS__)
* In case of other transport adapter, duplicate message check is not required.
*/
if (OC_ADAPTER_IP == ehRequest->devAddr.adapter &&
- previousMsgId == ehRequest->messageID)
+ previousMsgId == ehRequest->messageID && g_isConfirmResult == false)
{
isDuplicatedMsg = true;
}
ehRet = OC_EH_NOT_ACCEPTABLE;
goto exit;
}
+
+ if(0 != memcmp(&gDoxm->owner.id, &newDoxm->owner.id, sizeof(gDoxm->owner.id)))
+ {
+ OIC_LOG(ERROR, TAG, "Not acceptable request for owned property");
+ ehRet = OC_EH_NOT_ACCEPTABLE;
+ }
+
//Update gDoxm based on newDoxm
updateWriteableProperty(newDoxm, gDoxm);
{
oc_thread_detach(g_waitConfirmThreadId);
}
+
+ previousMsgId = ehRequest->messageID;
+
return OC_EH_SLOW;
}
}
InvokeOtmEventHandler(ehRequest->devAddr.addr, ehRequest->devAddr.port,
NULL, OIC_OTM_ERROR);
#endif
- RestoreDoxmToInitState();
- RestorePstatToInitState();
+ ResetSecureResourceInPS();
OIC_LOG(WARNING, TAG, "DOXM will be reverted.");
}
}