*/
CloudProp()
{
+ m_cloudID = "";
+ m_credID = -1;
}
CloudProp(const CloudProp& cloudProp) :
- m_rep(cloudProp.toOCRepresentation()), m_cloudID(cloudProp.getCloudID())
+ m_rep(cloudProp.toOCRepresentation()),
+ m_cloudID(cloudProp.getCloudID()),
+ m_credID(cloudProp.getCredID())
{
}
CloudProp(const CloudProp&& cloudProp) :
- m_rep(std::move(cloudProp.toOCRepresentation())), m_cloudID(cloudProp.getCloudID())
+ m_rep(std::move(cloudProp.toOCRepresentation())),
+ m_cloudID(cloudProp.getCloudID()),
+ m_credID(cloudProp.getCredID())
{
}
throw ESException("Not found owned devices.");
}
- if(performACLProvisioningForCloudServer(ownedDevice, cloudUuid) != ESResult::ES_OK)
+ if(!cloudUuid.empty()
+ && performACLProvisioningForCloudServer(ownedDevice, cloudUuid) != ESResult::ES_OK)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "error performACLProvisioningForCloudServer");
throw ESException("error performACLProvisioningForCloudServer");
}
- if(performCertProvisioningForCloudServer(ownedDevice, credId) != ESResult::ES_OK)
+ if(credId != -1
+ && performCertProvisioningForCloudServer(ownedDevice, credId) != ESResult::ES_OK)
{
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "error performCertProvisioningForCloudServer");
throw ESException("error performCertProvisioningForCloudServer");
{
if (hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Error in provisioning operation!");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Error in ACL provisioning operation!");
aclResult = false;
}
else
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Received provisioning results: ");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Received ACL provisioning results: ");
std::string devUuid;
for (unsigned int i = 0; i < result->size(); i++)
{
if (hasError)
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Error in provisioning operation!");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Error in Cert. provisioning operation!");
aclResult = false;
}
else
{
- OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Received provisioning results: ");
+ OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Received Cert. provisioning results: ");
std::string devUuid;
for (unsigned int i = 0; i < result->size(); i++)
#if defined(__WITH_DTLS__) && defined(__WITH_TLS__)
try
{
- m_enrolleeSecurity = std::make_shared <EnrolleeSecurity> (m_ocResource, "");
-
- if(cloudProp.getCloudID().empty())
+ if(!(cloudProp.getCloudID().empty() && cloudProp.getCredID() == -1))
{
- throw ESInvalidParameterException("Invalid Cloud Server UUID.");
- }
+ m_enrolleeSecurity = std::make_shared <EnrolleeSecurity> (m_ocResource, "");
- m_enrolleeSecurity->provisionSecurityForCloudServer(cloudProp.getCloudID(),
- cloudProp.getCredID());
+ m_enrolleeSecurity->provisionSecurityForCloudServer(cloudProp.getCloudID(),
+ cloudProp.getCredID());
+ }
}
catch (const std::exception& e)