Lines Matching full:if

104 #if (128 + BOOT_SERIAL_IMAGE_STATE_SIZE_MAX + BOOT_SERIAL_HASH_SIZE_MAX) > \
140 #if (BOOT_IMAGE_NUMBER > 1)
208 if (n || dgt > 0 || d == 0) { in u32toa()
232 if (ver->iv_build_num != 0) { in bs_list_img_ver()
249 if (ver->iv_build_num != 0 && len > 0 && len < maxlen) { in bs_list_img_ver()
290 if (flash_area_open(area_id, &fap)) { in bs_list()
296 if (rc == BOOT_HOOK_REGULAR) in bs_list()
301 if (hdr.ih_magic == IMAGE_MAGIC) in bs_list()
306 if (FIH_EQ(fih_rc, FIH_BOOT_HOOK_REGULAR)) in bs_list()
308 #if defined(MCUBOOT_ENC_IMAGES) in bs_list()
309 #if !defined(MCUBOOT_SINGLE_APPLICATION_SLOT) in bs_list()
310 if (IS_ENCRYPTED(&hdr) && MUST_DECRYPT(fap, image_index, &hdr)) { in bs_list()
315 if (IS_ENCRYPTED(&hdr)) { in bs_list()
327 #if defined(MCUBOOT_ENC_IMAGES) && !defined(MCUBOOT_SINGLE_APPLICATION_SLOT) in bs_list()
333 if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) { in bs_list()
346 #if (BOOT_IMAGE_NUMBER > 1) in bs_list()
352 if (swap_status == BOOT_SWAP_TYPE_NONE) { in bs_list()
353 if (slot == BOOT_PRIMARY_SLOT) { in bs_list()
357 } else if (swap_status == BOOT_SWAP_TYPE_TEST) { in bs_list()
358 if (slot == BOOT_PRIMARY_SLOT) { in bs_list()
363 } else if (swap_status == BOOT_SWAP_TYPE_PERM) { in bs_list()
364 if (slot == BOOT_PRIMARY_SLOT) { in bs_list()
370 } else if (swap_status == BOOT_SWAP_TYPE_REVERT) { in bs_list()
371 if (slot == BOOT_PRIMARY_SLOT) { in bs_list()
378 if (!(hdr.ih_flags & IMAGE_F_NON_BOOTABLE)) { in bs_list()
383 if (confirmed) { in bs_list()
388 if (active) { in bs_list()
393 if (pending) { in bs_list()
398 if (permanent) { in bs_list()
408 if (rc == 0) { in bs_list()
466 if (!ok) { in bs_set()
472 if ((img_hash.len != sizeof(hash) && img_hash.len != 0) || in bs_set()
479 if (img_hash.len != 0) { in bs_set()
487 if (flash_area_open(area_id, &fap)) { in bs_set()
494 if (rc == BOOT_HOOK_REGULAR) in bs_set()
499 if (hdr.ih_magic == IMAGE_MAGIC) in bs_set()
506 if (FIH_EQ(fih_rc, FIH_BOOT_HOOK_REGULAR)) in bs_set()
509 if (IS_ENCRYPTED(&hdr)) { in bs_set()
521 if (FIH_NOT_EQ(fih_rc, FIH_SUCCESS)) { in bs_set()
530 if (rc == 0 && memcmp(hash, img_hash.value, sizeof(hash)) == 0) { in bs_set()
537 if (!found) { in bs_set()
549 if (rc == 0) { in bs_set()
580 if (op == NMGR_OP_READ) { in bs_list_set()
602 if (op != NMGR_OP_READ) { in bs_slot_info()
614 if (slot == 0) { in bs_slot_info()
621 if (!ok) { in bs_slot_info()
630 if (!ok) { in bs_slot_info()
637 if (rc) { in bs_slot_info()
641 if (sizeof(fap->fa_size) == sizeof(uint64_t)) { in bs_slot_info()
649 if (!ok) { in bs_slot_info()
655 * Check if we support uploading to this slot and if so, return the in bs_slot_info()
658 #if defined(MCUBOOT_SINGLE_APPLICATION_SLOT) in bs_slot_info()
665 if (slot == 1) { in bs_slot_info()
673 if (!ok) { in bs_slot_info()
679 if (!ok) { in bs_slot_info()
683 if (slot == (BOOT_NUM_SLOTS - 1)) { in bs_slot_info()
686 if (!ok) { in bs_slot_info()
690 if (image_max_sizes[image_index].calculated == true) { in bs_slot_info()
695 if (!ok) { in bs_slot_info()
705 if (!ok) { in bs_slot_info()
715 if (!ok) { in bs_slot_info()
730 * erased sector, so basically offset of next sector to be erased if needed.
746 if (end >= flash_area_get_size(fap)) { in erase_range()
750 if (end < start) { in erase_range()
754 if (flash_area_get_sector(fap, end, &sect)) { in erase_range()
763 if (rc != 0) { in erase_range()
817 if (!ok) { in bs_upload()
834 if (img_chunk_off == SIZE_MAX || img_chunk == NULL) { in bs_upload()
842 if (img_chunk_off == 0) { in bs_upload()
843 if (img_num_tmp != UINT_MAX) { in bs_upload()
850 #if !defined(MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD) in bs_upload()
855 if (rc) { in bs_upload()
860 if (img_chunk_off == 0) { in bs_upload()
873 if (flash_area_get_sector(fap, boot_status_off(fap), &status_sector)) { in bs_upload()
880 #if defined(MCUBOOT_VALIDATE_PRIMARY_SLOT_ONCE) in bs_upload()
884 if (img_size_tmp > (area_size - BOOT_MAGIC_SZ)) { in bs_upload()
888 if (img_size_tmp > area_size) { in bs_upload()
899 if (rc) { in bs_upload()
907 } else if (img_chunk_off != curr_off) { in bs_upload()
908 /* If received chunk offset does not match expected one jump, pretend in bs_upload()
914 } else if (curr_off + img_chunk_len > img_size) { in bs_upload()
926 if (not_yet_erased < 0) { in bs_upload()
940 if (curr_off + img_chunk_len + rem_bytes < img_size) { in bs_upload()
946 #if defined(MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE) && MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE > 0 in bs_upload()
947 if (flash_area_align(fap) > 1 && in bs_upload()
954 if (write_size > img_chunk_len) { in bs_upload()
963 if (rc != 0) { in bs_upload()
978 if (rc == 0 && rem_bytes) { in bs_upload()
992 if (rc == 0) { in bs_upload()
994 if (curr_off == img_size) { in bs_upload()
1000 if (erase_range(fap, start, start) < 0) { in bs_upload()
1007 if (rc) { in bs_upload()
1022 if (rc == 0) { in bs_upload()
1031 /* Check if this upload was for the primary slot */ in bs_upload()
1032 #if !defined(MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD) in bs_upload()
1033 if (flash_area_id_from_multi_image_slot(img_num, 0) == FLASH_AREA_IMAGE_PRIMARY(0)) in bs_upload()
1035 if (flash_area_id_from_direct_image(img_num) == FLASH_AREA_IMAGE_PRIMARY(0)) in bs_upload()
1038 if (curr_off == img_size) { in bs_upload()
1039 /* Last sector received, now start a decryption on the image if it is encrypted */ in bs_upload()
1060 if (!zcbor_map_start_decode(zsd)) { in bs_echo()
1067 if (ok) { in bs_echo()
1068 if (key.len == 1 && *key.value == 'd') { in bs_echo()
1077 if (!ok || !zcbor_map_end_decode(zsd)) { in bs_echo()
1083 if (zcbor_tstr_encode(cbor_state, &value) && zcbor_map_end_encode(cbor_state, 10)) { in bs_echo()
1104 if (rc == BOOT_RESET_REQUEST_HOOK_BUSY) { in bs_reset()
1115 if (rc == 0) { in bs_reset()
1143 if (len < sizeof(*hdr) || in boot_serial_input()
1159 if (hdr->nh_group == MGMT_GROUP_ID_IMAGE) { in boot_serial_input()
1176 } else if (hdr->nh_group == MGMT_GROUP_ID_DEFAULT) { in boot_serial_input()
1193 } else if (MCUBOOT_PERUSER_MGMT_GROUP_ENABLED == 1) { in boot_serial_input()
1194 if (bs_peruser_system_specific(hdr, buf, len, cbor_state) == 0) { in boot_serial_input()
1263 if (out == 0) { in boot_serial_output()
1281 * Returns 1 if full packet has been received.
1293 if (err) { in boot_serial_in_dec()
1299 if (err) { in boot_serial_in_dec()
1303 if (*out_off + base64_decode_len(in) >= maxout) { in boot_serial_in_dec()
1307 if (rc < 0) { in boot_serial_in_dec()
1313 if (*out_off <= sizeof(uint16_t)) { in boot_serial_in_dec()
1318 if (len != *out_off - sizeof(uint16_t)) { in boot_serial_in_dec()
1330 if (crc || len <= sizeof(crc)) { in boot_serial_in_dec()
1363 * Don't enter CPU idle state here if timeout based serial recovery is in boot_serial_read_console()
1365 * from serial console (if single-thread mode is used). in boot_serial_read_console()
1368 if (allow_idle == true) { in boot_serial_read_console()
1378 if (rc <= 0 && !full_line) { in boot_serial_read_console()
1385 if (!full_line) { in boot_serial_read_console()
1386 if (off == max_input) { in boot_serial_read_console()
1394 if (in_buf[0] == SHELL_NLIP_PKT_START1 && in boot_serial_read_console()
1398 } else if (in_buf[0] == SHELL_NLIP_DATA_START1 && in boot_serial_read_console()
1404 if (rc == 1) { in boot_serial_read_console()
1431 * If within this timeout no mcumgr command is received, the function is
1457 if (rc) { in boot_serial_get_hash()
1464 if (rc < 0) { in boot_serial_get_hash()
1466 } else if (rc > 0) { in boot_serial_get_hash()
1470 if (type == IMAGE_TLV_SHA256) { in boot_serial_get_hash()
1472 if (len != 32) { in boot_serial_get_hash()
1477 if (rc) { in boot_serial_get_hash()