CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
verify.c File Reference

CycloneBOOT Image data verification module. More...

#include "verify.h"
#include "security/verify_auth.h"
#include "security/verify_sign.h"

Macros

#define TRACE_LEVEL   CBOOT_TRACE_LEVEL
 

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.
 

Detailed Description

CycloneBOOT Image data verification module.

License

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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.6.6

Function Documentation

◆ verifyConfirm()

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.

Parameters
[in,out]contextPointer to the image verification context
[in]verifyDataImage check data tag to be verified
[in]verifyDataLengthLength of the image check data
Returns
Error code

◆ verifyGenerateCheckData()

cboot_error_t verifyGenerateCheckData ( VerifyContext *  context,
uint8_t *  checkData,
size_t  checkDataSize,
size_t *  checkDataLength 
)

Generate image check data according to given verification method.

Parameters
[in,out]contextPointer to the image verification context
[in]checkDataBuffer that will hold image check data
[in]checkDataSizeSize of the image check data buffer
[out]checkDataLengthLength of the image check data buffer tag
Returns
Error code

◆ verifyInit()

cboot_error_t verifyInit ( VerifyContext *  context,
VerifySettings *  settings 
)

Initialize image verification context.

Parameters
[in]contextPointer to the image verification context to initialize
[in]settingsImage Verification specific settings
Returns

◆ verifyProcess()

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.

Parameters
[in]contextPointer to the image verification context
[in]dataPointer to the image data block to process
[in]lengthLength og the image data block
Returns
Error code