[IOT-3040] OCProvisionTrustCertChain CB not called 85/24585/3
authorVitalii Irkha <v.irkha@samsung.com>
Thu, 5 Apr 2018 12:29:26 +0000 (15:29 +0300)
committerAleksey Volkov <a.volkov@samsung.com>
Fri, 13 Apr 2018 15:15:46 +0000 (15:15 +0000)
SRPGetSpResourceCB registers any client responce.

Change-Id: Ib24479bfd76c8c683998ac4c7187dfc90fb47041
Signed-off-by: Vitalii Irkha <v.irkha@samsung.com>
resource/csdk/security/provisioning/sample/provisioningclient.c
resource/csdk/security/provisioning/src/secureresourceprovider.c

index cb0277c..302f8a0 100644 (file)
@@ -3511,19 +3511,19 @@ int main(void)
         case _33_CHECK_LINK_STATUS_:
             if(checkLinkedStatus())
             {
-                OIC_LOG(ERROR, TAG, "_34_CHECK_LINK_STATUS_: error");
+                OIC_LOG(ERROR, TAG, "_33_CHECK_LINK_STATUS_: error");
             }
             break;
         case _34_SAVE_ACL_:
             if(saveAcl())
             {
-                OIC_LOG(ERROR, TAG, "_35_SAVE_ACL_: error");
+                OIC_LOG(ERROR, TAG, "_34_SAVE_ACL_: error");
             }
             break;
         case _35_PROVIS_CERT_:
             if (provisionCert())
             {
-                OIC_LOG(ERROR, TAG, "_36_PROVIS_CERT_: error");
+                OIC_LOG(ERROR, TAG, "_35_PROVIS_CERT_: error");
             }
             break;
 #ifdef WITH_CLOUD
@@ -3549,7 +3549,7 @@ int main(void)
         case _39_PROVIS_SEC_PROFILE:
             if (provisionSecurityProfileInfo())
             {
-                OIC_LOG(ERROR, TAG, "_37_PROVIS_SEC_PROFILE: error");
+                OIC_LOG(ERROR, TAG, "_39_PROVIS_SEC_PROFILE: error");
             }
             break;
         case _40_UNLINK_PAIR_DEVS_:
index f09bdd8..b8cfd0e 100644 (file)
@@ -3868,17 +3868,14 @@ static OCStackApplicationResult SRPGetSpResourceCB(void *ctx, OCDoHandle UNUSED,
     GetSpData_t *getSpData = (GetSpData_t*)ctx;
     OCGetSpResultCB resultCallback = getSpData->resultCallback;
 
-    if (clientResponse)
+    if (clientResponse && (OC_STACK_OK == clientResponse->result))
     {
-        if (OC_STACK_OK == clientResponse->result)
-        {
             uint8_t *payload = ((OCSecurityPayload*)clientResponse->payload)->securityData;
             size_t size = ((OCSecurityPayload*)clientResponse->payload)->payloadSize;
 
             OIC_LOG_BUFFER(DEBUG, TAG, payload, size);
 
             registerResultForGetSpResourceCB(getSpData, OC_STACK_OK, payload, size);
-        }
     }
     else
     {