Commit 02c32aaf authored by Jihun Ha's avatar Jihun Ha Committed by Uze Choi

Fix a wrong return if an user does not set a MOT configuration

If an user does not set any MOT configuration and ownership transfer is
successfully done, then a result should be ES_OK.
If ESOwnershipTransferData->getMOTMethod() is OIC_OXM_COUNT, it means user
does not set the configuration.

Change-Id: I055beed8e893ae0754a4f5ea467cbe99f649ca4d
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17973Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Tested-by: default avatarUze Choi <uzchoi@samsung.com>
parent eac7dffe
......@@ -1013,7 +1013,7 @@ namespace OIC
public:
#ifdef __WITH_DTLS__
ESOwnershipTransferData() :
m_MOTMethod(OIC_JUST_WORKS), m_preconfiguredPin("")
m_MOTMethod(OIC_OXM_COUNT), m_preconfiguredPin("")
{
}
......
......@@ -429,6 +429,7 @@ namespace OIC
ESResult EnrolleeSecurity::requestEnableMOTMode()
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "requestEnableMOTMode IN");
ESResult res = ESResult:: ES_ERROR;
OC::ResultCallBack changeMOTMethodCB = std::bind(
......@@ -460,6 +461,7 @@ namespace OIC
ESResult EnrolleeSecurity::provisionMOTConfig(const ESOwnershipTransferData& MOTData)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "provisionMOTConfig IN");
ESResult res = ESResult:: ES_ERROR;
if(!m_securedResource->isMOTEnabled())
......@@ -910,7 +912,8 @@ namespace OIC
return res;
}
#ifdef MULTIPLE_OWNER
if( m_securedResource->isMOTSupported())
if( m_securedResource->isMOTSupported() &&
ownershipTransferData.getMOTMethod() != OIC_OXM_COUNT)
{
res = provisionMOTConfig(ownershipTransferData);
}
......
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