Skip to content

Commit

Permalink
Merge pull request #61 from oyvindronningstad/zcbor-0.8.0
Browse files Browse the repository at this point in the history
zcbor 0.8.0
  • Loading branch information
StefanHri authored Apr 14, 2024
2 parents 5024d8c + f1443b4 commit bbca526
Show file tree
Hide file tree
Showing 82 changed files with 1,172 additions and 1,251 deletions.
2 changes: 1 addition & 1 deletion externals/zcbor
Submodule zcbor updated 75 files
+4 −4 .github/actions/install_zcbor/action.yaml
+12 −7 .github/actions/prepare_and_run_tests/action.yaml
+17 −9 .github/workflows/run-tests.yaml
+0 −1 MANIFEST.in
+18 −19 README.md
+72 −0 RELEASE_NOTES.md
+14 −0 __init__.py
+128 −60 include/zcbor_common.h
+0 −69 include/zcbor_debug.h
+291 −202 include/zcbor_decode.h
+100 −156 include/zcbor_encode.h
+161 −0 include/zcbor_print.h
+46 −0 pyproject.toml
+1 −1 samples/hello_world/src/main.c
+1 −1 samples/pet/include/pet_decode.h
+1 −1 samples/pet/include/pet_encode.h
+4 −4 samples/pet/include/pet_types.h
+1 −1 samples/pet/pet.cmake
+4 −4 samples/pet/src/main.c
+15 −24 samples/pet/src/pet_decode.c
+14 −23 samples/pet/src/pet_encode.c
+3 −3 scripts/add_helptext.py
+0 −1 scripts/requirements-test.txt
+0 −91 setup.py
+202 −29 src/zcbor_common.c
+633 −173 src/zcbor_decode.c
+71 −184 src/zcbor_encode.c
+19 −0 tests/cases/corner_cases.cddl
+33 −0 tests/cases/everything.cddl
+25 −0 tests/cases/everything_example0.yaml
+32 −0 tests/cases/everything_example1.yaml
+4 −0 tests/cmake/test_template.cmake
+152 −153 tests/decode/test1_suit_old_formats/src/main.c
+1 −1 tests/decode/test2_suit/CMakeLists.txt
+64 −64 tests/decode/test2_suit/src/main.c
+15 −16 tests/decode/test3_simple/src/main.c
+4 −1 tests/decode/test5_corner_cases/CMakeLists.txt
+7 −0 tests/decode/test5_corner_cases/boards/qemu_malta_be.conf
+199 −84 tests/decode/test5_corner_cases/src/main.c
+2 −13 tests/decode/test5_corner_cases/testcase.yaml
+9 −9 tests/decode/test7_suit9_simple/src/main.c
+0 −1 tests/decode/test8_suit12/src/main.c
+172 −173 tests/decode/test9_manifest14/src/main.c
+3 −3 tests/decode/test9_manifest14/testcase.yaml
+73 −73 tests/encode/test1_suit/src/main.c
+1 −2 tests/encode/test2_simple/src/main.c
+1 −0 tests/encode/test3_corner_cases/CMakeLists.txt
+7 −0 tests/encode/test3_corner_cases/boards/mps2_an521.conf
+7 −0 tests/encode/test3_corner_cases/boards/qemu_malta_be.conf
+0 −1 tests/encode/test3_corner_cases/prj.conf
+83 −56 tests/encode/test3_corner_cases/src/main.c
+15 −16 tests/encode/test4_senml/src/main.c
+27 −0 tests/fuzz/CMakeLists.txt
+12 −0 tests/fuzz/fuzz_everything.c
+69 −69 tests/fuzz/fuzz_manifest12.c
+1 −1 tests/fuzz/test-afl.sh
+8 −9 tests/scripts/test_repo_files.py
+3 −3 tests/scripts/test_versions.py
+86 −74 tests/scripts/test_zcbor.py
+1 −4 tests/unit/test1_unit_tests/CMakeLists.txt
+7 −0 tests/unit/test1_unit_tests/boards/qemu_malta_be.conf
+434 −55 tests/unit/test1_unit_tests/src/main.c
+10 −3 tests/unit/test1_unit_tests/testcase.yaml
+10 −12 tests/unit/test2_cpp/src/main.cpp
+2 −3 tests/unit/test3_float16/CMakeLists.txt
+9 −0 tests/unit/test3_float16/README.md
+7 −0 tests/unit/test3_float16/boards/qemu_malta_be.conf
+ tests/unit/test3_float16/fp_bytes_decode.bin
+ tests/unit/test3_float16/fp_bytes_encode.bin
+0 −1 tests/unit/test3_float16/prj.conf
+49 −48 tests/unit/test3_float16/src/main.c
+1 −1 zcbor/VERSION
+0 −19 zcbor/__init__.py
+0 −0 zcbor/prelude.cddl
+245 −230 zcbor/zcbor.py
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_bstr_type.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_bstr_type_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
10 changes: 7 additions & 3 deletions inc/cbor/edhoc_decode_cert.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand All @@ -21,8 +21,12 @@ extern "C" {
#error "The type file was generated with a different default_max_qty than this file"
#endif

int cbor_decode_cert(const uint8_t *payload, size_t payload_len,
struct cert *result, size_t *payload_len_out);

int cbor_decode_cert(
const uint8_t *payload, size_t payload_len,
struct cert *result,
size_t *payload_len_out);


#ifdef __cplusplus
}
Expand Down
24 changes: 12 additions & 12 deletions inc/cbor/edhoc_decode_cert_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand All @@ -26,17 +26,17 @@ extern "C" {
#define DEFAULT_MAX_QTY 3

struct cert {
int32_t _cert_type;
int32_t _cert_serial_number;
struct zcbor_string _cert_issuer;
int32_t _cert_validity_not_before;
int32_t _cert_validity_not_after;
struct zcbor_string _cert_subject;
int32_t _cert_subject_public_key_algorithm;
struct zcbor_string _cert_pk;
int32_t _cert_extensions;
int32_t _cert_issuer_signature_algorithm;
struct zcbor_string _cert_signature;
int32_t cert_type;
int32_t cert_serial_number;
struct zcbor_string cert_issuer;
int32_t cert_validity_not_before;
int32_t cert_validity_not_after;
struct zcbor_string cert_subject;
int32_t cert_subject_public_key_algorithm;
struct zcbor_string cert_pk;
int32_t cert_extensions;
int32_t cert_issuer_signature_algorithm;
struct zcbor_string cert_signature;
};

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_id_cred_x.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
90 changes: 45 additions & 45 deletions inc/cbor/edhoc_decode_id_cred_x_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand All @@ -25,84 +25,84 @@ extern "C" {
*/
#define DEFAULT_MAX_QTY 3

struct id_cred_x_map_kid_ {
struct id_cred_x_map_kid_r {
union {
int32_t _id_cred_x_map_kid_int;
struct zcbor_string _id_cred_x_map_kid_bstr;
int32_t id_cred_x_map_kid_int;
struct zcbor_string id_cred_x_map_kid_bstr;
};
enum {
_id_cred_x_map_kid_int,
_id_cred_x_map_kid_bstr,
} _id_cred_x_map_kid_choice;
id_cred_x_map_kid_int_c,
id_cred_x_map_kid_bstr_c,
} id_cred_x_map_kid_choice;
};

struct id_cred_x_map_x5bag {
struct zcbor_string _id_cred_x_map_x5bag;
struct zcbor_string id_cred_x_map_x5bag;
};

struct id_cred_x_map_x5chain {
struct zcbor_string _id_cred_x_map_x5chain;
struct zcbor_string id_cred_x_map_x5chain;
};

struct id_cred_x_map_x5t_ {
struct id_cred_x_map_x5t_r {
union {
int32_t _id_cred_x_map_x5t_alg_int;
struct zcbor_string _id_cred_x_map_x5t_alg_tstr;
int32_t id_cred_x_map_x5t_alg_int;
struct zcbor_string id_cred_x_map_x5t_alg_tstr;
};
enum {
_id_cred_x_map_x5t_alg_int,
_id_cred_x_map_x5t_alg_tstr,
} _id_cred_x_map_x5t_alg_choice;
struct zcbor_string _id_cred_x_map_x5t_hash;
id_cred_x_map_x5t_alg_int_c,
id_cred_x_map_x5t_alg_tstr_c,
} id_cred_x_map_x5t_alg_choice;
struct zcbor_string id_cred_x_map_x5t_hash;
};

struct id_cred_x_map_x5u {
struct zcbor_string _id_cred_x_map_x5u;
struct zcbor_string id_cred_x_map_x5u;
};

struct id_cred_x_map_c5b {
struct zcbor_string _id_cred_x_map_c5b;
struct zcbor_string id_cred_x_map_c5b;
};

struct id_cred_x_map_c5c {
struct zcbor_string _id_cred_x_map_c5c;
struct zcbor_string id_cred_x_map_c5c;
};

struct id_cred_x_map_c5t_ {
struct id_cred_x_map_c5t_r {
union {
int32_t _id_cred_x_map_c5t_alg_int;
struct zcbor_string _id_cred_x_map_c5t_alg_tstr;
int32_t id_cred_x_map_c5t_alg_int;
struct zcbor_string id_cred_x_map_c5t_alg_tstr;
};
enum {
_id_cred_x_map_c5t_alg_int,
_id_cred_x_map_c5t_alg_tstr,
} _id_cred_x_map_c5t_alg_choice;
struct zcbor_string _id_cred_x_map_c5t_hash;
id_cred_x_map_c5t_alg_int_c,
id_cred_x_map_c5t_alg_tstr_c,
} id_cred_x_map_c5t_alg_choice;
struct zcbor_string id_cred_x_map_c5t_hash;
};

struct id_cred_x_map_c5u {
struct zcbor_string _id_cred_x_map_c5u;
struct zcbor_string id_cred_x_map_c5u;
};

struct id_cred_x_map {
struct id_cred_x_map_kid_ _id_cred_x_map_kid;
bool _id_cred_x_map_kid_present;
struct id_cred_x_map_x5bag _id_cred_x_map_x5bag;
bool _id_cred_x_map_x5bag_present;
struct id_cred_x_map_x5chain _id_cred_x_map_x5chain;
bool _id_cred_x_map_x5chain_present;
struct id_cred_x_map_x5t_ _id_cred_x_map_x5t;
bool _id_cred_x_map_x5t_present;
struct id_cred_x_map_x5u _id_cred_x_map_x5u;
bool _id_cred_x_map_x5u_present;
struct id_cred_x_map_c5b _id_cred_x_map_c5b;
bool _id_cred_x_map_c5b_present;
struct id_cred_x_map_c5c _id_cred_x_map_c5c;
bool _id_cred_x_map_c5c_present;
struct id_cred_x_map_c5t_ _id_cred_x_map_c5t;
bool _id_cred_x_map_c5t_present;
struct id_cred_x_map_c5u _id_cred_x_map_c5u;
bool _id_cred_x_map_c5u_present;
struct id_cred_x_map_kid_r id_cred_x_map_kid;
bool id_cred_x_map_kid_present;
struct id_cred_x_map_x5bag id_cred_x_map_x5bag;
bool id_cred_x_map_x5bag_present;
struct id_cred_x_map_x5chain id_cred_x_map_x5chain;
bool id_cred_x_map_x5chain_present;
struct id_cred_x_map_x5t_r id_cred_x_map_x5t;
bool id_cred_x_map_x5t_present;
struct id_cred_x_map_x5u id_cred_x_map_x5u;
bool id_cred_x_map_x5u_present;
struct id_cred_x_map_c5b id_cred_x_map_c5b;
bool id_cred_x_map_c5b_present;
struct id_cred_x_map_c5c id_cred_x_map_c5c;
bool id_cred_x_map_c5c_present;
struct id_cred_x_map_c5t_r id_cred_x_map_c5t;
bool id_cred_x_map_c5t_present;
struct id_cred_x_map_c5u id_cred_x_map_c5u;
bool id_cred_x_map_c5u_present;
};

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_int_type.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_int_type_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_message_1.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
32 changes: 16 additions & 16 deletions inc/cbor/edhoc_decode_message_1_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand All @@ -26,29 +26,29 @@ extern "C" {
#define DEFAULT_MAX_QTY 3

struct message_1 {
int32_t _message_1_METHOD;
int32_t message_1_METHOD;
union {
struct {
int32_t _SUITES_I__suite_suite[10];
size_t _SUITES_I__suite_suite_count;
int32_t SUITES_I_suite_l_suite[10];
size_t SUITES_I_suite_l_suite_count;
};
int32_t _message_1_SUITES_I_int;
int32_t message_1_SUITES_I_int;
};
enum {
_SUITES_I__suite,
_message_1_SUITES_I_int,
} _message_1_SUITES_I_choice;
struct zcbor_string _message_1_G_X;
SUITES_I_suite_l_c,
message_1_SUITES_I_int_c,
} message_1_SUITES_I_choice;
struct zcbor_string message_1_G_X;
union {
int32_t _message_1_C_I_int;
struct zcbor_string _message_1_C_I_bstr;
int32_t message_1_C_I_int;
struct zcbor_string message_1_C_I_bstr;
};
enum {
_message_1_C_I_int,
_message_1_C_I_bstr,
} _message_1_C_I_choice;
struct zcbor_string _message_1_ead_1;
bool _message_1_ead_1_present;
message_1_C_I_int_c,
message_1_C_I_bstr_c,
} message_1_C_I_choice;
struct zcbor_string message_1_ead_1;
bool message_1_ead_1_present;
};

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_message_2.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
14 changes: 7 additions & 7 deletions inc/cbor/edhoc_decode_message_2_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand All @@ -26,15 +26,15 @@ extern "C" {
#define DEFAULT_MAX_QTY 3

struct m2 {
struct zcbor_string _m2_G_Y_CIPHERTEXT_2;
struct zcbor_string m2_G_Y_CIPHERTEXT_2;
union {
int32_t _m2_C_R_int;
struct zcbor_string _m2_C_R_bstr;
int32_t m2_C_R_int;
struct zcbor_string m2_C_R_bstr;
};
enum {
_m2_C_R_int,
_m2_C_R_bstr,
} _m2_C_R_choice;
m2_C_R_int_c,
m2_C_R_bstr_c,
} m2_C_R_choice;
};

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_message_3.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_message_3_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
2 changes: 1 addition & 1 deletion inc/cbor/edhoc_decode_plaintext.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Generated using zcbor version 0.7.0
* Generated using zcbor version 0.8.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/
Expand Down
Loading

0 comments on commit bbca526

Please sign in to comment.