From: Nathan Heldt-Sheller Date: Sun, 19 Mar 2017 04:17:19 +0000 (-0700) Subject: [IOT-1763] Implemented device onboarding state CR 23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=208de8413e7d48a3fa9dd721d5bde41e8e08dbe4;p=contrib%2Fiotivity.git [IOT-1763] Implemented device onboarding state CR 23 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/17993 Tested-by: jenkins-iotivity Reviewed-by: Phil Coval Reviewed-by: Greg Zaverucha --- diff --git a/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.dat b/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.dat index 91be3ca..0586649 100644 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 diff --git a/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.json b/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.json index 03bca8c..bbcd7f9 100644 --- a/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.json +++ b/java/examples-android/cloudprovisioningclient/src/main/assets/oic_svr_db_client.json @@ -61,6 +61,7 @@ "rowneruuid" : "61646D69-6E44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 2, "tm": 0, diff --git a/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.dat b/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.dat index a7549d1..e486637 100644 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 diff --git a/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.json b/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.json index 29fd2bd..fccc4db 100644 --- a/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.json +++ b/java/examples-android/provisioningclient/src/main/assets/oic_svr_db_client.json @@ -49,6 +49,7 @@ "rowneruuid" : "61646D69-6E44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 2, "tm": 0, diff --git a/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.dat b/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.dat index 3a61974..2957343 100644 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 diff --git a/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.json b/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.json index 0cce3d9..cc0dde4 100644 --- a/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.json +++ b/java/examples-android/simpleclient/src/main/assets/oic_svr_db_client.json @@ -49,6 +49,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", diff --git a/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.dat b/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.dat index 1c6c9e1..f018452 100644 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 diff --git a/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.json b/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.json index 776cccd..11dbf46 100644 --- a/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.json +++ b/java/examples-android/simpleserver/src/main/assets/oic_svr_db_server.json @@ -79,6 +79,7 @@ "rowneruuid" : "31313131-3131-3131-3131-313131313131" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31313131-3131-3131-3131-313131313131", "rowneruuid": "31313131-3131-3131-3131-313131313131", diff --git a/java/examples-java/provisioningclient/src/main/assets/oic_svr_db_client.json b/java/examples-java/provisioningclient/src/main/assets/oic_svr_db_client.json index 1219d6a..d9b618f 100644 --- a/java/examples-java/provisioningclient/src/main/assets/oic_svr_db_client.json +++ b/java/examples-java/provisioningclient/src/main/assets/oic_svr_db_client.json @@ -24,6 +24,7 @@ } ], "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceid": "YWRtaW5EZXZpY2VVVUlEMA==", "ch": 0, diff --git a/java/examples-java/simpleclient/src/main/assets/oic_svr_db_client.json b/java/examples-java/simpleclient/src/main/assets/oic_svr_db_client.json index c16acb8..0b24158 100644 --- a/java/examples-java/simpleclient/src/main/assets/oic_svr_db_client.json +++ b/java/examples-java/simpleclient/src/main/assets/oic_svr_db_client.json @@ -24,6 +24,7 @@ } ], "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceid": "ZGV2aWNlaWQAAAAAABhanw==", "ch": 0, diff --git a/java/examples-java/simpleclientserver/src/main/assets/oic_svr_db_client.json b/java/examples-java/simpleclientserver/src/main/assets/oic_svr_db_client.json index c16acb8..0b24158 100644 --- a/java/examples-java/simpleclientserver/src/main/assets/oic_svr_db_client.json +++ b/java/examples-java/simpleclientserver/src/main/assets/oic_svr_db_client.json @@ -24,6 +24,7 @@ } ], "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceid": "ZGV2aWNlaWQAAAAAABhanw==", "ch": 0, diff --git a/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.dat b/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.dat index 9e4d7fa..5f303de 100644 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 diff --git a/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.json b/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.json index f6d3dca..2d43654 100644 --- a/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.json +++ b/java/examples-java/simpleserver/src/main/assets/oic_svr_db_server.json @@ -67,6 +67,7 @@ "rowneruuid" : "31313131-3131-3131-3131-313131313131" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31313131-3131-3131-3131-313131313131", "rowneruuid": "31313131-3131-3131-3131-313131313131", diff --git a/resource/csdk/security/include/internal/srmresourcestrings.h b/resource/csdk/security/include/internal/srmresourcestrings.h index 85ba6e8..3a5d38a 100644 --- a/resource/csdk/security/include/internal/srmresourcestrings.h +++ b/resource/csdk/security/include/internal/srmresourcestrings.h @@ -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; diff --git a/resource/csdk/security/include/securevirtualresourcetypes.h b/resource/csdk/security/include/securevirtualresourcetypes.h index 7fdd5f3..c58d722 100644 --- a/resource/csdk/security/include/securevirtualresourcetypes.h +++ b/resource/csdk/security/include/securevirtualresourcetypes.h @@ -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 { // :::: + 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 diff --git a/resource/csdk/security/provisioning/sample/cloud.dat b/resource/csdk/security/provisioning/sample/cloud.dat index a7549d1..86434cc 100644 Binary files a/resource/csdk/security/provisioning/sample/cloud.dat and b/resource/csdk/security/provisioning/sample/cloud.dat differ diff --git a/resource/csdk/security/provisioning/sample/cloud.json b/resource/csdk/security/provisioning/sample/cloud.json index 7f6e747..31657f1 100644 --- a/resource/csdk/security/provisioning/sample/cloud.json +++ b/resource/csdk/security/provisioning/sample/cloud.json @@ -47,6 +47,7 @@ "rowneruuid" : "61646D69-6E44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 0, "tm": 0, diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_client.dat index 1463162..86434cc 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_client.json b/resource/csdk/security/provisioning/sample/oic_svr_db_client.json index 1da8e2d..3e802d7 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_client.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_client.json @@ -47,6 +47,7 @@ "rowneruuid" : "61646D69-6E44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 0, "tm": 0, diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.dat index ac1c15f..a2a81fa 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.json b/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.json index 244ee83..aac2964 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_randompin_with_empty_deviceid.json @@ -53,6 +53,7 @@ "rowneruuid" : "" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "", "rowneruuid": "", diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.dat index 5d5d827..87196f9 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json b/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json index 92b63cc..fe9bd15 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_server_justworks.json @@ -53,6 +53,7 @@ "rowneruuid" : "6A757374-776F-726B-4465-765575696430" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "6A757374-776F-726B-4465-765575696430", "rowneruuid": "6A757374-776F-726B-4465-765575696430", diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.dat index 2391448..31de64e 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.json b/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.json index dd811fb..6b6c464 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_server_mvjustworks.json @@ -53,6 +53,7 @@ "rowneruuid" : "6D766A75-7374-776F-726B-735575696430" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "6D766A75-7374-776F-726B-735575696430", "rowneruuid": "6D766A75-7374-776F-726B-735575696430", diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.dat index 472ef8e..14f7bc6 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.json b/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.json index 89b960c..2f9e80b 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_server_preconfpin.json @@ -53,6 +53,7 @@ "rowneruuid" : "50726563-6F6E-6669-6775-72656450494E" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "50726563-6F6E-6669-6775-72656450494E", "rowneruuid": "50726563-6F6E-6669-6775-72656450494E", diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.dat index 9da9035..141a9c6 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.json b/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.json index 90863b1..d808256 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_server_randompin.json @@ -53,6 +53,7 @@ "rowneruuid" : "72616E64-5069-6E44-6576-557569643030" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "72616E64-5069-6E44-6576-557569643030", "rowneruuid": "72616E64-5069-6E44-6576-557569643030", diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.dat b/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.dat index ae130bc..7de6747 100644 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 diff --git a/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.json b/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.json index eba0cdd..acd4ac8 100644 --- a/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.json +++ b/resource/csdk/security/provisioning/sample/oic_svr_db_subowner_client.json @@ -65,6 +65,7 @@ "rowneruuid" : "5375624F-776E-6572-436C-69656E743030" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 0, "tm": 0, diff --git a/resource/csdk/security/src/pstatresource.c b/resource/csdk/security/src/pstatresource.c index d6a7b68..d7ed7ba 100644 --- a/resource/csdk/security/src/pstatresource.c +++ b/resource/csdk/security/src/pstatresource.c @@ -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 @@ -66,6 +70,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 * at least read only property value or not. @@ -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; diff --git a/resource/csdk/security/src/srmresourcestrings.c b/resource/csdk/security/src/srmresourcestrings.c index 3d4b913..c7f127a 100644 --- a/resource/csdk/security/src/srmresourcestrings.c +++ b/resource/csdk/security/src/srmresourcestrings.c @@ -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 = ""; diff --git a/resource/csdk/security/tool/json2cbor.c b/resource/csdk/security/tool/json2cbor.c index da650f0..3149858 100644 --- a/resource/csdk/security/tool/json2cbor.c +++ b/resource/csdk/security/tool/json2cbor.c @@ -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); diff --git a/resource/csdk/security/unittest/oic_svr_db.dat b/resource/csdk/security/unittest/oic_svr_db.dat index 56af560..87d5155 100644 Binary files a/resource/csdk/security/unittest/oic_svr_db.dat and b/resource/csdk/security/unittest/oic_svr_db.dat differ diff --git a/resource/csdk/security/unittest/oic_svr_db.json b/resource/csdk/security/unittest/oic_svr_db.json index 00fdea4..d4639a3 100644 --- a/resource/csdk/security/unittest/oic_svr_db.json +++ b/resource/csdk/security/unittest/oic_svr_db.json @@ -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", diff --git a/resource/csdk/security/unittest/oic_svr_db_prov.dat b/resource/csdk/security/unittest/oic_svr_db_prov.dat index 69dcf23..06b2851 100644 Binary files a/resource/csdk/security/unittest/oic_svr_db_prov.dat and b/resource/csdk/security/unittest/oic_svr_db_prov.dat differ diff --git a/resource/csdk/security/unittest/oic_svr_db_prov.json b/resource/csdk/security/unittest/oic_svr_db_prov.json index 608737b..8742bbe 100644 --- a/resource/csdk/security/unittest/oic_svr_db_prov.json +++ b/resource/csdk/security/unittest/oic_svr_db_prov.json @@ -6,7 +6,8 @@ "subjectuuid": "61646d69-6e44-6576-6963-655575696430", "credtype": 1, "privatedata": { - "data": "AAAAAAAAAAAAAAAA", + +"data": "AAAAAAAAAAAAAAAA", "encoding": "oic.sec.encoding.raw" } }, @@ -24,7 +25,8 @@ } } ], - "rowneruuid": "61646d69-6e44-6576-6963-655575696430" + +"rowneruuid": "61646d69-6e44-6576-6963-655575696430" }, "acl": { "aclist": { @@ -82,6 +84,7 @@ "rowneruuid": "61646d69-6e44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "646f6f72-4465-7669-6365-555549443030", "cm": 0, diff --git a/resource/csdk/security/unittest/oic_unittest.dat b/resource/csdk/security/unittest/oic_unittest.dat index 4befed0..d083815 100644 Binary files a/resource/csdk/security/unittest/oic_unittest.dat and b/resource/csdk/security/unittest/oic_unittest.dat differ diff --git a/resource/csdk/security/unittest/oic_unittest.json b/resource/csdk/security/unittest/oic_unittest.json index c435721..72683d5 100644 --- a/resource/csdk/security/unittest/oic_unittest.json +++ b/resource/csdk/security/unittest/oic_unittest.json @@ -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", diff --git a/resource/csdk/security/unittest/pstatresource.cpp b/resource/csdk/security/unittest/pstatresource.cpp index c97dd6a..1a7db7b 100644 --- a/resource/csdk/security/unittest/pstatresource.cpp +++ b/resource/csdk/security/unittest/pstatresource.cpp @@ -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 index e874653..0000000 --- a/resource/csdk/stack/samples/linux/secure/README +++ /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" diff --git a/resource/csdk/stack/samples/linux/secure/oic_amss_db.dat b/resource/csdk/stack/samples/linux/secure/oic_amss_db.dat index 3a8925e..8eb0616 100644 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 diff --git a/resource/csdk/stack/samples/linux/secure/oic_amss_db.json b/resource/csdk/stack/samples/linux/secure/oic_amss_db.json index 55c1d01..32d7b62 100644 --- a/resource/csdk/stack/samples/linux/secure/oic_amss_db.json +++ b/resource/csdk/stack/samples/linux/secure/oic_amss_db.json @@ -55,6 +55,7 @@ "rowneruuid" : "31393139-3139-3139-3139-313931393139" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31393139-3139-3139-3139-313931393139", "rowneruuid": "31393139-3139-3139-3139-313931393139", diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.dat b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.dat index 8574d70..184e10f 100644 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 diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.json b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.json index 795d436..a5e4772 100644 --- a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.json +++ b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_devowner.json @@ -55,6 +55,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", diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.dat b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.dat index 56f60b9..836dde1 100644 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 diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.json b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.json index 1fcceb7..c280b40 100644 --- a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.json +++ b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_directpairing.json @@ -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", diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.dat b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.dat index fd246a8..7354bfd 100644 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 diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.json b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.json index 7590b46..f30b29e 100644 --- a/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.json +++ b/resource/csdk/stack/samples/linux/secure/oic_svr_db_client_nondevowner.json @@ -55,6 +55,7 @@ "rowneruuid" : "31393139-3139-3139-3139-313931393139" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31393139-3139-3139-3139-313931393139", "rowneruuid": "31393139-3139-3139-3139-313931393139", diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.dat b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.dat index a50a65a..ad154f7 100644 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 diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.json b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.json index 8d52f5c..c985873 100644 --- a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.json +++ b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server.json @@ -91,6 +91,7 @@ "rowneruuid" : "31313131-3131-3131-3131-313131313131" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31313131-3131-3131-3131-313131313131", "rowneruuid": "31313131-3131-3131-3131-313131313131", diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.dat b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.dat index e02d465..87196f9 100644 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 diff --git a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.json b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.json index b8941d4..58d12de 100644 --- a/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.json +++ b/resource/csdk/stack/samples/linux/secure/oic_svr_db_server_justworks.json @@ -55,6 +55,7 @@ "rowneruuid": "6a757374-776f-726b-4465-765575696430" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "6a757374-776f-726b-4465-765575696430", "cm": 2, diff --git a/resource/examples/oic_svr_db_client.dat b/resource/examples/oic_svr_db_client.dat index 8574d70..184e10f 100644 Binary files a/resource/examples/oic_svr_db_client.dat and b/resource/examples/oic_svr_db_client.dat differ diff --git a/resource/examples/oic_svr_db_client.json b/resource/examples/oic_svr_db_client.json index 43d07b9..ef2ce9a 100644 --- a/resource/examples/oic_svr_db_client.json +++ b/resource/examples/oic_svr_db_client.json @@ -55,6 +55,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", diff --git a/resource/examples/oic_svr_db_client_directpairing.dat b/resource/examples/oic_svr_db_client_directpairing.dat index 9aa6bcc..94c2d67 100644 Binary files a/resource/examples/oic_svr_db_client_directpairing.dat and b/resource/examples/oic_svr_db_client_directpairing.dat differ diff --git a/resource/examples/oic_svr_db_client_directpairing.json b/resource/examples/oic_svr_db_client_directpairing.json index 577582f..e51bf08 100644 --- a/resource/examples/oic_svr_db_client_directpairing.json +++ b/resource/examples/oic_svr_db_client_directpairing.json @@ -55,6 +55,7 @@ "rowneruuid" : "64706169-7269-6e67-4465-765555494430" }, "pstat": { + "dos": {"s": 1, "p": false}, "isop": false, "deviceuuid": "64706169-7269-6e67-4465-765555494430", "rowneruuid": "64706169-7269-6e67-4465-765555494430", diff --git a/resource/examples/oic_svr_db_server.dat b/resource/examples/oic_svr_db_server.dat index 138b960..5f303de 100644 Binary files a/resource/examples/oic_svr_db_server.dat and b/resource/examples/oic_svr_db_server.dat differ diff --git a/resource/examples/oic_svr_db_server.json b/resource/examples/oic_svr_db_server.json index f6d3dca..2d43654 100644 --- a/resource/examples/oic_svr_db_server.json +++ b/resource/examples/oic_svr_db_server.json @@ -67,6 +67,7 @@ "rowneruuid" : "31313131-3131-3131-3131-313131313131" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31313131-3131-3131-3131-313131313131", "rowneruuid": "31313131-3131-3131-3131-313131313131", diff --git a/resource/provisioning/examples/cloud.dat b/resource/provisioning/examples/cloud.dat index a7549d1..86434cc 100644 Binary files a/resource/provisioning/examples/cloud.dat and b/resource/provisioning/examples/cloud.dat differ diff --git a/resource/provisioning/examples/cloud.json b/resource/provisioning/examples/cloud.json index 7f6e747..31657f1 100644 --- a/resource/provisioning/examples/cloud.json +++ b/resource/provisioning/examples/cloud.json @@ -47,6 +47,7 @@ "rowneruuid" : "61646D69-6E44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 0, "tm": 0, diff --git a/resource/provisioning/examples/oic_svr_db_client.dat b/resource/provisioning/examples/oic_svr_db_client.dat index a7549d1..86434cc 100644 Binary files a/resource/provisioning/examples/oic_svr_db_client.dat and b/resource/provisioning/examples/oic_svr_db_client.dat differ diff --git a/resource/provisioning/examples/oic_svr_db_client.json b/resource/provisioning/examples/oic_svr_db_client.json index 15a0afc..7cf5d6e 100644 --- a/resource/provisioning/examples/oic_svr_db_client.json +++ b/resource/provisioning/examples/oic_svr_db_client.json @@ -49,6 +49,7 @@ "rowneruuid" : "61646D69-6E44-6576-6963-655575696430" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 0, "tm": 0, diff --git a/resource/provisioning/examples/oic_svr_db_subowner_client.dat b/resource/provisioning/examples/oic_svr_db_subowner_client.dat index ae130bc..7de6747 100644 Binary files a/resource/provisioning/examples/oic_svr_db_subowner_client.dat and b/resource/provisioning/examples/oic_svr_db_subowner_client.dat differ diff --git a/resource/provisioning/examples/oic_svr_db_subowner_client.json b/resource/provisioning/examples/oic_svr_db_subowner_client.json index eba0cdd..acd4ac8 100644 --- a/resource/provisioning/examples/oic_svr_db_subowner_client.json +++ b/resource/provisioning/examples/oic_svr_db_subowner_client.json @@ -65,6 +65,7 @@ "rowneruuid" : "5375624F-776E-6572-436C-69656E743030" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "cm": 0, "tm": 0, diff --git a/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.dat b/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.dat index a7549d1..86434cc 100644 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 diff --git a/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.json b/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.json index 5bc15fc..bbf2144 100644 --- a/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.json +++ b/service/easy-setup/sampleapp/mediator/android/EasySetup/app/src/main/assets/oic_svr_db_client.json @@ -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", diff --git a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.dat b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.dat index 8574d70..184e10f 100644 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 diff --git a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.json b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.json index 43d07b9..ef2ce9a 100644 --- a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.json +++ b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_client.json @@ -55,6 +55,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", diff --git a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.dat b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.dat index 1c6c9e1..f018452 100644 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 diff --git a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.json b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.json index 776cccd..11dbf46 100644 --- a/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.json +++ b/service/resource-encapsulation/examples/linux/secureResourceExample/oic_svr_db_server.json @@ -79,6 +79,7 @@ "rowneruuid" : "31313131-3131-3131-3131-313131313131" }, "pstat": { + "dos": {"s": 3, "p": false}, "isop": true, "deviceuuid": "31313131-3131-3131-3131-313131313131", "rowneruuid": "31313131-3131-3131-3131-313131313131", diff --git a/service/resource-encapsulation/unittests/oic_svr_db_re_client.dat b/service/resource-encapsulation/unittests/oic_svr_db_re_client.dat index f806a20..b128bcb 100644 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 diff --git a/service/resource-encapsulation/unittests/oic_svr_db_re_client.json b/service/resource-encapsulation/unittests/oic_svr_db_re_client.json index b6ff1aa..726ed9d 100644 --- a/service/resource-encapsulation/unittests/oic_svr_db_re_client.json +++ b/service/resource-encapsulation/unittests/oic_svr_db_re_client.json @@ -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",