Commit bedf2f7a authored by leechul's avatar leechul Committed by Dmitriy Zhuravlev

RAML v1.1 sync-up in SVR DB

Patch#1 : Init
Patch#2 : add missed code
Patch#3 : sync-up ACL, change sample db file(dat, json)
Patch#4 : minor fix on ACL
Patch#5 : sync-up CRED
Patch#6 : minor fix on CRED
Patch#7 : add "didformat" into "doxm"
Patch#8 : remove "ch" and minor fix from "pstat"
Patch#9 : minor change
Patch#10 : change "oxm" to "oxms" in "doxm", minor change
Patch#11 : fix on CRED
Patch#12 : pconf sync up
Patch#13 : Remove TAB characters
Patch#14~16 : Remove the compile errors for arduino
Patch#16 : Modify the convertion funtion's error-handling logic to
           gurantee NULL termination of parameter in case of cbor error.
Patch#17 : 1. Rebase to resolve conflicts.
           2. Re-generate SVR DB(*.dat) files.
Patch#18 : 1. Resolve ownership transfer issues with two more servers.
           2. Resolve the unit test errors.
           3. Update unittest's SVR DB(*.dat) in CBOR format.
Patch#19~21 : Upload missing file.
Patch#22~23 : Update according to SVACE report.
Patch#24 : Update ocstack sample's SVR DB(*.dat) in CBOR format.
Patch#25 : Modify c++ samples SVR DB(*.dat, *.json) in correct format.
Patch#26-27 : Insert the device owner field as empty value explicitly
           into sample's default SVR DB.

Under test. Please don't merge this patch.

Change-Id: Ia3b6c65bf5c365c664e89d934042e30576f777bf
Signed-off-by: default avatarYonggoo Kang <ygace.kang@samsung.com>
Signed-off-by: default avatarAshwini Kumar <k.ashwini@samsung.com>
Signed-off-by: default avatarChul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6099Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarDmitriy Zhuravlev <d.zhuravlev@samsung.com>
parent 41d3dbf9
......@@ -36,6 +36,8 @@ extern const char * OIC_JSON_AMACL_NAME;
extern const char * OIC_RSRC_TYPE_SEC_ACL;
extern const char * OIC_RSRC_ACL_URI;
extern const char * OIC_JSON_ACL_NAME;
extern const char * OIC_JSON_ACLIST_NAME;
extern const char * OIC_JSON_ACES_NAME;
//PSTAT
extern const char * OIC_RSRC_TYPE_SEC_PSTAT;
......@@ -52,6 +54,7 @@ extern const char * OIC_JSON_DOXM_NAME;
extern const char * OIC_RSRC_TYPE_SEC_CRED;
extern const char * OIC_RSRC_CRED_URI;
extern const char * OIC_JSON_CRED_NAME;
extern const char * OIC_JSON_CREDS_NAME;
//CRL
extern const char * OIC_RSRC_TYPE_SEC_CRL;
......@@ -79,13 +82,17 @@ extern const char * OIC_RSRC_DPAIRING_URI;
extern const char * OIC_JSON_DPAIRING_NAME;
extern const char * OIC_JSON_SUBJECT_NAME;
extern const char * OIC_JSON_SUBJECTID_NAME;
extern const char * OIC_JSON_RESOURCES_NAME;
extern const char * OIC_JSON_AMSS_NAME;
extern const char * OIC_JSON_AMS_NAME;
extern const char * OIC_JSON_PERMISSION_NAME;
extern const char * OIC_JSON_OWNERS_NAME;
extern const char * OIC_JSON_OWNER_NAME;
extern const char * OIC_JSON_DEVOWNERID_NAME;
extern const char * OIC_JSON_OWNED_NAME;
extern const char * OIC_JSON_OXM_NAME;
extern const char * OIC_JSON_OXMS_NAME;
extern const char * OIC_JSON_OXM_TYPE_NAME;
extern const char * OIC_JSON_OXM_SEL_NAME;
extern const char * OIC_JSON_DEVICE_ID_FORMAT_NAME;
......@@ -94,6 +101,10 @@ extern const char * OIC_JSON_ROLEIDS_NAME;
extern const char * OIC_JSON_CREDTYPE_NAME;
extern const char * OIC_JSON_PUBLICDATA_NAME;
extern const char * OIC_JSON_PRIVATEDATA_NAME;
extern const char * OIC_JSON_PUBDATA_NAME;
extern const char * OIC_JSON_PRIVDATA_NAME;
extern const char * OIC_JSON_OPTDATA_NAME;
extern const char * OIC_JSON_CRMS_NAME;
extern const char * OIC_JSON_PERIOD_NAME;
extern const char * OIC_JSON_PERIODS_NAME;
extern const char * OIC_JSON_RECURRENCES_NAME;
......@@ -116,6 +127,14 @@ extern const char * OIC_JSON_ROWNER_NAME;
extern const char * OIC_JSON_PRM_NAME;
extern const char * OIC_JSON_SPM_NAME;
extern const char * OIC_JSON_PDEVICE_ID_NAME;
extern const char * OIC_JSON_RLIST_NAME;
extern const char * OIC_JSON_HREF_NAME;
extern const char * OIC_JSON_RT_NAME;
extern const char * OIC_JSON_IF_NAME;
extern const char * OIC_JSON_ROWNERID_NAME;
extern const char * OIC_JSON_ENCODING_NAME;
extern const char * OIC_JSON_EMPTY_STRING;
extern OicUuid_t WILDCARD_SUBJECT_ID;
extern OicUuid_t WILDCARD_SUBJECT_B64_ID;
......@@ -127,6 +146,9 @@ extern const char * OXM_JUST_WORKS;
extern const char * OXM_RANDOM_DEVICE_PIN;
extern const char * OXM_MANUFACTURER_CERTIFICATE;
extern const char * OIC_SEC_ENCODING_BASE64;
extern const char * OIC_SEC_ENCODING_BYTESTREAM;
extern const char * OIC_SEC_TRUE;
extern const char * OIC_SEC_FALSE;
......
......@@ -399,12 +399,13 @@ struct OicSecDoxm
//TODO: Need more clarification on deviceIDFormat field type.
//OicSecDvcIdFrmt_t deviceIDFormat; // 5:R:S:Y:UINT8
OicUuid_t deviceID; // 6:R:S:Y:oic.uuid
bool dpc; // 7:R:S:Y:Boolean
OicUuid_t owner; // 8:R:S:Y:oic.uuid
bool dpc; // 7:R:S:Y:Boolean
OicUuid_t owner; // 8:R:S:Y:oic.uuid
OicUuid_t rownerID; // 9:R:S:Y:oic.uuid
// NOTE: we are using UUID for Owner instead of Svc type for mid-April
// SRM version only; this will change to Svc type for full implementation.
//OicSecSvc_t devOwner; // 9:R:S:Y:oic.sec.svc
//OicSecSvc_t rOwner; // 10:R:S:Y:oic.sec.svc
//OicSecSvc_t devOwner; // 10:R:S:Y:oic.sec.svc
//OicSecSvc_t rOwner; // 11:R:S:Y:oic.sec.svc
//TODO change Owner type to oic.sec.svc
};
......@@ -424,6 +425,7 @@ struct OicSecPstat
size_t smLen; // the number of elts in Sm
OicSecDpom_t *sm; // 5:R:M:Y:oic.sec.dpom
uint16_t commitHash; // 6:R:S:Y:oic.sec.sha256
OicUuid_t rownerID; // 7:R:S:Y:oic.uuid
//TODO: this is supposed to be a 256-bit uint; temporarily use uint16_t
//TODO: need to decide which 256 bit and 128 bit types to use... boost?
};
......
......@@ -113,6 +113,29 @@ OCStackResult AddUuidArray(const cJSON* jsonRoot, const char* arrayItem,
*/
const char* GetOxmString(OicSecOxm_t oxmType);
/*
* This method converts UUID to canonical format string.
*
* @param uuid Device UUID
* @param strUuid converted UUID in canonical format
* @return OC_STACK_OK for success.
*
* @note Caller needs to invoke OICFree after done using the return pointer
*/
OCStackResult ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid);
/*
* This method converts string UUID to OicUuid_t.
*
* @param strUuid Device UUID in string format
* @param uuid converted UUID in OicUuid_t format
* @return OC_STACK_OK for success.
*
*/
OCStackResult ConvertStrToUuid(const char* strUuid, OicUuid_t* uuid);
#ifdef __cplusplus
}
#endif // __cplusplus
......
......@@ -87,7 +87,7 @@ if target_os == 'android':
provisioning_env.AppendUnique(LIBS = ['gnustl_static'])
if not env.get('RELEASE'):
provisioning_env.AppendUnique(LIBS = ['log'])
provisioning_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
if target_os in ['darwin', 'ios']:
provisioning_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
......
{
"acl": [
{
"sub": "Kg==",
"rsrc": [
"/oic/res",
"/oic/res/d",
"/oic/res/types/d",
"/oic/presence"
],
"perms": 2,
"ownrs" : [
"ZG9vckRldmljZVVVSUQwMA=="
"acl": {
"aclist":{
"aces":[
{
"subject": "*",
"resources": [
{
"href": "/oic/res",
"rt": "",
"if": ""
},
{
"href": "/oic/res/d",
"rt": "",
"if": ""
},
{
"href": "/oic/res/types/d",
"rt": "",
"if": ""
},
{
"href": "/oic/presence",
"rt": "",
"if": ""
}
],
"permission": 2
},
{
"subject": "*",
"resources": [
{
"href": "/oic/sec/doxm",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/pstat",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/acl",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/crl",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/cred",
"rt": "",
"if": ""
}
],
"permission": 6
}
]
},
{
"sub": "Kg==",
"rsrc": [
"/oic/sec/doxm",
"/oic/sec/pstat",
"/oic/sec/acl",
"/oic/sec/crl",
"/oic/sec/cred"
],
"perms": 6,
"ownrs" : [
"ZG9vckRldmljZVVVSUQwMA=="
]
}
],
"rownerid" : "646F6F72-4465-7669-6365-555549443030"
},
"pstat": {
"isop": false,
"deviceid": "ZG9vckRldmljZVVVSUQwMA==",
"ch": 0,
"deviceid": "646F6F72-4465-7669-6365-555549443030",
"rownerid": "646F6F72-4465-7669-6365-555549443030",
"cm": 2,
"tm": 0,
"om": 3,
"sm": [3]
},
"doxm": {
"oxm": [0],
"oxms": [0],
"oxmsel": 0,
"sct": 1,
"owned": false,
"deviceid": "ZG9vckRldmljZVVVSUQwMA==",
"dpc": true
"didformat": 0,
"dpc": false,
"deviceid": "646F6F72-4465-7669-6365-555549443030",
"rownerid": "646F6F72-4465-7669-6365-555549443030"
}
}
{
"acl": [
{
"sub": "Kg==",
"rsrc": [
"/oic/res",
"/oic/res/d",
"/oic/res/types/d",
"/oic/presence"
],
"perms": 2,
"ownrs" : [
"bGlnaHREZXZpY2VVVUlEMA=="
"acl": {
"aclist":{
"aces":[
{
"subject": "*",
"resources": [
{
"href": "/oic/res",
"rt": "",
"if": ""
},
{
"href": "/oic/res/d",
"rt": "",
"if": ""
},
{
"href": "/oic/res/types/d",
"rt": "",
"if": ""
},
{
"href": "/oic/presence",
"rt": "",
"if": ""
}
],
"permission": 2
},
{
"subject": "*",
"resources": [
{
"href": "/oic/sec/doxm",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/pstat",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/acl",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/crl",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/cred",
"rt": "",
"if": ""
}
],
"permission": 6
}
]
},
{
"sub": "Kg==",
"rsrc": [
"/oic/sec/doxm",
"/oic/sec/pstat",
"/oic/sec/acl",
"/oic/sec/crl",
"/oic/sec/cred"
],
"perms": 6,
"ownrs" : [
"bGlnaHREZXZpY2VVVUlEMA=="
]
}
],
"rownerid" : "6C696768-7444-6576-6963-655555494430"
},
"pstat": {
"isop": false,
"deviceid": "bGlnaHREZXZpY2VVVUlEMA==",
"ch": 0,
"deviceid": "6C696768-7444-6576-6963-655555494430",
"rownerid": "6C696768-7444-6576-6963-655555494430",
"cm": 2,
"tm": 0,
"om": 3,
"sm": [3]
},
"doxm": {
"oxm": [0],
"oxms": [0],
"oxmsel": 0,
"sct": 1,
"owned": false,
"deviceid": "bGlnaHREZXZpY2VVVUlEMA==",
"dpc": true
"dpc": false,
"didformat": 0,
"deviceid": "6C696768-7444-6576-6963-655555494430",
"rownerid": "6C696768-7444-6576-6963-655555494430"
}
}
{
"acl": [
{
"sub": "Kg==",
"rsrc": [
"/oic/res",
"/oic/d",
"/oic/p",
"/oic/res/types/d",
"/oic/ad"
],
"perms": 2,
"ownrs" : ["YWRtaW5EZXZpY2VVVUlEMA=="]
"acl": {
"aclist":{
"aces":[
{
"subject": "*",
"resources": [
{
"href": "/oic/res",
"rt": "",
"if": ""
},
{
"href": "/oic/d",
"rt": "",
"if": ""
},
{
"href": "/oic/p",
"rt": "",
"if": ""
},
{
"href": "/oic/res/types/d",
"rt": "",
"if": ""
},
{
"href": "/oic/ad",
"rt": "",
"if": ""
}
],
"permission": 2
},
{
"subject": "*",
"resources": [
{
"href": "/oic/sec/doxm",
"rt": "",
"if": ""
} ,
{
"href": "/oic/sec/pstat",
"rt": "",
"if": ""
}
],
"permission": 2
}
]
},
{
"sub": "Kg==",
"rsrc": [
"/oic/sec/doxm",
"/oic/sec/pstat",
"/oic/sec/acl",
"/oic/sec/cred"
],
"perms": 7,
"ownrs" : ["YWRtaW5EZXZpY2VVVUlEMA=="]
}
],
"rownerid" : "61646D69-6E44-6576-6963-655555494430"
},
"pstat": {
"isop": true,
"deviceid": "YWRtaW5EZXZpY2VVVUlEMA==",
"ch": 0,
"cm": 0,
"cm": 2,
"tm": 0,
"om": 3,
"sm": [3]
"sm": [3],
"deviceid": "61646D69-6E44-6576-6963-655575696430",
"rownerid": "61646D69-6E44-6576-6963-655575696430"
},
"doxm": {
"oxm": [0],
"oxms": [0],
"oxmsel": 0,
"sct": 1,
"owned": true,
"deviceid": "YWRtaW5EZXZpY2VVVUlEMA==",
"ownr": "YWRtaW5EZXZpY2VVVUlEMA==",
"dpc": true
"didformat": 0,
"deviceid": "61646D69-6E44-6576-6963-655575696430",
"dpc": false,
"devownerid": "61646D69-6E44-6576-6963-655575696430",
"rownerid": "61646D69-6E44-6576-6963-655575696430"
}
}
{
"acl": [
{
"sub": "Kg==",
"rsrc": [
"/oic/res",
"/oic/d",
"/oic/p",
"/oic/res/types/d",
"/oic/ad",
"/oic/sec/amacl"
],
"perms": 2,
"ownrs" : ["YWRtaW5EZXZpY2VVVUlEMA=="]
},
{
"sub": "Kg==",
"rsrc": [
"/oic/sec/doxm",
"/oic/sec/pstat"
],
"perms": 2,
"ownrs" : ["YWRtaW5EZXZpY2VVVUlEMA=="]
}
],
"pstat": {
"isop": true,
"deviceid": "YWRtaW5EZXZpY2VVVUlEMA==",
"ch": 0,
"cm": 0,
"tm": 0,
"om": 3,
"sm": [3]
},
"doxm": {
"oxm": [0],
"oxmsel": 0,
"sct": 1,
"owned": true,
"deviceid": "YWRtaW5EZXZpY2VVVUlEMA==",
"dpc": false,
"ownr": "YWRtaW5EZXZpY2VVVUlEMA=="
}
}
{
"acl": {
"aclist":{
"aces":[
{
"subject": "*",
"resources": [
{
"href": "/oic/res",
"rt": "",
"if": ""
},
{
"href": "/oic/d",
"rt": "",
"if": ""
},
{
"href": "/oic/p",
"rt": "",
"if": ""
},
{
"href": "/oic/res/types/d",
"rt": "",
"if": ""
},
{
"href": "/oic/ad",
"rt": "",
"if": ""
},
{
"href": "/oic/sec/amacl",
"rt": "",
"if": ""
}
],
"permission": 2
},
{
"subject": "*",
"resources": [
{
"href": "/oic/sec/doxm",
"rt": "",
"if": ""
} ,
{
"href": "/oic/sec/pstat",
"rt": "",
"if": ""
}
],
"permission": 2
}
]
},