1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

JSON Validation added

(1) JSON file structure altered a bit.
(2) JSON validated against schema.
(3) Corresponding changes in the python script.

Signed-off-by: Archana <archana.madhavan@silabs.com>
Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
This commit is contained in:
Archana
2022-01-09 13:28:28 +05:30
committed by Asfandyar Orakzai
parent 05efa17549
commit 04cfe34639
7 changed files with 269 additions and 20 deletions

View File

@ -0,0 +1,112 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"prefix": {
"type": "string"
},
"type": {
"type": "string"
},
"location": {
"type": "string"
},
"dependency": {
"type": "string"
},
"headers": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"capabilities": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"_comment": {
"type": "string"
},
"depend_on": {
"type": "string"
},
"entry_points": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string"
},
{
"type": "string"
}
]
}
},
"required": [
"_comment",
"depend_on",
"entry_points"
]
},
{
"type": "object",
"properties": {
"_comment": {
"type": "string"
},
"depend_on": {
"type": "string"
},
"entry_points": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"name": {
"type": "object",
"properties": {
"copy_key": {
"type": "string"
},
"get_builtin_key": {
"type": "string"
}
},
"required": [
"copy_key",
"get_builtin_key"
]
}
},
"required": [
"_comment",
"depend_on",
"entry_points",
"name"
]
}
]
}
},
"required": [
"prefix",
"type",
"location",
"dependency",
"headers",
"capabilities"
]
}

View File

@ -0,0 +1,106 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"prefix": {
"type": "string"
},
"type": {
"type": "string"
},
"dependency": {
"type": "string"
},
"headers": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"capabilities": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"_comment": {
"type": "string"
},
"depend_on": {
"type": "string"
},
"entry_points": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string"
}
]
},
"fallback": {
"type": "boolean"
}
},
"required": [
"_comment",
"depend_on",
"entry_points",
"fallback"
]
},
{
"type": "object",
"properties": {
"_comment": {
"type": "string"
},
"depend_on": {
"type": "string"
},
"entry_points": {
"type": "array",
"items": [
{
"type": "string"
}
]
},
"fallback": {
"type": "boolean"
},
"name": {
"type": "object",
"properties": {
"export_public_key": {
"type": "string"
}
},
"required": [
"export_public_key"
]
}
},
"required": [
"_comment",
"depend_on",
"entry_points",
"fallback",
"name"
]
}
]
}
},
"required": [
"prefix",
"type",
"dependency",
"headers",
"capabilities"
]
}

View File

@ -1,7 +1,8 @@
[{
{
"prefix": "mbedtls_test",
"type": "opaque",
"location": "0x7fffff",
"dependency": "defined(PSA_CRYPTO_DRIVER_TEST)",
"headers": ["test/drivers/test_driver.h"],
"capabilities": [
{
@ -16,4 +17,4 @@
"name": {"copy_key":"mbedtls_test_opaque_copy_key", "get_builtin_key":"mbedtls_test_opaque_get_builtin_key"}
}
]
}]
}

View File

@ -1,6 +1,7 @@
[{
{
"prefix": "mbedtls_test",
"type": "transparent",
"dependency": "defined(PSA_CRYPTO_DRIVER_TEST)",
"headers": ["test/drivers/test_driver.h"],
"capabilities": [
{
@ -18,4 +19,4 @@
}
]
}]
}