From 02c32aaf5be9784f064ab797792fe1780aaef93d Mon Sep 17 00:00:00 2001 From: Jihun Ha Date: Fri, 17 Mar 2017 17:20:44 +0900 Subject: [PATCH] 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: Jihun Ha Reviewed-on: https://gerrit.iotivity.org/gerrit/17973 Reviewed-by: Uze Choi Tested-by: Uze Choi --- service/easy-setup/mediator/richsdk/inc/ESRichCommon.h | 2 +- service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/service/easy-setup/mediator/richsdk/inc/ESRichCommon.h b/service/easy-setup/mediator/richsdk/inc/ESRichCommon.h index c0c1172..d346875 100755 --- a/service/easy-setup/mediator/richsdk/inc/ESRichCommon.h +++ b/service/easy-setup/mediator/richsdk/inc/ESRichCommon.h @@ -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("") { } diff --git a/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp b/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp index b553e93..4bd819d 100755 --- a/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp +++ b/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp @@ -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); } -- 2.7.4