Multiple Ownership Transfer support.
authorChul Lee <chuls.lee@samsung.com>
Fri, 14 Oct 2016 11:25:42 +0000 (20:25 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 14 Oct 2016 12:46:35 +0000 (12:46 +0000)
commitab62c8e15659e1b94259ac95b98e042383fc1cf9
tree77387d514bd0b52ff8c8ba11db4b213f1559b02f
parent8d7bb539d4325a857a8297a760348ccc0e1eb081
Multiple Ownership Transfer support.

  - Patch #1 : Initial upload
  - Patch #2 : Apply the conditional compilation for Multiple Owner features.
               e.g.) scons SECURED=1 MULTIPLE_OWNER=1
  - Patch #3 : Remove compile error for arduino
  - Patch #4-5 : Rebased for latest 1.2-rel branch
  - Patch #6 : Updated according to comment.
  - Patch #7 : Updated according to comments.
  - Patch #8 : Fixed unittest error.
  - Patch #9-10 : Fix svace issues
  - Patch #11 : Rebased with latest 1.2-rel
  - Patch #12 : Updated according to Kevin's comments.
  - Patch #13 : Rebased with latest 1.2-rel
  - Patch #14-15 : Fix svace issues
  - Patch #16 : Rebased with latest 1.2-rel
  - Patch #17 : Apply the optional compile for CA layer.

[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: I5449834e766d256495537d9fb469eb4d597f4c7a
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Signed-off-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12063
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
52 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
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/cloud/cloudCommon.c
resource/csdk/security/provisioning/sample/oic_svr_db_client_owned_by_subowner.dat [new file with mode: 0644]
resource/csdk/security/provisioning/sample/oic_svr_db_client_owned_by_subowner.json [new file with mode: 0644]
resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.dat [new file with mode: 0644]
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/sampleclient_owned_by_subowner.cpp [new file with mode: 0644]
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
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 [changed mode: 0644->0755]
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
resource/provisioning/examples/cloudClient.cpp