Changes to PolicyEngine to support rowner and isop checks.
authorleechul <chuls.lee@samsung.com>
Mon, 28 Mar 2016 04:58:25 +0000 (13:58 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Mon, 28 Mar 2016 06:18:38 +0000 (06:18 +0000)
commitf615e038a28c7283b06d343b1c15ab6275b7db48
tree8d25b8c881760359674d5fd4a3b8a651883c6218
parente99a7349101ceb29f5bb6bd3611a44ef232cb336
Changes to PolicyEngine to support rowner and isop checks.

Note that the pstat.isop must be set to "true" by the provisioning
tool after OTM is complete and provisioning is done!

patch #2 - added GetPstatIsop() function to pstatresource.h and .c.
Still needs to be properly provisioned by PT.

patch #3 - fixed unittest failure (workaround for now since proper
tests require device to be owned).  Also marked GetDeviceOwnerId()
function for fixing after schema updates are done.

patch #4 - change to Chul Lee's suggested design using function
array instead of case switch.  However it does not compile.  See
Reply comments please.

patch #5 - fixed compile error and also logic error (changed || to
&&)

patch #6 - implemented correct GetDoxmRownerId() in doxmresource.c.
Other entity handlers should follow this simple template after
schema update is done.

patch #7 - fixed build issue on other platforms (worked on Linux)

patch #8 - rebase

patch #9 - added correct functions for all resources with
rowner/rownerID vals.

patch #10 - changed behavior on SVRs without rownerID, since
devowner is already being checked.

patch #11 - rebase again

patch #12 - now that acl, amacl and cred have rownerID property,
added correct getRownerId() for those 3 resources

patch #13 - remove the unexpected condition in policyengine.c
            Please see my comments on line 465~473 in patch #12

Change-Id: If3c0a01f76260e10d3169fc0cfa79924175ca62d
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6185
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
18 files changed:
resource/csdk/security/include/internal/aclresource.h
resource/csdk/security/include/internal/amaclresource.h
resource/csdk/security/include/internal/credresource.h
resource/csdk/security/include/internal/doxmresource.h
resource/csdk/security/include/internal/dpairingresource.h
resource/csdk/security/include/internal/pconfresource.h
resource/csdk/security/include/internal/policyengine.h
resource/csdk/security/include/internal/pstatresource.h
resource/csdk/security/include/securevirtualresourcetypes.h
resource/csdk/security/src/aclresource.c
resource/csdk/security/src/amaclresource.c
resource/csdk/security/src/credresource.c
resource/csdk/security/src/doxmresource.c
resource/csdk/security/src/dpairingresource.c
resource/csdk/security/src/pconfresource.c
resource/csdk/security/src/policyengine.c
resource/csdk/security/src/pstatresource.c
resource/csdk/security/unittest/policyengine.cpp