in case of pstat's device id is empty.
If you want test with empty device uuid,
please use the resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.dat
Patch #1 : Intial upload
Patch #2 : Add json file according to Mr.JongSung Lee's comment.
Change-Id: I9c791074cd5abe179c2c4cccbb66e0d95d044399
Signed-off-by: leechul <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7383
Reviewed-by: Kyungsun Cho <goodsun.cho@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
sec_provisioning_src_dir + 'oic_svr_db_server_justworks.dat')
randompindat = provisioning_env.Install(sec_provisioning_build_dir,
sec_provisioning_src_dir+ 'oic_svr_db_server_randompin.dat')
+randompin_with_emptyuuid_dat = provisioning_env.Install(sec_provisioning_build_dir,
+ sec_provisioning_src_dir+ 'oic_svr_db_randompin_with_empty_deviceid.dat')
-Alias("samples", [provisioningclient, sampleserver_justworks, sampleserver_randompin, clientdat, justworksdat, randompindat])
+Alias("samples", [provisioningclient, sampleserver_justworks, sampleserver_randompin, clientdat, justworksdat, randompindat, randompin_with_emptyuuid_dat])
provisioning_env.AppendTarget('samples')
--- /dev/null
+{
+ "acl": {
+ "aclist": {
+ "aces": [
+ {
+ "subjectuuid": "*",
+ "resources": [
+ {
+ "href": "/oic/res",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/res/d",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/res/types/d",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/presence",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ }
+ ],
+ "permission": 2
+ },
+ {
+ "subjectuuid": "*",
+ "resources": [
+ {
+ "href": "/oic/sec/doxm",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/sec/pstat",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/sec/acl",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/sec/cred",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ }
+ ],
+ "permission": 6
+ },
+ {
+ "subjectuuid": "*",
+ "resources": [
+ {
+ "href": "/oic/sec/pconf",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ },
+ {
+ "href": "/oic/sec/dpairing",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ }
+ ],
+ "permission": 6
+ },
+ {
+ "subjectuuid": "*",
+ "resources": [
+ {
+ "href": "/oic/sec/ver",
+ "rel": "",
+ "rt": "",
+ "if": ""
+ }
+ ],
+ "permission": 2
+ }
+ ]
+ },
+ "rowneruuid" : ""
+ },
+ "pstat": {
+ "isop": false,
+ "deviceuuid": "",
+ "rowneruuid": "",
+ "cm": 2,
+ "tm": 0,
+ "om": 3,
+ "sm": 3
+ },
+ "doxm": {
+ "oxms": [0, 1],
+ "oxmsel": 0,
+ "sct": 1,
+ "owned": false,
+ "deviceuuid": "",
+ "devowneruuid": "",
+ "rowneruuid": "",
+ "dpc": true
+ }
+}
}
if (data)
{
+ OicUuid_t emptyUuid = {.id={0}};
+
// Read ACL resource from PS
ret = CBORPayloadToPstat(data, size, &gPstat);
OICFree(data);
+
+ //In case of PStat's device id is empty, fill the device id as doxm's device id.
+ if(memcmp(&gPstat->deviceID, &emptyUuid, sizeof(OicUuid_t)) == 0)
+ {
+ OicUuid_t doxmUuid = {.id={0}};
+ if(OC_STACK_OK == GetDoxmDeviceID(&doxmUuid))
+ {
+ memcpy(&gPstat->deviceID, &doxmUuid, sizeof(OicUuid_t));
+ }
+ }
}
/*
* If SVR database in persistent storage got corrupted or