Skip to content

Commit 31b4514

Browse files
Reference/override configuration settings
Use APPLICATION_CONFIG_DIR to reuse configuration files from `mcuboot/boot/zephyr`. Use the list nature of CONFIG_FILE to locally override settings picked up by APPLICATION_CONFIG_DIR. For illustration purposes, this sample provides a local version of keys and certificate files. Incremental verification: 1. (FAIL) ./zephyr/scripts/twister --testsuite-root mcuboot/samples/zephyr_external_config The above build completed, but the FLASH and RAM sizes **grew** because APPLICATION_CONFIG_DIR did not pick up the CONFIG_NRFX_QSPI=n from the file under ${APPLICATION_CONFIG_DIR}/boards/. Signed-off-by: Gregory Shue <[email protected]>
1 parent 9782875 commit 31b4514

File tree

5 files changed

+301
-14
lines changed

5 files changed

+301
-14
lines changed

samples/zephyr_external_config/CMakeLists.txt

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,92 @@
33

44
cmake_minimum_required(VERSION 3.20.0)
55

6+
# For this sample, use the all the configurations from mcuboot/boot/zephyr,
7+
# then supplement with local settings.
8+
set(APPLICATION_CONFIG_DIR "\${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr")
9+
10+
list(APPEND CONF_FILE ${APPLICATION_CONFIG_DIR}/prj.conf)
11+
list(APPEND CONF_FILE ${CMAKE_CURRENT_SOURCE_DIR}/prj.conf)
12+
13+
# Add a common dts overlay necessary to ensure mcuboot is linked into,
14+
# and fits inside, the boot partition. (If the user specified a
15+
# DTC_OVERLAY_FILE on the CMake command line, we need to append onto
16+
# the list).
17+
if(DTC_OVERLAY_FILE)
18+
set(DTC_OVERLAY_FILE
19+
"${DTC_OVERLAY_FILE} \${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/dts.overlay"
20+
CACHE STRING "" FORCE
21+
)
22+
else()
23+
set(DTC_OVERLAY_FILE "\${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr/dts.overlay")
24+
endif()
25+
26+
27+
# Enable Zephyr runner options which request mass erase if so
28+
# configured.
29+
#
30+
# Note that this also disables the default "leave" option when
31+
# targeting STM32 DfuSe devices with dfu-util, making the chip stay in
32+
# the bootloader after flashing.
33+
#
34+
# That's the right thing, because mcuboot has nothing to do since the
35+
# chip was just erased. The next thing the user is going to want to do
36+
# is flash the application. (Developers can reset DfuSE devices
37+
# manually to test mcuboot behavior on an otherwise erased flash
38+
# device.)
39+
macro(app_set_runner_args)
40+
if(CONFIG_ZEPHYR_TRY_MASS_ERASE)
41+
board_runner_args(dfu-util "--dfuse-modifiers=force:mass-erase")
42+
board_runner_args(pyocd "--flash-opt=-e=chip")
43+
board_runner_args(nrfjprog "--erase")
44+
endif()
45+
endmacro()
46+
47+
# find_package(Zephyr) in order to load application boilerplate:
48+
# http://docs.zephyrproject.org/application/application.html
649
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
750
project(mcuboot_exernal_config)
851

9-
target_sources(app PRIVATE empty.c)
52+
target_sources(app PRIVATE
53+
keys.c
54+
)
55+
56+
if(NOT CONFIG_BOOT_SIGNATURE_KEY_FILE STREQUAL "")
57+
# CONF_FILE points to the KConfig configuration files of the bootloader.
58+
foreach (mcuboot_filepath ${CONF_FILE})
59+
string(CONFIGURE "${mcuboot_filepath}" mcuboot_filepath_expanded)
60+
file(READ ${mcuboot_filepath_expanded} temp_text)
61+
string(FIND "${temp_text}" ${CONFIG_BOOT_SIGNATURE_KEY_FILE} match)
62+
if (${match} GREATER_EQUAL 0)
63+
if (NOT DEFINED mcuboot_signature_file_dir)
64+
get_filename_component(mcuboot_signature_file_dir ${mcuboot_filepath_expanded} DIRECTORY)
65+
else()
66+
message(FATAL_ERROR "Signature key file defined in multiple conf files")
67+
endif()
68+
endif()
69+
endforeach()
70+
71+
if(IS_ABSOLUTE ${CONFIG_BOOT_SIGNATURE_KEY_FILE})
72+
set(KEY_FILE ${CONFIG_BOOT_SIGNATURE_KEY_FILE})
73+
elseif((DEFINED mcuboot_signature_file_dir) AND
74+
(EXISTS ${mcuboot_signature_file_dir}/${CONFIG_BOOT_SIGNATURE_KEY_FILE}))
75+
set(KEY_FILE ${mcuboot_signature_file_dir}/${CONFIG_BOOT_SIGNATURE_KEY_FILE})
76+
else()
77+
set(KEY_FILE ${ZEPHYR_MCUBOOT_MODULE_DIR}/${CONFIG_BOOT_SIGNATURE_KEY_FILE})
78+
endif()
79+
message("MCUBoot bootloader key file: ${KEY_FILE}")
80+
81+
set(GENERATED_PUBKEY ${ZEPHYR_BINARY_DIR}/autogen-pubkey.c)
82+
add_custom_command(
83+
OUTPUT ${GENERATED_PUBKEY}
84+
COMMAND
85+
${PYTHON_EXECUTABLE}
86+
${ZEPHYR_MCUBOOT_MODULE_DIR}/scripts/imgtool.py
87+
getpub
88+
-k
89+
${KEY_FILE}
90+
> ${GENERATED_PUBKEY}
91+
DEPENDS ${KEY_FILE}
92+
)
93+
zephyr_library_sources(${GENERATED_PUBKEY})
94+
endif()

samples/zephyr_external_config/README.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ MCUBoot External Config
66
Overview
77
********
88

9-
A simple sample illustrating how to configure an MCUBoot image build
10-
from a different module.
9+
A simple sample illustrating how to configure from a different module
10+
an MCUBoot image, using local keys and certificates.
11+
12+
NOTE: This references ${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/zephyr
13+
for most configuration files for the verified set of boards. Other
14+
board configuration files will need to be provided locally.
1115

1216
Building and Running
1317
********************

samples/zephyr_external_config/empty.c

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
/*
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+
20+
#include <bootutil/sign_key.h>
21+
22+
/*
23+
* Even though this is in principle a Zephyr-specific file, the
24+
* simulator builds it and uses it as well. Because of that, we can't
25+
* use Kconfig symbols for key types, and have to rely on the MCUBoot
26+
* symbols (which Zephyr provides via this header, and the simulator
27+
* provides via the compiler command line).
28+
*/
29+
#include <mcuboot_config/mcuboot_config.h>
30+
31+
#if !defined(MCUBOOT_HW_KEY)
32+
#if defined(MCUBOOT_SIGN_RSA)
33+
#define HAVE_KEYS
34+
extern const unsigned char rsa_pub_key[];
35+
extern unsigned int rsa_pub_key_len;
36+
#elif defined(MCUBOOT_SIGN_EC256)
37+
#define HAVE_KEYS
38+
extern const unsigned char ecdsa_pub_key[];
39+
extern unsigned int ecdsa_pub_key_len;
40+
#elif defined(MCUBOOT_SIGN_ED25519)
41+
#define HAVE_KEYS
42+
extern const unsigned char ed25519_pub_key[];
43+
extern unsigned int ed25519_pub_key_len;
44+
#endif
45+
46+
/*
47+
* NOTE: *_pub_key and *_pub_key_len are autogenerated based on the provided
48+
* key file. If no key file was configured, the array and length must be
49+
* provided and added to the build manually.
50+
*/
51+
#if defined(HAVE_KEYS)
52+
const struct bootutil_key bootutil_keys[] = {
53+
{
54+
#if defined(MCUBOOT_SIGN_RSA)
55+
.key = rsa_pub_key,
56+
.len = &rsa_pub_key_len,
57+
#elif defined(MCUBOOT_SIGN_EC256)
58+
.key = ecdsa_pub_key,
59+
.len = &ecdsa_pub_key_len,
60+
#elif defined(MCUBOOT_SIGN_ED25519)
61+
.key = ed25519_pub_key,
62+
.len = &ed25519_pub_key_len,
63+
#endif
64+
},
65+
};
66+
const int bootutil_key_cnt = 1;
67+
#endif /* HAVE_KEYS */
68+
#else
69+
unsigned int pub_key_len;
70+
struct bootutil_key bootutil_keys[1] = {
71+
{
72+
.key = 0,
73+
.len = &pub_key_len,
74+
}
75+
};
76+
const int bootutil_key_cnt = 1;
77+
#endif /* !MCUBOOT_HW_KEY */
78+
79+
#if defined(MCUBOOT_ENCRYPT_RSA)
80+
unsigned char enc_priv_key[] = {
81+
0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
82+
0xb4, 0x26, 0x14, 0x49, 0x3d, 0x16, 0x13, 0x3a, 0x6d, 0x9c, 0x84, 0xa9,
83+
0x8b, 0x6a, 0x10, 0x20, 0x61, 0xef, 0x48, 0x04, 0xa4, 0x4b, 0x24, 0xf3,
84+
0x00, 0x32, 0xac, 0x22, 0xe0, 0x30, 0x27, 0x70, 0x18, 0xe5, 0x55, 0xc8,
85+
0xb8, 0x05, 0x34, 0x03, 0xb0, 0xf8, 0xa5, 0x96, 0xd2, 0x48, 0x58, 0xef,
86+
0x70, 0xb0, 0x09, 0xdb, 0xe3, 0x58, 0x62, 0xef, 0x99, 0x63, 0x01, 0xb2,
87+
0x89, 0xc4, 0xb3, 0xf6, 0x9e, 0x62, 0xbf, 0x4d, 0xc2, 0x8a, 0xd0, 0xc9,
88+
0x4d, 0x43, 0xa3, 0xd8, 0xe5, 0x1d, 0xec, 0x62, 0x63, 0x08, 0xe2, 0x20,
89+
0xa5, 0xfc, 0x78, 0xd0, 0x3e, 0x74, 0xc8, 0xa4, 0x1b, 0x36, 0xad, 0x7b,
90+
0xf5, 0x06, 0xae, 0x4d, 0x51, 0x9b, 0x40, 0xce, 0x30, 0x4f, 0x6c, 0xea,
91+
0xf9, 0xe9, 0x74, 0xea, 0x06, 0xee, 0x9c, 0xe4, 0x14, 0x68, 0x20, 0xb9,
92+
0x3d, 0xe7, 0x11, 0x14, 0x8b, 0x25, 0xa3, 0xff, 0x4c, 0x8a, 0xf3, 0x53,
93+
0xee, 0x6b, 0x3e, 0xef, 0x34, 0xcd, 0x6a, 0x3f, 0x62, 0x68, 0xc0, 0xff,
94+
0x78, 0x4c, 0xb0, 0xc3, 0xe6, 0x96, 0x61, 0xfc, 0x1f, 0x18, 0xf1, 0x7a,
95+
0x82, 0xe2, 0x8f, 0x35, 0xa8, 0x2b, 0x86, 0x16, 0xa4, 0x46, 0xfb, 0xac,
96+
0x7e, 0x41, 0xdb, 0x02, 0x05, 0x91, 0x6d, 0xdf, 0xc1, 0xde, 0x13, 0x95,
97+
0x9c, 0xf9, 0x9e, 0x5e, 0x72, 0xba, 0xa7, 0x25, 0x93, 0xfb, 0xdc, 0xe8,
98+
0xab, 0x86, 0x45, 0x88, 0x47, 0x2d, 0xed, 0xee, 0xee, 0x97, 0x9e, 0xce,
99+
0x5d, 0x9b, 0x04, 0x04, 0x40, 0x7c, 0xcb, 0x7c, 0x3d, 0x2c, 0x74, 0xab,
100+
0xa4, 0xcc, 0x64, 0xa3, 0x5c, 0x95, 0x3d, 0xd4, 0xa2, 0xdc, 0x92, 0xb2,
101+
0xc8, 0x18, 0xcb, 0xf9, 0x00, 0x39, 0x81, 0x8f, 0x8f, 0x40, 0xc2, 0xdf,
102+
0x99, 0x29, 0xac, 0x8a, 0xc2, 0x3b, 0xd8, 0xa4, 0xf2, 0xad, 0xaf, 0x74,
103+
0xc0, 0x11, 0xc7, 0x99, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01,
104+
0x00, 0x42, 0x47, 0x80, 0x4f, 0x31, 0xda, 0x5d, 0x58, 0xb1, 0xdb, 0x54,
105+
0x33, 0xcc, 0xc7, 0x49, 0x07, 0xa1, 0x00, 0x98, 0x4e, 0x9c, 0xe3, 0xc8,
106+
0xc4, 0x5e, 0xde, 0x45, 0xd6, 0xcf, 0x04, 0xe8, 0x7d, 0xa5, 0xab, 0x3a,
107+
0xd4, 0x8e, 0x5f, 0xdb, 0xb3, 0x3f, 0xf9, 0x3b, 0x73, 0x32, 0x0a, 0xcc,
108+
0x2d, 0xcc, 0x17, 0xf8, 0x88, 0x9e, 0x2c, 0x76, 0xba, 0x10, 0x85, 0x0c,
109+
0xaa, 0xd3, 0x65, 0x3b, 0x91, 0x10, 0xd4, 0xe3, 0xed, 0x88, 0x15, 0xea,
110+
0x9b, 0x25, 0x82, 0x2d, 0x56, 0x2f, 0x75, 0xc2, 0xf2, 0xaf, 0xdd, 0x24,
111+
0xd5, 0x3e, 0x3c, 0x95, 0x76, 0x88, 0x84, 0x0f, 0x0d, 0xd1, 0xb5, 0x5c,
112+
0x3e, 0xae, 0xf7, 0xb6, 0x49, 0x5c, 0x2c, 0xf2, 0xba, 0xe9, 0xab, 0x4f,
113+
0x37, 0x64, 0x9b, 0x30, 0x18, 0xaa, 0x54, 0x40, 0x04, 0xea, 0x3d, 0x25,
114+
0x4d, 0x02, 0x29, 0x71, 0x6f, 0x4d, 0x82, 0x9b, 0xc3, 0x44, 0x2a, 0x9d,
115+
0x0c, 0x98, 0xd3, 0xc8, 0x15, 0x0d, 0x04, 0x93, 0x60, 0x30, 0xc7, 0x5e,
116+
0x79, 0xea, 0x53, 0x9d, 0xc0, 0x0e, 0x81, 0xac, 0x90, 0xbc, 0x9e, 0x1e,
117+
0xd2, 0x28, 0x0f, 0x10, 0xf5, 0x1f, 0xdf, 0x38, 0x7f, 0x8a, 0x90, 0x8d,
118+
0x49, 0x07, 0x7d, 0x78, 0xcb, 0xa7, 0xef, 0x92, 0x6d, 0x3b, 0x13, 0x95,
119+
0x9b, 0xba, 0x83, 0xc6, 0xb3, 0x71, 0x25, 0x27, 0x07, 0x99, 0x54, 0x82,
120+
0x3d, 0xec, 0xc5, 0xf8, 0xb4, 0xa0, 0x38, 0x7a, 0x59, 0x6a, 0x0b, 0xca,
121+
0x69, 0x6c, 0x17, 0xa4, 0x18, 0xe0, 0xb4, 0xaa, 0x89, 0x99, 0x8f, 0xcb,
122+
0x71, 0x34, 0x09, 0x1b, 0x6e, 0xe6, 0x87, 0x00, 0xb5, 0xba, 0x70, 0x8a,
123+
0x29, 0x3d, 0x9a, 0x06, 0x18, 0x2d, 0x66, 0x5e, 0x61, 0x37, 0xeb, 0xdd,
124+
0x5e, 0xc8, 0x28, 0x92, 0x05, 0x30, 0xfd, 0xb8, 0x65, 0xb1, 0x7f, 0xbf,
125+
0x2d, 0x55, 0x12, 0x91, 0xc1, 0x02, 0x81, 0x81, 0x00, 0xda, 0x65, 0xda,
126+
0x38, 0x7c, 0x18, 0xfb, 0x00, 0x11, 0x60, 0xeb, 0x37, 0x65, 0xb8, 0x83,
127+
0x62, 0x88, 0xc4, 0x3a, 0x4e, 0x64, 0x6a, 0xf3, 0x3e, 0x4e, 0xc0, 0x34,
128+
0x19, 0x8a, 0xcb, 0x4a, 0xca, 0x2f, 0x5d, 0x50, 0x7a, 0xac, 0xf7, 0x9e,
129+
0x87, 0x5a, 0xfc, 0x4d, 0x49, 0xd7, 0xf9, 0x21, 0xf5, 0x0b, 0x6f, 0x57,
130+
0x41, 0x3d, 0x8f, 0xb8, 0xec, 0x7f, 0xcc, 0x92, 0x09, 0xbe, 0xd3, 0xa4,
131+
0xc3, 0x14, 0x85, 0x21, 0x5d, 0x05, 0xa3, 0xaa, 0x20, 0xf6, 0x62, 0x44,
132+
0x50, 0x03, 0x5e, 0x53, 0x4a, 0xcd, 0x6a, 0xb6, 0x65, 0x8e, 0x4e, 0x4b,
133+
0x3f, 0x25, 0xc6, 0x16, 0x31, 0xf5, 0x99, 0x13, 0x77, 0x42, 0xda, 0xdc,
134+
0x70, 0x4d, 0x65, 0xb0, 0x99, 0x0f, 0xdf, 0x5a, 0xb1, 0x45, 0xf0, 0xb9,
135+
0x8e, 0xa0, 0xae, 0x4f, 0x4d, 0x65, 0x09, 0x84, 0xb5, 0x38, 0x29, 0xbf,
136+
0x69, 0xe0, 0x88, 0x1f, 0x27, 0x02, 0x81, 0x81, 0x00, 0xd3, 0x2a, 0x59,
137+
0xec, 0x28, 0xc3, 0x0d, 0x4f, 0x92, 0x96, 0xca, 0x67, 0x94, 0xfc, 0x2e,
138+
0xa6, 0x86, 0x68, 0x45, 0x53, 0x92, 0xcc, 0x86, 0x7f, 0x8a, 0xe1, 0x5d,
139+
0xe8, 0x1d, 0x9e, 0xbb, 0x1e, 0x00, 0x26, 0x1d, 0x80, 0x12, 0xff, 0x9c,
140+
0x11, 0x0a, 0xbd, 0xa6, 0xc3, 0x8d, 0x48, 0xda, 0xfc, 0x10, 0xf7, 0x7a,
141+
0x16, 0x07, 0x15, 0xa0, 0x3a, 0xd3, 0x94, 0xfb, 0x52, 0x87, 0x39, 0xee,
142+
0xe7, 0xc4, 0x26, 0x49, 0x16, 0xc6, 0xc0, 0x83, 0x25, 0xbf, 0x6a, 0x4e,
143+
0x8c, 0x0b, 0x10, 0x85, 0x66, 0xab, 0x7e, 0xae, 0xac, 0x4c, 0x69, 0x3c,
144+
0x44, 0xeb, 0xcd, 0xe9, 0xf6, 0x64, 0x8b, 0x4a, 0xd8, 0x6a, 0x4d, 0x6d,
145+
0x47, 0xa9, 0xb8, 0x55, 0x72, 0xc1, 0xfd, 0xf4, 0x81, 0x4c, 0x66, 0xbe,
146+
0x49, 0xf2, 0x75, 0x4f, 0x80, 0xf1, 0x20, 0x38, 0xb8, 0x6a, 0x1b, 0x75,
147+
0x41, 0x30, 0x0f, 0x1b, 0x3f, 0x02, 0x81, 0x80, 0x09, 0x35, 0xfa, 0x7a,
148+
0x1f, 0x61, 0xbe, 0x54, 0x46, 0x67, 0x5c, 0x04, 0x3e, 0x1a, 0x06, 0x10,
149+
0x85, 0xcc, 0x20, 0xd9, 0x65, 0x8a, 0xcd, 0x2f, 0x77, 0x8a, 0xcb, 0xa7,
150+
0xb8, 0x1e, 0xd2, 0xcc, 0xac, 0x2a, 0xb7, 0x56, 0x35, 0x2d, 0x4c, 0x56,
151+
0x51, 0x14, 0x0a, 0xfe, 0x6e, 0x49, 0x67, 0x91, 0x3a, 0x26, 0x3b, 0xfb,
152+
0xd8, 0x68, 0xd3, 0x57, 0xc6, 0x1c, 0x0e, 0x9c, 0xb2, 0x9b, 0xa2, 0x7b,
153+
0x47, 0xc6, 0x45, 0x9d, 0xf2, 0xba, 0xf0, 0x55, 0xeb, 0x8e, 0x41, 0x6b,
154+
0x4e, 0x79, 0x0f, 0xf2, 0x3b, 0xaf, 0xa0, 0x79, 0xb0, 0x02, 0xc5, 0x51,
155+
0xa8, 0x7a, 0x2e, 0x3d, 0x75, 0x2a, 0x3b, 0x93, 0xf0, 0x11, 0xe2, 0xf2,
156+
0x29, 0x91, 0x7c, 0x5d, 0x38, 0x3a, 0x27, 0x4d, 0x0a, 0xb2, 0x18, 0x61,
157+
0x57, 0x8d, 0x82, 0x72, 0xb5, 0x2c, 0x2d, 0x98, 0xa7, 0x01, 0xbb, 0xbc,
158+
0xef, 0x67, 0x4e, 0x49, 0x02, 0x81, 0x81, 0x00, 0xb2, 0x70, 0x53, 0x54,
159+
0x70, 0x8d, 0x82, 0xad, 0xff, 0x1d, 0x55, 0x24, 0x7a, 0x8d, 0x2f, 0x8e,
160+
0xa0, 0x7d, 0x74, 0x37, 0xcf, 0x10, 0xed, 0x86, 0xd1, 0x80, 0xe7, 0xad,
161+
0xc1, 0x79, 0xe4, 0x7c, 0xd1, 0x7b, 0x63, 0xea, 0x5a, 0x23, 0x8d, 0x6a,
162+
0x09, 0x3d, 0x81, 0xb2, 0x35, 0xad, 0x9e, 0xfe, 0xea, 0x07, 0x76, 0x2f,
163+
0x2f, 0x05, 0x63, 0x44, 0xd2, 0x8e, 0x4e, 0x61, 0xca, 0xcb, 0x75, 0xca,
164+
0x7b, 0xc2, 0x2e, 0x79, 0x04, 0xb2, 0xa1, 0x20, 0x40, 0xc4, 0x40, 0x63,
165+
0xae, 0xe5, 0xe3, 0x14, 0x83, 0x4e, 0xa5, 0xa4, 0x0b, 0x5d, 0xd2, 0x04,
166+
0x1b, 0x8f, 0x01, 0x69, 0xa8, 0x44, 0xdc, 0x96, 0x4c, 0x1d, 0xe9, 0x7e,
167+
0x69, 0x38, 0xcf, 0x5c, 0x0d, 0xf9, 0xdf, 0xa7, 0x73, 0x3c, 0x4f, 0x08,
168+
0x85, 0xce, 0x03, 0xc4, 0xdd, 0xfd, 0x70, 0x70, 0xc5, 0x99, 0x36, 0x58,
169+
0x43, 0x98, 0x40, 0x59, 0x02, 0x81, 0x81, 0x00, 0xd5, 0xaa, 0xfb, 0xec,
170+
0x8d, 0xc6, 0xdd, 0xfa, 0x2b, 0x5a, 0x24, 0xd0, 0xda, 0x58, 0xbd, 0x87,
171+
0x92, 0x1a, 0x29, 0x62, 0x13, 0x1d, 0x4b, 0x79, 0x1b, 0xbe, 0x79, 0x7d,
172+
0xad, 0x79, 0xca, 0x17, 0x75, 0xda, 0xe8, 0x32, 0xe8, 0xa0, 0x9e, 0xa8,
173+
0x77, 0x53, 0xac, 0x38, 0xd6, 0xeb, 0xe6, 0x22, 0x65, 0xc4, 0xaa, 0x4c,
174+
0xc8, 0xd0, 0x33, 0x1a, 0x1e, 0xbe, 0xbd, 0x73, 0x09, 0x4a, 0xfa, 0x85,
175+
0x5c, 0xf3, 0x0c, 0x9c, 0x81, 0x56, 0x30, 0xa7, 0xf7, 0x9b, 0xf4, 0x92,
176+
0x9c, 0x6b, 0x93, 0x6a, 0x00, 0x33, 0xdc, 0x2f, 0x54, 0x1e, 0x78, 0xd4,
177+
0x97, 0xec, 0x24, 0xa2, 0xdb, 0x3d, 0x03, 0x33, 0x09, 0xb2, 0x2c, 0x03,
178+
0x05, 0x40, 0xde, 0x52, 0xf2, 0x9b, 0xfa, 0x00, 0x8d, 0x4b, 0xfe, 0x5b,
179+
0x9b, 0x9c, 0x73, 0xad, 0xfb, 0x7a, 0x00, 0x42, 0x62, 0x9e, 0xa0, 0x95,
180+
0x55, 0x50, 0x32, 0x87
181+
};
182+
static unsigned int enc_priv_key_len = 1192;
183+
184+
const struct bootutil_key bootutil_enc_key = {
185+
.key = enc_priv_key,
186+
.len = &enc_priv_key_len,
187+
};
188+
#elif defined(MCUBOOT_ENCRYPT_EC256)
189+
extern const unsigned char enc_priv_key[];
190+
extern unsigned int enc_priv_key_len;
191+
const struct bootutil_key bootutil_enc_key = {
192+
.key = enc_priv_key,
193+
.len = &enc_priv_key_len,
194+
};
195+
#elif defined(MCUBOOT_ENCRYPT_X25519)
196+
unsigned char enc_key[] = {
197+
0x30, 0x2e, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e,
198+
0x04, 0x22, 0x04, 0x20, 0x28, 0x80, 0x2f, 0xef, 0xef, 0x82, 0x95, 0x50,
199+
0xf1, 0x41, 0x93, 0x03, 0x6c, 0x1b, 0xb9, 0x49, 0x6c, 0x51, 0xe5, 0x26,
200+
0x87, 0x8f, 0x77, 0x07, 0xf8, 0xb4, 0x1f, 0x04, 0x45, 0x6d, 0x84, 0x4f,
201+
};
202+
static unsigned int enc_key_len = 48;
203+
const struct bootutil_key bootutil_enc_key = {
204+
.key = enc_key,
205+
.len = &enc_key_len,
206+
};
207+
#elif defined(MCUBOOT_ENCRYPT_KW)
208+
#error "Encrypted images with AES-KW is not implemented yet."
209+
#endif
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
# Copyright (c) 2022 Legrand North America, LLC.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
CONFIG_MCUBOOT=y
5-
6-
CONFIG_LOG=y
7-
CONFIG_LOG_MODE_MINIMAL=y
8-
CONFIG_LOG_DEFAULT_LEVEL=0
9-
CONFIG_CBPRINTF_NANO=y
10-
11-
CONFIG_FLASH=y
12-
CONFIG_DEBUG=y
13-
CONFIG_PM=n

0 commit comments

Comments
 (0)