|
CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
|
CycloneBOOT Image data verification module. More...
#include "boot_config.h"#include "core/cboot_error.h"#include "core/crc32.h"#include "core/crypto.h"#include "debug.h"#include "hash/hash_algorithms.h"#include "cipher/cipher_algorithms.h"#include "mac/mac_algorithms.h"#include "pkc/rsa.h"#include "ecc/ecdsa.h"#include "pkix/pem_import.h"#include "pkix/pem_key_import.h"Go to the source code of this file.
Classes | |
| struct | VerifySettings |
| Verification settings. More... | |
| struct | VerifyContext |
| Verification context. More... | |
Enumerations | |
| enum | VerifyMethod { VERIFY_METHOD_INTEGRITY , VERIFY_METHOD_AUTHENTICATION , VERIFY_METHOD_SIGNATURE } |
| Verification method. | |
| enum | VerifyAuthAlgo { VERIFY_AUTH_NONE , VERIFY_AUTH_HMAC } |
| Verification authentication algorithms. | |
| enum | VerifySignAlgo { VERIFY_SIGN_NONE , VERIFY_SIGN_RSA , VERIFY_SIGN_ECDSA } |
| Verification signature algorithms. | |
Functions | |
| cboot_error_t | verifyInit (VerifyContext *context, VerifySettings *settings) |
| Initialize image verification context. | |
| cboot_error_t | verifyProcess (VerifyContext *context, uint8_t *data, size_t length) |
| Process image data verification by updating integrity, authentication or signature tag with a portion of the image data. It basically constist to update hash tag on image data block. Once the image data fully processed the final hash tag will be used to check image validy according the verification method. | |
| cboot_error_t | verifyConfirm (VerifyContext *context, uint8_t *verifyData, size_t verifyDataLength) |
| Validate image check data tag using the given verification method. For integrity check in consist on a comparison between image check integrity hash tag and the computed image integrity hash tag. For integrity check in consist on a comparison between image check authentication tag and the computed image authentication tag. For the signature method is use both teh public signature key and the computed hash tag to check the image check signature tag. | |
| cboot_error_t | verifyGenerateCheckData (VerifyContext *context, uint8_t *checkData, size_t checkDataSize, size_t *checkDataLength) |
| Generate image check data according to given verification method. | |
CycloneBOOT Image data verification module.
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 verifyConfirm | ( | VerifyContext * | context, |
| uint8_t * | verifyData, | ||
| size_t | verifyDataLength | ||
| ) |
Validate image check data tag using the given verification method. For integrity check in consist on a comparison between image check integrity hash tag and the computed image integrity hash tag. For integrity check in consist on a comparison between image check authentication tag and the computed image authentication tag. For the signature method is use both teh public signature key and the computed hash tag to check the image check signature tag.
| [in,out] | context | Pointer to the image verification context |
| [in] | verifyData | Image check data tag to be verified |
| [in] | verifyDataLength | Length of the image check data |
| cboot_error_t verifyGenerateCheckData | ( | VerifyContext * | context, |
| uint8_t * | checkData, | ||
| size_t | checkDataSize, | ||
| size_t * | checkDataLength | ||
| ) |
Generate image check data according to given verification method.
| [in,out] | context | Pointer to the image verification context |
| [in] | checkData | Buffer that will hold image check data |
| [in] | checkDataSize | Size of the image check data buffer |
| [out] | checkDataLength | Length of the image check data buffer tag |
| cboot_error_t verifyInit | ( | VerifyContext * | context, |
| VerifySettings * | settings | ||
| ) |
Initialize image verification context.
| [in] | context | Pointer to the image verification context to initialize |
| [in] | settings | Image Verification specific settings |
| cboot_error_t verifyProcess | ( | VerifyContext * | context, |
| uint8_t * | data, | ||
| size_t | length | ||
| ) |
Process image data verification by updating integrity, authentication or signature tag with a portion of the image data. It basically constist to update hash tag on image data block. Once the image data fully processed the final hash tag will be used to check image validy according the verification method.
| [in] | context | Pointer to the image verification context |
| [in] | data | Pointer to the image data block to process |
| [in] | length | Length og the image data block |