Multiple Ownership Transfer support.
authorChul Lee <chuls.lee@samsung.com>
Wed, 19 Oct 2016 01:32:32 +0000 (10:32 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 19 Oct 2016 10:34:44 +0000 (10:34 +0000)
commit933662a634ea3bd10add613ef167bdaf98be98c9
treeca1c3f5b308482fba954a15767d8a951f08f63a6
parent34a692f488c04e6014b0bbdc7c9adec31d69a409
Multiple Ownership Transfer support.

[NOTE] This patch includes the following patches for MOT :
   https://gerrit.iotivity.org/gerrit/#/c/12063/
   https://gerrit.iotivity.org/gerrit/#/c/13375/
   https://gerrit.iotivity.org/gerrit/#/c/13341/
   https://gerrit.iotivity.org/gerrit/#/c/13343/

[Overview]
This patch is to support the multiple ownership transfer(MOT).
We assume the MOT authenticated client is the SubOwner.
SubOwner can access the ALL resources with full permsion except the DOXM, ACL and CRED.

This patch includes following changes :
1. Update the doxm resource to include MOT related properties.
   - New Properties
     . x.org.iotivity.mom : Mode of MOT
     . x.org.iotivity.subowneruuid : List of SubOwner
   - SubOwner has READ permission for DOXM.
   - The resource server will be update subowner list of doxm
     when MOT authentication successfully done.

2. Update the cred, acl resource to include MOT related property.
   - New Properties
     . x.org.iotivity.eowneruuid : entry owner uuid for each entry.
   - SubOwner should set the eowner as subowner's UUID
     when provision the ACL and CRED.
   - SubOwner can access only those resources that registered as eowner.

3. Update the PolicyEngine for SubOwner's access control as following :
   - DOXM : READ ONLY
   - CRED/ACL : SubOwner can access only those resources that registerd as eowner.
     . SubOwner can not provision ACL which is include the DOXM, CRED, ACL, PSTAT.
   - PSTAT : FULL permission
   - Application Resources : FULL permission

4. Add Preconfigured-PIN OxM

5. Update the sample codes
   - Test Preconfigured PIN based MOT
     1. Run the sampleserver_justworks
     2. Run the provisioningclient
     [On the provisioningclient]
     3. Perform the UnOwned Device discovery [Menu:11]
     4. Perform the OTM [Menu:20]
     5. Perform the Owned Device Discovery [Menu:12]
     6. Change the server's 'mode of MOT' [Menu:70]
     7. Perform the MOT enabled device discovery [Menu:13]
        - Check the discovered device list.
     8. POST the preconfigured-PIN credential [Menu:71]
         - sample's preconfigured-PIN is '12341234'
     9. Change the server's 'oxmsel' [Menu:72]
         - '3' is preconfigured-PIN OxM
     10. Run the subownerclient
     [On the subownerclient]
     11. Perform the MOT enabled device discovery [Menu:10]
         - Check the discovered device list.
     12. Perform the MOT [Menu:20]
     13. Perform the Multiple Owned device discovery [Menu:11]
         - Check the discovered device list.
     14. Perform the ACL provisioning TEST [Menu:40]

   - Test Random PIN based MOT
     1. Run the sampleserver_randompin
     2. Run the provisioningclient
     [On the provisioningclient]
     3. Perform the UnOwned Device discovery [Menu:11]
     4. Perform the OTM [Menu:20]
     5. Perform the Owned Device Discovery [Menu:12]
     6. Change the server's 'mode of MOT' [Menu:70]
     7. Run the subownerclient
     [On the subownerclient]
     8. Perform the MOT enabled device discovery [Menu:10]
         - Check the discovered device list.
     9. Perform the MOT [Menu:20]
         In case of random PIN based MOT, PIN input required.
     [On the sampleserver_randompin]
     10. Press 'G' or 'g' on the sampleserver_randompin.
         server will generate and display the random PIN.
     11. Input the server's PIN number on the subownerclient side.
     12. Perform the Multiple Owned device discovery [Menu:11]
         - Check the discovered device list.
     13. Perform the ACL provisioning TEST [Menu:40]
     14. Press 'E' or 'e' on the sampleserver_randompin to exit server.

Change-Id: I25d029839b3567455743031afafb34d2fc78278c
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13419
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
46 files changed:
build_common/SConscript
resource/csdk/connectivity/api/casecurityinterface.h
resource/csdk/connectivity/inc/ca_adapter_net_ssl.h
resource/csdk/connectivity/inc/caadapternetdtls.h
resource/csdk/connectivity/src/SConscript
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
resource/csdk/connectivity/src/caconnectivitymanager.c
resource/csdk/security/SConscript
resource/csdk/security/include/internal/aclresource.h
resource/csdk/security/include/internal/credresource.h
resource/csdk/security/include/internal/doxmresource.h
resource/csdk/security/include/internal/policyengine.h
resource/csdk/security/include/internal/srmresourcestrings.h
resource/csdk/security/include/pinoxmcommon.h
resource/csdk/security/include/securevirtualresourcetypes.h
resource/csdk/security/provisioning/SConscript
resource/csdk/security/provisioning/include/internal/multipleownershiptransfermanager.h [new file with mode: 0644]
resource/csdk/security/provisioning/include/ocprovisioningmanager.h [changed mode: 0755->0644]
resource/csdk/security/provisioning/include/oxm/oxmpreconfpin.h [new file with mode: 0644]
resource/csdk/security/provisioning/include/pmutility.h [changed mode: 0755->0644]
resource/csdk/security/provisioning/sample/SConscript
resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.json [new file with mode: 0644]
resource/csdk/security/provisioning/sample/provisioningclient.c
resource/csdk/security/provisioning/sample/sampleserver_randompin.cpp
resource/csdk/security/provisioning/sample/subownerclient.c [new file with mode: 0644]
resource/csdk/security/provisioning/src/credentialgenerator.c
resource/csdk/security/provisioning/src/multipleownershiptransfermanager.c [new file with mode: 0644]
resource/csdk/security/provisioning/src/ocprovisioningmanager.c [changed mode: 0755->0644]
resource/csdk/security/provisioning/src/ownershiptransfermanager.c
resource/csdk/security/provisioning/src/oxmpreconfpin.c [new file with mode: 0644]
resource/csdk/security/provisioning/src/oxmrandompin.c
resource/csdk/security/provisioning/src/pmutility.c [changed mode: 0755->0644]
resource/csdk/security/provisioning/unittest/SConscript
resource/csdk/security/provisioning/unittest/otmunittest.cpp [changed mode: 0755->0644]
resource/csdk/security/src/aclresource.c
resource/csdk/security/src/credresource.c
resource/csdk/security/src/doxmresource.c
resource/csdk/security/src/dpairingresource.c
resource/csdk/security/src/oxmpincommon.c
resource/csdk/security/src/policyengine.c
resource/csdk/security/src/secureresourcemanager.c
resource/csdk/security/src/srmresourcestrings.c
resource/csdk/security/src/srmutility.c
resource/csdk/security/tool/json2cbor.c
resource/csdk/security/unittest/SConscript
resource/csdk/security/unittest/credentialresource.cpp