security: Refactor json2cbor for error checking
Detect JSON type and make json2cbor fail on error.
IoTivity JSON are "upgraded" by default,
Swagger files are just converted.
Json2cbor report not zero on failure.
This prevents silent failure when generating CBOR from JSON.
Many MLK fixed.
Bug: https://jira.iotivity.org/browse/IOT-2310
Change-Id: I905b7d2ba1021686e3794167266b1853ad0f9872
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20795
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit
48dfc99470067336f65ed2e7570b041805cd6d81)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21145