A patch for security APIs is submitted: https://gerrit.iotivity.org/gerrit/#/c/15577/
With this patch, some points in easy setup can utilize the new APIs for more
correct decision.
Change-Id: I3b570f7f28d587ef39a0323f6d39294c0a391568
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15581
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit
bb947106af8e4b51603cc82c40f96b7c43283dd6)
Reviewed-on: https://gerrit.iotivity.org/gerrit/16013
{
m_devUUID = resource->getDeviceID();
m_isOwned = resource->getOwnedStatus();
+#ifdef MULTIPLE_OWNER
+ m_isMOTEnabled = resource->isMOTEnabled();
+#endif
- // TODO
- // When severAPIs in OCSecureResource for getting a list of supported methods or
- // status of MOT support, a code for setting this information will be implemeted.
- m_selectedOTMethod = OIC_JUST_WORKS;
+ if( OC_STACK_OK != resource->getOTMethod(&m_selectedOTMethod) )
+ {
+ m_selectedOTMethod = OIC_OXM_COUNT; // Out-of-range
+ }
}
}
return res;
}
#ifdef MULTIPLE_OWNER
- if( // m_securedResource->isMOTSupported() && //not provided, yet
+ if( m_securedResource->isMOTSupported() &&
+ m_securedResource->isMOTEnabled() &&
OIC_PRECONFIG_PIN == m_ownershipTransferData.getMOTMethod() &&
!m_ownershipTransferData.getPreConfiguredPin().empty())
{
}
}
- if(// m_securedResource->isMOTSupported() && //not provided, yet
- OIC_PRECONFIG_PIN == m_ownershipTransferData.getMOTMethod() ||
- OIC_RANDOM_DEVICE_PIN == m_ownershipTransferData.getMOTMethod())
+ if( m_securedResource->isMOTSupported() &&
+ m_securedResource->isMOTEnabled() &&
+ (OIC_PRECONFIG_PIN == m_ownershipTransferData.getMOTMethod() ||
+ OIC_RANDOM_DEVICE_PIN == m_ownershipTransferData.getMOTMethod()))
{
OC::ResultCallBack selectMOTMethodCB = std::bind(
&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
if(secProvisioningStatus->getESResult() == ES_SECURE_RESOURCE_IS_DISCOVERED)
{
-#if defined(__WITH_DTLS__) && defined(MULTIPLE_OWNER)
+#ifdef __WITH_DTLS__
cout << "Owned Status : " << secProvisioningStatus->isOwnedDevice() << std::endl;
cout << "OT Method : " << secProvisioningStatus->getSelectedOTMethod() << std::endl;
+#ifdef MULTIPLE_OWNER
+ cout << "MOT Enabled : " << secProvisioningStatus->isMOTEnabled() << std::endl;
// TEST
ESOwnershipTransferData OTData;
return OTData;
#endif
+#endif
}
else if(secProvisioningStatus->getESResult() == ES_OK)
{
if(secProvisioningStatus->getESResult() == ES_SECURE_RESOURCE_IS_DISCOVERED)
{
-#if defined(__WITH_DTLS__) && defined(MULTIPLE_OWNER)
+#ifdef __WITH_DTLS__
cout << "Owned Status : " << secProvisioningStatus->isOwnedDevice() << std::endl;
cout << "OT Method : " << secProvisioningStatus->getSelectedOTMethod() << std::endl;
+#ifdef MULTIPLE_OWNER
+ cout << "MOT Enabled : " << secProvisioningStatus->isMOTEnabled() << std::endl;
// TEST
ESOwnershipTransferData OTData;
return OTData;
#endif
+#endif
+
}
else if(secProvisioningStatus->getESResult() == ES_OK)
{