-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boot: boot_serial: Fix issue with encrypted second slot images
Fixes issues whereby encrypted images were not properly listed due to not treating them as encrypted, also removes a piece of wrong hack code that would never run as the primary slot cannot be encrypted. Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
- Loading branch information
Showing
12 changed files
with
436 additions
and
405 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
boot/boot_serial/include/boot_serial/boot_serial_encryption.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
*/ | ||
|
||
#ifndef H_BOOT_SERIAL_ENCRYPTION_ | ||
#define H_BOOT_SERIAL_ENCRYPTION_ | ||
#include "bootutil/fault_injection_hardening.h" | ||
|
||
/** | ||
* Validate hash of a primary boot image doing on the fly decryption as well | ||
* | ||
* @param[in] fa_p flash area pointer | ||
* @param[in] hdr boot image header pointer | ||
* @param[in] buf buffer which is used for validating data | ||
* @param[in] buf_size size of input buffer | ||
* | ||
* @return FIH_SUCCESS on success, error code otherwise | ||
*/ | ||
fih_ret | ||
boot_image_validate_encrypted(const struct flash_area *fa_p, | ||
struct image_header *hdr, uint8_t *buf, | ||
uint16_t buf_size); | ||
|
||
/** | ||
* Handle an encrypted firmware in the main flash. | ||
* This will decrypt the image inplace | ||
*/ | ||
int boot_handle_enc_fw(const struct flash_area *flash_area); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.