Commit 6eb82077 authored by Ziran Sun's avatar Ziran Sun

Add check secure port info from EndPoints for Provisioning manager.

With OCF1.0 in place, secure and port are removed from policy schema.
These information are now available in EndPoints. Add support for this.
Otherwise provision discovery fails for format vnd_cbor.

Bug: https://jira.iotivity.org/browse/IOT-1987
Change-Id: I999aca98c6e7c5ba16dc1c63e7348c977daf8924
Signed-off-by: default avatarZiran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18605Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
parent 5c93577b
......@@ -753,6 +753,28 @@ static OCStackApplicationResult SecurePortDiscoveryHandler(void *ctx, OCDoHandle
{
securePort = resPayload->port;
}
else if (resPayload && resPayload->eps)
{
OCEndpointPayload* eps = resPayload->eps;
while (eps != NULL)
{
if ((eps->family & OC_FLAG_SECURE) &&
((OC_IP_USE_V6 == clientResponse->devAddr.flags &&
strchr(eps->addr, ':')) ||
(OC_IP_USE_V4 == clientResponse->devAddr.flags &&
strchr(eps->addr, ','))))
{
securePort = eps->port;
break;
}
eps = eps->next;
}
if (!securePort)
{
OIC_LOG(INFO, TAG, "Can not find secure port information.");
return OC_STACK_DELETE_TRANSACTION;
}
}
else
{
OIC_LOG(INFO, TAG, "Can not find secure port information.");
......@@ -763,8 +785,8 @@ static OCStackApplicationResult SecurePortDiscoveryHandler(void *ctx, OCDoHandle
#endif
DiscoveryInfo* pDInfo = (DiscoveryInfo*)ctx;
OCProvisionDev_t *ptr = GetDevice(&pDInfo->pCandidateList,
clientResponse->devAddr.addr,
clientResponse->devAddr.port);
clientResponse->devAddr.addr,
clientResponse->devAddr.port);
if(!ptr)
{
OIC_LOG(ERROR, TAG, "Can not find device information in the discovery candidate device list");
......
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