Lines Matching refs:hdr
157 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()
325 FIH_CALL(bootutil_img_validate, fih_rc, NULL, 0, &hdr, in bs_list()
340 rc = boot_serial_get_hash(&hdr, fap, hash); in bs_list()
378 if (!(hdr.ih_flags & IMAGE_F_NON_BOOTABLE)) { in bs_list()
416 bs_list_img_ver((char *)tmpbuf, sizeof(tmpbuf), &hdr.ih_ver); in bs_list()
481 struct image_header hdr; in bs_set() local
493 BOOT_HOOK_REGULAR, image_index, 1, &hdr); in bs_set()
496 flash_area_read(fap, 0, &hdr, sizeof(hdr)); in bs_set()
499 if (hdr.ih_magic == IMAGE_MAGIC) in bs_set()
509 if (IS_ENCRYPTED(&hdr)) { in bs_set()
511 &hdr, tmpbuf, sizeof(tmpbuf)); in bs_set()
514 FIH_CALL(bootutil_img_validate, fih_rc, NULL, 0, &hdr, in bs_set()
527 rc = boot_serial_get_hash(&hdr, fap, hash); in bs_set()
1140 struct nmgr_hdr *hdr; in boot_serial_input() local
1142 hdr = (struct nmgr_hdr *)buf; in boot_serial_input()
1143 if (len < sizeof(*hdr) || in boot_serial_input()
1144 (hdr->nh_op != NMGR_OP_READ && hdr->nh_op != NMGR_OP_WRITE) || in boot_serial_input()
1145 (ntohs(hdr->nh_len) < len - sizeof(*hdr))) { in boot_serial_input()
1148 bs_hdr = hdr; in boot_serial_input()
1149 hdr->nh_group = ntohs(hdr->nh_group); in boot_serial_input()
1151 buf += sizeof(*hdr); in boot_serial_input()
1152 len -= sizeof(*hdr); in boot_serial_input()
1159 if (hdr->nh_group == MGMT_GROUP_ID_IMAGE) { in boot_serial_input()
1160 switch (hdr->nh_id) { in boot_serial_input()
1162 bs_list_set(hdr->nh_op, buf, len); in boot_serial_input()
1169 bs_slot_info(hdr->nh_op, buf, len); in boot_serial_input()
1176 } else if (hdr->nh_group == MGMT_GROUP_ID_DEFAULT) { in boot_serial_input()
1177 switch (hdr->nh_id) { in boot_serial_input()
1194 if (bs_peruser_system_specific(hdr, buf, len, cbor_state) == 0) { in boot_serial_input()
1444 static int boot_serial_get_hash(const struct image_header *hdr, in boot_serial_get_hash() argument
1456 rc = bootutil_tlv_iter_begin(&it, hdr, fap, IMAGE_TLV_ANY, false); in boot_serial_get_hash()