|
CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
|
CycloneBOOT Image managment. More...
#include "image.h"#include "core/crc32.h"#include "core/crypto.h"#include "debug.h"#include "memory/memory.h"#include <stdlib.h>Macros | |
| #define | TRACE_LEVEL CBOOT_TRACE_LEVEL |
Functions | |
| bool_t | imageSafeAdd32 (uint32_t a, uint32_t b, uint32_t *sum) |
| Overflow-safe addition of two 32-bit image geometry values. | |
| bool_t | imageFitsSlot (const ImageHeader *header, size_t slotSize) |
| Check that an image (header, data and CRC32 tag) fits in a slot. | |
| bool_t | imageIsBootImage (const ImageHeader *header) |
| Check whether an image holds a bootloader. | |
| cboot_error_t | imageCheckHeader (ImageHeader *header) |
| Check Internal Image header validity. | |
| cboot_error_t | imageGetHeader (uint8_t *buffer, size_t bufferLen, ImageHeader **header) |
| Get image header from data buffer. | |
| cboot_error_t | imageComputeHeaderCrc (ImageHeader *header) |
| Compute image header crc and store it in the image header crc field. The given input header will also be the outout image header. | |
| cboot_error_t | imageCheckIntegrity (Image *image) |
| Verifies the complete image integrity. | |
CycloneBOOT Image managment.
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2021-2026 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneBOOT Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
| cboot_error_t imageCheckHeader | ( | ImageHeader * | header | ) |
Check Internal Image header validity.
| [in] | header | Pointer to the internal image header to be checked |
| cboot_error_t imageCheckIntegrity | ( | Image * | image | ) |
Verifies the complete image integrity.
| [in/out] | image Pointer to the image we want to verify. |
| cboot_error_t imageComputeHeaderCrc | ( | ImageHeader * | header | ) |
Compute image header crc and store it in the image header crc field. The given input header will also be the outout image header.
| [in/out] | header Pointer the header on which to calculate the crc. |
| bool_t imageFitsSlot | ( | const ImageHeader * | header, |
| size_t | slotSize | ||
| ) |
| cboot_error_t imageGetHeader | ( | uint8_t * | buffer, |
| size_t | bufferLen, | ||
| ImageHeader ** | header | ||
| ) |
Get image header from data buffer.
| [in] | buffer | Data buffer containing the image header |
| [in] | bufferLen | Data buffer length |
| [out] | header | Pointer to the header structure to be returned |
| bool_t imageIsBootImage | ( | const ImageHeader * | header | ) |
Check whether an image holds a bootloader.
| [in] | header | Image header |
| bool_t imageSafeAdd32 | ( | uint32_t | a, |
| uint32_t | b, | ||
| uint32_t * | sum | ||
| ) |
Overflow-safe addition of two 32-bit image geometry values.
| [in] | a | First addend |
| [in] | b | Second addend |
| [out] | sum | Receives a + b when it fits in uint32_t |