blob: f2b58256791355512a581361da5fcf1c871a8b0e [file] [log] [blame]
Christopher Collins92ea77f2016-12-12 15:59:26 -08001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
David Vinczee2453472019-06-17 12:31:59 +020020/*
21 * Modifications are Copyright (c) 2019 Arm Limited.
22 */
23
Christopher Collins92ea77f2016-12-12 15:59:26 -080024#ifndef H_BOOTUTIL_PRIV_
25#define H_BOOTUTIL_PRIV_
26
Marti Bolivarcca28a92017-06-12 16:52:22 -040027#include "sysflash/sysflash.h"
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +020028
29#include <flash_map_backend/flash_map_backend.h>
30
Christopher Collins01dfbb62019-03-21 07:28:37 -070031#include "bootutil/bootutil.h"
Christopher Collins92ea77f2016-12-12 15:59:26 -080032#include "bootutil/image.h"
Marti Bolivarf91bca52018-04-12 12:40:46 -040033#include "mcuboot_config/mcuboot_config.h"
Christopher Collins92ea77f2016-12-12 15:59:26 -080034
Fabio Utzigba829042018-09-18 08:29:34 -030035#ifdef MCUBOOT_ENC_IMAGES
36#include "bootutil/enc_key.h"
37#endif
38
Christopher Collins92ea77f2016-12-12 15:59:26 -080039#ifdef __cplusplus
40extern "C" {
41#endif
42
Marti Bolivar248da082018-04-24 15:11:39 -040043#ifdef MCUBOOT_HAVE_ASSERT_H
44#include "mcuboot_config/mcuboot_assert.h"
Fabio Utzig57c40f72017-12-12 21:48:30 -020045#else
46#define ASSERT assert
47#endif
48
Christopher Collins92ea77f2016-12-12 15:59:26 -080049struct flash_area;
50
David Vinczee32483f2019-06-13 10:46:24 +020051#define BOOT_EFLASH 1
52#define BOOT_EFILE 2
53#define BOOT_EBADIMAGE 3
54#define BOOT_EBADVECT 4
55#define BOOT_EBADSTATUS 5
56#define BOOT_ENOMEM 6
57#define BOOT_EBADARGS 7
58#define BOOT_EBADVERSION 8
Christopher Collins92ea77f2016-12-12 15:59:26 -080059
60#define BOOT_TMPBUF_SZ 256
61
Fabio Utzig1e4284b2019-08-23 11:55:27 -030062/** Number of image slots in flash; currently limited to two. */
63#define BOOT_NUM_SLOTS 2
64
Christopher Collins92ea77f2016-12-12 15:59:26 -080065/*
66 * Maintain state of copy progress.
67 */
68struct boot_status {
Fabio Utzig2473ac02017-05-02 12:45:02 -030069 uint32_t idx; /* Which area we're operating on */
70 uint8_t state; /* Which part of the swapping process are we at */
71 uint8_t use_scratch; /* Are status bytes ever written to scratch? */
Christopher Collinsa1c12042019-05-23 14:00:28 -070072 uint8_t swap_type; /* The type of swap in effect */
Fabio Utzig46490722017-09-04 15:34:32 -030073 uint32_t swap_size; /* Total size of swapped image */
Fabio Utzigba829042018-09-18 08:29:34 -030074#ifdef MCUBOOT_ENC_IMAGES
Fabio Utzig1e4284b2019-08-23 11:55:27 -030075 uint8_t enckey[BOOT_NUM_SLOTS][BOOT_ENC_KEY_SIZE];
Fabio Utzigba829042018-09-18 08:29:34 -030076#endif
Christopher Collins92ea77f2016-12-12 15:59:26 -080077};
78
Fabio Utzig39000012018-07-30 12:40:20 -030079#define BOOT_MAGIC_GOOD 1
80#define BOOT_MAGIC_BAD 2
81#define BOOT_MAGIC_UNSET 3
82#define BOOT_MAGIC_ANY 4 /* NOTE: control only, not dependent on sector */
Christopher Collinsa1c12042019-05-23 14:00:28 -070083#define BOOT_MAGIC_NOTGOOD 5 /* NOTE: control only, not dependent on sector */
Fabio Utzig39000012018-07-30 12:40:20 -030084
85/*
86 * NOTE: leave BOOT_FLAG_SET equal to one, this is written to flash!
87 */
88#define BOOT_FLAG_SET 1
89#define BOOT_FLAG_BAD 2
90#define BOOT_FLAG_UNSET 3
91#define BOOT_FLAG_ANY 4 /* NOTE: control only, not dependent on sector */
92
93#define BOOT_STATUS_IDX_0 1
94
95#define BOOT_STATUS_STATE_0 1
96#define BOOT_STATUS_STATE_1 2
97#define BOOT_STATUS_STATE_2 3
Christopher Collins92ea77f2016-12-12 15:59:26 -080098
99/**
100 * End-of-image slot structure.
101 *
Christopher Collinsa1c12042019-05-23 14:00:28 -0700102 * 0 1 2 3
103 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
104 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
105 * ~ ~
106 * ~ Swap status (BOOT_MAX_IMG_SECTORS * min-write-size * 3) ~
107 * ~ ~
108 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
109 * | Encryption key 0 (16 octets) [*] |
110 * | |
111 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
112 * | Encryption key 1 (16 octets) [*] |
113 * | |
114 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
115 * | Swap size (4 octets) |
116 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
David Vinczee2453472019-06-17 12:31:59 +0200117 * | Swap info | 0xff padding (7 octets) |
Christopher Collinsa1c12042019-05-23 14:00:28 -0700118 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
119 * | Copy done | 0xff padding (7 octets) |
120 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
121 * | Image OK | 0xff padding (7 octets) |
122 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
123 * | MAGIC (16 octets) |
124 * | |
125 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
126 *
127 * [*]: Only present if the encryption option is enabled
128 * (`MCUBOOT_ENC_IMAGES`).
Christopher Collins92ea77f2016-12-12 15:59:26 -0800129 */
130
131extern const uint32_t boot_img_magic[4];
132
133struct boot_swap_state {
Christopher Collinsa1c12042019-05-23 14:00:28 -0700134 uint8_t magic; /* One of the BOOT_MAGIC_[...] values. */
135 uint8_t swap_type; /* One of the BOOT_SWAP_TYPE_[...] values. */
136 uint8_t copy_done; /* One of the BOOT_FLAG_[...] values. */
137 uint8_t image_ok; /* One of the BOOT_FLAG_[...] values. */
David Vinczee2453472019-06-17 12:31:59 +0200138 uint8_t image_num; /* Boot status belongs to this image */
Christopher Collins92ea77f2016-12-12 15:59:26 -0800139};
140
David Vinczeb75c12a2019-03-22 14:58:33 +0100141#ifdef MCUBOOT_IMAGE_NUMBER
142#define BOOT_IMAGE_NUMBER MCUBOOT_IMAGE_NUMBER
143#else
144#define BOOT_IMAGE_NUMBER 1
145#endif
146
Fabio Utzigabec0732019-07-31 08:40:22 -0300147_Static_assert(BOOT_IMAGE_NUMBER > 0, "Invalid value for BOOT_IMAGE_NUMBER");
148
Marti Bolivarf9bfddd2018-04-24 14:28:33 -0400149#define BOOT_MAX_IMG_SECTORS MCUBOOT_MAX_IMG_SECTORS
Fabio Utziga1fae672018-03-30 10:52:38 -0300150
151/*
David Vinczee2453472019-06-17 12:31:59 +0200152 * Extract the swap type and image number from image trailers's swap_info
153 * filed.
154 */
155#define BOOT_GET_SWAP_TYPE(swap_info) ((swap_info) & 0x0F)
156#define BOOT_GET_IMAGE_NUM(swap_info) ((swap_info) >> 4)
157
158/* Construct the swap_info field from swap type and image number */
159#define BOOT_SET_SWAP_INFO(swap_info, image, type) { \
160 assert((image) < 0xF); \
161 assert((type) < 0xF); \
162 (swap_info) = (image) << 4 \
163 | (type); \
164 }
165
166/*
Fabio Utziga1fae672018-03-30 10:52:38 -0300167 * The current flashmap API does not check the amount of space allocated when
168 * loading sector data from the flash device, allowing for smaller counts here
169 * would most surely incur in overruns.
170 *
171 * TODO: make flashmap API receive the current sector array size.
172 */
173#if BOOT_MAX_IMG_SECTORS < 32
174#error "Too few sectors, please increase BOOT_MAX_IMG_SECTORS to at least 32"
175#endif
176
Fabio Utziga1fae672018-03-30 10:52:38 -0300177/** Maximum number of image sectors supported by the bootloader. */
David Vincze2d736ad2019-02-18 11:50:22 +0100178#define BOOT_STATUS_STATE_COUNT 3
179#define BOOT_STATUS_MAX_ENTRIES BOOT_MAX_IMG_SECTORS
Christopher Collins92ea77f2016-12-12 15:59:26 -0800180
David Vincze2d736ad2019-02-18 11:50:22 +0100181#define BOOT_PRIMARY_SLOT 0
182#define BOOT_SECONDARY_SLOT 1
Christopher Collins92ea77f2016-12-12 15:59:26 -0800183
David Vincze2d736ad2019-02-18 11:50:22 +0100184#define BOOT_STATUS_SOURCE_NONE 0
185#define BOOT_STATUS_SOURCE_SCRATCH 1
186#define BOOT_STATUS_SOURCE_PRIMARY_SLOT 2
187
David Brown2b8a6952019-10-01 16:14:53 -0600188#define BOOT_MAGIC_SZ (sizeof boot_img_magic)
Fabio Utzig7ebb7c22017-04-26 10:59:31 -0300189
Marti Bolivarc50926f2017-06-14 09:35:40 -0400190/**
191 * Compatibility shim for flash sector type.
192 *
193 * This can be deleted when flash_area_to_sectors() is removed.
194 */
195#ifdef MCUBOOT_USE_FLASH_AREA_GET_SECTORS
196typedef struct flash_sector boot_sector_t;
197#else
198typedef struct flash_area boot_sector_t;
199#endif
200
Marti Bolivar9b1f8bb2017-06-12 15:24:13 -0400201/** Private state maintained during boot. */
202struct boot_loader_state {
203 struct {
204 struct image_header hdr;
Marti Bolivarc0b47912017-06-13 17:18:09 -0400205 const struct flash_area *area;
Marti Bolivarc50926f2017-06-14 09:35:40 -0400206 boot_sector_t *sectors;
Marti Bolivar84898652017-06-13 17:20:22 -0400207 size_t num_sectors;
David Vinczeba3bd602019-06-17 16:01:43 +0200208 } imgs[BOOT_IMAGE_NUMBER][BOOT_NUM_SLOTS];
Marti Bolivar9b1f8bb2017-06-12 15:24:13 -0400209
Fabio Utzig2bd980a2018-11-26 10:38:17 -0200210 struct {
211 const struct flash_area *area;
212 boot_sector_t *sectors;
213 size_t num_sectors;
214 } scratch;
Marti Bolivar9b1f8bb2017-06-12 15:24:13 -0400215
David Vinczeba3bd602019-06-17 16:01:43 +0200216 uint8_t swap_type[BOOT_IMAGE_NUMBER];
Marti Bolivar9b1f8bb2017-06-12 15:24:13 -0400217 uint8_t write_sz;
Fabio Utzig10ee6482019-08-01 12:04:52 -0300218
219#if defined(MCUBOOT_ENC_IMAGES)
Fabio Utzig1e4284b2019-08-23 11:55:27 -0300220 struct enc_key_data enc[BOOT_IMAGE_NUMBER][BOOT_NUM_SLOTS];
Fabio Utzig10ee6482019-08-01 12:04:52 -0300221#endif
222
Fabio Utzigb0f04732019-07-31 09:49:19 -0300223#if (BOOT_IMAGE_NUMBER > 1)
224 uint8_t curr_img_idx;
225#endif
Marti Bolivar9b1f8bb2017-06-12 15:24:13 -0400226};
227
Fabio Utzig1a927dd2017-12-05 10:30:26 -0200228int bootutil_verify_sig(uint8_t *hash, uint32_t hlen, uint8_t *sig,
229 size_t slen, uint8_t key_id);
Christopher Collins92ea77f2016-12-12 15:59:26 -0800230
Christopher Collinsa1c12042019-05-23 14:00:28 -0700231int boot_magic_compatible_check(uint8_t tbl_val, uint8_t val);
Christopher Collins2adef702019-05-22 14:37:31 -0700232uint32_t boot_trailer_sz(uint8_t min_write_sz);
Fabio Utzigb0f04732019-07-31 09:49:19 -0300233int boot_status_entries(int image_index, const struct flash_area *fap);
Christopher Collins92ea77f2016-12-12 15:59:26 -0800234uint32_t boot_status_off(const struct flash_area *fap);
David Vinczee2453472019-06-17 12:31:59 +0200235uint32_t boot_swap_info_off(const struct flash_area *fap);
Christopher Collins92ea77f2016-12-12 15:59:26 -0800236int boot_read_swap_state(const struct flash_area *fap,
237 struct boot_swap_state *state);
Fabio Utzig2473ac02017-05-02 12:45:02 -0300238int boot_read_swap_state_by_id(int flash_area_id,
239 struct boot_swap_state *state);
Christopher Collins92ea77f2016-12-12 15:59:26 -0800240int boot_write_magic(const struct flash_area *fap);
Fabio Utzig10ee6482019-08-01 12:04:52 -0300241int boot_write_status(struct boot_loader_state *state, struct boot_status *bs);
Christopher Collins92ea77f2016-12-12 15:59:26 -0800242int boot_schedule_test_swap(void);
243int boot_write_copy_done(const struct flash_area *fap);
244int boot_write_image_ok(const struct flash_area *fap);
David Vinczee2453472019-06-17 12:31:59 +0200245int boot_write_swap_info(const struct flash_area *fap, uint8_t swap_type,
246 uint8_t image_num);
Fabio Utzig46490722017-09-04 15:34:32 -0300247int boot_write_swap_size(const struct flash_area *fap, uint32_t swap_size);
Fabio Utzigb0f04732019-07-31 09:49:19 -0300248int boot_read_swap_size(int image_index, uint32_t *swap_size);
Fabio Utzigba829042018-09-18 08:29:34 -0300249#ifdef MCUBOOT_ENC_IMAGES
250int boot_write_enc_key(const struct flash_area *fap, uint8_t slot,
251 const uint8_t *enckey);
Fabio Utzigb0f04732019-07-31 09:49:19 -0300252int boot_read_enc_key(int image_index, uint8_t slot, uint8_t *enckey);
Fabio Utzigba829042018-09-18 08:29:34 -0300253#endif
Christopher Collins92ea77f2016-12-12 15:59:26 -0800254
David Browneffb06e2019-10-10 14:45:32 -0600255/**
256 * Safe (non-overflowing) uint32_t addition. Returns true, and stores
257 * the result in *dest if it can be done without overflow. Otherwise,
258 * returns false.
259 */
260static inline bool boot_u32_safe_add(uint32_t *dest, uint32_t a, uint32_t b)
261{
262 /*
263 * "a + b <= UINT32_MAX", subtract 'b' from both sides to avoid
264 * the overflow.
265 */
266 if (a > UINT32_MAX - b) {
267 return false;
268 } else {
269 *dest = a + b;
270 return true;
271 }
272}
273
274/**
275 * Safe (non-overflowing) uint16_t addition. Returns true, and stores
276 * the result in *dest if it can be done without overflow. Otherwise,
277 * returns false.
278 */
279static inline bool boot_u16_safe_add(uint16_t *dest, uint16_t a, uint16_t b)
280{
281 uint32_t tmp = a + b;
282 if (tmp > UINT16_MAX) {
283 return false;
284 } else {
285 *dest = tmp;
286 return true;
287 }
288}
289
Marti Bolivarf804f622017-06-12 15:41:48 -0400290/*
291 * Accessors for the contents of struct boot_loader_state.
292 */
293
Marti Bolivarc0b47912017-06-13 17:18:09 -0400294/* These are macros so they can be used as lvalues. */
Fabio Utzigb0f04732019-07-31 09:49:19 -0300295#if (BOOT_IMAGE_NUMBER > 1)
296#define BOOT_CURR_IMG(state) ((state)->curr_img_idx)
297#else
298#define BOOT_CURR_IMG(state) 0
Fabio Utzigbc077932019-08-26 11:16:34 -0300299#endif
300#ifdef MCUBOOT_ENC_IMAGES
301#define BOOT_CURR_ENC(state) ((state)->enc[BOOT_CURR_IMG(state)])
302#else
303#define BOOT_CURR_ENC(state) NULL
Fabio Utzigb0f04732019-07-31 09:49:19 -0300304#endif
305#define BOOT_IMG(state, slot) ((state)->imgs[BOOT_CURR_IMG(state)][(slot)])
David Vinczeba3bd602019-06-17 16:01:43 +0200306#define BOOT_IMG_AREA(state, slot) (BOOT_IMG(state, slot).area)
Fabio Utzig2bd980a2018-11-26 10:38:17 -0200307#define BOOT_SCRATCH_AREA(state) ((state)->scratch.area)
Marti Bolivare10a7392017-06-14 16:20:07 -0400308#define BOOT_WRITE_SZ(state) ((state)->write_sz)
Fabio Utzigb0f04732019-07-31 09:49:19 -0300309#define BOOT_SWAP_TYPE(state) ((state)->swap_type[BOOT_CURR_IMG(state)])
Fabio Utzigc9621352019-08-08 12:15:51 -0300310#define BOOT_TLV_OFF(hdr) ((hdr)->ih_hdr_size + (hdr)->ih_img_size)
Marti Bolivarc0b47912017-06-13 17:18:09 -0400311
Fabio Utzige575b0b2019-09-11 12:34:23 -0300312#define BOOT_IS_UPGRADE(swap_type) \
313 (((swap_type) == BOOT_SWAP_TYPE_TEST) || \
314 ((swap_type) == BOOT_SWAP_TYPE_REVERT) || \
315 ((swap_type) == BOOT_SWAP_TYPE_PERM))
316
Marti Bolivarf804f622017-06-12 15:41:48 -0400317static inline struct image_header*
318boot_img_hdr(struct boot_loader_state *state, size_t slot)
319{
David Vinczeba3bd602019-06-17 16:01:43 +0200320 return &BOOT_IMG(state, slot).hdr;
Marti Bolivarf804f622017-06-12 15:41:48 -0400321}
322
Marti Bolivard3269fd2017-06-12 16:31:12 -0400323static inline size_t
Fabio Utzig10ee6482019-08-01 12:04:52 -0300324boot_img_num_sectors(const struct boot_loader_state *state, size_t slot)
Marti Bolivard3269fd2017-06-12 16:31:12 -0400325{
David Vinczeba3bd602019-06-17 16:01:43 +0200326 return BOOT_IMG(state, slot).num_sectors;
Marti Bolivard3269fd2017-06-12 16:31:12 -0400327}
328
Fabio Utzig2bd980a2018-11-26 10:38:17 -0200329static inline size_t
330boot_scratch_num_sectors(struct boot_loader_state *state)
331{
332 return state->scratch.num_sectors;
333}
334
Marti Bolivar135b8f62017-06-13 17:22:13 -0400335/*
336 * Offset of the slot from the beginning of the flash device.
337 */
338static inline uint32_t
339boot_img_slot_off(struct boot_loader_state *state, size_t slot)
340{
David Vinczeba3bd602019-06-17 16:01:43 +0200341 return BOOT_IMG(state, slot).area->fa_off;
Marti Bolivar135b8f62017-06-13 17:22:13 -0400342}
343
344static inline size_t boot_scratch_area_size(struct boot_loader_state *state)
345{
Fabio Utzig2bd980a2018-11-26 10:38:17 -0200346 return BOOT_SCRATCH_AREA(state)->fa_size;
Marti Bolivar135b8f62017-06-13 17:22:13 -0400347}
348
Marti Bolivarc50926f2017-06-14 09:35:40 -0400349#ifndef MCUBOOT_USE_FLASH_AREA_GET_SECTORS
350
Marti Bolivard3269fd2017-06-12 16:31:12 -0400351static inline size_t
Fabio Utzig10ee6482019-08-01 12:04:52 -0300352boot_img_sector_size(const struct boot_loader_state *state,
Marti Bolivard3269fd2017-06-12 16:31:12 -0400353 size_t slot, size_t sector)
354{
David Vinczeba3bd602019-06-17 16:01:43 +0200355 return BOOT_IMG(state, slot).sectors[sector].fa_size;
Marti Bolivard3269fd2017-06-12 16:31:12 -0400356}
357
Marti Bolivarea088872017-06-12 17:10:49 -0400358/*
359 * Offset of the sector from the beginning of the image, NOT the flash
360 * device.
361 */
362static inline uint32_t
Fabio Utzig10ee6482019-08-01 12:04:52 -0300363boot_img_sector_off(const struct boot_loader_state *state, size_t slot,
Marti Bolivarea088872017-06-12 17:10:49 -0400364 size_t sector)
365{
David Vinczeba3bd602019-06-17 16:01:43 +0200366 return BOOT_IMG(state, slot).sectors[sector].fa_off -
367 BOOT_IMG(state, slot).sectors[0].fa_off;
Marti Bolivarea088872017-06-12 17:10:49 -0400368}
369
Marti Bolivarc50926f2017-06-14 09:35:40 -0400370#else /* defined(MCUBOOT_USE_FLASH_AREA_GET_SECTORS) */
371
372static inline size_t
Fabio Utzig10ee6482019-08-01 12:04:52 -0300373boot_img_sector_size(const struct boot_loader_state *state,
Marti Bolivarc50926f2017-06-14 09:35:40 -0400374 size_t slot, size_t sector)
375{
David Vinczeba3bd602019-06-17 16:01:43 +0200376 return BOOT_IMG(state, slot).sectors[sector].fs_size;
Marti Bolivarc50926f2017-06-14 09:35:40 -0400377}
378
379static inline uint32_t
Fabio Utzig10ee6482019-08-01 12:04:52 -0300380boot_img_sector_off(const struct boot_loader_state *state, size_t slot,
Marti Bolivarc50926f2017-06-14 09:35:40 -0400381 size_t sector)
382{
David Vinczeba3bd602019-06-17 16:01:43 +0200383 return BOOT_IMG(state, slot).sectors[sector].fs_off -
384 BOOT_IMG(state, slot).sectors[0].fs_off;
Marti Bolivarc50926f2017-06-14 09:35:40 -0400385}
386
Marti Bolivarc50926f2017-06-14 09:35:40 -0400387#endif /* !defined(MCUBOOT_USE_FLASH_AREA_GET_SECTORS) */
388
Christopher Collins92ea77f2016-12-12 15:59:26 -0800389#ifdef __cplusplus
390}
391#endif
392
393#endif