}
- void EnrolleeSecurity::SelectMOTMethodCB(PMResultList_t *result, int hasError)
+ void EnrolleeSecurity::selectMOTMethodCB(PMResultList_t *result, int hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "SelectMOTMethodCB IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "selectMOTMethodCB IN");
if (hasError)
{
OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG,
"selectMOTMethod API is failed with error %d", hasError);
- MOTMethodProvResult = false;
+ motMethodProvResult = false;
}
else
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "selectMOTMethod API is succeeded");
- MOTMethodProvResult = true;
+ motMethodProvResult = true;
}
delete result;
m_cond.notify_all();
}
- void EnrolleeSecurity::PreconfigPinProvCB(PMResultList_t *result, int hasError)
+ void EnrolleeSecurity::preconfigPinProvCB(PMResultList_t *result, int hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "PreconfigPinProvCB IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "preconfigPinProvCB IN");
if (hasError)
{
OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG,
"provisionPreconfPin API is failed with error %d", hasError);
- PreConfigPinProvResult = false;
+ preConfigPinProvResult = false;
}
else
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "provisionPreconfPin API is succeeded");
- PreConfigPinProvResult = true;
+ preConfigPinProvResult = true;
}
delete result;
m_cond.notify_all();
}
- void EnrolleeSecurity::MultipleOwnershipTransferCb(OC::PMResultList_t *result, int hasError)
+ void EnrolleeSecurity::multipleOwnershipTransferCb(OC::PMResultList_t *result, int hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "MultipleOwnershipTransferCb IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "multipleOwnershipTransferCb IN");
- OTMResult = false;
+ otmResult = false;
if (hasError)
{
- OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG, "MultipleOwnershipTransferCb is failed with code(%d)", hasError);
- OTMResult = false;
+ OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG, "multipleOwnershipTransferCb is failed with code(%d)", hasError);
+ otmResult = false;
m_cond.notify_all();
}
else
{
if( OC_STACK_OK == result->at(i).res )
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "MultipleOwnershipTransferCb is succeeded");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "multipleOwnershipTransferCb is succeeded");
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res);
OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", uuid.c_str());
- OTMResult = true;
+ otmResult = true;
}
else
{
- OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG, "OwnershipTransfer is failed with code(%d)", hasError);
- OTMResult = false;
+ OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG, "multipleOwnershipTransfer is failed with code(%d)", hasError);
+ otmResult = false;
}
}
}
}
}
- ESResult EnrolleeSecurity::RequestSetPreconfPinData(const ESOwnershipTransferData& MOTData)
+ ESResult EnrolleeSecurity::requestSetPreconfPinData(const ESOwnershipTransferData& MOTData)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "RequestSetPreconfPinData IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "requestSetPreconfPinData IN");
ESResult res = ESResult::ES_ERROR;
OC::ResultCallBack preconfigPinProvCB = std::bind(
&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
std::placeholders::_1, std::placeholders::_2,
- static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::PreconfigPinProvCB,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::preconfigPinProvCB,
this, std::placeholders::_1, std::placeholders::_2)),
shared_from_this());
std::unique_lock<std::mutex> lck(m_mtx);
m_cond.wait(lck);
- if(!PreConfigPinProvResult)
+ if(!preConfigPinProvResult)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "provisionPreconfPin is failed.");
res = ESResult:: ES_PRE_CONFIG_PIN_PROVISIONING_FAILURE;
return ESResult::ES_OK;
}
- ESResult EnrolleeSecurity::RequestSetMOTMethod(const ESOwnershipTransferData& MOTData)
+ ESResult EnrolleeSecurity::requestSetMOTMethod(const ESOwnershipTransferData& MOTData)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "RequestSetMOTMethod IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "requestSetMOTMethod IN");
ESResult res = ESResult::ES_ERROR;
OC::ResultCallBack selectMOTMethodCB = std::bind(
&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
std::placeholders::_1, std::placeholders::_2,
- static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::SelectMOTMethodCB,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::selectMOTMethodCB,
this, std::placeholders::_1, std::placeholders::_2)),
shared_from_this());
std::unique_lock<std::mutex> lck(m_mtx);
m_cond.wait(lck);
- if(!MOTMethodProvResult)
+ if(!motMethodProvResult)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "selectMOTMethod is failed.");
res = ESResult:: ES_MOT_METHOD_SELECTION_FAILURE;
if( OIC_PRECONFIG_PIN == MOTData.getMOTMethod() &&
!MOTData.getPreConfiguredPin().empty())
{
- res = RequestSetPreconfPinData(MOTData);
+ res = requestSetPreconfPinData(MOTData);
if(res != ESResult::ES_OK)
{
if(OIC_PRECONFIG_PIN == MOTData.getMOTMethod() ||
OIC_RANDOM_DEVICE_PIN == MOTData.getMOTMethod())
{
- res = RequestSetMOTMethod(MOTData);
+ res = requestSetMOTMethod(MOTData);
if(res != ESResult::ES_OK)
{
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "ownershipTransferCb IN");
- OTMResult = false;
+ otmResult = false;
if (hasError)
{
OicSecOxm_t oxm = OIC_OXM_COUNT;
if(OC_STACK_OK != m_securedResource->getOTMethod(&oxm))
{
- OTMResult = false;
+ otmResult = false;
return;
}
}
OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG, "OwnershipTransfer is failed with ESResult(%d)", res);
- OTMResult = false;
+ otmResult = false;
}
else
{
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res);
OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", uuid.c_str());
- OTMResult = true;
+ otmResult = true;
}
else
{
OIC_LOG_V(ERROR, ENROLEE_SECURITY_TAG, "OwnershipTransfer is failed with code(%d)", hasError);
- OTMResult = false;
+ otmResult = false;
}
}
}
std::unique_lock<std::mutex> lck(m_mtx);
m_cond.wait(lck);
- if(!OTMResult)
+ if(!otmResult)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Ownership-Transfer failed.");
return res;
OC::ResultCallBack multipleOwnershipTransferCb =
std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
std::placeholders::_1, std::placeholders::_2,
- static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::MultipleOwnershipTransferCb,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::multipleOwnershipTransferCb,
this, std::placeholders::_1, std::placeholders::_2)),
shared_from_this());
std::unique_lock<std::mutex> lck(m_mtx);
m_cond.wait(lck);
- if(!OTMResult)
+ if(!otmResult)
{
OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Multiple Ownership-Transfer failed.");
return ESResult::ES_OWNERSHIP_TRANSFER_FAILURE;
OC::ResultCallBack CertProvisioningCb =
std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
std::placeholders::_1, std::placeholders::_2,
- static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::CertProvisioningCb,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::certProvisioningCb,
this, std::placeholders::_1, std::placeholders::_2)),
shared_from_this());
OC::ResultCallBack aclProvisioningCb =
std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
std::placeholders::_1, std::placeholders::_2,
- static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::ACLProvisioningCb,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::aclProvisioningCb,
this, std::placeholders::_1, std::placeholders::_2)),
shared_from_this());
return acl;
}
- void EnrolleeSecurity::ACLProvisioningCb(PMResultList_t *result, int hasError)
+ void EnrolleeSecurity::aclProvisioningCb(PMResultList_t *result, int hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "ACLProvisioningCb IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "aclProvisioningCb IN");
if (hasError)
{
m_cond.notify_all();
}
- void EnrolleeSecurity::CertProvisioningCb(PMResultList_t *result, int hasError)
+ void EnrolleeSecurity::certProvisioningCb(PMResultList_t *result, int hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "CertProvisioningCb IN");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "certProvisioningCb IN");
if (hasError)
{
std::mutex m_mtx;
std::condition_variable m_cond;
- std::atomic<bool> OTMResult;
+ std::atomic<bool> otmResult;
std::atomic<bool> enableMOTModeResult;
- std::atomic<bool> MOTMethodProvResult;
- std::atomic<bool> PreConfigPinProvResult;
+ std::atomic<bool> motMethodProvResult;
+ std::atomic<bool> preConfigPinProvResult;
std::atomic<bool> removeDeviceResult;
std::atomic<bool> aclResult;
std::atomic<bool> certResult;
ESResult performMultipleOwnershipTransfer(const ESOwnershipTransferData& MOTdata);
void changeMOTMethodCB(PMResultList_t *result, int hasError);
- void SelectMOTMethodCB(PMResultList_t *result, int hasError);
- void PreconfigPinProvCB(PMResultList_t *result, int hasError);
- void MultipleOwnershipTransferCb(OC::PMResultList_t *result, int hasError);
+ void selectMOTMethodCB(PMResultList_t *result, int hasError);
+ void preconfigPinProvCB(PMResultList_t *result, int hasError);
+ void multipleOwnershipTransferCb(OC::PMResultList_t *result, int hasError);
bool isSubOwnerIDMatched(std::shared_ptr< OC::OCSecureResource > foundDevice);
- ESResult RequestSetPreconfPinData(const ESOwnershipTransferData& MOTData);
- ESResult RequestSetMOTMethod(const ESOwnershipTransferData& MOTData);
+ ESResult requestSetPreconfPinData(const ESOwnershipTransferData& MOTData);
+ ESResult requestSetMOTMethod(const ESOwnershipTransferData& MOTData);
ESResult requestEnableMOTMode();
ESResult provisionMOTConfig(const ESOwnershipTransferData& MOTData);
#endif
std::shared_ptr< OC::OCSecureResource > ownedDevice,
std::string& cloudUuid);
OicSecAcl_t* createAcl(const OicUuid_t cloudUuid);
- void ACLProvisioningCb(PMResultList_t *result, int hasError);
- void CertProvisioningCb(PMResultList_t *result, int hasError);
+ void aclProvisioningCb(PMResultList_t *result, int hasError);
+ void certProvisioningCb(PMResultList_t *result, int hasError);
#endif //defined(__WITH_DTLS__) && defined(__WITH_TLS__)
};
}