CycloneBOOT 2.6.6
Secure Bootloader for ARM Cortex-M MCU
Loading...
Searching...
No Matches
verify_runtime.h
Go to the documentation of this file.
1
31#ifndef _VERIFY_RUNTIME_H
32#define _VERIFY_RUNTIME_H
33
34// Dependencies
35#include "modules/image/image.h"
37#include "core/verify.h"
38
39// The runtime signature algorithm verification
40#if (defined(BOOT_RUNTIME_SIGNATURE_RSA) && (BOOT_RUNTIME_SIGNATURE_RSA == ENABLED)) || \
41 (defined(BOOT_FIRST_STAGE_RUNTIME_SIGNATURE_RSA) && \
42 (BOOT_FIRST_STAGE_RUNTIME_SIGNATURE_RSA == ENABLED))
43#define VERIFY_RUNTIME_RSA_SUPPORT ENABLED
44#else
45#define VERIFY_RUNTIME_RSA_SUPPORT DISABLED
46#endif
47
48#if (defined(BOOT_RUNTIME_SIGNATURE_ECDSA) && (BOOT_RUNTIME_SIGNATURE_ECDSA == ENABLED)) || \
49 (defined(BOOT_FIRST_STAGE_RUNTIME_SIGNATURE_ECDSA) && \
50 (BOOT_FIRST_STAGE_RUNTIME_SIGNATURE_ECDSA == ENABLED))
51#define VERIFY_RUNTIME_ECDSA_SUPPORT ENABLED
52#else
53#define VERIFY_RUNTIME_ECDSA_SUPPORT DISABLED
54#endif
55
56#if (VERIFY_RUNTIME_RSA_SUPPORT == ENABLED)
57#include "pkc/rsa.h"
58#include "pkix/pem_key_import.h"
59#endif
60
61#if (VERIFY_RUNTIME_ECDSA_SUPPORT == ENABLED)
62#include "ecc/ec.h"
63#include "ecc/ecdsa.h"
64#include "pkix/pem_key_import.h"
65#endif
66
67// C++ guard
68#ifdef __cplusplus
69extern "C"
70{
71#endif
72
85cboot_error_t verifyRuntimeImageSignature(const Slot *slot, uint32_t entryOffset,
86 const char_t *signKey, size_t signKeyLen,
87 const HashAlgo *hashAlgo, VerifySignAlgo signAlgo);
88
96cboot_error_t verifyRuntimeImageIntegrity(const Slot *slot, uint32_t entryOffset,
97 const HashAlgo *hashAlgo);
98
99// C++ guard
100#ifdef __cplusplus
101}
102#endif
103#endif // !_VERIFY_RUNTIME_H
cboot_error_t
Error codes.
Definition cboot_error.h:57
CycloneBOOT Image management.
CycloneBOOT Memory Layer Abstraction.
Slot Type definition.
Definition memory.h:181
CycloneBOOT Image data verification module.
VerifySignAlgo
Verification signature algorithms.
Definition verify.h:146
cboot_error_t verifyRuntimeImageSignature(const Slot *slot, uint32_t entryOffset, const char_t *signKey, size_t signKeyLen, const HashAlgo *hashAlgo, VerifySignAlgo signAlgo)
Verify the runtime signature of an image.
Definition verify_runtime.c:51
cboot_error_t verifyRuntimeImageIntegrity(const Slot *slot, uint32_t entryOffset, const HashAlgo *hashAlgo)
Verify the runtime integrity digest embedded in an image.
Definition verify_runtime.c:69