/mcuboot-latest/boot/bootutil/src/ |
D | swap_move.c | 73 struct image_header *out_hdr, struct boot_status *bs) in boot_read_image_header() argument 88 if (bs && !boot_status_is_reset(bs)) { in boot_read_image_header() 103 if (bs->op == BOOT_STATUS_OP_MOVE && slot == 0 && bs->idx > last_idx) { in boot_read_image_header() 105 } else if (bs->op == BOOT_STATUS_OP_SWAP) { in boot_read_image_header() 106 if (bs->idx > 1 && bs->idx <= last_idx) { in boot_read_image_header() 108 } else if (bs->idx == 1) { in boot_read_image_header() 111 } else if (slot == 1 && bs->state == 2) { in boot_read_image_header() 132 if (bs != NULL && out_hdr->ih_magic != IMAGE_MAGIC) { in boot_read_image_header() 146 struct boot_loader_state *state, struct boot_status *bs) in swap_read_status_bytes() argument 208 bs->op = BOOT_STATUS_OP_MOVE; in swap_read_status_bytes() [all …]
|
D | swap_offset.c | 81 struct image_header *out_hdr, struct boot_status *bs) argument 96 if (bs == NULL) { 104 if (!boot_status_is_reset(bs)) { 121 if (bs->swap_type == BOOT_SWAP_TYPE_REVERT || 124 if (((bs->idx - BOOT_STATUS_IDX_0) > last_idx || 125 ((bs->idx - BOOT_STATUS_IDX_0) == last_idx && 126 bs->state == BOOT_STATUS_STATE_1))) { 134 if ((bs->idx - BOOT_STATUS_IDX_0) > last_idx || 135 ((bs->idx - BOOT_STATUS_IDX_0) == last_idx && 136 bs->state == BOOT_STATUS_STATE_2)) { [all …]
|
D | swap_scratch.c | 58 struct boot_loader_state *state, struct boot_status *bs) in swap_read_status_bytes() argument 117 bs->idx = (found_idx / BOOT_STATUS_STATE_COUNT) + 1; in swap_read_status_bytes() 118 bs->state = (found_idx % BOOT_STATUS_STATE_COUNT) + 1; in swap_read_status_bytes() 125 boot_status_internal_off(const struct boot_status *bs, int elem_sz) in boot_status_internal_off() argument 131 return (bs->idx - BOOT_STATUS_IDX_0) * idx_sz + in boot_status_internal_off() 132 (bs->state - BOOT_STATUS_STATE_0) * elem_sz; in boot_status_internal_off() 547 struct boot_status *bs) in boot_swap_sectors() argument 599 bs->use_scratch = (bs->idx == BOOT_STATUS_IDX_0 && copy_sz != sz); in boot_swap_sectors() 614 if (bs->state == BOOT_STATUS_STATE_0) { in boot_swap_sectors() 619 if (bs->idx == BOOT_STATUS_IDX_0) { in boot_swap_sectors() [all …]
|
D | swap_misc.c | 85 const struct boot_status *bs) in swap_status_init() argument 103 if (bs->swap_type != BOOT_SWAP_TYPE_NONE) { in swap_status_init() 104 rc = boot_write_swap_info(fap, bs->swap_type, image_index); in swap_status_init() 113 rc = boot_write_swap_size(fap, bs->swap_size); in swap_status_init() 117 rc = boot_write_enc_key(fap, 0, bs); in swap_status_init() 120 rc = boot_write_enc_key(fap, 1, bs); in swap_status_init() 131 swap_read_status(struct boot_loader_state *state, struct boot_status *bs) in swap_read_status() argument 139 bs->source = swap_status_source(state); in swap_read_status() 140 switch (bs->source) { in swap_read_status() 164 rc = swap_read_status_bytes(fap, state, bs); in swap_read_status() [all …]
|
D | swap_priv.h | 39 const struct boot_status *bs); 58 int swap_read_status(struct boot_loader_state *state, struct boot_status *bs); 67 struct boot_status *bs); 90 struct boot_status *bs,
|
D | loader.c | 128 struct boot_status *bs) in boot_read_image_headers() argument 138 rc = boot_read_image_header(state, i, boot_img_hdr(state, i), bs); in boot_read_image_headers() 676 boot_status_reset(struct boot_status *bs) in boot_status_reset() argument 679 memset(&bs->enckey, 0xff, BOOT_NUM_SLOTS * BOOT_ENC_KEY_ALIGN_SIZE); in boot_status_reset() 681 memset(&bs->enctlv, 0xff, BOOT_NUM_SLOTS * BOOT_ENC_TLV_ALIGN_SIZE); in boot_status_reset() 685 bs->use_scratch = 0; in boot_status_reset() 686 bs->swap_size = 0; in boot_status_reset() 687 bs->source = 0; in boot_status_reset() 690 bs->op = BOOT_STATUS_OP_SWAP; in boot_status_reset() 692 bs->op = BOOT_STATUS_OP_MOVE; in boot_status_reset() [all …]
|
D | bootutil_misc.c | 267 boot_read_enc_key(const struct flash_area *fap, uint8_t slot, struct boot_status *bs) in boot_read_enc_key() argument 277 rc = flash_area_read(fap, off, bs->enctlv[slot], BOOT_ENC_TLV_ALIGN_SIZE); in boot_read_enc_key() 280 if (bs->enctlv[slot][i] != 0xff) { in boot_read_enc_key() 286 rc = boot_decrypt_key(bs->enctlv[slot], bs->enckey[slot]); in boot_read_enc_key() 290 rc = flash_area_read(fap, off, bs->enckey[slot], BOOT_ENC_KEY_ALIGN_SIZE); in boot_read_enc_key() 312 const struct boot_status *bs) in boot_write_enc_key() argument 322 rc = flash_area_write(fap, off, bs->enctlv[slot], BOOT_ENC_TLV_ALIGN_SIZE); in boot_write_enc_key() 324 rc = flash_area_write(fap, off, bs->enckey[slot], BOOT_ENC_KEY_ALIGN_SIZE); in boot_write_enc_key()
|
D | bootutil_priv.h | 311 int boot_write_status(const struct boot_loader_state *state, struct boot_status *bs); 323 uint32_t boot_status_internal_off(const struct boot_status *bs, int elem_sz); 325 struct image_header *out_hdr, struct boot_status *bs); 338 bool boot_status_is_reset(const struct boot_status *bs); 342 const struct boot_status *bs); 344 struct boot_status *bs);
|
D | ram_load.c | 129 struct boot_status bs; in boot_decrypt_and_copy_image_to_sram() local 156 rc = boot_enc_load(state, slot, hdr, fap_src, &bs); in boot_decrypt_and_copy_image_to_sram() 162 if (rc == 0 && boot_enc_set_key(BOOT_CURR_ENC(state), slot, &bs)) { in boot_decrypt_and_copy_image_to_sram()
|
D | encrypted.c | 371 const struct boot_status *bs) in boot_enc_set_key() argument 375 rc = bootutil_aes_ctr_set_key(&enc_state[slot].aes_ctr, bs->enckey[slot]); in boot_enc_set_key() 637 struct boot_status *bs in boot_enc_load() argument 685 buf = bs->enctlv[slot]; in boot_enc_load() 694 return boot_decrypt_key(buf, bs->enckey[slot]); in boot_enc_load()
|
/mcuboot-latest/boot/boot_serial/src/ |
D | boot_serial_encryption.c | 36 struct boot_status *bs = &_bs; in boot_image_validate_encrypted() local 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() 49 rc = boot_enc_set_key(BOOT_CURR_ENC(state), 1, bs); in boot_image_validate_encrypted() 228 struct boot_status *bs = &_bs; in decrypt_image_inplace() local 253 rc = boot_enc_load(state, 0, hdr, fa_p, bs, 0); in decrypt_image_inplace() 255 rc = boot_enc_load(state, 0, hdr, fa_p, bs); in decrypt_image_inplace() 260 if (rc == 0 && boot_enc_set_key(BOOT_CURR_ENC(state), 0, bs)) { in decrypt_image_inplace()
|
/mcuboot-latest/ext/mbedtls-asn1/src/ |
D | asn1parse.c | 215 mbedtls_asn1_bitstring *bs) in mbedtls_asn1_get_bitstring() argument 220 if( ( ret = mbedtls_asn1_get_tag( p, end, &bs->len, MBEDTLS_ASN1_BIT_STRING ) ) != 0 ) in mbedtls_asn1_get_bitstring() 224 if( bs->len < 1 ) in mbedtls_asn1_get_bitstring() 226 bs->len -= 1; in mbedtls_asn1_get_bitstring() 229 bs->unused_bits = **p; in mbedtls_asn1_get_bitstring() 230 if( bs->unused_bits > 7 ) in mbedtls_asn1_get_bitstring() 235 bs->p = *p; in mbedtls_asn1_get_bitstring() 236 *p += bs->len; in mbedtls_asn1_get_bitstring()
|
/mcuboot-latest/boot/bootutil/include/bootutil/ |
D | enc_key.h | 69 const struct boot_status *bs); 72 struct boot_status *bs
|
/mcuboot-latest/ext/mbedtls-asn1/include/mbedtls/ |
D | asn1.h | 313 mbedtls_asn1_bitstring *bs );
|