Ok, why is this done like this? Since this can be done in 1 conversion from the top… I know this is an implementation only (e.g. I am not aware that this is on the wire this way..), but now we need to maintain code that does this..
Kind Regards, Wouter From: [email protected] [mailto:[email protected]] On Behalf Of Nash, George Sent: 05 March 2018 22:48 To: Gregg Reynolds <[email protected]>; Mats Wichmann <[email protected]> Cc: iotivity-dev <[email protected]> Subject: Re: [dev] .dat files not being .gitignored? The .dat files are cbor but the cbor2json tool does some things that are unusual that makes them a little less convenient. For example: If you pass { "acl": { "aclist2": [ { "aceid": 1, "subject": { "conntype": "anon-clear" }, "resources": [ { "href": "/oic/res" }, { "href": "/oic/d" }, { "href": "/oic/p" }, { "href": "/oic/sec/doxm" } ], "permission": 2 } ], "rowneruuid" : "31313131-3131-3131-3131-313131313131" } } Json2cbor tool will encode everything after “acl”: into cbor then insert that into the final cbor output as a byte array as the value contained in acl If you pass this value to a cbor2json decoder you will not get the json shown above you will get: { "acl": <an array of bytes depending on the decoder this could be in a format like base64> } You must then take the array of bytes to the right of acl and decode them using a cbor2json decoder to find out the actual value. See https://jira.iotivity.org/browse/IOT-2849 for a more in depth description. Using the “doxm” tag instead of the “acl” tag. The unusual way json2cbor has actually made learning and understanding iotivity’s security much harder for me since it has made inspecting the *.dat files more difficult. George Nash From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Gregg Reynolds Sent: Monday, March 5, 2018 10:43 AM To: Mats Wichmann <[email protected]<mailto:[email protected]>> Cc: iotivity-dev <[email protected]<mailto:[email protected]>> Subject: Re: [dev] .dat files not being .gitignored? On Mar 5, 2018 12:13 PM, "Mats Wichmann" <[email protected]<mailto:[email protected]>> wrote: Really, we should get to a point where they don't need to be checked-in in git at all, and just always generated during the build, but as noted that can't be the case right now because of cross-building. I gather from all this that the .dat files are not cbor? I was under the impression that cbor is platform-independent. No? Gregg
_______________________________________________ iotivity-dev mailing list [email protected] https://lists.iotivity.org/mailman/listinfo/iotivity-dev
