MCCI Trusted Bootloader
Simple trusted bootloader and tools for small embedded systems
mccibootloaderplatform_getsignatureblock.c
Go to the documentation of this file.
1/*
2
3Module: mccibootloaderplatform_getsignatureblock.c
4
5Function:
6 McciBootloaderPlatform_getSignatureBlock()
7
8Copyright and License:
9 This file copyright (C) 2021 by
10
11 MCCI Corporation
12 3520 Krums Corners Road
13 Ithaca, NY 14850
14
15 See accompanying LICENSE file for copyright and license information.
16
17Author:
18 Terry Moore, MCCI Corporation April 2021
19
20*/
21
22
24
26
27/****************************************************************************\
28|
29| Manifest constants & typedefs.
30|
31\****************************************************************************/
32
33
34
35/****************************************************************************\
36|
37| Read-only data.
38|
39\****************************************************************************/
40
41
42
43/****************************************************************************\
44|
45| Variables.
46|
47\****************************************************************************/
48
49
50/*
51
52Name: McciBootloaderPlatform_getSignatureBlock()
53
54Function:
55 Fetch pointer to signature block given appinfo block.
56
57Definition:
58 McciBootloader_SignatureBlock_t McciBootloaderPlatform_getSignatureBlock(
59 const McciBootloader_AppInfo_t *pAppInfo
60 );
61
62Description:
63 The address of the signature block is computed based on the contents of
64 the app info block.
65
66Returns:
67 Pointer to signature block, or NULL if incoming arg is NULL.
68
69Notes:
70 The address is computed relative to the targetAddress in the app info
71 block. The AppInfo block might not be in its target location.
72
73*/
74
75#define FUNCTION "McciBootloaderPlatform_getSignatureBlock"
76
77const McciBootloader_SignatureBlock_t *
79 const McciBootloader_AppInfo_t *pAppInfo
80 )
81 {
82 if (pAppInfo == NULL)
83 return NULL;
84
85 return (const McciBootloader_SignatureBlock_t *)(
86 pAppInfo->targetAddress + pAppInfo->imagesize
87 );
88 }
89
90#undef FUNCTION
91
92/**** end of mccibootloaderplatform_getsignatureblock.c ****/
const McciBootloader_SignatureBlock_t * McciBootloaderPlatform_getSignatureBlock(const McciBootloader_AppInfo_t *pAppInfo)