[IOT-1763] Implemented device onboarding state CR 23 93/17993/13
authorNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Sun, 19 Mar 2017 04:17:19 +0000 (21:17 -0700)
committerGreg Zaverucha <gregz@microsoft.com>
Fri, 24 Mar 2017 21:57:12 +0000 (21:57 +0000)
Added oic.r.pstat Property "dos" as made mandatory by
OCF Security Specification CR 23.

patch set 2: Functional cbor marshalling.

patch set 3: Updated json2cbor tool and every svr.json and
.dat file I could find to use the new pstat.dos property.

patch set 4: Updated json2cbor tool to support oic 1.1 format
but print warning if .dos property not found.

patch set 5: Added better handling for .dat files that don't
contain "dos" Property, to aid in legacy app migration.

patch set 6: Rebase.

patch set 7: Fixed unittest issue that appeared after re-base,
and addressed misc comments on patch set 5.

patch set 8: commit msg fix.

patch set 9: added "TODO" items for UPDATE handling once
other CRs are done.

patch set 10: addressed a few of Kevin's comments.

patch set 11: rebase

patch set 12: addressed Greg's request for specific JIRA numbers.

Change-Id: I6d9751ff1e6d7d88789e1462819736b38f176a53
Signed-off-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17993
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Greg Zaverucha <gregz@microsoft.com>
74 files changed:
java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.dat
java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.json
java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.dat
java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.json
java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.dat
java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.json
java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.dat
java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.json
java/examples-java/provisioningclient/src/main/assets/oic_svr_db_client.json
java/examples-java/simpleclient/src/main/assets/oic_svr_db_client.json
java/examples-java/simpleclientserver/src/main/assets/oic_svr_db_client.json
java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.dat
java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.json
resource/csdk/security/include/internal/srmresourcestrings.h
resource/csdk/security/include/securevirtualresourcetypes.h
resource/csdk/security/provisioning/sample/cloud.dat
resource/csdk/security/provisioning/sample/cloud.json
resource/csdk/security/provisioning/sample/oic_svr_db_client.dat
resource/csdk/security/provisioning/sample/oic_svr_db_client.json
resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.dat
resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.json
resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat
resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json
resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.dat
resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.json
resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.dat
resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.json
resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat
resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.json
resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.dat
resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.json
resource/csdk/security/src/pstatresource.c
resource/csdk/security/src/srmresourcestrings.c
resource/csdk/security/tool/json2cbor.c
resource/csdk/security/unittest/oic_svr_db.dat
resource/csdk/security/unittest/oic_svr_db.json
resource/csdk/security/unittest/oic_svr_db_prov.dat
resource/csdk/security/unittest/oic_svr_db_prov.json
resource/csdk/security/unittest/oic_unittest.dat
resource/csdk/security/unittest/oic_unittest.json
resource/csdk/security/unittest/pstatresource.cpp
resource/csdk/stack/samples/linux/secure/README [deleted file]
resource/csdk/stack/samples/linux/secure/oic_amss_db.dat
resource/csdk/stack/samples/linux/secure/oic_amss_db.json
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.dat
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.json
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.dat
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.json
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.dat
resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.json
resource/csdk/stack/samples/linux/secure/oic_svr_db_server.dat
resource/csdk/stack/samples/linux/secure/oic_svr_db_server.json
resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.dat
resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.json
resource/examples/oic_svr_db_client.dat
resource/examples/oic_svr_db_client.json
resource/examples/oic_svr_db_client_directpairing.dat
resource/examples/oic_svr_db_client_directpairing.json
resource/examples/oic_svr_db_server.dat
resource/examples/oic_svr_db_server.json
resource/provisioning/examples/cloud.dat
resource/provisioning/examples/cloud.json
resource/provisioning/examples/oic_svr_db_client.dat
resource/provisioning/examples/oic_svr_db_client.json
resource/provisioning/examples/oic_svr_db_subowner_client.dat
resource/provisioning/examples/oic_svr_db_subowner_client.json
service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.dat
service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.json
service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.dat
service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.json
service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.dat
service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.json
service/resource-encapsulation/unittests/oic_svr_db_re_client.dat
service/resource-encapsulation/unittests/oic_svr_db_re_client.json

index 91be3ca..0586649 100644 (file)
Binary files a/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.dat and b/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.dat differ
index 03bca8c..bbcd7f9 100644 (file)
@@ -61,6 +61,7 @@
         "rowneruuid" : "61646D69-6E44-6576-6963-655575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "cm": 2,\r
         "tm": 0,\r
index a7549d1..e486637 100644 (file)
Binary files a/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.dat and b/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.dat differ
index 29fd2bd..fccc4db 100644 (file)
@@ -49,6 +49,7 @@
         "rowneruuid" : "61646D69-6E44-6576-6963-655575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "cm": 2,\r
         "tm": 0,\r
index 3a61974..2957343 100644 (file)
Binary files a/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.dat and b/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.dat differ
index 0cce3d9..cc0dde4 100644 (file)
@@ -49,6 +49,7 @@
         "rowneruuid" : "32323232-3232-3232-3232-323232323232"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "32323232-3232-3232-3232-323232323232",\r
         "rowneruuid": "32323232-3232-3232-3232-323232323232",\r
index 1c6c9e1..f018452 100644 (file)
Binary files a/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.dat and b/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.dat differ
index 776cccd..11dbf46 100644 (file)
@@ -79,6 +79,7 @@
         "rowneruuid" : "31313131-3131-3131-3131-313131313131"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31313131-3131-3131-3131-313131313131",\r
         "rowneruuid": "31313131-3131-3131-3131-313131313131",\r
index 1219d6a..d9b618f 100644 (file)
@@ -24,6 +24,7 @@
         }
        ],
        "pstat":        {
+               "dos": {"s": 3, "p": false},
                "isop": true,
                "deviceid":     "YWRtaW5EZXZpY2VVVUlEMA==",
                "ch": 0,
index c16acb8..0b24158 100644 (file)
@@ -24,6 +24,7 @@
         }
        ],
        "pstat":        {
+               "dos": {"s": 3, "p": false},
                "isop": true,
                "deviceid":     "ZGV2aWNlaWQAAAAAABhanw==",
                "ch": 0,
index c16acb8..0b24158 100644 (file)
@@ -24,6 +24,7 @@
         }
        ],
        "pstat":        {
+               "dos": {"s": 3, "p": false},
                "isop": true,
                "deviceid":     "ZGV2aWNlaWQAAAAAABhanw==",
                "ch": 0,
index 9e4d7fa..5f303de 100644 (file)
Binary files a/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.dat and b/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.dat differ
index f6d3dca..2d43654 100644 (file)
@@ -67,6 +67,7 @@
         "rowneruuid" : "31313131-3131-3131-3131-313131313131"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31313131-3131-3131-3131-313131313131",\r
         "rowneruuid": "31313131-3131-3131-3131-313131313131",\r
index 85ba6e8..3a5d38a 100644 (file)
@@ -157,6 +157,9 @@ extern const char * OIC_JSON_EOWNERID_NAME;
 extern const char * OIC_JSON_ENCODING_NAME;
 extern const char * OIC_JSON_DATA_NAME;
 extern const char * OIC_JSON_SEC_V_NAME;
+extern const char * OIC_JSON_DOS_NAME;
+extern const char * OIC_JSON_S_NAME;
+extern const char * OIC_JSON_P_NAME;
 
 extern const char * OIC_JSON_EMPTY_STRING;
 
index 7fdd5f3..c58d722 100644 (file)
@@ -218,6 +218,21 @@ typedef unsigned int OSCTBitmask_t;
  */
 typedef OSCTBitmask_t OicSecCredType_t;
 
+typedef enum OicSecDeviceOnboardingState
+{
+    DOS_RESET = 0,
+    DOS_RFOTM,
+    DOS_RFPRO,
+    DOS_RFNOP,
+    DOS_SRESET
+} OicSecDeviceOnboardingState_t;
+
+typedef struct OicSecDostype
+{
+    OicSecDeviceOnboardingState_t state;
+    bool                          pending;
+} OicSecDostype_t;
+
 typedef struct OicSecDoxm OicSecDoxm_t;
 
 /**
@@ -541,6 +556,7 @@ struct OicSecDoxm
 struct OicSecPstat
 {
     // <Attribute ID>:<Read/Write>:<Multiple/Single>:<Mandatory?>:<Type>
+    OicSecDostype_t     dos;            // -:RW:S:Y:oic.sec.dostype
     bool                isOp;           // 0:R:S:Y:Boolean
     OicSecDpm_t         cm;             // 1:R:S:Y:oic.sec.dpmtype
     OicSecDpm_t         tm;             // 2:RW:S:Y:oic.sec.dpmtype
index a7549d1..86434cc 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/cloud.dat and b/resource/csdk/security/provisioning/sample/cloud.dat differ
index 7f6e747..31657f1 100644 (file)
@@ -47,6 +47,7 @@
         "rowneruuid" : "61646D69-6E44-6576-6963-655575696430"
     },
     "pstat": {
+        "dos": {"s": 3, "p": false},
         "isop": true,
         "cm": 0,
         "tm": 0,
index 1463162..86434cc 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat differ
index 1da8e2d..3e802d7 100644 (file)
@@ -47,6 +47,7 @@
         "rowneruuid" : "61646D69-6E44-6576-6963-655575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "cm": 0,\r
         "tm": 0,\r
index ac1c15f..a2a81fa 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.dat differ
index 244ee83..aac2964 100644 (file)
@@ -53,6 +53,7 @@
         "rowneruuid" : ""
     },
     "pstat": {
+        "dos": {"s": 1, "p": false},
         "isop": false,
         "deviceuuid": "",
         "rowneruuid": "",
index 5d5d827..87196f9 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat differ
index 92b63cc..fe9bd15 100644 (file)
@@ -53,6 +53,7 @@
         "rowneruuid" : "6A757374-776F-726B-4465-765575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 1, "p": false},\r
         "isop": false,\r
         "deviceuuid": "6A757374-776F-726B-4465-765575696430",\r
         "rowneruuid": "6A757374-776F-726B-4465-765575696430",\r
index 2391448..31de64e 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.dat differ
index dd811fb..6b6c464 100644 (file)
@@ -53,6 +53,7 @@
         "rowneruuid" : "6D766A75-7374-776F-726B-735575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 1, "p": false},\r
         "isop": false,\r
         "deviceuuid": "6D766A75-7374-776F-726B-735575696430",\r
         "rowneruuid": "6D766A75-7374-776F-726B-735575696430",\r
index 472ef8e..14f7bc6 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.dat differ
index 89b960c..2f9e80b 100644 (file)
@@ -53,6 +53,7 @@
         "rowneruuid" : "50726563-6F6E-6669-6775-72656450494E"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 1, "p": false},\r
         "isop": false,\r
         "deviceuuid": "50726563-6F6E-6669-6775-72656450494E",\r
         "rowneruuid": "50726563-6F6E-6669-6775-72656450494E",\r
index 9da9035..141a9c6 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat differ
index 90863b1..d808256 100644 (file)
@@ -53,6 +53,7 @@
         "rowneruuid" : "72616E64-5069-6E44-6576-557569643030"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 1, "p": false},\r
         "isop": false,\r
         "deviceuuid": "72616E64-5069-6E44-6576-557569643030",\r
         "rowneruuid": "72616E64-5069-6E44-6576-557569643030",\r
index ae130bc..7de6747 100644 (file)
Binary files a/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.dat and b/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.dat differ
index eba0cdd..acd4ac8 100644 (file)
@@ -65,6 +65,7 @@
         "rowneruuid" : "5375624F-776E-6572-436C-69656E743030"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "cm": 0,\r
         "tm": 0,\r
index d6a7b68..d7ed7ba 100644 (file)
@@ -43,14 +43,18 @@ static const uint16_t CBOR_SIZE = 512;
 static const uint16_t CBOR_MAX_SIZE = 4400;
 
 // PSTAT Map size - Number of mandatory items
-static const uint8_t PSTAT_MAP_SIZE = 6;
+static const uint8_t PSTAT_MAP_SIZE = 7;
+
+// .dos Property map size
+static const uint8_t PSTAT_DOS_MAP_SIZE = 2;
 
 // Number of writeable property
-static const uint8_t WRITEABLE_PROPERTY_SIZE = 2;
+static const uint8_t WRITEABLE_PROPERTY_SIZE = 3;
 
 static OicSecDpom_t gSm = SINGLE_SERVICE_CLIENT_DRIVEN;
 static OicSecPstat_t gDefaultPstat =
 {
+    {DOS_RFOTM, false},                       // OicSecDostype_t dos
     false,                                    // bool isop
     TAKE_OWNER,                               // OicSecDpm_t cm
     NORMAL,                                   // OicSecDpm_t tm
@@ -65,6 +69,16 @@ static OicSecPstat_t    *gPstat = NULL;
 
 static OCResourceHandle gPstatHandle = NULL;
 
+/**
+ * Get the default value.
+ *
+ * @return the gDefaultPstat pointer.
+ */
+static OicSecPstat_t* GetPstatDefault()
+{
+    return &gDefaultPstat;
+}
+
 /**
  * This method is internal method.
  * the param roParsed is optionally used to know whether cborPayload has
@@ -85,6 +99,28 @@ void DeletePstatBinData(OicSecPstat_t* pstat)
     }
 }
 
+/**
+ * Function to update persistent storage
+ */
+static bool UpdatePersistentStorage(OicSecPstat_t *pstat)
+{
+    bool bRet = false;
+
+    size_t size = 0;
+    uint8_t *cborPayload = NULL;
+    OCStackResult ret = PstatToCBORPayload(pstat, &cborPayload, &size, false);
+    if (OC_STACK_OK == ret)
+    {
+        if (OC_STACK_OK == UpdateSecureResourceInPS(OIC_JSON_PSTAT_NAME, cborPayload, size))
+        {
+            bRet = true;
+        }
+        OICFree(cborPayload);
+    }
+
+    return bRet;
+}
+
 OCStackResult PstatToCBORPayload(const OicSecPstat_t *pstat, uint8_t **payload, size_t *size,
                                  bool writableOnly)
 {
@@ -120,27 +156,59 @@ OCStackResult PstatToCBORPayload(const OicSecPstat_t *pstat, uint8_t **payload,
         pstatMapSize += WRITEABLE_PROPERTY_SIZE;
     }
 
+    // Top Level Pstat Map
     cborEncoderResult = cbor_encoder_create_map(&encoder, &pstatMap, pstatMapSize);
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding Pstat Map.");
 
+    // Device Onboarding State Property tag
+    cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_DOS_NAME,
+        strlen(OIC_JSON_DOS_NAME));
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding dos Name Tag.");
+
+    // Device Onboarding State Property map
+    CborEncoder dosMap;
+    cborEncoderResult = cbor_encoder_create_map(&pstatMap, &dosMap, PSTAT_DOS_MAP_SIZE);
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed creating pstat.dos map");
+
+    cborEncoderResult = cbor_encode_text_string(&dosMap, OIC_JSON_S_NAME,
+        strlen(OIC_JSON_S_NAME));
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding pstat.dos.s tag.");
+
+    cborEncoderResult = cbor_encode_int(&dosMap, pstat->dos.state);
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding pstat.dos.s value.");
+
+    cborEncoderResult = cbor_encode_text_string(&dosMap, OIC_JSON_P_NAME,
+        strlen(OIC_JSON_P_NAME));
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding pstat.dos.p tag.");
+
+    cborEncoderResult = cbor_encode_boolean(&dosMap, pstat->dos.pending);
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed adding pstat.dos.p value.");
+
+    cborEncoderResult = cbor_encoder_close_container(&pstatMap, &dosMap);
+    VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed closing pstat.dos map");
+
+    // IsOp Property
     cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_ISOP_NAME,
         strlen(OIC_JSON_ISOP_NAME));
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding ISOP Name Tag.");
     cborEncoderResult = cbor_encode_boolean(&pstatMap, pstat->isOp);
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding ISOP Name Value.");
 
+    // cm Property
     cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_CM_NAME,
         strlen(OIC_JSON_CM_NAME));
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding CM Name Tag.");
     cborEncoderResult = cbor_encode_int(&pstatMap, pstat->cm);
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding CM Name Value.");
 
+    // tm Property
     cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_TM_NAME,
         strlen(OIC_JSON_TM_NAME));
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding TM Name Tag.");
     cborEncoderResult = cbor_encode_int(&pstatMap, pstat->tm);
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding TM Name Value.");
 
+    // om Property
     cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_OM_NAME,
         strlen(OIC_JSON_OM_NAME));
     VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding OM Name Tag.");
@@ -149,12 +217,14 @@ OCStackResult PstatToCBORPayload(const OicSecPstat_t *pstat, uint8_t **payload,
 
     if (false == writableOnly)
     {
+        // sm Property
         cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_SM_NAME,
             strlen(OIC_JSON_SM_NAME));
         VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding SM Name Tag.");
         cborEncoderResult = cbor_encode_int(&pstatMap, pstat->sm[0]);
         VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding SM Name Value.");
 
+        // rowneruuid property
         cborEncoderResult = cbor_encode_text_string(&pstatMap, OIC_JSON_ROWNERID_NAME,
             strlen(OIC_JSON_ROWNERID_NAME));
         VERIFY_CBOR_SUCCESS(TAG, cborEncoderResult, "Failed Adding ROwner Id Tag.");
@@ -250,24 +320,108 @@ static OCStackResult CBORPayloadToPstatBin(const uint8_t *cborPayload, const siz
     }
 
     OCStackResult ret = OC_STACK_ERROR;
-    *secPstat = NULL;
-
-    CborValue pstatCbor;
-    CborParser parser;
+    CborValue pstatCbor = { .parser = NULL };
+    CborValue pstatMap = { .parser = NULL, .ptr = NULL, .remaining = 0, .extra = 0, .type = 0, .flags = 0 };
+    CborValue dosMap = { .parser = NULL, .ptr = NULL, .remaining = 0, .extra = 0, .type = 0, .flags = 0 };
+    CborParser parser = { .end = NULL };
     CborError cborFindResult = CborNoError;
     char *strUuid = NULL;
+    char *dosTagName = NULL;
     size_t len = 0;
+    size_t dosLen = 0;
+    OicSecPstat_t *pstat = NULL;
 
-    cbor_parser_init(cborPayload, size, 0, &parser, &pstatCbor);
-    CborValue pstatMap = { .parser = NULL };
+    *secPstat = NULL;
 
-    OicSecPstat_t *pstat = NULL;
-    cborFindResult = cbor_value_enter_container(&pstatCbor, &pstatMap);
-    VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding PSTAT Map.");
+    // init cbor parser
+    cbor_parser_init(cborPayload, size, 0, &parser, &pstatCbor);
 
+    // allocate pstat struct
     pstat = (OicSecPstat_t *)OICCalloc(1, sizeof(OicSecPstat_t));
     VERIFY_NOT_NULL(TAG, pstat, ERROR);
 
+    // Individual Properties missing from cbor representation may result in
+    // pstat Property assignment to existing gPstat values.  Therefore,
+    // we must ensure that gPstat to a valid value, to avoid null deref.
+    if (!gPstat)
+    {
+        gPstat = GetPstatDefault();
+    }
+    VERIFY_NOT_NULL(TAG, gPstat, FATAL);
+
+    // Enter pstat Map
+    cborFindResult = cbor_value_enter_container(&pstatCbor, &pstatMap);
+    VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Entering pstat Map.");
+
+    // Find pstat.dos tag
+    cborFindResult = cbor_value_map_find_value(&pstatCbor, OIC_JSON_DOS_NAME, &pstatMap);
+    VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding dos tag.");
+
+    if (CborInvalidType != pstatMap.type)
+    {
+        // found pstat.dos tag "dos" in pstatMap
+        OIC_LOG(INFO, TAG, "Found pstat.dos tag in pstatMap.");
+        if (CborNoError == cborFindResult && cbor_value_is_container(&pstatMap))
+        {
+            OIC_LOG(INFO, TAG, "Found pstat.dos cbor container; entering.");
+            cborFindResult = cbor_value_enter_container(&pstatMap, &dosMap);
+            VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Entering dos map.");
+        }
+        while (cbor_value_is_valid(&dosMap) && cbor_value_is_text_string(&dosMap))
+        {
+            cborFindResult = cbor_value_dup_text_string(&dosMap, &dosTagName, &dosLen, NULL);
+            VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed getting dos map next tag.");
+            cborFindResult = cbor_value_advance(&dosMap);
+            VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed advancing dos map.");
+
+            if (NULL != dosTagName)
+            {
+                if (strcmp(dosTagName, OIC_JSON_S_NAME) == 0)
+                {
+                    OIC_LOG(INFO, TAG, "Found pstat.dos.s tag; getting int value.");
+                    int s = -1;
+                    cborFindResult = cbor_value_get_int(&dosMap, &s);
+                    VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed getting pstat.dos.s value.");
+                    OIC_LOG_V(INFO, TAG, "Read pstat.dos.s value = %d.", s);
+                    pstat->dos.state = (OicSecDeviceOnboardingState_t)s;
+                }
+                else if (strcmp(dosTagName, OIC_JSON_P_NAME) == 0)
+                {
+                    OIC_LOG(INFO, TAG, "Found pstat.dos.p tag; getting boolean value.");
+                    bool p = false;
+                    cborFindResult = cbor_value_get_boolean(&dosMap, &p);
+                    VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed getting pstat.dos.p value.");
+                    OIC_LOG_V(INFO, TAG, "Read pstat.dos.p value = %s.", p?"true":"false");
+                    pstat->dos.pending = p;
+                }
+                else
+                {
+                    OIC_LOG_V(WARNING, TAG, "Unknown tag name in dos map: %s", dosTagName);
+                }
+                free(dosTagName);
+                dosTagName = NULL;
+            }
+
+            if (cbor_value_is_valid(&dosMap))
+            {
+                cborFindResult = cbor_value_advance(&dosMap);
+                VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed advancing dos map.");
+            }
+        }
+    }
+    else
+    {
+        // didn't find pstat.dos tag "dos" in pstatMap
+        OIC_LOG(WARNING, TAG, "Did not find mandatory pstat.dos tag in pstatMap.");
+        OIC_LOG(WARNING, TAG, "If this is not an intentionally-partial pstat representation,");
+        OIC_LOG(WARNING, TAG, "it may be an outdated .dat file that is missing the \"dos\" Property.");
+        OIC_LOG(WARNING, TAG, "Using existing pstat.dos value from gPstat.");
+        pstat->dos.state = gPstat->dos.state;
+        pstat->dos.pending = gPstat->dos.pending;
+        cborFindResult = CborNoError;
+    }
+    // end pstat.dos map
+
     cborFindResult = cbor_value_map_find_value(&pstatCbor, OIC_JSON_ISOP_NAME, &pstatMap);
     if (CborNoError == cborFindResult && cbor_value_is_boolean(&pstatMap))
     {
@@ -368,6 +522,7 @@ static OCStackResult CBORPayloadToPstatBin(const uint8_t *cborPayload, const siz
     }
 
     *secPstat = pstat;
+
     ret = OC_STACK_OK;
 
 exit:
@@ -383,28 +538,6 @@ exit:
     return ret;
 }
 
-/**
- * Function to update persistent storage
- */
-static bool UpdatePersistentStorage(OicSecPstat_t *pstat)
-{
-    bool bRet = false;
-
-    size_t size = 0;
-    uint8_t *cborPayload = NULL;
-    OCStackResult ret = PstatToCBORPayload(pstat, &cborPayload, &size, false);
-    if (OC_STACK_OK == ret)
-    {
-        if (OC_STACK_OK == UpdateSecureResourceInPS(OIC_JSON_PSTAT_NAME, cborPayload, size))
-        {
-            bRet = true;
-        }
-        OICFree(cborPayload);
-    }
-
-    return bRet;
-}
-
 static bool ValidateQuery(const char * query)
 {
     OIC_LOG (DEBUG, TAG, "In ValidateQuery");
@@ -481,7 +614,7 @@ static OCEntityHandlerResult HandlePstatGetRequest (const OCEntityHandlerRequest
  * The entity handler determines how to process a POST request.
  * Per the REST paradigm, POST can also be used to update representation of existing
  * resource or create a new resource.
- * For pstat, it updates only tm and om.
+ * For pstat, it updates only dos, isOp, tm, om, and rowneruuid.
  */
 static OCEntityHandlerResult HandlePstatPostRequest(OCEntityHandlerRequest *ehRequest)
 {
@@ -540,7 +673,8 @@ static OCEntityHandlerResult HandlePstatPostRequest(OCEntityHandlerRequest *ehRe
             }
             validReq = false;
 
-            //Currently, IoTivity only supports Single Service Client Directed provisioning
+            // Currently, IoTivity only supports Single Service Client Directed provisioning
+            // TODO [IOT-1763]: update this state management logic as part of CR 32.
             if (pstat->om == SINGLE_SERVICE_CLIENT_DRIVEN)
             {
                 if ((pstat->cm & RESET) && false == pstat->isOp)
@@ -591,10 +725,13 @@ static OCEntityHandlerResult HandlePstatPostRequest(OCEntityHandlerRequest *ehRe
                 goto exit;
             }
 
+            // TODO [IOT-1763]: use SetState() function on dos as part of CR 32.
+            gPstat->dos.state = pstat->dos.state;
+            gPstat->dos.pending = pstat->dos.pending;
             gPstat->isOp = pstat->isOp;
             gPstat->om = pstat->om;
             gPstat->tm = pstat->tm;
-            gPstat->cm = pstat->cm;
+            gPstat->cm = pstat->cm; // TODO [IOT-1900]: remove once tm change is done in prov tool etc.
             memcpy(&(gPstat->rownerID), &(pstat->rownerID), sizeof(OicUuid_t));
 
             // Convert pstat data into CBOR for update to persistent storage
@@ -717,16 +854,6 @@ static OCEntityHandlerResult HandlePstatPostRequest(OCEntityHandlerRequest *ehRe
     return ret;
 }
 
-/**
- * Get the default value.
- *
- * @return the gDefaultPstat pointer.
- */
-static OicSecPstat_t* GetPstatDefault()
-{
-    return &gDefaultPstat;
-}
-
 OCStackResult InitPstatResource()
 {
     OCStackResult ret = OC_STACK_ERROR;
@@ -787,7 +914,8 @@ void RestorePstatToInitState()
     if(gPstat)
     {
         OIC_LOG(INFO, TAG, "PSTAT resource will revert back to initial status.");
-
+        gPstat->dos.state = DOS_RFOTM;
+        gPstat->dos.pending = false;
         gPstat->cm = (OicSecDpm_t)(gPstat->cm | TAKE_OWNER);
         gPstat->tm = (OicSecDpm_t)(gPstat->tm & (~TAKE_OWNER));
         gPstat->om = SINGLE_SERVICE_CLIENT_DRIVEN;
index 3d4b913..c7f127a 100644 (file)
@@ -151,6 +151,9 @@ const char * OIC_JSON_EOWNERID_NAME = "x.org.iotivity.eowneruuid";
 const char * OIC_JSON_ENCODING_NAME = "encoding";
 const char * OIC_JSON_DATA_NAME = "data";
 const char * OIC_JSON_SEC_V_NAME = "secv";
+const char * OIC_JSON_DOS_NAME = "dos";
+const char * OIC_JSON_S_NAME = "s";
+const char * OIC_JSON_P_NAME = "p";
 
 const char * OIC_JSON_EMPTY_STRING = "";
 
index da650f0..3149858 100644 (file)
@@ -739,10 +739,14 @@ OicSecPstat_t* JSONToPstatBin(const char * jsonStr)
         return NULL;
     }
 
+    OIC_LOG(INFO, TAG, "Using pstat with mandatory .dos object.");
+
     OCStackResult ret = OC_STACK_ERROR;
     OicSecPstat_t *pstat = NULL;
-    cJSON *jsonPstat = NULL;
     cJSON *jsonObj = NULL;
+    cJSON *jsonPstat = NULL;
+    cJSON *jsonDos = NULL;
+    cJSON *jsonDosObj = NULL;
 
     cJSON *jsonRoot = cJSON_Parse(jsonStr);
     VERIFY_NOT_NULL(TAG, jsonRoot, INFO);
@@ -752,6 +756,35 @@ OicSecPstat_t* JSONToPstatBin(const char * jsonStr)
 
     pstat = (OicSecPstat_t*)OICCalloc(1, sizeof(OicSecPstat_t));
     VERIFY_NOT_NULL(TAG, pstat, INFO);
+
+    jsonDos = cJSON_GetObjectItem(jsonPstat, OIC_JSON_DOS_NAME);
+    if (jsonDos) // do not abort if no .dos found, but print warning
+    {
+        OIC_LOG(INFO, TAG, "pstat.dos object found in jsonPstat");
+
+        jsonDosObj = cJSON_GetObjectItem(jsonDos, OIC_JSON_S_NAME);
+        VERIFY_NOT_NULL(TAG, jsonDosObj, ERROR);
+        OIC_LOG(INFO, TAG, "pstat.dos.s object found in jsonDos");
+        pstat->dos.state = jsonDosObj->valueint;
+        OIC_LOG_V(INFO, TAG, "pstat.dos.s = %d", pstat->dos.state);
+
+        jsonDosObj = cJSON_GetObjectItem(jsonDos, OIC_JSON_P_NAME);
+        VERIFY_NOT_NULL(TAG, jsonDosObj, ERROR);
+        OIC_LOG(INFO, TAG, "pstat.dos.p object found in jsonDos");
+        VERIFY_SUCCESS(TAG, (cJSON_True == jsonDosObj->type || cJSON_False == jsonDosObj->type) , ERROR);
+        pstat->dos.pending = (bool)jsonDosObj->valueint;
+        OIC_LOG_V(INFO, TAG, "pstat.dos.p = %s", pstat->dos.pending?"true":"false");
+    }
+    else
+    {
+        pstat->dos.state = DOS_RFOTM;
+        pstat->dos.pending = false;
+        printf("\n***** Pstat.dos Property not found in JSON file. *****\
+            \n***** Pstat.dos Property is MANDATORY as of OCF 1.0 *****\
+            \n***** Using default .dos vals: s = %d, p = %s *****\n\n", pstat->dos.state, \
+            pstat->dos.pending?"true":"false");
+    }
+
     jsonObj = cJSON_GetObjectItem(jsonPstat, OIC_JSON_ISOP_NAME);
     VERIFY_NOT_NULL(TAG, jsonObj, ERROR);
     VERIFY_SUCCESS(TAG, (cJSON_True == jsonObj->type || cJSON_False == jsonObj->type) , ERROR);
index 56af560..87d5155 100644 (file)
Binary files a/resource/csdk/security/unittest/oic_svr_db.dat and b/resource/csdk/security/unittest/oic_svr_db.dat differ
index 00fdea4..d4639a3 100644 (file)
@@ -73,6 +73,7 @@
         "rowneruuid" : "756E6B6E-6F77-6564-4465-766963654964"
     },
     "pstat": {
+        "dos": {"s": 1, "p": false},
         "isop": false,
         "deviceuuid": "756E6B6E-6F77-6564-4465-766963654964",
         "rowneruuid": "756E6B6E-6F77-6564-4465-766963654964",
index 69dcf23..06b2851 100644 (file)
Binary files a/resource/csdk/security/unittest/oic_svr_db_prov.dat and b/resource/csdk/security/unittest/oic_svr_db_prov.dat differ
index 608737b..8742bbe 100644 (file)
@@ -6,7 +6,8 @@
                 "subjectuuid": "61646d69-6e44-6576-6963-655575696430",\r
                 "credtype": 1,\r
                 "privatedata": {\r
-                    \r"data": "AAAAAAAAAAAAAAAA",\r
+\r
+"data": "AAAAAAAAAAAAAAAA",\r
                     "encoding": "oic.sec.encoding.raw"\r
                 }\r
             },\r
@@ -24,7 +25,8 @@
                 }\r
             }\r
         ],\r
-        \r"rowneruuid": "61646d69-6e44-6576-6963-655575696430"\r
+\r
+"rowneruuid": "61646d69-6e44-6576-6963-655575696430"\r
     },\r
     "acl": {\r
         "aclist": {\r
@@ -82,6 +84,7 @@
         "rowneruuid": "61646d69-6e44-6576-6963-655575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "646f6f72-4465-7669-6365-555549443030",\r
         "cm": 0,\r
index 4befed0..d083815 100644 (file)
Binary files a/resource/csdk/security/unittest/oic_unittest.dat and b/resource/csdk/security/unittest/oic_unittest.dat differ
index c435721..72683d5 100644 (file)
@@ -43,6 +43,7 @@
         "rowneruuid" : "32323232-3232-3232-3232-323232323232"
     },
     "pstat": {
+        "dos": {"s": 1, "p": false},
         "isop": false,
         "deviceuuid": "756E6B6E-6F77-6564-4465-766963654964",
         "rowneruuid": "756E6B6E-6F77-6564-4465-766963654964",
index c97dd6a..1a7db7b 100644 (file)
@@ -62,6 +62,8 @@ TEST(PstatResourceTest, PstatEntityHandlerWithPostRequest)
 {
     OicSecPstat_t *defaultPstat = (OicSecPstat_t *) OICCalloc(1, sizeof(*defaultPstat));
     ASSERT_TRUE(defaultPstat != NULL);
+    defaultPstat->dos.state = DOS_RFOTM;
+    defaultPstat->dos.pending = false;
     defaultPstat->isOp = false;
     defaultPstat->commitHash = 1234;
     defaultPstat->cm = 63;
@@ -117,6 +119,8 @@ TEST(PstatResourceTest, CBORPayloadToPstat)
 TEST(PstatResourceTest, PstatToCBORPayloadAndCBORPayloadToPstat)
 {
     OicSecPstat_t pstat;
+    pstat.dos.state = DOS_RFNOP;
+    pstat.dos.pending = false;
     pstat.cm = NORMAL;
     pstat.commitHash = 0;
     pstat.isOp = true;
@@ -140,6 +144,8 @@ TEST(PstatResourceTest, PstatToCBORPayloadAndCBORPayloadToPstat)
     OicSecPstat_t *pstat1 = NULL;
     EXPECT_EQ(OC_STACK_OK, CBORPayloadToPstat(cbor, size, &pstat1));
     ASSERT_TRUE(NULL != pstat1);
+    EXPECT_EQ(pstat.dos.state, pstat1->dos.state);
+    EXPECT_EQ(pstat.dos.pending, pstat1->dos.pending);
     EXPECT_EQ(pstat.commitHash, pstat1->commitHash);
     EXPECT_EQ(pstat.isOp, pstat1->isOp);
     EXPECT_EQ(pstat.tm, pstat1->tm);
diff --git a/resource/csdk/stack/samples/linux/secure/README b/resource/csdk/stack/samples/linux/secure/README
deleted file mode 100644 (file)
index e874653..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Testing AMS service:
-1. Copy subjectID ("NDQ0NDMzMzMyMjIyMTExMQ==") of ACE with resource "/a/led" from AMS service 
-   database file, "oic_amss_db.json" into client Doxm resource deviceID located in file 
-   "oic_svr_client.json".
-2. Start ocserverbasicops
-3. start ocamsservice
-4. Start occlientbasicops
-
-
-Expected Result:
-1. New ACE with subjectID="NDQ0NDMzMzMyMjIyMTExMQ==" and rsrc="/a/led/" will be appended to the
-   server ACL resource in file "oic_svr_db_server.json".
-2. GET request made by occlientbasicops will be received successfully
-3. PUT reuest will received with result "OC_STACK_UNAUTHORIZED_REQ"
index 3a8925e..8eb0616 100644 (file)
Binary files a/resource/csdk/stack/samples/linux/secure/oic_amss_db.dat and b/resource/csdk/stack/samples/linux/secure/oic_amss_db.dat differ
index 55c1d01..32d7b62 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "31393139-3139-3139-3139-313931393139"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31393139-3139-3139-3139-313931393139",\r
         "rowneruuid": "31393139-3139-3139-3139-313931393139",\r
index 8574d70..184e10f 100644 (file)
Binary files a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.dat and b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.dat differ
index 795d436..a5e4772 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "32323232-3232-3232-3232-323232323232"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "32323232-3232-3232-3232-323232323232",\r
         "rowneruuid": "32323232-3232-3232-3232-323232323232",\r
index 56f60b9..836dde1 100644 (file)
Binary files a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.dat and b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.dat differ
index 1fcceb7..c280b40 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "64697265-6374-7061-6972-696e67446576"
     },
     "pstat": {
+        "dos": {"s": 1, "p": false},
         "isop": false,
         "deviceuuid": "64697265-6374-7061-6972-696e67446576",
         "rowneruuid": "64697265-6374-7061-6972-696e67446576",
index fd246a8..7354bfd 100644 (file)
Binary files a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.dat and b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.dat differ
index 7590b46..f30b29e 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "31393139-3139-3139-3139-313931393139"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31393139-3139-3139-3139-313931393139",\r
         "rowneruuid": "31393139-3139-3139-3139-313931393139",\r
index a50a65a..ad154f7 100644 (file)
Binary files a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.dat and b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.dat differ
index 8d52f5c..c985873 100644 (file)
@@ -91,6 +91,7 @@
         "rowneruuid" : "31313131-3131-3131-3131-313131313131"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31313131-3131-3131-3131-313131313131",\r
         "rowneruuid": "31313131-3131-3131-3131-313131313131",\r
index e02d465..87196f9 100644 (file)
Binary files a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.dat and b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.dat differ
index b8941d4..58d12de 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid": "6a757374-776f-726b-4465-765575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 1, "p": false},\r
         "isop": false,\r
         "deviceuuid": "6a757374-776f-726b-4465-765575696430",\r
         "cm": 2,\r
index 8574d70..184e10f 100644 (file)
Binary files a/resource/examples/oic_svr_db_client.dat and b/resource/examples/oic_svr_db_client.dat differ
index 43d07b9..ef2ce9a 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "32323232-3232-3232-3232-323232323232"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "32323232-3232-3232-3232-323232323232",\r
         "rowneruuid": "32323232-3232-3232-3232-323232323232",\r
index 9aa6bcc..94c2d67 100644 (file)
Binary files a/resource/examples/oic_svr_db_client_directpairing.dat and b/resource/examples/oic_svr_db_client_directpairing.dat differ
index 577582f..e51bf08 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "64706169-7269-6e67-4465-765555494430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 1, "p": false},\r
         "isop": false,\r
         "deviceuuid": "64706169-7269-6e67-4465-765555494430",\r
         "rowneruuid": "64706169-7269-6e67-4465-765555494430",\r
index 138b960..5f303de 100644 (file)
Binary files a/resource/examples/oic_svr_db_server.dat and b/resource/examples/oic_svr_db_server.dat differ
index f6d3dca..2d43654 100644 (file)
@@ -67,6 +67,7 @@
         "rowneruuid" : "31313131-3131-3131-3131-313131313131"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31313131-3131-3131-3131-313131313131",\r
         "rowneruuid": "31313131-3131-3131-3131-313131313131",\r
index a7549d1..86434cc 100644 (file)
Binary files a/resource/provisioning/examples/cloud.dat and b/resource/provisioning/examples/cloud.dat differ
index 7f6e747..31657f1 100644 (file)
@@ -47,6 +47,7 @@
         "rowneruuid" : "61646D69-6E44-6576-6963-655575696430"
     },
     "pstat": {
+        "dos": {"s": 3, "p": false},
         "isop": true,
         "cm": 0,
         "tm": 0,
index a7549d1..86434cc 100644 (file)
Binary files a/resource/provisioning/examples/oic_svr_db_client.dat and b/resource/provisioning/examples/oic_svr_db_client.dat differ
index 15a0afc..7cf5d6e 100644 (file)
@@ -49,6 +49,7 @@
         "rowneruuid" : "61646D69-6E44-6576-6963-655575696430"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "cm": 0,\r
         "tm": 0,\r
index ae130bc..7de6747 100644 (file)
Binary files a/resource/provisioning/examples/oic_svr_db_subowner_client.dat and b/resource/provisioning/examples/oic_svr_db_subowner_client.dat differ
index eba0cdd..acd4ac8 100644 (file)
@@ -65,6 +65,7 @@
         "rowneruuid" : "5375624F-776E-6572-436C-69656E743030"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "cm": 0,\r
         "tm": 0,\r
index a7549d1..86434cc 100644 (file)
Binary files a/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.dat and b/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.dat differ
index 5bc15fc..bbf2144 100644 (file)
@@ -49,6 +49,7 @@
         "rowneruuid" : "61646d69-6e44-6576-6963-655575696430"
     },
     "pstat": {
+        "dos": {"s": 3, "p": false},
         "isop": true,
         "deviceuuid": "61646d69-6e44-6576-6963-655575696430",
         "rowneruuid": "61646d69-6e44-6576-6963-655575696430",
index 8574d70..184e10f 100644 (file)
Binary files a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.dat and b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.dat differ
index 43d07b9..ef2ce9a 100644 (file)
@@ -55,6 +55,7 @@
         "rowneruuid" : "32323232-3232-3232-3232-323232323232"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "32323232-3232-3232-3232-323232323232",\r
         "rowneruuid": "32323232-3232-3232-3232-323232323232",\r
index 1c6c9e1..f018452 100644 (file)
Binary files a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.dat and b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.dat differ
index 776cccd..11dbf46 100644 (file)
@@ -79,6 +79,7 @@
         "rowneruuid" : "31313131-3131-3131-3131-313131313131"\r
     },\r
     "pstat": {\r
+        "dos": {"s": 3, "p": false},\r
         "isop": true,\r
         "deviceuuid": "31313131-3131-3131-3131-313131313131",\r
         "rowneruuid": "31313131-3131-3131-3131-313131313131",\r
index f806a20..b128bcb 100644 (file)
Binary files a/service/resource-encapsulation/unittests/oic_svr_db_re_client.dat and b/service/resource-encapsulation/unittests/oic_svr_db_re_client.dat differ
index b6ff1aa..726ed9d 100644 (file)
@@ -73,6 +73,7 @@
         "rowneruuid" : "32323232-3232-3232-3232-323232323232"
     },
     "pstat": {
+        "dos": {"s": 3, "p": false},
         "isop": true,
         "deviceuuid": "32323232-3232-3232-3232-323232323232",
         "rowneruuid": "32323232-3232-3232-3232-323232323232",