/uoscore-uedhoc-3.5.0/src/oscore/ |
D | oscore_cose.c | 41 enc_structure._oscore_enc_structure_context.len = in create_enc_structure() 44 enc_structure._oscore_enc_structure_protected.len = 0; in create_enc_structure() 47 enc_structure._oscore_enc_structure_external_aad.len = in create_enc_structure() 48 external_aad->len; in create_enc_structure() 52 TRY_EXPECT(cbor_encode_oscore_enc_structure(out->ptr, out->len, in create_enc_structure() 57 out->len = (uint32_t)payload_len_out; in create_enc_structure() 68 uint32_t aad_len = recipient_aad->len + ENCRYPT0_ENCODING_OVERHEAD; in oscore_cose_decrypt() 71 PRINT_ARRAY("AAD encoded", aad.ptr, aad.len); in oscore_cose_decrypt() 73 (in_ciphertext->ptr + in_ciphertext->len - 8), 8); in oscore_cose_decrypt() 75 PRINT_ARRAY("Ciphertext", in_ciphertext->ptr, in_ciphertext->len); in oscore_cose_decrypt() [all …]
|
D | oscore_hkdf_info.c | 48 uint8_t len = 0; in oscore_create_hkdf_info() local 52 len = 16; in oscore_create_hkdf_info() 56 len = 13; in oscore_create_hkdf_info() 61 info_struct._oscore_info_id.len = id->len; in oscore_create_hkdf_info() 63 if (id_context->len == 0) { in oscore_create_hkdf_info() 71 info_struct._oscore_info_id_context_bstr.len = id_context->len; in oscore_create_hkdf_info() 77 info_struct._oscore_info_type.len = (uint32_t)strlen(type_enc); in oscore_create_hkdf_info() 78 info_struct._oscore_info_L = len; in oscore_create_hkdf_info() 82 TRY_EXPECT(cbor_encode_oscore_info(out->ptr, out->len, &info_struct, in oscore_create_hkdf_info() 86 out->len = (uint32_t)payload_len_out; in oscore_create_hkdf_info()
|
D | security_context.c | 48 PRINT_ARRAY("info struct", info.ptr, info.len); in derive() 70 PRINT_ARRAY("Common IV", cc->common_iv.ptr, cc->common_iv.len); in derive_common_iv() 84 PRINT_ARRAY("Sender Key", sc->sender_key.ptr, sc->sender_key.len); in derive_sender_key() 100 rc->recipient_key.len); in derive_recipient_key() 125 c->cc.common_iv.len = sizeof(c->cc.common_iv_buf); in oscore_context_init() 132 c->rc.recipient_id.len = params->recipient_id.len; in oscore_context_init() 135 params->recipient_id.len); in oscore_context_init() 136 c->rc.recipient_key.len = sizeof(c->rc.recipient_key_buf); in oscore_context_init() 142 c->sc.sender_key.len = sizeof(c->sc.sender_key_buf); in oscore_context_init() 153 c->rrc.nonce.len = sizeof(c->rrc.nonce_buf); in oscore_context_init() [all …]
|
D | nonce.c | 26 TRY(_memcpy_s(&padded_piv[sizeof(padded_piv) - piv->len], piv->len, in create_nonce() 27 piv->ptr, piv->len)); in create_nonce() 33 TRY(_memcpy_s(&padded_id_piv[sizeof(padded_id_piv) - id_piv->len], in create_nonce() 34 id_piv->len, id_piv->ptr, id_piv->len)); in create_nonce() 37 nonce->ptr[0] = (uint8_t)id_piv->len; in create_nonce() 44 PRINT_ARRAY("nonce input A", nonce->ptr, nonce->len); in create_nonce() 45 PRINT_ARRAY("nonce input B", common_iv->ptr, common_iv->len); in create_nonce() 47 for (uint32_t i = 0; i < common_iv->len; i++) { in create_nonce() 51 PRINT_ARRAY("nonce", nonce->ptr, nonce->len); in create_nonce()
|
D | oscore_coap.c | 51 uint32_t out_capacity = out->len; in options_serialize() 52 out->len = 0; in options_serialize() 56 len_extra_byte = opt_extra_bytes(options[i].len); in options_serialize() 80 *(header_byte) |= (uint8_t)(options[i].len); in options_serialize() 85 (uint8_t)(options[i].len - 13); in options_serialize() 89 uint16_t temp_len = (uint16_t)(options[i].len - 269); in options_serialize() 100 out->len = (uint32_t)(out->len + 1 + delta_extra_byte + in options_serialize() 101 len_extra_byte + options[i].len); in options_serialize() 103 if (0 != options[i].len) { in options_serialize() 107 options[i].len)); in options_serialize() [all …]
|
D | aad.c | 34 aad_array._aad_array_request_kid.len = kid->len; in create_aad() 36 aad_array._aad_array_request_piv.len = piv->len; in create_aad() 38 PRINT_ARRAY("request_piv", piv->ptr, piv->len); in create_aad() 39 PRINT_ARRAY("request_kid", kid->ptr, kid->len); in create_aad() 46 aad_array._aad_array_options.len = 0; in create_aad() 50 TRY_EXPECT(cbor_encode_aad_array(out->ptr, out->len, &aad_array, in create_aad() 54 out->len = (uint32_t)payload_len_out; in create_aad() 55 PRINT_ARRAY("AAD", out->ptr, out->len); in create_aad()
|
D | coap2oscore.c | 67 opt_extra_bytes(in_o_coap->options[i].len); in inner_outer_option_split() 71 temp_len = in_o_coap->options[i].len; in inner_outer_option_split() 90 e_options[*e_options_cnt].len = temp_len; in inner_outer_option_split() 100 e_options[*e_options_cnt].len = 0; in inner_outer_option_split() 123 U_options[*U_options_cnt].len = temp_len; in inner_outer_option_split() 146 e_options[*e_options_cnt].len = temp_len; in inner_outer_option_split() 168 U_options[*U_options_cnt].len = temp_len; in inner_outer_option_split() 212 E_options[i].len); in plaintext_setup() 221 uint32_t dest_size = (plaintext->len - (uint32_t)(temp_plaintext_ptr + in plaintext_setup() 224 e_opt_serial.len)); in plaintext_setup() [all …]
|
D | option.c | 73 output->len = options[i].len; in get_observe_value() 86 TRY(_memcpy_s(dest->ptr, dest->len, options[i].value, in cache_echo_val() 87 options[i].len)); in cache_echo_val() 88 dest->len = options[i].len; in cache_echo_val() 102 uint32_t temp_payload_len = in_payload->len; in oscore_decrypted_payload_parser() 133 cache_val->len) && in echo_val_is_fresh() 134 cache_val->len == E_options[i].len) { in echo_val_is_fresh() 166 if ((0 != option->len) && (NULL == option->value)) { in uri_path_create() 171 option->value, option->len)); in uri_path_create()
|
D | oscore2coap.c | 53 temp_kid_len = opt[i].len; in oscore_option_parser() 57 if (opt[i].len == 0) { in oscore_option_parser() 63 out->piv.len = 0; in oscore_option_parser() 65 out->kid.len = 0; in oscore_option_parser() 67 out->kid_context.len = 0; in oscore_option_parser() 89 out->piv.len = 0; in oscore_option_parser() 98 out->piv.len = out->n; in oscore_option_parser() 107 out->kid_context.len = 0; in oscore_option_parser() 110 out->kid_context.len = *val_ptr; in oscore_option_parser() 112 val_ptr += out->kid_context.len; in oscore_option_parser() [all …]
|
/uoscore-uedhoc-3.5.0/src/edhoc/ |
D | cert.c | 51 size_t len) in deser_sign_cb() argument 57 memcpy(ctx->seek, start + len - ctx->unit_size, in deser_sign_cb() 65 static int find_pk_cb(void *void_ppk, int tag, unsigned char *start, size_t len) in find_pk_cb() argument 67 (void)len; in find_pk_cb() 86 #define EXPECTO_TAG(tag, cursor, len) \ argument 95 mbedtls_asn1_get_len(&cursor, end, &len); \ 96 if (0 == *cursor) {cursor++; len--;} \ 113 size_t *len) in mbedtls_asn1_get_len() argument 119 *len = *(*p)++; in mbedtls_asn1_get_len() 126 *len = (*p)[1]; in mbedtls_asn1_get_len() [all …]
|
D | initiator.c | 61 (uint32_t)(m._m2_G_Y_CIPHERTEXT_2.len - g_y_len))); in msg2_parse() 63 *ciphertext2_len = (uint32_t)m._m2_G_Y_CIPHERTEXT_2.len - g_y_len; in msg2_parse() 70 (uint32_t)m._m2_C_R_bstr.len)); in msg2_parse() 71 *c_r_len = (uint32_t)m._m2_C_R_bstr.len; in msg2_parse() 87 if (c->suites_i.len == 1) { in msg1_gen() 91 } else if (c->suites_i.len > 1) { in msg1_gen() 94 m1._SUITES_I__suite_suite_count = c->suites_i.len; in msg1_gen() 95 for (uint32_t i = 0; i < c->suites_i.len; i++) { in msg1_gen() 102 m1._message_1_G_X.len = c->g_x.len; in msg1_gen() 105 PRINT_ARRAY("C_I", c->c_i.ptr, c->c_i.len); in msg1_gen() [all …]
|
D | plaintext_decode.c | 55 map._id_cred_x_map_x5chain._id_cred_x_map_x5chain.len = id_len; in id_cred_x_encode() 63 map._id_cred_x_map_x5t._id_cred_x_map_x5t_hash.len = id_len; in id_cred_x_encode() 99 ._map_x5chain._map_x5chain.len, in plaintext_split() 111 ._map_x5t_hash.len, in plaintext_split() 122 (uint32_t)p._plaintext_ID_CRED_x_bstr.len, in plaintext_split() 133 (uint32_t)p._plaintext_SGN_or_MAC_x.len)); in plaintext_split() 134 *sign_or_mac_len = (uint32_t)p._plaintext_SGN_or_MAC_x.len; in plaintext_split() 138 (uint32_t)p._plaintext_AD_x.len)); in plaintext_split() 139 *ad_len = (uint32_t)p._plaintext_AD_x.len; in plaintext_split()
|
D | edhoc_cose.c | 31 enc_structure._edhoc_enc_structure_context.len = context_len; in cose_enc_structure_encode() 33 enc_structure._edhoc_enc_structure_external_aad.len = external_aad_len; in cose_enc_structure_encode() 56 enc_structure._edhoc_enc_structure_protected.len = protected_len; in cose_enc_structure_encode() 77 sig_structure._sig_structure_context.len = context_len; in cose_sig_structure_encode() 79 sig_structure._sig_structure_protected.len = protected_len; in cose_sig_structure_encode() 81 sig_structure._sig_structure_external_aad.len = external_aad_len; in cose_sig_structure_encode() 83 sig_structure._sig_structure_payload.len = payload_len; in cose_sig_structure_encode()
|
D | retrieve_cred.c | 106 if ((cred_array[i].id_cred.len == id_cred_len) && in get_local_cred() 111 cred_array[i].cred.len)); in get_local_cred() 112 *cred_len = cred_array[i].cred.len; in get_local_cred() 117 if (cred_array[i].g.len == 65) { in get_local_cred() 128 cred_array[i].g.len)); in get_local_cred() 129 *g_len = cred_array[i].g.len; in get_local_cred() 135 cred_array[i].pk.len)); in get_local_cred() 136 *pk_len = cred_array[i].pk.len; in get_local_cred() 175 ._id_cred_x_map_x5chain.len, in retrieve_cred() 185 .len, in retrieve_cred() [all …]
|
/uoscore-uedhoc-3.5.0/test/oscore_unit_tests/ |
D | unit_test_coap2oscore.c | 28 PRINT_ARRAY("value", opt[i].value, opt[i].len); in print_options() 42 zassert_equal(opt[i].len, opt_expected[i].len, "wrong length"); in assert_options() 47 opt[i].len, "wrong value"); in assert_options() 74 .len = 0, in t100_inner_outer_option_split__no_special_options() 79 .len = 0, in t100_inner_outer_option_split__no_special_options() 84 .len = 0, in t100_inner_outer_option_split__no_special_options() 89 .len = 0, in t100_inner_outer_option_split__no_special_options() 93 .payload.len = 0, in t100_inner_outer_option_split__no_special_options() 110 .len = 0, in t100_inner_outer_option_split__no_special_options() 114 { .delta = 3, .len = 0, .value = NULL, .option_number = ETAG }, in t100_inner_outer_option_split__no_special_options() [all …]
|
D | unit_test_oscore2coap.c | 38 .piv.len = 0, in t300_oscore_option_parser_no_piv() 40 .kid_context.len = sizeof(kid_context), in t300_oscore_option_parser_no_piv() 42 .kid.len = sizeof(kid), in t300_oscore_option_parser_no_piv() 52 .len = sizeof(val), in t300_oscore_option_parser_no_piv() 65 zassert_equal(result.piv.len, 0, "wrong piv len"); in t300_oscore_option_parser_no_piv() 67 result.kid.len, "wrong kid"); in t300_oscore_option_parser_no_piv() 70 result.kid_context.len, "wrong kid_context"); in t300_oscore_option_parser_no_piv() 79 .len = sizeof(val), in t301_oscore_option_parser_wrong_n() 109 .piv.len = sizeof(piv), in t302_oscore_option_parser_no_kid() 111 .kid_context.len = sizeof(kid_context), in t302_oscore_option_parser_no_kid() [all …]
|
D | unit_test_oscore_coap.c | 42 result.options[0].len = observe_len; in generate_test_packet() 49 uint8_t out_buf[expected->len]; in serialization_test() 55 PRINT_ARRAY("computed", out.ptr, out.len); in serialization_test() 56 PRINT_ARRAY("expected", expected->ptr, expected->len); in serialization_test() 58 zassert_mem_equal__(out.ptr, expected->ptr, expected->len, in serialization_test() 78 zassert_equal(options[i].len, coap_pkt.options[i].len, in deserialization_test() 79 "len mismatch: %d", coap_pkt.options[i].len); in deserialization_test() 85 options[i].len, "option value mismatch"); in deserialization_test() 99 .len = sizeof(uri_host_val), in t200_options_serialize_deserialize() 103 .len = sizeof(uri_path_val), in t200_options_serialize_deserialize() [all …]
|
D | unit_test_option.c | 53 uint32_t len = sizeof(not_e_opt_nums) / sizeof(not_e_opt_nums[0]); in t400_is_class_e() local 54 for (uint32_t i = 0; i < len; i++) { in t400_is_class_e() 65 { .delta = 2, .len = 0, .value = NULL, .option_number = 2 }, in t401_cache_echo_val() 66 { .delta = 2, .len = 0, .value = NULL, .option_number = 4 }, in t401_cache_echo_val() 67 { .delta = 3, .len = 0, .value = NULL, .option_number = 7 }, in t401_cache_echo_val() 68 { .delta = 5, .len = 0, .value = NULL, .option_number = ECHO } in t401_cache_echo_val() 117 { .option_number = URI_PATH, .value = "path", .len = 4 }, in t403_uri_path_create() 118 { .option_number = URI_PATH, .value = "to", .len = 2 }, in t403_uri_path_create() 120 { .option_number = URI_PATH, .value = "rsc", .len = 3 }, in t403_uri_path_create() 144 { .option_number = URI_PATH, .value = "path", .len = 4 }, in t403_uri_path_create() [all …]
|
/uoscore-uedhoc-3.5.0/src/common/ |
D | byte_array.c | 18 .len = 0, 23 .len = 0, 30 TRY(_memcpy_s(dest->ptr, dest_max_len, src->ptr, src->len)); in byte_array_cpy() 31 dest->len = src->len; in byte_array_cpy() 37 if (left->len != right->len) { in array_equals() 40 for (uint32_t i = 0; i < left->len; i++) { in array_equals()
|
/uoscore-uedhoc-3.5.0/test/oscore_integration_tests/ |
D | oscore_integration_tests.c | 27 struct byte_array sender = { .ptr = (uint8_t *)T1__SENDER_ID, .len = T1__SENDER_ID_LEN }; in get_default_params() 28 struct byte_array recipient = { .ptr = (uint8_t *)T1__RECIPIENT_ID, .len = T1__RECIPIENT_ID_LEN }; in get_default_params() 32 .master_secret.len = T1__MASTER_SECRET_LEN, in get_default_params() 36 .master_salt.len = T1__MASTER_SALT_LEN, in get_default_params() 38 .id_context.len = T1__ID_CONTEXT_LEN, in get_default_params() 79 c_client.sc.sender_key.len, in t1_oscore_client_request_response() 83 c_client.rc.recipient_key.len, in t1_oscore_client_request_response() 87 c_client.cc.common_iv.len, in t1_oscore_client_request_response() 112 .master_secret.len = T3__MASTER_SECRET_LEN, in t3_oscore_client_request() 114 .sender_id.len = T3__SENDER_ID_LEN, in t3_oscore_client_request() [all …]
|
/uoscore-uedhoc-3.5.0/test/edhoc_integration_tests/ |
D | initiator_responder_interaction.c | 137 c_i.c_i.len = test_vectors[vec_num_i].c_i_len; in thread_initiator() 140 c_i.suites_i.len = test_vectors[vec_num_i].SUITES_I_len; in thread_initiator() 142 c_i.ead_1.len = test_vectors[vec_num_i].ead_1_len; in thread_initiator() 144 c_i.ead_3.len = test_vectors[vec_num_i].ead_3_len; in thread_initiator() 146 c_i.id_cred_i.len = test_vectors[vec_num_i].id_cred_i_len; in thread_initiator() 148 c_i.cred_i.len = test_vectors[vec_num_i].cred_i_len; in thread_initiator() 150 c_i.g_x.len = test_vectors[vec_num_i].g_x_raw_len; in thread_initiator() 152 c_i.x.len = test_vectors[vec_num_i].x_raw_len; in thread_initiator() 154 c_i.g_i.len = test_vectors[vec_num_i].g_i_raw_len; in thread_initiator() 156 c_i.i.len = test_vectors[vec_num_i].i_raw_len; in thread_initiator() [all …]
|
/uoscore-uedhoc-3.5.0/samples/linux_edhoc/initiator/src/ |
D | main.cpp | 155 c_i.c_i.len = test_vectors[vec_num_i].c_i_len; in main() 158 c_i.suites_i.len = test_vectors[vec_num_i].SUITES_I_len; in main() 160 c_i.ead_1.len = test_vectors[vec_num_i].ead_1_len; in main() 162 c_i.ead_3.len = test_vectors[vec_num_i].ead_3_len; in main() 164 c_i.id_cred_i.len = test_vectors[vec_num_i].id_cred_i_len; in main() 166 c_i.cred_i.len = test_vectors[vec_num_i].cred_i_len; in main() 168 c_i.g_x.len = test_vectors[vec_num_i].g_x_raw_len; in main() 170 c_i.x.len = test_vectors[vec_num_i].x_raw_len; in main() 172 c_i.g_i.len = test_vectors[vec_num_i].g_i_raw_len; in main() 174 c_i.i.len = test_vectors[vec_num_i].i_raw_len; in main() [all …]
|
/uoscore-uedhoc-3.5.0/samples/linux_edhoc/responder/src/ |
D | main.cpp | 192 c_r.c_r.len = test_vectors[vec_num_i].c_r_len; in main() 193 c_r.suites_r.len = test_vectors[vec_num_i].SUITES_R_len; in main() 195 c_r.ead_2.len = test_vectors[vec_num_i].ead_2_len; in main() 197 c_r.ead_4.len = test_vectors[vec_num_i].ead_4_len; in main() 199 c_r.id_cred_r.len = test_vectors[vec_num_i].id_cred_r_len; in main() 201 c_r.cred_r.len = test_vectors[vec_num_i].cred_r_len; in main() 203 c_r.g_y.len = test_vectors[vec_num_i].g_y_raw_len; in main() 205 c_r.y.len = test_vectors[vec_num_i].y_raw_len; in main() 207 c_r.g_r.len = test_vectors[vec_num_i].g_r_raw_len; in main() 209 c_r.r.len = test_vectors[vec_num_i].r_raw_len; in main() [all …]
|
/uoscore-uedhoc-3.5.0/samples/zephyr_edhoc/initiator/src/ |
D | main.c | 145 c_i.c_i.len = test_vectors[vec_num_i].c_i_len; in main() 148 c_i.suites_i.len = test_vectors[vec_num_i].SUITES_I_len; in main() 150 c_i.ead_1.len = test_vectors[vec_num_i].ead_1_len; in main() 152 c_i.ead_3.len = test_vectors[vec_num_i].ead_3_len; in main() 154 c_i.id_cred_i.len = test_vectors[vec_num_i].id_cred_i_len; in main() 156 c_i.cred_i.len = test_vectors[vec_num_i].cred_i_len; in main() 158 c_i.g_x.len = test_vectors[vec_num_i].g_x_raw_len; in main() 160 c_i.x.len = test_vectors[vec_num_i].x_raw_len; in main() 162 c_i.g_i.len = test_vectors[vec_num_i].g_i_raw_len; in main() 164 c_i.i.len = test_vectors[vec_num_i].i_raw_len; in main() [all …]
|
/uoscore-uedhoc-3.5.0/samples/zephyr_edhoc/responder/src/ |
D | main.c | 158 c_r.c_r.len = test_vectors[vec_num_i].c_r_len; in main() 159 c_r.suites_r.len = test_vectors[vec_num_i].SUITES_R_len; in main() 161 c_r.ead_2.len = test_vectors[vec_num_i].ead_2_len; in main() 163 c_r.ead_4.len = test_vectors[vec_num_i].ead_4_len; in main() 165 c_r.id_cred_r.len = test_vectors[vec_num_i].id_cred_r_len; in main() 167 c_r.cred_r.len = test_vectors[vec_num_i].cred_r_len; in main() 169 c_r.g_y.len = test_vectors[vec_num_i].g_y_raw_len; in main() 171 c_r.y.len = test_vectors[vec_num_i].y_raw_len; in main() 173 c_r.g_r.len = test_vectors[vec_num_i].g_r_raw_len; in main() 175 c_r.r.len = test_vectors[vec_num_i].r_raw_len; in main() [all …]
|