Home
last modified time | relevance | path

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

123

/mcuboot-latest/boot/bootutil/src/
Dswap_misc.c47 int rc; in swap_erase_trailer_sectors() local
72 rc = boot_erase_region(fap, off, sz); in swap_erase_trailer_sectors()
73 assert(rc == 0); in swap_erase_trailer_sectors()
79 return rc; in swap_erase_trailer_sectors()
89 int rc; in swap_status_init() local
99 rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SECONDARY(image_index), in swap_status_init()
101 assert(rc == 0); in swap_status_init()
104 rc = boot_write_swap_info(fap, bs->swap_type, image_index); in swap_status_init()
105 assert(rc == 0); in swap_status_init()
109 rc = boot_write_image_ok(fap); in swap_status_init()
[all …]
Dloader.c119 int rc; in boot_read_image_headers() local
123 rc = BOOT_HOOK_CALL(boot_read_image_header_hook, BOOT_HOOK_REGULAR, in boot_read_image_headers()
125 if (rc == BOOT_HOOK_REGULAR) in boot_read_image_headers()
127 rc = boot_read_image_header(state, i, boot_img_hdr(state, i), bs); in boot_read_image_headers()
129 if (rc != 0) { in boot_read_image_headers()
139 return rc; in boot_read_image_headers()
160 int rc; in boot_add_shared_data() local
163 rc = boot_save_boot_status(BOOT_CURR_IMG(state), in boot_add_shared_data()
166 if (rc != 0) { in boot_add_shared_data()
168 return rc; in boot_add_shared_data()
[all …]
Dbootutil_public.c197 int rc; in boot_read_flag() local
199 rc = flash_area_read(fap, off, flag, sizeof *flag); in boot_read_flag()
200 if (rc < 0) { in boot_read_flag()
226 int rc; in boot_read_swap_state() local
229 rc = flash_area_read(fap, off, magic, BOOT_MAGIC_SZ); in boot_read_swap_state()
230 if (rc < 0) { in boot_read_swap_state()
240 rc = flash_area_read(fap, off, &swap_info, sizeof swap_info); in boot_read_swap_state()
241 if (rc < 0) { in boot_read_swap_state()
255 rc = boot_read_copy_done(fap, &state->copy_done); in boot_read_swap_state()
256 if (rc) { in boot_read_swap_state()
[all …]
Dencrypted.c73 int rc; in key_unwrap() local
76 rc = bootutil_aes_kw_set_unwrap_key(&aes_kw, bootutil_enc_key->key, *bootutil_enc_key->len); in key_unwrap()
77 if (rc != 0) { in key_unwrap()
80 rc = bootutil_aes_kw_unwrap(&aes_kw, wrapped, TLV_ENC_KW_SZ, enckey, BOOT_ENC_KEY_SIZE); in key_unwrap()
81 if (rc != 0) { in key_unwrap()
87 return rc; in key_unwrap()
105 int rc; in parse_ec256_enckey() local
111 if ((rc = mbedtls_asn1_get_tag(p, end, &len, in parse_ec256_enckey()
125 if ((rc = mbedtls_asn1_get_alg(p, end, &alg, &param)) != 0) { in parse_ec256_enckey()
138 if ((rc = mbedtls_asn1_get_tag(p, end, &len, MBEDTLS_ASN1_OCTET_STRING)) != 0) { in parse_ec256_enckey()
[all …]
Dswap_move.c81 int rc; in boot_read_image_header() local
91 rc = BOOT_EFLASH; in boot_read_image_header()
119 rc = flash_area_open(area_id, &fap); in boot_read_image_header()
120 if (rc != 0) { in boot_read_image_header()
121 rc = BOOT_EFLASH; in boot_read_image_header()
125 rc = flash_area_read(fap, off, out_hdr, sizeof *out_hdr); in boot_read_image_header()
126 if (rc != 0) { in boot_read_image_header()
127 rc = BOOT_EFLASH; in boot_read_image_header()
133 rc = -1; in boot_read_image_header()
137 rc = 0; in boot_read_image_header()
[all …]
Dswap_scratch.c66 int rc; in swap_read_status_bytes() local
79 rc = flash_area_read(fap, off + i * BOOT_WRITE_SZ(state), in swap_read_status_bytes()
81 if (rc < 0) { in swap_read_status_bytes()
349 int rc; in swap_status_source() local
359 rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_PRIMARY(image_index), in swap_status_source()
361 assert(rc == 0); in swap_status_source()
364 rc = boot_read_swap_state_by_id(FLASH_AREA_IMAGE_SCRATCH, &state_scratch); in swap_status_source()
365 assert(rc == 0); in swap_status_source()
561 int rc; in boot_swap_sectors() local
603 rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY(image_index), in boot_swap_sectors()
[all …]
Dimage_validate.c75 int rc; in bootutil_img_hash() local
89 (void)rc; in bootutil_img_hash()
143 rc = flash_area_read(fap, off, tmp_buf, blk_sz); in bootutil_img_hash()
144 if (rc) { in bootutil_img_hash()
146 return rc; in bootutil_img_hash()
263 int rc; in bootutil_find_key() local
271 rc = boot_retrieve_public_key_hash(image_index, key_hash, &key_hash_size); in bootutil_find_key()
272 if (rc) { in bootutil_find_key()
313 int32_t rc; in bootutil_get_img_security_cnt() local
327 rc = bootutil_tlv_iter_begin(&it, hdr, fap, IMAGE_TLV_SEC_CNT, true); in bootutil_get_img_security_cnt()
[all …]
Dboot_record.c137 int rc; in boot_save_boot_status() local
143 rc = bootutil_tlv_iter_begin(&it, hdr, fap, IMAGE_TLV_ANY, false); in boot_save_boot_status()
144 if (rc) { in boot_save_boot_status()
152 rc = bootutil_tlv_iter_next(&it, &offset, &len, &type); in boot_save_boot_status()
153 if (rc < 0) { in boot_save_boot_status()
155 } else if (rc > 0) { in boot_save_boot_status()
163 rc = flash_area_read(fap, offset, buf, len); in boot_save_boot_status()
164 if (rc) { in boot_save_boot_status()
176 rc = flash_area_read(fap, offset, image_hash, len); in boot_save_boot_status()
177 if (rc) { in boot_save_boot_status()
[all …]
Dimage_ecdsa.c43 int rc; in bootutil_verify_sig() local
53 rc = bootutil_ecdsa_parse_public_key(&ctx, &pubkey, end); in bootutil_verify_sig()
54 if (rc) { in bootutil_verify_sig()
58 rc = bootutil_ecdsa_verify(&ctx, pubkey, end-pubkey, hash, hlen, sig, slen); in bootutil_verify_sig()
59 fih_rc = fih_ret_encode_zero_equality(rc); in bootutil_verify_sig()
74 int rc; in bootutil_verify_sig() local
83 rc = bootutil_ecdsa_verify(&ctx, NULL, 0, hash, hlen, sig, slen); in bootutil_verify_sig()
84 fih_rc = fih_ret_encode_zero_equality(rc); in bootutil_verify_sig()
/mcuboot-latest/boot/bootutil/include/bootutil/crypto/
Dhmac_sha256.h54 int rc; in bootutil_hmac_sha256_set_key() local
55 rc = tc_hmac_set_key(ctx, key, key_size); in bootutil_hmac_sha256_set_key()
56 if (rc != TC_CRYPTO_SUCCESS) { in bootutil_hmac_sha256_set_key()
59 rc = tc_hmac_init(ctx); in bootutil_hmac_sha256_set_key()
60 if (rc != TC_CRYPTO_SUCCESS) { in bootutil_hmac_sha256_set_key()
68 int rc; in bootutil_hmac_sha256_update() local
69 rc = tc_hmac_update(ctx, data, data_length); in bootutil_hmac_sha256_update()
70 if (rc != TC_CRYPTO_SUCCESS) { in bootutil_hmac_sha256_update()
78 int rc; in bootutil_hmac_sha256_finish() local
79 rc = tc_hmac_final(tag, taglen, ctx); in bootutil_hmac_sha256_finish()
[all …]
Decdh_p256.h50 int rc; in bootutil_ecdh_p256_shared_secret() local
57 rc = uECC_valid_public_key(&pk[1], uECC_secp256r1()); in bootutil_ecdh_p256_shared_secret()
58 if (rc != 0) { in bootutil_ecdh_p256_shared_secret()
62 rc = uECC_shared_secret(&pk[1], sk, z, uECC_secp256r1()); in bootutil_ecdh_p256_shared_secret()
63 if (rc != TC_CRYPTO_SUCCESS) { in bootutil_ecdh_p256_shared_secret()
108 int rc; in bootutil_ecdh_p256_shared_secret() local
110 rc = mbedtls_ecp_point_read_binary(&ctx->grp, in bootutil_ecdh_p256_shared_secret()
114 if (rc != 0) { in bootutil_ecdh_p256_shared_secret()
120 rc = mbedtls_ecp_check_pubkey(&ctx->grp, &ctx->P); in bootutil_ecdh_p256_shared_secret()
121 if (rc != 0) { in bootutil_ecdh_p256_shared_secret()
[all …]
/mcuboot-latest/boot/zephyr/
Dboot_serial_extension_zephyr_basic.c34 int rc; in bs_custom_storage_erase() local
45 rc = flash_area_open(FIXED_PARTITION_ID(storage_partition), &fa); in bs_custom_storage_erase()
47 if (rc < 0) { in bs_custom_storage_erase()
50 rc = flash_area_erase(fa, 0, flash_area_get_size(fa)); in bs_custom_storage_erase()
51 if (rc < 0) { in bs_custom_storage_erase()
56 if (rc == 0) { in bs_custom_storage_erase()
57 rc = MGMT_ERR_OK; in bs_custom_storage_erase()
59 rc = MGMT_ERR_EUNKNOWN; in bs_custom_storage_erase()
64 zcbor_uint32_put(cs, rc); in bs_custom_storage_erase()
67 return rc; in bs_custom_storage_erase()
Dshared_data.c42 int rc; in boot_add_data_to_shared_area() local
68 rc = retention_read(bootloader_info_dev, offset, (void *)&tlv_entry, in boot_add_data_to_shared_area()
71 if (rc) { in boot_add_data_to_shared_area()
98 rc = retention_write(bootloader_info_dev, offset, (void*)&tlv_entry, in boot_add_data_to_shared_area()
100 if (rc) { in boot_add_data_to_shared_area()
101 LOG_ERR("Shared data TLV header write failed: %d", rc); in boot_add_data_to_shared_area()
106 rc = retention_write(bootloader_info_dev, offset, data, size); in boot_add_data_to_shared_area()
108 if (rc) { in boot_add_data_to_shared_area()
109 LOG_ERR("Shared data TLV data write failed: %d", rc); in boot_add_data_to_shared_area()
116 rc = retention_write(bootloader_info_dev, 0, (void *)&header, in boot_add_data_to_shared_area()
[all …]
Dio.c122 int rc; in io_detect_pin() local
130 rc = gpio_pin_configure_dt(&button0, GPIO_INPUT); in io_detect_pin()
131 __ASSERT(rc == 0, "Failed to initialize boot detect pin.\n"); in io_detect_pin()
133 rc = gpio_pin_get_dt(&button0); in io_detect_pin()
134 pin_active = rc; in io_detect_pin()
136 __ASSERT(rc >= 0, "Failed to read boot detect pin.\n"); in io_detect_pin()
150 rc = gpio_pin_get_dt(&button0); in io_detect_pin()
151 pin_active = rc; in io_detect_pin()
152 __ASSERT(rc >= 0, "Failed to read boot detect pin.\n"); in io_detect_pin()
180 int rc; in io_detect_pin_reset() local
[all …]
Dsingle_loader.c67 int rc; in boot_image_validate_once() local
71 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once()
72 if (rc != 0) in boot_image_validate_once()
82 rc = boot_write_magic(fa_p); in boot_image_validate_once()
83 if (rc != 0) in boot_image_validate_once()
86 rc = boot_write_image_ok(fa_p); in boot_image_validate_once()
87 if (rc != 0) in boot_image_validate_once()
104 int rc = -1; in boot_go() local
107 rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY(0), &_fa_p); in boot_go()
108 assert(rc == 0); in boot_go()
[all …]
Dmain.c160 int rc; in do_boot() local
165 rc = flash_area_open(rsp->br_flash_dev_id, &fap); in do_boot()
166 assert(rc == 0); in do_boot()
168 rc = flash_area_read(fap, rsp->br_hdr->ih_hdr_size, dst, sizeof(dst)); in do_boot()
169 assert(rc == 0); in do_boot()
172 if (rc != 0) { in do_boot()
252 int rc; in copy_img_to_SRAM() local
258 rc = flash_area_open(area_id, &fap); in copy_img_to_SRAM()
259 if (rc != 0) { in copy_img_to_SRAM()
260 BOOT_LOG_ERR("flash_area_open failed with %d\n", rc); in copy_img_to_SRAM()
[all …]
Dfirmware_loader.c71 int rc; in boot_image_validate_once() local
75 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once()
76 if (rc != 0) in boot_image_validate_once()
86 rc = boot_write_magic(fa_p); in boot_image_validate_once()
87 if (rc != 0) in boot_image_validate_once()
90 rc = boot_write_image_ok(fa_p); in boot_image_validate_once()
91 if (rc != 0) in boot_image_validate_once()
108 int rc = -1; in validate_image_slot() local
111 rc = flash_area_open(slot, &_fa_p); in validate_image_slot()
112 assert(rc == 0); in validate_image_slot()
[all …]
/mcuboot-latest/boot/boot_serial/src/
Dboot_serial_encryption.c34 int rc; in boot_image_validate_encrypted() local
39 rc = boot_enc_load(BOOT_CURR_ENC(state), 1, hdr, fa_p, bs); in boot_image_validate_encrypted()
40 if (rc < 0) { in boot_image_validate_encrypted()
43 rc = boot_enc_set_key(BOOT_CURR_ENC(state), 1, bs); in boot_image_validate_encrypted()
44 if (rc < 0) { in boot_image_validate_encrypted()
66 int rc; in read_image_size() local
71 rc = BOOT_EFLASH; in read_image_size()
78 rc = BOOT_EBADIMAGE; in read_image_size()
83 rc = BOOT_EFLASH; in read_image_size()
87 rc = BOOT_EBADIMAGE; in read_image_size()
[all …]
Dboot_serial.c294 int rc = BOOT_HOOK_CALL(boot_read_image_header_hook, in bs_list() local
296 if (rc == BOOT_HOOK_REGULAR) in bs_list()
340 rc = boot_serial_get_hash(&hdr, fap, hash); in bs_list()
408 if (rc == 0) { in bs_list()
447 int rc; in bs_set() local
467 rc = MGMT_ERR_EINVAL; in bs_set()
475 rc = MGMT_ERR_EINVAL; in bs_set()
492 rc = BOOT_HOOK_CALL(boot_read_image_header_hook, in bs_set()
494 if (rc == BOOT_HOOK_REGULAR) in bs_set()
527 rc = boot_serial_get_hash(&hdr, fap, hash); in bs_set()
[all …]
/mcuboot-latest/boot/mbed/
Dmcuboot_main.cpp51 int rc; in main() local
65 rc = mbedtls_platform_setup(&unused_ctx); in main()
66 if(rc != 0) { in main()
67 tr_error("Failed to setup Mbed TLS, error: %d", rc); in main()
68 exit(rc); in main()
75 rc = boot_go(&rsp); in main()
76 if(rc != 0) { in main()
77 tr_error("Failed to locate firmware image, error: %d", rc); in main()
78 exit(rc); in main()
/mcuboot-latest/ci/
Dsim_run.sh30 rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc
38 rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc
60 rc=$? && [ $rc -ne 0 ] && EXIT_CODE=$rc
/mcuboot-latest/boot/mynewt/src/
Dsingle_loader.c67 int rc; in boot_image_validate_once() local
71 rc = boot_read_swap_state(fa_p, &state); in boot_image_validate_once()
72 if (rc != 0) in boot_image_validate_once()
82 rc = boot_write_magic(fa_p); in boot_image_validate_once()
83 if (rc != 0) in boot_image_validate_once()
86 rc = boot_write_image_ok(fa_p); in boot_image_validate_once()
87 if (rc != 0) in boot_image_validate_once()
104 int rc = -1; in boot_go() local
107 rc = flash_area_open(FLASH_AREA_IMAGE_PRIMARY(0), &_fa_p); in boot_go()
108 assert(rc == 0); in boot_go()
[all …]
/mcuboot-latest/boot/cypress/cy_flash_pal/
Dcy_smif_psoc6.c79 int rc = -1; in psoc6_smif_read() local
90 rc = 0; in psoc6_smif_read()
92 return rc; in psoc6_smif_read()
100 int rc = -1; in psoc6_smif_write() local
111 rc = 0; in psoc6_smif_write()
113 return rc; in psoc6_smif_write()
118 int rc = -1; in psoc6_smif_erase() local
140 rc = 0; in psoc6_smif_erase()
142 return rc; in psoc6_smif_erase()
Dcy_flash_map.c228 int rc = 0; in flash_area_read() local
245 rc = psoc6_smif_read(fa, addr, dst, len); in flash_area_read()
251 rc = -1; in flash_area_read()
254 if (rc != 0) { in flash_area_read()
255 BOOT_LOG_ERR("Flash area read error, rc = %d", (int)rc); in flash_area_read()
257 return rc; in flash_area_read()
266 cy_en_flashdrv_status_t rc = CY_FLASH_DRV_SUCCESS; in flash_area_write() local
293 rc = Cy_Flash_WriteRow(row_addr, row_ptr); in flash_area_write()
302 rc = psoc6_smif_write(fa, write_start_addr, src, len); in flash_area_write()
308 rc = -1; in flash_area_write()
[all …]
/mcuboot-latest/boot/cypress/MCUBootApp/
Dmain.c83 cy_rslt_t rc = CY_RSLT_TYPE_ERROR; in main() local
110 rc = cy_retarget_io_pdl_init(115200u); in main()
112 if (rc != CY_RSLT_SUCCESS) in main()
120 rc = CY_SMIF_CMD_NOT_FOUND; in main()
127 rc = qspi_init_sfdp(smif_id); in main()
128 if (rc == CY_SMIF_SUCCESS) in main()
134 BOOT_LOG_ERR("External Memory initialization w/ SFDP FAILED: 0x%02x", (int)rc); in main()
136 if (CY_SMIF_SUCCESS == rc) in main()

123