/mcuboot-latest/boot/boot_serial/test/src/testcases/ |
D | boot_serial_empty_img_msg.c | 24 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()
|
D | boot_serial_empty_msg.c | 24 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()
|
D | boot_serial_img_msg.c | 29 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()
|
D | boot_serial_upload_bigger_image.c | 33 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/ |
D | tlv.c | 40 bootutil_tlv_iter_begin(struct image_tlv_iter *it, const struct image_header *hdr, in bootutil_tlv_iter_begin() argument 46 if (it == NULL || hdr == NULL || fap == NULL) { in bootutil_tlv_iter_begin() 51 off_ = BOOT_TLV_OFF(hdr) + it->start_off; in bootutil_tlv_iter_begin() 53 off_ = BOOT_TLV_OFF(hdr); in bootutil_tlv_iter_begin() 56 if (LOAD_IMAGE_DATA(hdr, fap, off_, &info, sizeof(info))) { in bootutil_tlv_iter_begin() 61 if (hdr->ih_protect_tlv_size != info.it_tlv_tot) { in bootutil_tlv_iter_begin() 65 if (LOAD_IMAGE_DATA(hdr, fap, off_ + info.it_tlv_tot, in bootutil_tlv_iter_begin() 69 } else if (hdr->ih_protect_tlv_size != 0) { in bootutil_tlv_iter_begin() 77 it->hdr = hdr; in bootutil_tlv_iter_begin() 81 it->prot_end = off_ + it->hdr->ih_protect_tlv_size; in bootutil_tlv_iter_begin() [all …]
|
D | ram_load.c | 118 uint32_t slot, struct image_header *hdr, in boot_decrypt_and_copy_image_to_sram() argument 133 uint32_t bytes_copied = hdr->ih_hdr_size; in boot_decrypt_and_copy_image_to_sram() 148 tlv_off = BOOT_TLV_OFF(hdr); in boot_decrypt_and_copy_image_to_sram() 156 rc = boot_enc_load(state, slot, hdr, fap_src, &bs); in boot_decrypt_and_copy_image_to_sram() 177 blk_off = ((bytes_copied) - hdr->ih_hdr_size) & 0xf; in boot_decrypt_and_copy_image_to_sram() 184 (bytes_copied + idx) - hdr->ih_hdr_size, blk_sz, in boot_decrypt_and_copy_image_to_sram() 321 struct image_header *hdr = NULL; in boot_load_image_to_sram() local 327 hdr = boot_img_hdr(state, active_slot); in boot_load_image_to_sram() 329 if (hdr->ih_flags & IMAGE_F_RAM_LOAD) { in boot_load_image_to_sram() 331 img_dst = hdr->ih_load_addr; in boot_load_image_to_sram() [all …]
|
D | image_validate.c | 69 struct image_header *hdr, const struct flash_area *fap, in bootutil_img_hash() argument 121 if (MUST_DECRYPT(fap, image_index, hdr) && in bootutil_img_hash() 147 size = hdr_size = hdr->ih_hdr_size; in bootutil_img_hash() 148 size += hdr->ih_img_size; in bootutil_img_hash() 152 size += hdr->ih_protect_tlv_size; in bootutil_img_hash() 162 (void*)(IMAGE_RAM_BASE + hdr->ih_load_addr), in bootutil_img_hash() 193 if (MUST_DECRYPT(fap, image_index, hdr)) { in bootutil_img_hash() 415 static int bootutil_check_for_pure(const struct image_header *hdr, in bootutil_check_for_pure() argument 423 rc = bootutil_tlv_iter_begin(&it, hdr, fap, IMAGE_TLV_SIG_PURE, false); in bootutil_check_for_pure() 433 rc = LOAD_IMAGE_DATA(hdr, fap, off, &val, sizeof(val)); in bootutil_check_for_pure() [all …]
|
D | bootutil_priv.h | 193 #define BOOT_LOG_IMAGE_INFO(slot, hdr) \ argument 196 (hdr)->ih_ver.iv_major, \ 197 (hdr)->ih_ver.iv_minor, \ 198 (hdr)->ih_ver.iv_revision, \ 199 (hdr)->ih_ver.iv_build_num) 236 struct image_header hdr; member 411 #define BOOT_TLV_OFF(hdr) ((hdr)->ih_hdr_size + (hdr)->ih_img_size) argument 421 return &BOOT_IMG(state, slot).hdr; in boot_img_hdr() 501 #define LOAD_IMAGE_DATA(hdr, fap, start, output, size) \ argument 502 (memcpy((output),(void*)(IMAGE_RAM_BASE + (hdr)->ih_load_addr + (start)), \ [all …]
|
D | loader.c | 417 dep_version = &state->imgs[dep->image_id][dep_slot].hdr.ih_ver; in boot_verify_slot_dependency() 781 boot_image_check(struct boot_loader_state *state, struct image_header *hdr, in boot_image_check() argument 799 if (MUST_DECRYPT(fap, BOOT_CURR_IMG(state), hdr)) { in boot_image_check() 801 rc = boot_enc_load(state, 1, hdr, fap, bs, 0); in boot_image_check() 803 rc = boot_enc_load(state, 1, hdr, fap, bs); in boot_image_check() 815 FIH_CALL(bootutil_img_validate, fih_rc, state, hdr, fap, tmpbuf, BOOT_TMPBUF_SZ, in boot_image_check() 818 FIH_CALL(bootutil_img_validate, fih_rc, state, hdr, fap, tmpbuf, BOOT_TMPBUF_SZ, in boot_image_check() 876 boot_is_header_valid(const struct image_header *hdr, const struct flash_area *fap, argument 883 if (hdr->ih_magic != IMAGE_MAGIC) { 887 if (!boot_u32_safe_add(&size, hdr->ih_img_size, hdr->ih_hdr_size)) { [all …]
|
D | bootutil_public.c | 761 struct image_header *hdr) in boot_image_load_header() argument 764 int rc = flash_area_read(fa_p, 0, hdr, sizeof *hdr); in boot_image_load_header() 772 if (hdr->ih_magic != IMAGE_MAGIC) { in boot_image_load_header() 773 BOOT_LOG_ERR("Bad image magic 0x%lx", (unsigned long)hdr->ih_magic); in boot_image_load_header() 778 if (hdr->ih_flags & IMAGE_F_NON_BOOTABLE) { in boot_image_load_header() 784 if (!boot_u32_safe_add(&size, hdr->ih_img_size, hdr->ih_hdr_size) || in boot_image_load_header()
|
D | boot_record.c | 127 const struct image_header *hdr, in boot_save_boot_status() argument 150 rc = bootutil_tlv_iter_begin(&it, hdr, fap, IMAGE_TLV_ANY, false); in boot_save_boot_status() 239 int boot_save_shared_data(const struct image_header *hdr, const struct flash_area *fap, in boot_save_shared_data() argument
|
/mcuboot-latest/ext/tinycrypt/tests/ |
D | test_ccm_mode.c | 71 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/ |
D | boot_serial_encryption.c | 24 struct image_header *hdr, uint8_t *buf, in boot_image_validate_encrypted() argument 40 if(IS_ENCRYPTED(hdr)) { in boot_image_validate_encrypted() 42 rc = boot_enc_load(state, 1, hdr, fa_p, bs, start_off); in boot_image_validate_encrypted() 44 rc = boot_enc_load(state, 1, hdr, fa_p, bs); in boot_image_validate_encrypted() 57 hdr, fa_p, buf, buf_size, NULL, 0, NULL, start_off); in boot_image_validate_encrypted() 60 hdr, fa_p, buf, buf_size, NULL, 0, NULL); in boot_image_validate_encrypted() 72 struct image_header *hdr, in read_image_size() argument 80 off = BOOT_TLV_OFF(hdr); in read_image_size() 87 protect_tlv_size = hdr->ih_protect_tlv_size; in read_image_size() 130 struct image_header *hdr, in decrypt_region_inplace() argument [all …]
|
D | boot_serial.c | 172 static int boot_serial_get_hash(const struct image_header *hdr, 175 static int boot_serial_get_hash(const struct image_header *hdr, 200 extern int bs_peruser_system_specific(const struct nmgr_hdr *hdr, 280 struct image_header hdr; in bs_list() local 336 BOOT_HOOK_REGULAR, image_index, slot, &hdr); in bs_list() 340 flash_area_read(fap, start_off, &hdr, sizeof(hdr)); in bs_list() 342 flash_area_read(fap, 0, &hdr, sizeof(hdr)); in bs_list() 346 if (hdr.ih_magic == IMAGE_MAGIC) in bs_list() 355 if (IS_ENCRYPTED(&hdr) && MUST_DECRYPT(fap, image_index, &hdr)) { in bs_list() 358 &hdr, tmpbuf, sizeof(tmpbuf), start_off); in bs_list() [all …]
|
/mcuboot-latest/boot/bootutil/include/bootutil/ |
D | image.h | 184 #define IS_ENCRYPTED(hdr) (((hdr)->ih_flags & IMAGE_F_ENCRYPTED_AES128) \ argument 185 || ((hdr)->ih_flags & IMAGE_F_ENCRYPTED_AES256)) 186 #define MUST_DECRYPT(fap, idx, hdr) \ argument 187 (flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(idx) && IS_ENCRYPTED(hdr)) 191 #define IS_COMPRESSED(hdr) ((hdr)->ih_flags & COMPRESSIONFLAGS) argument 192 #define MUST_DECOMPRESS(fap, idx, hdr) \ argument 193 (flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(idx) && IS_COMPRESSED(hdr)) 201 struct image_header *hdr, 211 const struct image_header *hdr; member 224 const struct image_header *hdr,
|
D | boot_record.h | 66 const struct image_header *hdr, 80 int boot_save_shared_data(const struct image_header *hdr,
|
D | bootutil_public.h | 312 struct image_header *hdr); 326 struct image_header *hdr);
|
D | enc_key.h | 71 const struct image_header *hdr, const struct flash_area *fap,
|
/mcuboot-latest/boot/zephyr/ |
D | boot_serial_extension_zephyr_basic.c | 30 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()
|
D | single_loader.c | 42 struct image_header *hdr) in boot_image_validate() argument 53 if (IS_ENCRYPTED(hdr)) in boot_image_validate() 60 hdr->ih_flags &= ~(ENCRYPTIONFLAGS); in boot_image_validate() 62 FIH_CALL(bootutil_img_validate, fih_rc, NULL, hdr, fa_p, tmpbuf, in boot_image_validate() 72 struct image_header *hdr) in boot_image_validate_once() argument 85 FIH_CALL(boot_image_validate, fih_rc, fa_p, hdr); in boot_image_validate_once() 124 state.imgs[0][0].hdr = _hdr; in boot_go()
|
D | firmware_loader.c | 38 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, 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()
|
D | boot_serial_extensions.c | 16 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/ |
D | single_loader.c | 34 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, 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/ |
D | boot_serial_encryption.h | 24 struct image_header *hdr, uint8_t *buf,
|
/mcuboot-latest/boot/zephyr/include/boot_serial/ |
D | boot_serial_extensions.h | 25 typedef int (*bs_custom_handler_cb)(const struct nmgr_hdr *hdr,
|