Commit a532ef72 authored by Dmitriy Zhuravlev's avatar Dmitriy Zhuravlev Committed by Randeep

[IOT-2359][IOT-2360][IOT-2364] Separate provisioning with DOS

Restore functions removed in https://gerrit.iotivity.org/gerrit/#/c/19931/
Add NULL checking for pDev2 in SRPProvisionCredentialsDos

Change-Id: Icf3397247478c97c7029380aadcaa5dd89b42870
Signed-off-by: default avatarDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20387Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatardongik Lee <dongik.lee@samsung.com>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Reviewed-by: default avatarJongmin Choi <jminl.choi@samsung.com>
Reviewed-by: Randeep's avatarRandeep Singh <randeep.s@samsung.com>
parent 485293de
......@@ -236,6 +236,22 @@ OCStackResult SRPProvisionCredentials(void *ctx,OicSecCredType_t type, size_t ke
const OicSecRole_t *role1,
const OicSecRole_t *role2,
OCProvisionResultCB resultCallback);
/**
* API to provision credential to devices with DOS.
*
* @param[in] ctx Application context to be returned in result callback.
* @param[in] type Type of credentials to be provisioned to the device.
* @param[in] keySize size of key
* @param[in] pDev1 Pointer to PMOwnedDeviceInfo_t instance, representing the resource to be provisioned.
* @param[in] pDev2 Pointer to PMOwnedDeviceInfo_t instance, representing the resource to be provisioned.
* @param[in] resultCallback callback provided by API user, callback will be called when
* provisioning request recieves a response from first resource server.
* @return OC_STACK_OK in case of success and other value otherwise.
*/
OCStackResult SRPProvisionCredentialsDos(void *ctx,OicSecCredType_t type, size_t keySize,
const OCProvisionDev_t *pDev1,
const OCProvisionDev_t *pDev2,
OCProvisionResultCB resultCallback);
/**
* Function to unlink devices.
......
......@@ -482,8 +482,8 @@ OCStackResult OCProvisionCredentials(void *ctx, OicSecCredType_t type, size_t ke
const OCProvisionDev_t *pDev2,
OCProvisionResultCB resultCallback)
{
return SRPProvisionCredentials(ctx, type, keySize,
pDev1, pDev2, NULL, NULL, NULL, resultCallback);
return SRPProvisionCredentialsDos(ctx, type, keySize,
pDev1, pDev2, resultCallback);
}
/**
......@@ -1275,8 +1275,8 @@ OCStackResult OCProvisionPairwiseDevices(void* ctx, OicSecCredType_t type, size_
link->resultCallback = resultCallback;
link->currentCountResults = 0;
link->resArr = (OCProvisionResult_t*) OICMalloc(sizeof(OCProvisionResult_t)*noOfResults);
res = SRPProvisionCredentials(link, type, keySize,
pDev1, pDev2, NULL, NULL, NULL, &ProvisionCredsCB);
res = SRPProvisionCredentialsDos(link, type, keySize,
pDev1, pDev2, &ProvisionCredsCB);
if (res != OC_STACK_OK)
{
OICFree(link->resArr);
......
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