edhoc 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +170 -0
- package/binding.gyp +13 -11
- package/dist/bindings.d.ts +5 -0
- package/dist/bindings.d.ts.map +1 -0
- package/dist/bindings.js +10 -0
- package/dist/crypto.d.ts +29 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +205 -0
- package/dist/edhoc.d.ts +368 -0
- package/dist/edhoc.d.ts.map +1 -0
- package/dist/edhoc.js +76 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/x509credentials.d.ts +20 -0
- package/dist/x509credentials.d.ts.map +1 -0
- package/dist/x509credentials.js +140 -0
- package/external/libedhoc/backends/cbor/include/backend_cbor_bstr_type_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_bstr_type_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_bstr_type_types.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_ead_decode.h +2 -2
- package/external/libedhoc/backends/cbor/include/backend_cbor_ead_encode.h +2 -2
- package/external/libedhoc/backends/cbor/include/backend_cbor_edhoc_types.h +48 -43
- package/external/libedhoc/backends/cbor/include/backend_cbor_enc_structure_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_enc_structure_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_enc_structure_types.h +3 -3
- package/external/libedhoc/backends/cbor/include/backend_cbor_id_cred_x_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_id_cred_x_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_info_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_info_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_int_type_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_int_type_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_int_type_types.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_1_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_1_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_2_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_2_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_3_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_3_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_4_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_4_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_error_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_message_error_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_2_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_2_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_3_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_3_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_4_decode.h +3 -3
- package/external/libedhoc/backends/cbor/include/backend_cbor_plaintext_4_encode.h +3 -3
- package/external/libedhoc/backends/cbor/include/backend_cbor_sig_structure_decode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_sig_structure_encode.h +1 -1
- package/external/libedhoc/backends/cbor/include/backend_cbor_sig_structure_types.h +4 -4
- package/external/libedhoc/backends/cbor/include/backend_cbor_x509_types.h +93 -83
- package/external/libedhoc/backends/cbor/src/backend_cbor_bstr_type_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_bstr_type_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_ead_decode.c +27 -32
- package/external/libedhoc/backends/cbor/src/backend_cbor_ead_encode.c +27 -32
- package/external/libedhoc/backends/cbor/src/backend_cbor_enc_structure_decode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_enc_structure_encode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_id_cred_x_decode.c +63 -52
- package/external/libedhoc/backends/cbor/src/backend_cbor_id_cred_x_encode.c +62 -51
- package/external/libedhoc/backends/cbor/src/backend_cbor_info_decode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_info_encode.c +14 -23
- package/external/libedhoc/backends/cbor/src/backend_cbor_int_type_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_int_type_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_1_decode.c +54 -51
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_1_encode.c +54 -51
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_2_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_2_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_3_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_3_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_4_decode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_4_encode.c +11 -20
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_error_decode.c +36 -37
- package/external/libedhoc/backends/cbor/src/backend_cbor_message_error_encode.c +36 -37
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_2_decode.c +103 -80
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_2_encode.c +102 -79
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_3_decode.c +99 -76
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_3_encode.c +98 -75
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_4_decode.c +40 -41
- package/external/libedhoc/backends/cbor/src/backend_cbor_plaintext_4_encode.c +40 -41
- package/external/libedhoc/backends/cbor/src/backend_cbor_sig_structure_decode.c +15 -24
- package/external/libedhoc/backends/cbor/src/backend_cbor_sig_structure_encode.c +15 -24
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_1/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/TestProductionCode.c +69 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/TestProductionCode2.c +38 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
- package/external/libedhoc/externals/Unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_2/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/TestProductionCode.c +71 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/TestProductionCode2.c +40 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +16 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_2/test/test_runners/all_tests.c +19 -0
- package/external/libedhoc/externals/Unity/examples/example_3/helper/UnityHelper.c +17 -0
- package/external/libedhoc/externals/Unity/examples/example_3/helper/UnityHelper.h +19 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_3/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_3/test/TestProductionCode.c +69 -0
- package/external/libedhoc/externals/Unity/examples/example_3/test/TestProductionCode2.c +38 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode.c +31 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode.h +10 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode2.c +18 -0
- package/external/libedhoc/externals/Unity/examples/example_4/src/ProductionCode2.h +9 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/TestProductionCode.c +70 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/TestProductionCode2.c +42 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c +53 -0
- package/external/libedhoc/externals/Unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c +57 -0
- package/external/libedhoc/externals/Unity/examples/unity_config.h +251 -0
- package/external/libedhoc/externals/Unity/extras/bdd/src/unity_bdd.h +44 -0
- package/external/libedhoc/externals/Unity/extras/bdd/test/test_bdd.c +129 -0
- package/external/libedhoc/externals/Unity/extras/fixture/src/unity_fixture.c +310 -0
- package/external/libedhoc/externals/Unity/extras/fixture/src/unity_fixture.h +95 -0
- package/external/libedhoc/externals/Unity/extras/fixture/src/unity_fixture_internals.h +51 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/main/AllTests.c +20 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/template_fixture_tests.c +40 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/unity_fixture_Test.c +246 -0
- package/external/libedhoc/externals/Unity/extras/fixture/test/unity_fixture_TestRunner.c +33 -0
- package/external/libedhoc/externals/Unity/extras/memory/src/unity_memory.c +203 -0
- package/external/libedhoc/externals/Unity/extras/memory/src/unity_memory.h +61 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_memory_Test.c +326 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_memory_TestRunner.c +50 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_output_Spy.c +57 -0
- package/external/libedhoc/externals/Unity/extras/memory/test/unity_output_Spy.h +17 -0
- package/external/libedhoc/externals/Unity/src/unity.c +2501 -0
- package/external/libedhoc/externals/Unity/src/unity.h +698 -0
- package/external/libedhoc/externals/Unity/src/unity_internals.h +1183 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_cmd.c +61 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_def.c +57 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_head1.c +55 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_head1.h +15 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_cmd.c +80 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_def.c +76 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_head1.c +75 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_head1.h +13 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_new1.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_new2.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_param.c +77 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_run1.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_run2.c +89 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_mock_yaml.c +90 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_new1.c +67 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_new2.c +70 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_param.c +58 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_run1.c +67 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_run2.c +70 -0
- package/external/libedhoc/externals/Unity/test/expectdata/testsample_yaml.c +71 -0
- package/external/libedhoc/externals/Unity/test/testdata/CException.h +18 -0
- package/external/libedhoc/externals/Unity/test/testdata/Defs.h +16 -0
- package/external/libedhoc/externals/Unity/test/testdata/cmock.h +21 -0
- package/external/libedhoc/externals/Unity/test/testdata/mockMock.h +20 -0
- package/external/libedhoc/externals/Unity/test/testdata/testRunnerGenerator.c +204 -0
- package/external/libedhoc/externals/Unity/test/testdata/testRunnerGeneratorSmall.c +73 -0
- package/external/libedhoc/externals/Unity/test/testdata/testRunnerGeneratorWithMocks.c +200 -0
- package/external/libedhoc/externals/Unity/test/tests/self_assessment_utils.h +151 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_arrays.c +2941 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_core.c +375 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_doubles.c +1285 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_floats.c +1395 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_integers.c +2863 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_integers_64.c +783 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_memory.c +82 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_parameterized.c +309 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_parameterizedDemo.c +28 -0
- package/external/libedhoc/externals/Unity/test/tests/test_unity_strings.c +330 -0
- package/external/libedhoc/externals/Unity/test/tests/types_for_test.h +21 -0
- package/external/libedhoc/externals/zcbor/include/zcbor_common.h +147 -60
- package/external/libedhoc/externals/zcbor/include/zcbor_decode.h +291 -202
- package/external/libedhoc/externals/zcbor/include/zcbor_encode.h +100 -156
- package/external/libedhoc/externals/zcbor/include/zcbor_print.h +165 -0
- package/external/libedhoc/externals/zcbor/samples/hello_world/src/main.c +1 -1
- package/external/libedhoc/externals/zcbor/samples/pet/include/pet_decode.h +1 -1
- package/external/libedhoc/externals/zcbor/samples/pet/include/pet_encode.h +1 -1
- package/external/libedhoc/externals/zcbor/samples/pet/include/pet_types.h +4 -4
- package/external/libedhoc/externals/zcbor/samples/pet/src/main.c +4 -4
- package/external/libedhoc/externals/zcbor/samples/pet/src/pet_decode.c +15 -24
- package/external/libedhoc/externals/zcbor/samples/pet/src/pet_encode.c +14 -23
- package/external/libedhoc/externals/zcbor/src/zcbor_common.c +202 -29
- package/external/libedhoc/externals/zcbor/src/zcbor_decode.c +633 -173
- package/external/libedhoc/externals/zcbor/src/zcbor_encode.c +71 -184
- package/external/libedhoc/externals/zcbor/tests/decode/test1_suit_old_formats/src/main.c +152 -153
- package/external/libedhoc/externals/zcbor/tests/decode/test2_suit/src/main.c +64 -64
- package/external/libedhoc/externals/zcbor/tests/decode/test3_simple/src/main.c +15 -16
- package/external/libedhoc/externals/zcbor/tests/decode/test5_corner_cases/src/main.c +228 -84
- package/external/libedhoc/externals/zcbor/tests/decode/test7_suit9_simple/src/main.c +9 -9
- package/external/libedhoc/externals/zcbor/tests/decode/test8_suit12/src/main.c +0 -1
- package/external/libedhoc/externals/zcbor/tests/decode/test9_manifest14/src/main.c +172 -173
- package/external/libedhoc/externals/zcbor/tests/encode/test1_suit/src/main.c +73 -73
- package/external/libedhoc/externals/zcbor/tests/encode/test2_simple/src/main.c +1 -2
- package/external/libedhoc/externals/zcbor/tests/encode/test3_corner_cases/src/main.c +83 -56
- package/external/libedhoc/externals/zcbor/tests/encode/test4_senml/src/main.c +15 -16
- package/external/libedhoc/externals/zcbor/tests/fuzz/fuzz_everything.c +12 -0
- package/external/libedhoc/externals/zcbor/tests/fuzz/fuzz_manifest12.c +69 -69
- package/external/libedhoc/externals/zcbor/tests/unit/test1_unit_tests/src/main.c +448 -55
- package/external/libedhoc/externals/zcbor/tests/unit/test3_float16/src/main.c +49 -48
- package/external/libedhoc/include/edhoc.h +348 -54
- package/external/libedhoc/include/edhoc_common.h +289 -0
- package/external/libedhoc/include/edhoc_context.h +60 -35
- package/external/libedhoc/include/edhoc_credentials.h +55 -7
- package/external/libedhoc/include/edhoc_crypto.h +10 -10
- package/external/libedhoc/include/edhoc_ead.h +13 -10
- package/external/libedhoc/include/edhoc_macros.h +20 -11
- package/external/libedhoc/include/edhoc_values.h +2 -2
- package/external/libedhoc/library/edhoc.c +70 -36
- package/external/libedhoc/library/edhoc_common.c +1314 -0
- package/external/libedhoc/library/edhoc_exporter.c +45 -46
- package/external/libedhoc/library/edhoc_message_1.c +107 -72
- package/external/libedhoc/library/edhoc_message_2.c +396 -1693
- package/external/libedhoc/library/edhoc_message_3.c +465 -1656
- package/external/libedhoc/library/edhoc_message_4.c +93 -91
- package/external/libedhoc/library/edhoc_message_error.c +41 -41
- package/external/libedhoc/tests/include/{cipher_suites/cipher_suite_0.h → cipher_suite_0.h} +131 -134
- package/external/libedhoc/tests/include/{cipher_suites/cipher_suite_2.h → cipher_suite_2.h} +139 -140
- package/external/libedhoc/tests/include/{edhoc_trace_1/test_vector_1.h → test_vector_rfc9529_chapter_2.h} +786 -738
- package/external/libedhoc/tests/include/{edhoc_trace_2/test_vector_2.h → test_vector_rfc9529_chapter_3.h} +14 -10
- package/external/libedhoc/tests/include/{x509_chain_cs_0/test_vector_x5chain_cs_0.h → test_vector_x5chain_sign_keys_suite_0.h} +137 -140
- package/external/libedhoc/tests/include/{x509_chain_cs_2/test_vector_x5chain_cs_2.h → test_vector_x5chain_sign_keys_suite_2.h} +7 -8
- package/external/libedhoc/tests/include/{x509_chain_cs_2_static_dh/test_vector_x5chain_cs_2_static_dh.h → test_vector_x5chain_static_dh_keys_suite_2.h} +7 -8
- package/external/libedhoc/tests/include/{x509_hash_cs_2/test_vector_x5t_cs_2.h → test_vector_x5t_sign_keys_suite_2.h} +6 -7
- package/external/libedhoc/tests/src/{cipher_suites/cipher_suite_0.c → cipher_suite_0.c} +445 -447
- package/external/libedhoc/tests/src/{cipher_suites/cipher_suite_2.c → cipher_suite_2.c} +600 -600
- package/external/libedhoc/tests/src/module_test_api.c +430 -0
- package/external/libedhoc/tests/src/module_test_cipher_suite_0.c +395 -0
- package/external/libedhoc/tests/src/module_test_cipher_suite_2.c +392 -0
- package/external/libedhoc/tests/src/{error_message/test_edhoc_error_message.c → module_test_error_message.c} +94 -69
- package/external/libedhoc/tests/src/module_test_main.c +49 -0
- package/external/libedhoc/tests/src/{cipher_suite_negotiation/test_edhoc_cipher_suite_negotiation.c → module_test_rfc9528_suites_negotiation.c} +224 -227
- package/external/libedhoc/tests/src/module_test_rfc9529_chapter_2.c +2681 -0
- package/external/libedhoc/tests/src/module_test_rfc9529_chapter_3.c +1635 -0
- package/external/libedhoc/tests/src/module_test_x5chain_sign_keys_suite_0.c +1135 -0
- package/external/libedhoc/tests/src/module_test_x5chain_sign_keys_suite_2.c +1249 -0
- package/external/libedhoc/tests/src/module_test_x5chain_static_dh_keys_suite_2.c +798 -0
- package/external/libedhoc/tests/src/module_test_x5t_sign_keys_suite_2.c +956 -0
- package/include/EdhocComposeAsyncWorker.h +8 -6
- package/include/EdhocCredentialManager.h +16 -11
- package/include/EdhocCryptoManager.h +28 -21
- package/include/EdhocEadManager.h +3 -6
- package/include/{EdhocExportAsyncWorker.h → EdhocExportOscoreAsyncWorker.h} +20 -17
- package/include/EdhocKeyExporterAsyncWorker.h +76 -0
- package/include/EdhocKeyUpdateAsyncWorker.h +72 -0
- package/include/EdhocProcessAsyncWorker.h +14 -10
- package/include/LibEDHOC.h +44 -20
- package/include/UserContext.h +7 -9
- package/include/Utils.h +31 -27
- package/package.json +14 -3
- package/prebuilds/android-arm/edhoc.armv7.node +0 -0
- package/prebuilds/android-arm64/edhoc.armv8.node +0 -0
- package/prebuilds/darwin-arm64/edhoc.node +0 -0
- package/prebuilds/darwin-x64/edhoc.node +0 -0
- package/prebuilds/linux-arm/edhoc.armv6.node +0 -0
- package/prebuilds/linux-arm/edhoc.armv7.node +0 -0
- package/prebuilds/linux-arm64/edhoc.armv8.node +0 -0
- package/prebuilds/linux-x64/edhoc.glibc.node +0 -0
- package/prebuilds/linux-x64/edhoc.musl.node +0 -0
- package/prebuilds/win32-ia32/edhoc.node +0 -0
- package/prebuilds/win32-x64/edhoc.node +0 -0
- package/src/EdhocComposeAsyncWorker.cpp +18 -35
- package/src/EdhocCredentialManager.cpp +160 -187
- package/src/EdhocCryptoManager.cpp +386 -586
- package/src/EdhocEadManager.cpp +10 -18
- package/src/EdhocExportOscoreAsyncWorker.cpp +77 -0
- package/src/EdhocKeyExporterAsyncWorker.cpp +49 -0
- package/src/EdhocKeyUpdateAsyncWorker.cpp +41 -0
- package/src/EdhocProcessAsyncWorker.cpp +72 -19
- package/src/LibEDHOC.cpp +213 -174
- package/src/Suites.cpp +39 -72
- package/src/Utils.cpp +32 -56
- package/test/basic.test.ts +64 -0
- package/test/vectors.test.ts +111 -0
- package/external/libedhoc/externals/zcbor/include/zcbor_debug.h +0 -69
- package/external/libedhoc/tests/include/cipher_suite_negotiation/test_edhoc_cipher_suite_negotiation.h +0 -37
- package/external/libedhoc/tests/include/cipher_suites/test_cipher_suite_0.h +0 -48
- package/external/libedhoc/tests/include/cipher_suites/test_cipher_suite_2.h +0 -48
- package/external/libedhoc/tests/include/edhoc_trace_1/authentication_credentials_1.h +0 -60
- package/external/libedhoc/tests/include/edhoc_trace_1/test_edhoc_handshake_1.h +0 -208
- package/external/libedhoc/tests/include/edhoc_trace_1/test_edhoc_handshake_ead_1.h +0 -59
- package/external/libedhoc/tests/include/edhoc_trace_2/authentication_credentials_2.h +0 -60
- package/external/libedhoc/tests/include/edhoc_trace_2/test_edhoc_handshake_2.h +0 -199
- package/external/libedhoc/tests/include/error_message/test_edhoc_error_message.h +0 -48
- package/external/libedhoc/tests/include/x509_chain_cs_0/authentication_credentials_x5chain_cs_0.h +0 -92
- package/external/libedhoc/tests/include/x509_chain_cs_0/test_edhoc_handshake_x5chain_cs_0.h +0 -96
- package/external/libedhoc/tests/include/x509_chain_cs_2/authentication_credentials_x5chain_cs_2.h +0 -58
- package/external/libedhoc/tests/include/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2.h +0 -56
- package/external/libedhoc/tests/include/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2_ead.h +0 -57
- package/external/libedhoc/tests/include/x509_chain_cs_2_static_dh/authentication_credentials_x5chain_cs_2_static_dh.h +0 -59
- package/external/libedhoc/tests/include/x509_chain_cs_2_static_dh/test_edhoc_handshake_x5chain_cs_2_static_dh_ead.h +0 -57
- package/external/libedhoc/tests/include/x509_hash_cs_2/authentication_credentials_x5t_cs_2.h +0 -60
- package/external/libedhoc/tests/include/x509_hash_cs_2/test_edhoc_handshake_x5t_cs_2_ead.h +0 -57
- package/external/libedhoc/tests/src/cipher_suites/test_cipher_suite_0.c +0 -475
- package/external/libedhoc/tests/src/cipher_suites/test_cipher_suite_2.c +0 -473
- package/external/libedhoc/tests/src/edhoc_trace_1/authentication_credentials_1.c +0 -252
- package/external/libedhoc/tests/src/edhoc_trace_1/test_edhoc_handshake_1.c +0 -1829
- package/external/libedhoc/tests/src/edhoc_trace_1/test_edhoc_handshake_ead_1.c +0 -1247
- package/external/libedhoc/tests/src/edhoc_trace_2/authentication_credentials_2.c +0 -170
- package/external/libedhoc/tests/src/edhoc_trace_2/test_edhoc_handshake_2.c +0 -1783
- package/external/libedhoc/tests/src/tests.c +0 -228
- package/external/libedhoc/tests/src/x509_chain_cs_0/authentication_credentials_x5chain_cs_0.c +0 -332
- package/external/libedhoc/tests/src/x509_chain_cs_0/test_edhoc_handshake_x5chain_cs_0.c +0 -936
- package/external/libedhoc/tests/src/x509_chain_cs_2/authentication_credentials_x5chain_cs_2.c +0 -166
- package/external/libedhoc/tests/src/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2.c +0 -587
- package/external/libedhoc/tests/src/x509_chain_cs_2/test_edhoc_handshake_x5chain_cs_2_ead.c +0 -917
- package/external/libedhoc/tests/src/x509_chain_cs_2_static_dh/authentication_credentials_x5chain_cs_2_static_dh.c +0 -186
- package/external/libedhoc/tests/src/x509_chain_cs_2_static_dh/test_edhoc_handshake_x5chain_cs_2_static_dh_ead.c +0 -743
- package/external/libedhoc/tests/src/x509_hash_cs_2/authentication_credentials_x5t_cs_2.c +0 -261
- package/external/libedhoc/tests/src/x509_hash_cs_2/test_edhoc_handshake_x5t_cs_2_ead.c +0 -854
- package/src/EdhocExportAsyncWorker.cpp +0 -82
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
#include <zephyr/ztest.h>
|
|
8
8
|
#include "manifest-moran3_decode.h"
|
|
9
9
|
#include "manifest-moran4_decode.h"
|
|
10
|
-
#include "zcbor_debug.h" // Enables use of print functions when debugging tests.
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
uint8_t test_vector2[] = {
|
|
@@ -115,33 +114,33 @@ ZTEST(cbor_decode_test, test_1)
|
|
|
115
114
|
"test_vector2 failed");
|
|
116
115
|
zassert_equal(sizeof(test_vector2), decode_len, NULL);
|
|
117
116
|
zassert_equal(2, outerwrapper
|
|
118
|
-
.
|
|
119
|
-
.
|
|
120
|
-
"Sequence number incorrect (%d)", outerwrapper.
|
|
117
|
+
.OuterWrapper_manifest_cbor
|
|
118
|
+
.Manifest_sequence,
|
|
119
|
+
"Sequence number incorrect (%d)", outerwrapper.OuterWrapper_manifest_cbor.Manifest_sequence);
|
|
121
120
|
zassert_true(outerwrapper
|
|
122
|
-
.
|
|
123
|
-
.
|
|
121
|
+
.OuterWrapper_manifest_cbor
|
|
122
|
+
.Manifest_payloads_present,
|
|
124
123
|
"Expected payloads entry");
|
|
125
124
|
zassert_equal(1, outerwrapper
|
|
126
|
-
.
|
|
127
|
-
.
|
|
125
|
+
.OuterWrapper_manifest_cbor
|
|
126
|
+
.Manifest_payloads_present,
|
|
128
127
|
"Expected payloads present");
|
|
129
128
|
zassert_equal(1, outerwrapper
|
|
130
|
-
.
|
|
131
|
-
.
|
|
132
|
-
.
|
|
129
|
+
.OuterWrapper_manifest_cbor
|
|
130
|
+
.Manifest_payloads
|
|
131
|
+
.Manifest_payloads_PayloadInfo_m_count,
|
|
133
132
|
"Expected single payloads entry, was %d",
|
|
134
133
|
outerwrapper
|
|
135
|
-
.
|
|
136
|
-
.
|
|
137
|
-
.
|
|
134
|
+
.OuterWrapper_manifest_cbor
|
|
135
|
+
.Manifest_payloads
|
|
136
|
+
.Manifest_payloads_PayloadInfo_m_count);
|
|
138
137
|
zassert_mem_equal(expected_tag,
|
|
139
138
|
outerwrapper
|
|
140
|
-
.
|
|
141
|
-
.
|
|
142
|
-
.
|
|
143
|
-
.
|
|
144
|
-
.
|
|
139
|
+
.OuterWrapper_manifest_cbor
|
|
140
|
+
.Manifest_payloads
|
|
141
|
+
.Manifest_payloads_PayloadInfo_m[0]
|
|
142
|
+
.PayloadInfo_payloadDigest
|
|
143
|
+
.COSE_Mac0_tag
|
|
145
144
|
.value,
|
|
146
145
|
sizeof(expected_tag),
|
|
147
146
|
"Expected a certain payloads tag");
|
|
@@ -163,35 +162,35 @@ ZTEST(cbor_decode_test, test_2)
|
|
|
163
162
|
"test_vector3 failed");
|
|
164
163
|
zassert_equal(sizeof(test_vector3), decode_len, NULL);
|
|
165
164
|
zassert_equal(2, outerwrapper
|
|
166
|
-
.
|
|
167
|
-
.
|
|
168
|
-
"Sequence number incorrect (%d)", outerwrapper.
|
|
165
|
+
.OuterWrapper_manifest_cbor
|
|
166
|
+
.Manifest_sequence,
|
|
167
|
+
"Sequence number incorrect (%d)", outerwrapper.OuterWrapper_manifest_cbor.Manifest_sequence);
|
|
169
168
|
zassert_equal(1, outerwrapper
|
|
170
|
-
.
|
|
169
|
+
.OuterWrapper_textExt_present,
|
|
171
170
|
"Expected text present");
|
|
172
171
|
zassert_equal(1, outerwrapper
|
|
173
|
-
.
|
|
174
|
-
.
|
|
172
|
+
.OuterWrapper_textExt
|
|
173
|
+
.OuterWrapper_textExt_cbor_count,
|
|
175
174
|
"Expected single text entry");
|
|
176
175
|
zassert_equal(1, outerwrapper
|
|
177
|
-
.
|
|
178
|
-
.
|
|
176
|
+
.OuterWrapper_textExt
|
|
177
|
+
.OuterWrapper_textExt_cbor_count,
|
|
179
178
|
"Expected single text entry");
|
|
180
179
|
zassert_equal(1, outerwrapper
|
|
181
|
-
.
|
|
182
|
-
.
|
|
183
|
-
.
|
|
180
|
+
.OuterWrapper_manifest_cbor
|
|
181
|
+
.Manifest_payloads
|
|
182
|
+
.Manifest_payloads_PayloadInfo_m_count,
|
|
184
183
|
"Expected single payloads entry, was %d",
|
|
185
184
|
outerwrapper
|
|
186
|
-
.
|
|
187
|
-
.
|
|
188
|
-
.
|
|
185
|
+
.OuterWrapper_manifest_cbor
|
|
186
|
+
.Manifest_payloads
|
|
187
|
+
.Manifest_payloads_PayloadInfo_m_count);
|
|
189
188
|
zassert_mem_equal(expected_updateDescription,
|
|
190
189
|
outerwrapper
|
|
191
|
-
.
|
|
192
|
-
.
|
|
193
|
-
.
|
|
194
|
-
.
|
|
190
|
+
.OuterWrapper_textExt
|
|
191
|
+
.OuterWrapper_textExt_cbor[0]
|
|
192
|
+
.Text_inttstr[0]
|
|
193
|
+
.Text_inttstr
|
|
195
194
|
.value,
|
|
196
195
|
sizeof(expected_updateDescription) - 1,
|
|
197
196
|
"Expected lorem ipsum text.");
|
|
@@ -208,159 +207,159 @@ ZTEST(cbor_decode_test, test_3)
|
|
|
208
207
|
zassert_equal(sizeof(test_vector4), decode_len, NULL);
|
|
209
208
|
zassert_equal(2,
|
|
210
209
|
outerwrapper4
|
|
211
|
-
.
|
|
212
|
-
.
|
|
210
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
211
|
+
.SUIT_Manifest_suit_manifest_sequence_number,
|
|
213
212
|
"Sequence number incorrect");
|
|
214
213
|
zassert_equal(1,
|
|
215
214
|
outerwrapper4
|
|
216
|
-
.
|
|
217
|
-
.
|
|
215
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
216
|
+
.SUIT_Manifest_suit_install_present,
|
|
218
217
|
"Expected install present");
|
|
219
|
-
zassert_equal(
|
|
218
|
+
zassert_equal(SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_c,
|
|
220
219
|
outerwrapper4
|
|
221
|
-
.
|
|
222
|
-
.
|
|
223
|
-
.
|
|
224
|
-
.
|
|
220
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
221
|
+
.SUIT_Manifest_suit_install
|
|
222
|
+
.SUIT_Manifest_suit_install
|
|
223
|
+
.SUIT_Severable_Command_Sequence3_choice,
|
|
225
224
|
"Expected install present");
|
|
226
225
|
zassert_equal(3,
|
|
227
226
|
outerwrapper4
|
|
228
|
-
.
|
|
229
|
-
.
|
|
230
|
-
.
|
|
231
|
-
.
|
|
232
|
-
.
|
|
227
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
228
|
+
.SUIT_Manifest_suit_install
|
|
229
|
+
.SUIT_Manifest_suit_install
|
|
230
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
231
|
+
.SUIT_Command_Sequence_SUIT_Command_m_count,
|
|
233
232
|
"Expected x commands.");
|
|
234
|
-
zassert_equal(
|
|
233
|
+
zassert_equal(SUIT_Command_union_SUIT_Directive_m_c,
|
|
235
234
|
outerwrapper4
|
|
236
|
-
.
|
|
237
|
-
.
|
|
238
|
-
.
|
|
239
|
-
.
|
|
240
|
-
.
|
|
241
|
-
.
|
|
235
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
236
|
+
.SUIT_Manifest_suit_install
|
|
237
|
+
.SUIT_Manifest_suit_install
|
|
238
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
239
|
+
.SUIT_Command_Sequence_SUIT_Command_m[0]
|
|
240
|
+
.SUIT_Command_union_choice,
|
|
242
241
|
"Expected directive");
|
|
243
|
-
zassert_equal(
|
|
242
|
+
zassert_equal(SUIT_Directive_Set_Component_Index_c,
|
|
244
243
|
outerwrapper4
|
|
245
|
-
.
|
|
246
|
-
.
|
|
247
|
-
.
|
|
248
|
-
.
|
|
249
|
-
.
|
|
250
|
-
.
|
|
251
|
-
.
|
|
244
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
245
|
+
.SUIT_Manifest_suit_install
|
|
246
|
+
.SUIT_Manifest_suit_install
|
|
247
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
248
|
+
.SUIT_Command_Sequence_SUIT_Command_m[0]
|
|
249
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
250
|
+
.SUIT_Directive_choice,
|
|
252
251
|
"Expected Component_Index");
|
|
253
|
-
zassert_equal(
|
|
252
|
+
zassert_equal(SUIT_Directive_Set_Component_Index_uint_c,
|
|
254
253
|
outerwrapper4
|
|
255
|
-
.
|
|
256
|
-
.
|
|
257
|
-
.
|
|
258
|
-
.
|
|
259
|
-
.
|
|
260
|
-
.
|
|
261
|
-
.
|
|
254
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
255
|
+
.SUIT_Manifest_suit_install
|
|
256
|
+
.SUIT_Manifest_suit_install
|
|
257
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
258
|
+
.SUIT_Command_Sequence_SUIT_Command_m[0]
|
|
259
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
260
|
+
.SUIT_Directive_Set_Component_Index_choice,
|
|
262
261
|
NULL);
|
|
263
|
-
zassert_equal(
|
|
262
|
+
zassert_equal(SUIT_Command_union_SUIT_Directive_m_c,
|
|
264
263
|
outerwrapper4
|
|
265
|
-
.
|
|
266
|
-
.
|
|
267
|
-
.
|
|
268
|
-
.
|
|
269
|
-
.
|
|
270
|
-
.
|
|
264
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
265
|
+
.SUIT_Manifest_suit_install
|
|
266
|
+
.SUIT_Manifest_suit_install
|
|
267
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
268
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
269
|
+
.SUIT_Command_union_choice,
|
|
271
270
|
"Expected directive");
|
|
272
|
-
zassert_equal(
|
|
271
|
+
zassert_equal(SUIT_Directive_Set_Parameters_c,
|
|
273
272
|
outerwrapper4
|
|
274
|
-
.
|
|
275
|
-
.
|
|
276
|
-
.
|
|
277
|
-
.
|
|
278
|
-
.
|
|
279
|
-
.
|
|
280
|
-
.
|
|
273
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
274
|
+
.SUIT_Manifest_suit_install
|
|
275
|
+
.SUIT_Manifest_suit_install
|
|
276
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
277
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
278
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
279
|
+
.SUIT_Directive_choice,
|
|
281
280
|
"Expected Set_Parameters");
|
|
282
281
|
zassert_equal(1,
|
|
283
282
|
outerwrapper4
|
|
284
|
-
.
|
|
285
|
-
.
|
|
286
|
-
.
|
|
287
|
-
.
|
|
288
|
-
.
|
|
289
|
-
.
|
|
290
|
-
.
|
|
283
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
284
|
+
.SUIT_Manifest_suit_install
|
|
285
|
+
.SUIT_Manifest_suit_install
|
|
286
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
287
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
288
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
289
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m_count,
|
|
291
290
|
"Expected 1 parameter");
|
|
292
|
-
zassert_equal(
|
|
291
|
+
zassert_equal(SUIT_Parameters_SUIT_Parameter_URI_List_c,
|
|
293
292
|
outerwrapper4
|
|
294
|
-
.
|
|
295
|
-
.
|
|
296
|
-
.
|
|
297
|
-
.
|
|
298
|
-
.
|
|
299
|
-
.
|
|
300
|
-
.
|
|
301
|
-
.
|
|
302
|
-
.
|
|
293
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
294
|
+
.SUIT_Manifest_suit_install
|
|
295
|
+
.SUIT_Manifest_suit_install
|
|
296
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
297
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
298
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
299
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m[0]
|
|
300
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m
|
|
301
|
+
.SUIT_Parameters_choice,
|
|
303
302
|
"Expected uri list parameter");
|
|
304
303
|
zassert_equal(1,
|
|
305
304
|
outerwrapper4
|
|
306
|
-
.
|
|
307
|
-
.
|
|
308
|
-
.
|
|
309
|
-
.
|
|
310
|
-
.
|
|
311
|
-
.
|
|
312
|
-
.
|
|
313
|
-
.
|
|
314
|
-
.
|
|
315
|
-
.
|
|
305
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
306
|
+
.SUIT_Manifest_suit_install
|
|
307
|
+
.SUIT_Manifest_suit_install
|
|
308
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
309
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
310
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
311
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m[0]
|
|
312
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m
|
|
313
|
+
.SUIT_Parameters_SUIT_Parameter_URI_List_cbor
|
|
314
|
+
.SUIT_URI_List_SUIT_Prioritized_URI_m_count,
|
|
316
315
|
"Expected 1 uri");
|
|
317
316
|
zassert_equal(0,
|
|
318
317
|
outerwrapper4
|
|
319
|
-
.
|
|
320
|
-
.
|
|
321
|
-
.
|
|
322
|
-
.
|
|
323
|
-
.
|
|
324
|
-
.
|
|
325
|
-
.
|
|
326
|
-
.
|
|
327
|
-
.
|
|
328
|
-
.
|
|
329
|
-
.
|
|
318
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
319
|
+
.SUIT_Manifest_suit_install
|
|
320
|
+
.SUIT_Manifest_suit_install
|
|
321
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
322
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
323
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
324
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m[0]
|
|
325
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m
|
|
326
|
+
.SUIT_Parameters_SUIT_Parameter_URI_List_cbor
|
|
327
|
+
.SUIT_URI_List_SUIT_Prioritized_URI_m[0]
|
|
328
|
+
.SUIT_Prioritized_URI_priority,
|
|
330
329
|
"Expected priority x");
|
|
331
330
|
zassert_mem_equal(expected_uri,
|
|
332
331
|
outerwrapper4
|
|
333
|
-
.
|
|
334
|
-
.
|
|
335
|
-
.
|
|
336
|
-
.
|
|
337
|
-
.
|
|
338
|
-
.
|
|
339
|
-
.
|
|
340
|
-
.
|
|
341
|
-
.
|
|
342
|
-
.
|
|
343
|
-
.
|
|
332
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
333
|
+
.SUIT_Manifest_suit_install
|
|
334
|
+
.SUIT_Manifest_suit_install
|
|
335
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
336
|
+
.SUIT_Command_Sequence_SUIT_Command_m[1]
|
|
337
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
338
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m[0]
|
|
339
|
+
.SUIT_Directive_Set_Parameters_SUIT_Parameters_m
|
|
340
|
+
.SUIT_Parameters_SUIT_Parameter_URI_List_cbor
|
|
341
|
+
.SUIT_URI_List_SUIT_Prioritized_URI_m[0]
|
|
342
|
+
.SUIT_Prioritized_URI_uri.value,
|
|
344
343
|
sizeof(expected_uri) - 1,
|
|
345
344
|
"Expected example.com uri");
|
|
346
|
-
zassert_equal(
|
|
345
|
+
zassert_equal(SUIT_Command_union_SUIT_Directive_m_c,
|
|
347
346
|
outerwrapper4
|
|
348
|
-
.
|
|
349
|
-
.
|
|
350
|
-
.
|
|
351
|
-
.
|
|
352
|
-
.
|
|
353
|
-
.
|
|
347
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
348
|
+
.SUIT_Manifest_suit_install
|
|
349
|
+
.SUIT_Manifest_suit_install
|
|
350
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
351
|
+
.SUIT_Command_Sequence_SUIT_Command_m[2]
|
|
352
|
+
.SUIT_Command_union_choice,
|
|
354
353
|
"Expected directive");
|
|
355
|
-
zassert_equal(
|
|
354
|
+
zassert_equal(SUIT_Directive_Fetch_c,
|
|
356
355
|
outerwrapper4
|
|
357
|
-
.
|
|
358
|
-
.
|
|
359
|
-
.
|
|
360
|
-
.
|
|
361
|
-
.
|
|
362
|
-
.
|
|
363
|
-
.
|
|
356
|
+
.SUIT_Outer_Wrapper_suit_manifest_cbor
|
|
357
|
+
.SUIT_Manifest_suit_install
|
|
358
|
+
.SUIT_Manifest_suit_install
|
|
359
|
+
.SUIT_Severable_Command_Sequence3_SUIT_Command_Sequence_bstr_cbor
|
|
360
|
+
.SUIT_Command_Sequence_SUIT_Command_m[2]
|
|
361
|
+
.SUIT_Command_union_SUIT_Directive_m
|
|
362
|
+
.SUIT_Directive_choice,
|
|
364
363
|
"Expected Directive_Fetch");
|
|
365
364
|
}
|
|
366
365
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
#include <zephyr/ztest.h>
|
|
8
8
|
#include "manifest2_decode.h"
|
|
9
|
-
#include "
|
|
9
|
+
#include "zcbor_print.h"
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
/* draft-ietf-suit-manifest-02 Example 0 */
|
|
@@ -45,144 +45,144 @@ ZTEST(cbor_decode_test2, test_5)
|
|
|
45
45
|
uint8_t expected_component1[] = {0x00, 0x34, 0x01};
|
|
46
46
|
int res;
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
zcbor_log("test_vector at: 0x%zu\r\n", (size_t)test_vector1);
|
|
49
|
+
zcbor_log("test_vector end at: 0x%zu\r\n",
|
|
50
50
|
((size_t)test_vector1) + sizeof(test_vector1));
|
|
51
51
|
memset(&outerwrapper1, 0, sizeof(outerwrapper1));
|
|
52
52
|
res = cbor_decode_SUIT_Outer_Wrapper(test_vector1, sizeof(test_vector1),
|
|
53
53
|
&outerwrapper1, &decode_len);
|
|
54
54
|
zassert_equal(ZCBOR_SUCCESS, res, "top-level decoding failed.");
|
|
55
55
|
zassert_equal(sizeof(test_vector1), decode_len, NULL);
|
|
56
|
-
zassert_equal(
|
|
57
|
-
.
|
|
58
|
-
.
|
|
56
|
+
zassert_equal(SUIT_Manifest_Wrapped_suit_manifest_c, outerwrapper1
|
|
57
|
+
.SUIT_Outer_Wrapper_SUIT_Manifest_Wrapped_m
|
|
58
|
+
.SUIT_Manifest_Wrapped_choice,
|
|
59
59
|
"wrong manifest variant");
|
|
60
60
|
manifest = &outerwrapper1
|
|
61
|
-
.
|
|
62
|
-
.
|
|
61
|
+
.SUIT_Outer_Wrapper_SUIT_Manifest_Wrapped_m
|
|
62
|
+
.SUIT_Manifest_Wrapped_suit_manifest_cbor;
|
|
63
63
|
zassert_equal(1, manifest
|
|
64
|
-
->
|
|
64
|
+
->SUIT_Manifest_suit_manifest_sequence_number,
|
|
65
65
|
"wrong sequence number");
|
|
66
66
|
zassert_equal(1, manifest
|
|
67
|
-
->
|
|
67
|
+
->SUIT_Manifest_suit_common_present,
|
|
68
68
|
"common should be present");
|
|
69
69
|
zassert_equal(0, manifest
|
|
70
|
-
->
|
|
70
|
+
->SUIT_Manifest_suit_dependency_resolution_present,
|
|
71
71
|
"should not be present");
|
|
72
72
|
zassert_equal(0, manifest
|
|
73
|
-
->
|
|
73
|
+
->SUIT_Manifest_suit_payload_fetch_present,
|
|
74
74
|
"should not be present");
|
|
75
75
|
zassert_equal(0, manifest
|
|
76
|
-
->
|
|
76
|
+
->SUIT_Manifest_suit_install_present,
|
|
77
77
|
"should not be present");
|
|
78
78
|
zassert_equal(0, manifest
|
|
79
|
-
->
|
|
79
|
+
->SUIT_Manifest_suit_validate_present,
|
|
80
80
|
"should not be present");
|
|
81
81
|
zassert_equal(0, manifest
|
|
82
|
-
->
|
|
82
|
+
->SUIT_Manifest_suit_load_present,
|
|
83
83
|
"should not be present");
|
|
84
84
|
zassert_equal(1, manifest
|
|
85
|
-
->
|
|
85
|
+
->SUIT_Manifest_suit_run_present,
|
|
86
86
|
"should not be present");
|
|
87
87
|
zassert_equal(0, manifest
|
|
88
|
-
->
|
|
88
|
+
->SUIT_Manifest_suit_text_present,
|
|
89
89
|
"should not be present");
|
|
90
90
|
zassert_equal(0, manifest
|
|
91
|
-
->
|
|
91
|
+
->SUIT_Manifest_suit_coswid_present,
|
|
92
92
|
"should not be present");
|
|
93
93
|
zassert_equal(1, manifest
|
|
94
|
-
->
|
|
95
|
-
.
|
|
96
|
-
.
|
|
97
|
-
.
|
|
98
|
-
.
|
|
94
|
+
->SUIT_Manifest_suit_common
|
|
95
|
+
.SUIT_Manifest_suit_common_cbor
|
|
96
|
+
.SUIT_Common_suit_components
|
|
97
|
+
.SUIT_Common_suit_components_cbor
|
|
98
|
+
.SUIT_Components_SUIT_Component_Identifier_m_count,
|
|
99
99
|
"Wrong number of common components");
|
|
100
100
|
component = &manifest
|
|
101
|
-
->
|
|
102
|
-
.
|
|
103
|
-
.
|
|
104
|
-
.
|
|
105
|
-
.
|
|
101
|
+
->SUIT_Manifest_suit_common
|
|
102
|
+
.SUIT_Manifest_suit_common_cbor
|
|
103
|
+
.SUIT_Common_suit_components
|
|
104
|
+
.SUIT_Common_suit_components_cbor
|
|
105
|
+
.SUIT_Components_SUIT_Component_Identifier_m[0];
|
|
106
106
|
zassert_equal(2, component
|
|
107
|
-
->
|
|
107
|
+
->SUIT_Component_Identifier_bstr_count,
|
|
108
108
|
"Wrong number of elements in component");
|
|
109
109
|
zassert_equal(sizeof(expected_component0), component
|
|
110
|
-
->
|
|
110
|
+
->SUIT_Component_Identifier_bstr[0]
|
|
111
111
|
.len,
|
|
112
112
|
"component elem 0 len doesn't match.");
|
|
113
113
|
zassert_mem_equal(expected_component0, component
|
|
114
|
-
->
|
|
114
|
+
->SUIT_Component_Identifier_bstr[0]
|
|
115
115
|
.value,
|
|
116
116
|
sizeof(expected_component0),
|
|
117
117
|
"component elem 0 doesn't match.");
|
|
118
118
|
zassert_equal(sizeof(expected_component1), component
|
|
119
|
-
->
|
|
119
|
+
->SUIT_Component_Identifier_bstr[1]
|
|
120
120
|
.len,
|
|
121
121
|
"component elem 1 len doesn't match.");
|
|
122
122
|
zassert_mem_equal(expected_component1, component
|
|
123
|
-
->
|
|
123
|
+
->SUIT_Component_Identifier_bstr[1]
|
|
124
124
|
.value,
|
|
125
125
|
sizeof(expected_component1),
|
|
126
126
|
"component elem 1 doesn't match.");
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
zcbor_log("\r\n");
|
|
129
129
|
zassert_equal(1, manifest
|
|
130
|
-
->
|
|
131
|
-
.
|
|
132
|
-
.
|
|
130
|
+
->SUIT_Manifest_suit_common
|
|
131
|
+
.SUIT_Manifest_suit_common_cbor
|
|
132
|
+
.SUIT_Common_suit_common_sequence_present,
|
|
133
133
|
"common sequence should be present.");
|
|
134
134
|
memset(&sequence, 0, sizeof(sequence));
|
|
135
135
|
res = cbor_decode_SUIT_Command_Sequence(
|
|
136
136
|
manifest
|
|
137
|
-
->
|
|
138
|
-
.
|
|
139
|
-
.
|
|
140
|
-
.
|
|
137
|
+
->SUIT_Manifest_suit_common
|
|
138
|
+
.SUIT_Manifest_suit_common_cbor
|
|
139
|
+
.SUIT_Common_suit_common_sequence
|
|
140
|
+
.SUIT_Common_suit_common_sequence
|
|
141
141
|
.value,
|
|
142
142
|
manifest
|
|
143
|
-
->
|
|
144
|
-
.
|
|
145
|
-
.
|
|
146
|
-
.
|
|
143
|
+
->SUIT_Manifest_suit_common
|
|
144
|
+
.SUIT_Manifest_suit_common_cbor
|
|
145
|
+
.SUIT_Common_suit_common_sequence
|
|
146
|
+
.SUIT_Common_suit_common_sequence
|
|
147
147
|
.len,
|
|
148
148
|
&sequence, &decode_len);
|
|
149
149
|
zassert_equal(ZCBOR_SUCCESS, res, "Parsing common sequence failed.");
|
|
150
150
|
zassert_equal(manifest
|
|
151
|
-
->
|
|
152
|
-
.
|
|
153
|
-
.
|
|
154
|
-
.
|
|
151
|
+
->SUIT_Manifest_suit_common
|
|
152
|
+
.SUIT_Manifest_suit_common_cbor
|
|
153
|
+
.SUIT_Common_suit_common_sequence
|
|
154
|
+
.SUIT_Common_suit_common_sequence
|
|
155
155
|
.len, decode_len, NULL);
|
|
156
156
|
zassert_equal(1, sequence
|
|
157
|
-
.
|
|
157
|
+
.SUIT_Command_Sequence_SUIT_Command_m_count,
|
|
158
158
|
"Should be one command (was %d).", sequence
|
|
159
|
-
.
|
|
160
|
-
zassert_equal(
|
|
161
|
-
.
|
|
162
|
-
.
|
|
159
|
+
.SUIT_Command_Sequence_SUIT_Command_m_count);
|
|
160
|
+
zassert_equal(SUIT_Command_SUIT_Directive_m_c, sequence
|
|
161
|
+
.SUIT_Command_Sequence_SUIT_Command_m[0]
|
|
162
|
+
.SUIT_Command_choice,
|
|
163
163
|
"Should be a directive.");
|
|
164
164
|
zassert_equal(2, sequence
|
|
165
|
-
.
|
|
166
|
-
.
|
|
167
|
-
.
|
|
165
|
+
.SUIT_Command_Sequence_SUIT_Command_m[0]
|
|
166
|
+
.SUIT_Command_SUIT_Directive_m
|
|
167
|
+
.suit_directive_set_parameters_m_l_map_SUIT_Parameters_m_count,
|
|
168
168
|
"Should be two vars (parameters).");
|
|
169
|
-
|
|
169
|
+
zcbor_log("\r\n");
|
|
170
170
|
|
|
171
171
|
memset(&sequence, 0, sizeof(sequence));
|
|
172
172
|
res = cbor_decode_SUIT_Command_Sequence(
|
|
173
173
|
manifest
|
|
174
|
-
->
|
|
175
|
-
.
|
|
174
|
+
->SUIT_Manifest_suit_run
|
|
175
|
+
.SUIT_Manifest_suit_run
|
|
176
176
|
.value,
|
|
177
177
|
manifest
|
|
178
|
-
->
|
|
179
|
-
.
|
|
178
|
+
->SUIT_Manifest_suit_run
|
|
179
|
+
.SUIT_Manifest_suit_run
|
|
180
180
|
.len,
|
|
181
181
|
&sequence, &decode_len);
|
|
182
182
|
zassert_equal(ZCBOR_SUCCESS, res, "Parsing run command sequence failed.");
|
|
183
183
|
zassert_equal(manifest
|
|
184
|
-
->
|
|
185
|
-
.
|
|
184
|
+
->SUIT_Manifest_suit_run
|
|
185
|
+
.SUIT_Manifest_suit_run
|
|
186
186
|
.len, decode_len, NULL);
|
|
187
187
|
}
|
|
188
188
|
|