Home
last modified time | relevance | path

Searched refs:hdr (Results 1 – 25 of 25) sorted by relevance

/mcuboot-latest/boot/boot_serial/test/src/testcases/
Dboot_serial_empty_img_msg.c24 struct nmgr_hdr *hdr; in TEST_CASE() local
26 hdr = (struct nmgr_hdr *)buf; in TEST_CASE()
27 memset(hdr, 0, sizeof(*hdr)); in TEST_CASE()
28 hdr->nh_op = NMGR_OP_WRITE; in TEST_CASE()
29 hdr->nh_group = htons(MGMT_GROUP_ID_IMAGE); in TEST_CASE()
30 hdr->nh_id = IMGMGR_NMGR_ID_UPLOAD; in TEST_CASE()
31 hdr->nh_len = htons(2); in TEST_CASE()
32 strcpy((char *)(hdr + 1), "{}"); in TEST_CASE()
34 tx_msg(buf, sizeof(*hdr) + 2); in TEST_CASE()
Dboot_serial_empty_msg.c24 struct nmgr_hdr hdr; in TEST_CASE() local
31 memset(&hdr, 0, sizeof(hdr)); in TEST_CASE()
32 tx_msg(&hdr, sizeof(hdr)); in TEST_CASE()
34 hdr.nh_op = NMGR_OP_WRITE; in TEST_CASE()
36 tx_msg(&hdr, sizeof(hdr)); in TEST_CASE()
Dboot_serial_img_msg.c29 struct nmgr_hdr *hdr; in TEST_CASE() local
49 hdr = (struct nmgr_hdr *)buf; in TEST_CASE()
50 memset(hdr, 0, sizeof(*hdr)); in TEST_CASE()
51 hdr->nh_op = NMGR_OP_WRITE; in TEST_CASE()
52 hdr->nh_group = htons(MGMT_GROUP_ID_IMAGE); in TEST_CASE()
53 hdr->nh_id = IMGMGR_NMGR_ID_UPLOAD; in TEST_CASE()
55 memcpy(hdr + 1, payload, sizeof payload); in TEST_CASE()
56 hdr->nh_len = htons(sizeof payload); in TEST_CASE()
58 len = sizeof(*hdr) + sizeof payload; in TEST_CASE()
Dboot_serial_upload_bigger_image.c33 struct nmgr_hdr *hdr; in TEST_CASE() local
37 const int payload_off = sizeof *hdr; in TEST_CASE()
83 hdr = (struct nmgr_hdr *)buf; in TEST_CASE()
84 memset(hdr, 0, sizeof(*hdr)); in TEST_CASE()
85 hdr->nh_op = NMGR_OP_WRITE; in TEST_CASE()
86 hdr->nh_group = htons(MGMT_GROUP_ID_IMAGE); in TEST_CASE()
87 hdr->nh_id = IMGMGR_NMGR_ID_UPLOAD; in TEST_CASE()
99 hdr->nh_len = htons(len); in TEST_CASE()
101 len = sizeof(*hdr) + len; in TEST_CASE()
/mcuboot-latest/boot/bootutil/src/
Dtlv.c39 bootutil_tlv_iter_begin(struct image_tlv_iter *it, const struct image_header *hdr, in bootutil_tlv_iter_begin() argument
45 if (it == NULL || hdr == NULL || fap == NULL) { in bootutil_tlv_iter_begin()
49 off_ = BOOT_TLV_OFF(hdr); in bootutil_tlv_iter_begin()
50 if (LOAD_IMAGE_DATA(hdr, fap, off_, &info, sizeof(info))) { in bootutil_tlv_iter_begin()
55 if (hdr->ih_protect_tlv_size != info.it_tlv_tot) { in bootutil_tlv_iter_begin()
59 if (LOAD_IMAGE_DATA(hdr, fap, off_ + info.it_tlv_tot, in bootutil_tlv_iter_begin()
63 } else if (hdr->ih_protect_tlv_size != 0) { in bootutil_tlv_iter_begin()
71 it->hdr = hdr; in bootutil_tlv_iter_begin()
75 it->prot_end = off_ + it->hdr->ih_protect_tlv_size; in bootutil_tlv_iter_begin()
76 it->tlv_end = off_ + it->hdr->ih_protect_tlv_size + info.it_tlv_tot; in bootutil_tlv_iter_begin()
[all …]
Dimage_validate.c66 struct image_header *hdr, const struct flash_area *fap, in bootutil_img_hash() argument
98 if (MUST_DECRYPT(fap, image_index, hdr) && in bootutil_img_hash()
113 size = hdr_size = hdr->ih_hdr_size; in bootutil_img_hash()
114 size += hdr->ih_img_size; in bootutil_img_hash()
118 size += hdr->ih_protect_tlv_size; in bootutil_img_hash()
122 (void*)(IMAGE_RAM_BASE + hdr->ih_load_addr), in bootutil_img_hash()
149 if (MUST_DECRYPT(fap, image_index, hdr)) { in bootutil_img_hash()
306 bootutil_get_img_security_cnt(struct image_header *hdr, in bootutil_get_img_security_cnt() argument
315 if ((hdr == NULL) || in bootutil_get_img_security_cnt()
323 if (hdr->ih_protect_tlv_size == 0) { in bootutil_get_img_security_cnt()
[all …]
Dbootutil_priv.h185 #define BOOT_LOG_IMAGE_INFO(slot, hdr) \ argument
188 (hdr)->ih_ver.iv_major, \
189 (hdr)->ih_ver.iv_minor, \
190 (hdr)->ih_ver.iv_revision, \
191 (hdr)->ih_ver.iv_build_num)
225 struct image_header hdr; member
377 #define BOOT_TLV_OFF(hdr) ((hdr)->ih_hdr_size + (hdr)->ih_img_size) argument
387 return &BOOT_IMG(state, slot).hdr; in boot_img_hdr()
467 #define LOAD_IMAGE_DATA(hdr, fap, start, output, size) \ argument
468 (memcpy((output),(void*)(IMAGE_RAM_BASE + (hdr)->ih_load_addr + (start)), \
[all …]
Dloader.c406 dep_version = &state->imgs[dep->image_id][dep_slot].hdr.ih_ver; in boot_verify_slot_dependency()
824 boot_image_check(struct boot_loader_state *state, struct image_header *hdr, in boot_image_check() argument
841 if (MUST_DECRYPT(fap, BOOT_CURR_IMG(state), hdr)) { in boot_image_check()
842 rc = boot_enc_load(BOOT_CURR_ENC(state), 1, hdr, fap, bs); in boot_image_check()
853 BOOT_CURR_IMG(state), hdr, fap, tmpbuf, BOOT_TMPBUF_SZ, in boot_image_check()
900 boot_is_header_valid(const struct image_header *hdr, const struct flash_area *fap, argument
907 if (hdr->ih_magic != IMAGE_MAGIC) {
911 if (!boot_u32_safe_add(&size, hdr->ih_img_size, hdr->ih_hdr_size)) {
916 if (!MUST_DECOMPRESS(fap, BOOT_CURR_IMG(state), hdr)) {
920 if (!boot_u32_safe_add(&size, size, hdr->ih_protect_tlv_size)) {
[all …]
Dbootutil_public.c733 struct image_header *hdr) in boot_image_load_header() argument
736 int rc = flash_area_read(fa_p, 0, hdr, sizeof *hdr); in boot_image_load_header()
744 if (hdr->ih_magic != IMAGE_MAGIC) { in boot_image_load_header()
745 BOOT_LOG_ERR("Bad image magic 0x%lx", (unsigned long)hdr->ih_magic); in boot_image_load_header()
750 if (hdr->ih_flags & IMAGE_F_NON_BOOTABLE) { in boot_image_load_header()
756 if (!boot_u32_safe_add(&size, hdr->ih_img_size, hdr->ih_hdr_size) || in boot_image_load_header()
Dboot_record.c123 const struct image_header *hdr, in boot_save_boot_status() argument
143 rc = bootutil_tlv_iter_begin(&it, hdr, fap, IMAGE_TLV_ANY, false); in boot_save_boot_status()
232 int boot_save_shared_data(const struct image_header *hdr, const struct flash_area *fap, in boot_save_shared_data() argument
Dencrypted.c636 const struct image_header *hdr, const struct flash_area *fap, in boot_enc_load() argument
657 rc = bootutil_tlv_iter_begin(&it, hdr, fap, EXPECTED_ENC_TLV, false); in boot_enc_load()
/mcuboot-latest/boot/bootutil/include/bootutil/
Dimage.h181 #define IS_ENCRYPTED(hdr) (((hdr)->ih_flags & IMAGE_F_ENCRYPTED_AES128) \ argument
182 || ((hdr)->ih_flags & IMAGE_F_ENCRYPTED_AES256))
183 #define MUST_DECRYPT(fap, idx, hdr) \ argument
184 (flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(idx) && IS_ENCRYPTED(hdr))
188 #define IS_COMPRESSED(hdr) ((hdr)->ih_flags & COMPRESSIONFLAGS) argument
189 #define MUST_DECOMPRESS(fap, idx, hdr) \ argument
190 (flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(idx) && IS_COMPRESSED(hdr))
197 struct image_header *hdr,
203 const struct image_header *hdr; member
213 const struct image_header *hdr,
[all …]
Dboot_record.h66 const struct image_header *hdr,
80 int boot_save_shared_data(const struct image_header *hdr,
Denc_key.h70 const struct image_header *hdr, const struct flash_area *fap,
Dbootutil_public.h310 struct image_header *hdr);
/mcuboot-latest/ext/tinycrypt/tests/
Dtest_ccm_mode.c71 size_t nlen, const uint8_t *hdr, in do_test() argument
94 result = tc_ccm_generation_encryption(ciphertext, TC_CCM_MAX_CT_SIZE, hdr, in do_test()
114 result = tc_ccm_decryption_verification(decrypted, TC_CCM_MAX_PT_SIZE, hdr, in do_test()
144 const uint8_t hdr[HEADER_LEN] = { in test_vector_1() local
163 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in test_vector_1()
181 const uint8_t hdr[HEADER_LEN] = { in test_vector_2() local
200 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), in test_vector_2()
218 const uint8_t hdr[HEADER_LEN] = { in test_vector_3() local
239 result = do_test(key, nonce, sizeof(nonce), hdr, sizeof(hdr), data, in test_vector_3()
257 const uint8_t hdr[HEADER_LEN] = { in test_vector_4() local
[all …]
/mcuboot-latest/boot/boot_serial/src/
Dboot_serial_encryption.c24 struct image_header *hdr, uint8_t *buf, in boot_image_validate_encrypted() argument
38 if(IS_ENCRYPTED(hdr)) { in boot_image_validate_encrypted()
39 rc = boot_enc_load(BOOT_CURR_ENC(state), 1, hdr, fa_p, bs); in boot_image_validate_encrypted()
49 hdr, fa_p, buf, buf_size, NULL, 0, NULL); in boot_image_validate_encrypted()
60 struct image_header *hdr, in read_image_size() argument
68 off = BOOT_TLV_OFF(hdr); in read_image_size()
75 protect_tlv_size = hdr->ih_protect_tlv_size; in read_image_size()
118 struct image_header *hdr, in decrypt_region_inplace() argument
147 if (IS_ENCRYPTED(hdr)) { in decrypt_region_inplace()
150 if (off + bytes_copied < hdr->ih_hdr_size) { in decrypt_region_inplace()
[all …]
Dboot_serial.c157 static int boot_serial_get_hash(const struct image_header *hdr,
181 extern int bs_peruser_system_specific(const struct nmgr_hdr *hdr,
261 struct image_header hdr; in bs_list() local
295 BOOT_HOOK_REGULAR, image_index, slot, &hdr); in bs_list()
298 flash_area_read(fap, 0, &hdr, sizeof(hdr)); in bs_list()
301 if (hdr.ih_magic == IMAGE_MAGIC) in bs_list()
310 if (IS_ENCRYPTED(&hdr) && MUST_DECRYPT(fap, image_index, &hdr)) { in bs_list()
312 &hdr, tmpbuf, sizeof(tmpbuf)); in bs_list()
315 if (IS_ENCRYPTED(&hdr)) { in bs_list()
321 hdr.ih_flags &= ~ENCRYPTIONFLAGS; in bs_list()
[all …]
/mcuboot-latest/boot/zephyr/
Dboot_serial_extension_zephyr_basic.c30 static int bs_custom_storage_erase(const struct nmgr_hdr *hdr, in bs_custom_storage_erase() argument
40 if (hdr->nh_group != ZEPHYR_MGMT_GRP_BASIC || hdr->nh_op != NMGR_OP_WRITE || in bs_custom_storage_erase()
41 hdr->nh_id != ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE) { in bs_custom_storage_erase()
Dsingle_loader.c34 struct image_header *hdr) in boot_image_validate() argument
45 if (IS_ENCRYPTED(hdr)) in boot_image_validate()
52 hdr->ih_flags &= ~(ENCRYPTIONFLAGS); in boot_image_validate()
54 FIH_CALL(bootutil_img_validate, fih_rc, NULL, 0, hdr, fa_p, tmpbuf, in boot_image_validate()
64 struct image_header *hdr) in boot_image_validate_once() argument
77 FIH_CALL(boot_image_validate, fih_rc, fa_p, hdr); in boot_image_validate_once()
Dfirmware_loader.c38 struct image_header *hdr) in boot_image_validate() argument
49 if (IS_ENCRYPTED(hdr)) in boot_image_validate()
56 hdr->ih_flags &= ~(ENCRYPTIONFLAGS); in boot_image_validate()
58 FIH_CALL(bootutil_img_validate, fih_rc, NULL, 0, hdr, fa_p, tmpbuf, in boot_image_validate()
68 struct image_header *hdr) in boot_image_validate_once() argument
81 FIH_CALL(boot_image_validate, fih_rc, fa_p, hdr); in boot_image_validate_once()
Dboot_serial_extensions.c16 int bs_peruser_system_specific(const struct nmgr_hdr *hdr, const char *buffer, in bs_peruser_system_specific() argument
23 mgmt_rc = function->handler(hdr, buffer, len, cs); in bs_peruser_system_specific()
/mcuboot-latest/boot/mynewt/src/
Dsingle_loader.c34 struct image_header *hdr) in boot_image_validate() argument
45 if (IS_ENCRYPTED(hdr)) in boot_image_validate()
52 hdr->ih_flags &= ~(ENCRYPTIONFLAGS); in boot_image_validate()
54 FIH_CALL(bootutil_img_validate, fih_rc, NULL, 0, hdr, fa_p, tmpbuf, in boot_image_validate()
64 struct image_header *hdr) in boot_image_validate_once() argument
77 FIH_CALL(boot_image_validate, fih_rc, fa_p, hdr); in boot_image_validate_once()
/mcuboot-latest/boot/boot_serial/include/boot_serial/
Dboot_serial_encryption.h23 struct image_header *hdr, uint8_t *buf,
/mcuboot-latest/boot/zephyr/include/boot_serial/
Dboot_serial_extensions.h25 typedef int (*bs_custom_handler_cb)(const struct nmgr_hdr *hdr,