Hi Raveendranath,

 

This isn't ownerid, this is eownerID for MULTIPLE_OWNER scenario.

 

 

Best regards,

Aleksey Volkov

 

 

--------- Original Message ---------

Sender : Raveendranath Kondrakunta <raveendranath.kondraku...@gmail.com>

Date : 2018-02-27 17:14 (GMT+2)

Title : [dev] SaveOwnerPSK - Bug or Intentional

 

Hi,

While reading through the ownership transfer code, I came across this SaveOwnerPSK function.

This was generating a Symmetric pair wise key. The ownerid of the credential is set NULL, meaning that rowneruuid is all zeros. Is this intentional or a bug?

802 static OCStackResult SaveOwnerPSK(OCProvisionDev_t *selectedDeviceInfo)
803 {
804     OIC_LOG(DEBUG, TAG, "IN SaveOwnerPSK");
806     OCStackResult res = OC_STACK_ERROR;
808     CAEndpoint_t endpoint;
809     CopyDevAddrToEndpoint(&selectedDeviceInfo->endpoint, &endpoint);
810     endpoint.port = getSecurePort(selectedDeviceInfo);
812     OicUuid_t ownerDeviceID = {.id={0}};
813     if (OC_STACK_OK != GetDoxmDeviceID(&ownerDeviceID))
814     {
815         OIC_LOG(ERROR, TAG, "Error while retrieving Owner's device ID");
816         return res;
817     }
819     OicSecKey_t ownerKey;
820     memset(&ownerKey, 0, sizeof(ownerKey));
822     uint8_t ownerPSK[OWNER_PSK_LENGTH_128] = { 0 };
823     ownerKey.data = ownerPSK;
824     ownerKey.len = OWNER_PSK_LENGTH_128;
825     ownerKey.encoding = OIC_ENCODING_RAW;
827     //Generating OwnerPSK
828     CAResult_t pskRet = CAGenerateOwnerPSK(&endpoint,
829             (uint8_t *)GetOxmString(selectedDeviceInfo->doxm->oxmSel),
830             strlen(GetOxmString(selectedDeviceInfo->doxm->oxmSel)),
831             ownerDeviceID.id, sizeof(ownerDeviceID.id),
832             selectedDeviceInfo->doxm->deviceID.id, sizeof(selectedDeviceInfo->doxm->deviceID.id),
833             ownerPSK, OWNER_PSK_LENGTH_128);
835     if (CA_STATUS_OK == pskRet)
836     {
837         OIC_LOG(DEBUG, TAG,"Owner PSK dump:\n");
838         OIC_LOG_BUFFER(DEBUG, TAG,ownerPSK, OWNER_PSK_LENGTH_128);
839         //Generating new credential for provisioning tool
840         OicSecCred_t *cred = GenerateCredential(&selectedDeviceInfo->doxm->deviceID,
841                                   SYMMETRIC_PAIR_WISE_KEY, NULL,
842                                   &ownerKey, NULL);


-Ravee
_______________________________________________
iotivity-dev mailing list
iotivity-dev@lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

 

 

 

  

_______________________________________________
iotivity-dev mailing list
iotivity-dev@lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to