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
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* \file edhoc_ead.h
|
|
3
3
|
* \author Kamil Kielbasa
|
|
4
4
|
* \brief EDHOC External Authorization Data (EAD) interface.
|
|
5
|
-
* \version 0.
|
|
6
|
-
* \date 2024-
|
|
5
|
+
* \version 0.6
|
|
6
|
+
* \date 2024-08-05
|
|
7
7
|
*
|
|
8
8
|
* \copyright Copyright (c) 2024
|
|
9
9
|
*
|
|
@@ -62,9 +62,11 @@ struct edhoc_ead_token {
|
|
|
62
62
|
*
|
|
63
63
|
* \return EDHOC_SUCCESS on success, otherwise failure.
|
|
64
64
|
*/
|
|
65
|
-
typedef int (*
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
typedef int (*edhoc_ead_compose_t)(void *user_context,
|
|
66
|
+
enum edhoc_message message,
|
|
67
|
+
struct edhoc_ead_token *ead_token,
|
|
68
|
+
size_t ead_token_size,
|
|
69
|
+
size_t *ead_token_len);
|
|
68
70
|
|
|
69
71
|
/**
|
|
70
72
|
* \brief Callback for external authorization data (EAD) processing.
|
|
@@ -76,18 +78,19 @@ typedef int (*edhoc_ead_compose)(void *user_context, enum edhoc_message message,
|
|
|
76
78
|
*
|
|
77
79
|
* \return EDHOC_SUCCESS on success, otherwise failure.
|
|
78
80
|
*/
|
|
79
|
-
typedef int (*
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
typedef int (*edhoc_ead_process_t)(void *user_context,
|
|
82
|
+
enum edhoc_message message,
|
|
83
|
+
const struct edhoc_ead_token *ead_token,
|
|
84
|
+
size_t ead_token_size);
|
|
82
85
|
|
|
83
86
|
/**
|
|
84
87
|
* \brief Bind structure for EAD operations.
|
|
85
88
|
*/
|
|
86
89
|
struct edhoc_ead {
|
|
87
90
|
/** External authorization data compose callback. */
|
|
88
|
-
|
|
91
|
+
edhoc_ead_compose_t compose;
|
|
89
92
|
/** External authorization data process callback. */
|
|
90
|
-
|
|
93
|
+
edhoc_ead_process_t process;
|
|
91
94
|
};
|
|
92
95
|
|
|
93
96
|
/**@}*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* \file edhoc_macros.h
|
|
3
3
|
* \author Kamil Kielbasa
|
|
4
4
|
* \brief EDHOC macros and functionlike macros.
|
|
5
|
-
* \version 0.
|
|
6
|
-
* \date 2024-
|
|
5
|
+
* \version 0.6
|
|
6
|
+
* \date 2024-08-05
|
|
7
7
|
*
|
|
8
8
|
* \copyright Copyright (c) 2024
|
|
9
9
|
*
|
|
@@ -14,26 +14,35 @@
|
|
|
14
14
|
#define EDHOC_MACROS_H
|
|
15
15
|
|
|
16
16
|
/* Include files ----------------------------------------------------------- */
|
|
17
|
+
#include <stddef.h>
|
|
18
|
+
|
|
17
19
|
/* Defines ----------------------------------------------------------------- */
|
|
18
20
|
/* Types and type definitions ---------------------------------------------- */
|
|
19
21
|
|
|
22
|
+
/**
|
|
23
|
+
* \brief Macros for hiding dynamic stack allocations:
|
|
24
|
+
* - GCC and Clang support C99 feature VLA. (Variable Length Array)
|
|
25
|
+
* - MSVC supports only alloca. Lack of VLA.
|
|
26
|
+
*/
|
|
20
27
|
#if defined(_WIN32) || defined(_MSC_VER)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
#include <malloc.h>
|
|
29
|
+
#define VLA_ALLOC(type, name, size) \
|
|
30
|
+
type *name = _alloca(size * sizeof(type)); \
|
|
31
|
+
const size_t name##_size = size * sizeof(type)
|
|
32
|
+
#define VLA_SIZEOF(name) name##_size
|
|
26
33
|
#else
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#define ALLOCATE_ARRAY_SIZEOF(name) sizeof(name)
|
|
34
|
+
#define VLA_ALLOC(type, name, size) type name[size]
|
|
35
|
+
#define VLA_SIZEOF(name) sizeof(name)
|
|
30
36
|
#endif
|
|
31
37
|
|
|
38
|
+
#define VLA_SIZE(x) (VLA_SIZEOF(x) / sizeof(x[0]))
|
|
39
|
+
|
|
32
40
|
/**
|
|
33
41
|
* \brief Macro for calculating arrays length.
|
|
34
42
|
*/
|
|
43
|
+
#ifndef ARRAY_SIZE
|
|
35
44
|
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
|
36
|
-
#
|
|
45
|
+
#endif
|
|
37
46
|
|
|
38
47
|
/**
|
|
39
48
|
* \brief Macro which allows for private access into structure members.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* \file edhoc.c
|
|
3
3
|
* \author Kamil Kielbasa
|
|
4
4
|
* \brief EDHOC context.
|
|
5
|
-
* \version 0.
|
|
6
|
-
* \date 2024-
|
|
5
|
+
* \version 0.6
|
|
6
|
+
* \date 2024-08-05
|
|
7
7
|
*
|
|
8
8
|
* \copyright Copyright (c) 2024
|
|
9
9
|
*
|
|
@@ -52,15 +52,18 @@ int edhoc_context_deinit(struct edhoc_context *ctx)
|
|
|
52
52
|
return EDHOC_SUCCESS;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
int
|
|
55
|
+
int edhoc_set_methods(struct edhoc_context *ctx,
|
|
56
|
+
const enum edhoc_method *method, size_t method_len)
|
|
56
57
|
{
|
|
57
|
-
if (NULL == ctx
|
|
58
|
+
if (NULL == ctx || NULL == method || 0 == method_len ||
|
|
59
|
+
EDHOC_METHOD_MAX < method_len)
|
|
58
60
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
59
61
|
|
|
60
62
|
if (!ctx->is_init)
|
|
61
63
|
return EDHOC_ERROR_BAD_STATE;
|
|
62
64
|
|
|
63
|
-
ctx->
|
|
65
|
+
ctx->method_len = method_len;
|
|
66
|
+
memcpy(ctx->method, method, sizeof(*method) * method_len);
|
|
64
67
|
|
|
65
68
|
return EDHOC_SUCCESS;
|
|
66
69
|
}
|
|
@@ -69,14 +72,14 @@ int edhoc_set_cipher_suites(struct edhoc_context *ctx,
|
|
|
69
72
|
const struct edhoc_cipher_suite *csuite,
|
|
70
73
|
size_t csuite_len)
|
|
71
74
|
{
|
|
72
|
-
if (NULL == ctx)
|
|
75
|
+
if (NULL == ctx || NULL == csuite || 0 == csuite_len)
|
|
73
76
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
74
77
|
|
|
75
78
|
if (!ctx->is_init)
|
|
76
79
|
return EDHOC_ERROR_BAD_STATE;
|
|
77
80
|
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
81
|
+
if (ARRAY_SIZE(ctx->csuite) < csuite_len)
|
|
82
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
80
83
|
|
|
81
84
|
ctx->csuite_len = csuite_len;
|
|
82
85
|
memcpy(ctx->csuite, csuite, sizeof(*csuite) * csuite_len);
|
|
@@ -85,34 +88,34 @@ int edhoc_set_cipher_suites(struct edhoc_context *ctx,
|
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
int edhoc_set_connection_id(struct edhoc_context *ctx,
|
|
88
|
-
struct edhoc_connection_id cid)
|
|
91
|
+
const struct edhoc_connection_id *cid)
|
|
89
92
|
{
|
|
90
|
-
if (NULL == ctx)
|
|
93
|
+
if (NULL == ctx || NULL == cid)
|
|
91
94
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
92
95
|
|
|
93
96
|
if (!ctx->is_init)
|
|
94
97
|
return EDHOC_ERROR_BAD_STATE;
|
|
95
98
|
|
|
96
|
-
switch (cid
|
|
99
|
+
switch (cid->encode_type) {
|
|
97
100
|
case EDHOC_CID_TYPE_ONE_BYTE_INTEGER:
|
|
98
|
-
if (ONE_BYTE_CBOR_INT_MIN_VALUE > cid
|
|
99
|
-
ONE_BYTE_CBOR_INT_MAX_VALUE < cid
|
|
100
|
-
return
|
|
101
|
+
if (ONE_BYTE_CBOR_INT_MIN_VALUE > cid->int_value ||
|
|
102
|
+
ONE_BYTE_CBOR_INT_MAX_VALUE < cid->int_value)
|
|
103
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
101
104
|
break;
|
|
102
105
|
|
|
103
106
|
case EDHOC_CID_TYPE_BYTE_STRING:
|
|
104
|
-
if (0 == cid
|
|
105
|
-
return
|
|
107
|
+
if (0 == cid->bstr_length)
|
|
108
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
106
109
|
|
|
107
|
-
if (
|
|
108
|
-
return
|
|
110
|
+
if (CONFIG_LIBEDHOC_MAX_LEN_OF_CONN_ID < cid->bstr_length)
|
|
111
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
109
112
|
break;
|
|
110
113
|
|
|
111
114
|
default:
|
|
112
115
|
return EDHOC_ERROR_BAD_STATE;
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
ctx->cid = cid;
|
|
118
|
+
ctx->cid = *cid;
|
|
116
119
|
|
|
117
120
|
return EDHOC_SUCCESS;
|
|
118
121
|
}
|
|
@@ -130,58 +133,72 @@ int edhoc_set_user_context(struct edhoc_context *ctx, void *user_ctx)
|
|
|
130
133
|
return EDHOC_SUCCESS;
|
|
131
134
|
}
|
|
132
135
|
|
|
133
|
-
int edhoc_bind_ead(struct edhoc_context *ctx, struct edhoc_ead ead)
|
|
136
|
+
int edhoc_bind_ead(struct edhoc_context *ctx, const struct edhoc_ead *ead)
|
|
134
137
|
{
|
|
135
|
-
if (NULL == ctx)
|
|
138
|
+
if (NULL == ctx || NULL == ead)
|
|
136
139
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
137
140
|
|
|
138
141
|
if (!ctx->is_init)
|
|
139
142
|
return EDHOC_ERROR_BAD_STATE;
|
|
140
143
|
|
|
141
|
-
if (NULL == ead
|
|
142
|
-
return
|
|
144
|
+
if (NULL == ead->compose && NULL == ead->process)
|
|
145
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
143
146
|
|
|
144
|
-
ctx->ead = ead;
|
|
147
|
+
ctx->ead = *ead;
|
|
145
148
|
|
|
146
149
|
return EDHOC_SUCCESS;
|
|
147
150
|
}
|
|
148
151
|
|
|
149
|
-
int edhoc_bind_keys(struct edhoc_context *ctx, struct edhoc_keys keys)
|
|
152
|
+
int edhoc_bind_keys(struct edhoc_context *ctx, const struct edhoc_keys *keys)
|
|
150
153
|
{
|
|
151
|
-
if (NULL == ctx)
|
|
154
|
+
if (NULL == ctx || NULL == keys)
|
|
152
155
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
153
156
|
|
|
154
157
|
if (!ctx->is_init)
|
|
155
158
|
return EDHOC_ERROR_BAD_STATE;
|
|
156
159
|
|
|
157
|
-
|
|
160
|
+
if (NULL == keys->import_key || NULL == keys->destroy_key)
|
|
161
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
162
|
+
|
|
163
|
+
ctx->keys = *keys;
|
|
158
164
|
|
|
159
165
|
return EDHOC_SUCCESS;
|
|
160
166
|
}
|
|
161
167
|
|
|
162
|
-
int edhoc_bind_crypto(struct edhoc_context *ctx,
|
|
168
|
+
int edhoc_bind_crypto(struct edhoc_context *ctx,
|
|
169
|
+
const struct edhoc_crypto *crypto)
|
|
163
170
|
{
|
|
164
|
-
if (NULL == ctx)
|
|
171
|
+
if (NULL == ctx || NULL == crypto)
|
|
165
172
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
166
173
|
|
|
167
174
|
if (!ctx->is_init)
|
|
168
175
|
return EDHOC_ERROR_BAD_STATE;
|
|
169
176
|
|
|
170
|
-
|
|
177
|
+
if (NULL == crypto->make_key_pair || NULL == crypto->key_agreement ||
|
|
178
|
+
NULL == crypto->signature || NULL == crypto->verify ||
|
|
179
|
+
NULL == crypto->extract || NULL == crypto->expand ||
|
|
180
|
+
NULL == crypto->encrypt || NULL == crypto->decrypt ||
|
|
181
|
+
NULL == crypto->hash)
|
|
182
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
183
|
+
|
|
184
|
+
ctx->crypto = *crypto;
|
|
171
185
|
|
|
172
186
|
return EDHOC_SUCCESS;
|
|
173
187
|
}
|
|
174
188
|
|
|
175
189
|
int edhoc_bind_credentials(struct edhoc_context *ctx,
|
|
176
|
-
struct edhoc_credentials cred)
|
|
190
|
+
const struct edhoc_credentials *cred)
|
|
177
191
|
{
|
|
178
|
-
if (NULL == ctx)
|
|
192
|
+
if (NULL == ctx || NULL == cred)
|
|
179
193
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
180
194
|
|
|
181
195
|
if (!ctx->is_init)
|
|
182
196
|
return EDHOC_ERROR_BAD_STATE;
|
|
183
197
|
|
|
184
|
-
|
|
198
|
+
if (NULL == cred->fetch || NULL == cred->verify)
|
|
199
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
200
|
+
|
|
201
|
+
ctx->cred = *cred;
|
|
185
202
|
|
|
186
203
|
return EDHOC_SUCCESS;
|
|
187
204
|
}
|
|
@@ -192,22 +209,31 @@ int edhoc_error_get_code(const struct edhoc_context *ctx,
|
|
|
192
209
|
if (NULL == ctx || NULL == code)
|
|
193
210
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
194
211
|
|
|
212
|
+
if (!ctx->is_init)
|
|
213
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
214
|
+
|
|
195
215
|
*code = ctx->error_code;
|
|
196
216
|
return EDHOC_SUCCESS;
|
|
197
217
|
}
|
|
198
218
|
|
|
199
219
|
int edhoc_error_get_cipher_suites(const struct edhoc_context *ctx,
|
|
200
220
|
int32_t *csuites, size_t csuites_size,
|
|
201
|
-
size_t *csuites_len
|
|
221
|
+
size_t *csuites_len, int32_t *peer_csuites,
|
|
222
|
+
size_t peer_csuites_size,
|
|
223
|
+
size_t *peer_csuites_len)
|
|
202
224
|
{
|
|
203
225
|
if (NULL == ctx || NULL == csuites || 0 == csuites_size ||
|
|
204
|
-
NULL == csuites_len
|
|
226
|
+
NULL == csuites_len || NULL == peer_csuites ||
|
|
227
|
+
0 == peer_csuites_size || NULL == peer_csuites_len)
|
|
205
228
|
return EDHOC_ERROR_INVALID_ARGUMENT;
|
|
206
229
|
|
|
230
|
+
if (!ctx->is_init)
|
|
231
|
+
return EDHOC_ERROR_BAD_STATE;
|
|
232
|
+
|
|
207
233
|
if (EDHOC_ERROR_CODE_WRONG_SELECTED_CIPHER_SUITE != ctx->error_code)
|
|
208
234
|
return EDHOC_ERROR_BAD_STATE;
|
|
209
235
|
|
|
210
|
-
if (ctx->csuite_len
|
|
236
|
+
if (csuites_size < ctx->csuite_len)
|
|
211
237
|
return EDHOC_ERROR_BUFFER_TOO_SMALL;
|
|
212
238
|
|
|
213
239
|
*csuites_len = ctx->csuite_len;
|
|
@@ -215,5 +241,13 @@ int edhoc_error_get_cipher_suites(const struct edhoc_context *ctx,
|
|
|
215
241
|
for (size_t i = 0; i < ctx->csuite_len; ++i)
|
|
216
242
|
csuites[i] = ctx->csuite[i].value;
|
|
217
243
|
|
|
244
|
+
if (peer_csuites_size < ctx->peer_csuite_len)
|
|
245
|
+
return EDHOC_ERROR_BUFFER_TOO_SMALL;
|
|
246
|
+
|
|
247
|
+
*peer_csuites_len = ctx->peer_csuite_len;
|
|
248
|
+
|
|
249
|
+
for (size_t i = 0; i < ctx->peer_csuite_len; ++i)
|
|
250
|
+
peer_csuites[i] = ctx->peer_csuite[i].value;
|
|
251
|
+
|
|
218
252
|
return EDHOC_SUCCESS;
|
|
219
253
|
}
|