Hi Ravee,
you are right, this is a bug.
I prepared a fix: https://gerrit.iotivity.org/gerrit/#/c/24239/, you can use it for your tests.
Best regards,
Aleksey Volkov
--------- Original Message ---------
Sender : Raveendranath Kondrakunta <raveendranath.kondraku...@gmail.com>
Date : 2018-02-28 11:22 (GMT+2)
Title : Re: [dev] SaveOwnerPSK - Bug or Intentional
- In the persistent store(oic_svr_db_server.dat and oic_svr_db_client.dat) rowneruuid of the Owner Credential (OC) stored as nil uuid.
- Using release 1.3.1
- Created my svr db files(both client and server) with initial values suitable for OTM. The content of db is attached. Please note that, no credential resources defined in db.
- Since, there is not Cred Resource in the db and also "GetCredDefault() in credresource.c is not defined yet, gRownerId is set to Nil UUID, as per InitCredResource definition.
- OTM successful, and SaveOwnerPSK called, followed by PostOwnerCredential
- SaveOwnerPSK, while saving cred to local db uses gRownerID, which is nil uuid
- PostOwnerCredential, doesn't post rowner at all
Hi Ravee,
The MULTIPLE_OWNER support is a vendor-defined feature (meaning, not in OCF Specifications), so the M_O behavior may not be clear if you’re reading the Specifications and looking at the M_O code.
However with M_O compiled out, what you are seeing looks correct: after completing the JustWorks OTM, the /cred Resource should have rowneruuid = <OBT UUID>, which should not be the Nil UUID (all zeroes). Can you explain if there is an issue/concern? Or are you just confirming what you see is expected?
Thanks,
Nathan
From: iotivity-dev-bounces@lists.
iotivity.org [mailto:iotivity-dev-bounces@lists.iotivity.org ] On Behalf Of Raveendranath Kondrakunta
Sent: Tuesday, February 27, 2018 8:31 AM
To: a.vol...@samsung.com
Cc: iotivity-dev@lists.iotivity.org
Subject: Re: [dev] SaveOwnerPSK - Bug or Intentional
Thanks Aleksey.
Yes, from the Cred data structure, for MULTIPLE_OWNER scenario, there is eownerID. How is it expected to behave, if the stack is not built for MULTIPLE_OWNER support.
I've built the stack without MULTIPLE_OWNER support.
- Completed Ownership transfer, using just works
- OBT is trying to install Owner Credential(OC) using SaveOwnerPSK
- The persistent store(oic_svr_db_server.dat and oic_svr_db_client.dat) have Owner Credential (OC) stored in them without rowneruuid all zeros.
-Ravee
On Tue, Feb 27, 2018 at 8:54 PM, Oleksiy Volkov <a.vol...@samsung.com> wrote:
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 listiotivity-dev@lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev
![]()
|
|
oic_svr_db_client.json
Description: Binary data
oic_svr_db_server_justworks.json
Description: Binary data
_______________________________________________ iotivity-dev mailing list iotivity-dev@lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev