Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: boot_set_confirmed_multi() ignores set/confirm command if "unset" #234

Open
wants to merge 124 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
014f42d
zephyr: Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROL…
galak Apr 8, 2020
8cd5dc5
zephyr: convert DT_JEDEC_SPI_NOR_0_LABEL to new dt macros
galak Apr 8, 2020
39d1aef
Revert "zephyr: convert DT_JEDEC_SPI_NOR_0_LABEL to new dt macros"
nvlsianpu May 7, 2020
48b8ef0
Revert "Revert "zephyr: convert DT_JEDEC_SPI_NOR_0_LABEL to new dt ma…
nvlsianpu May 7, 2020
5657d00
mergeup: merge up to upstream 82c5f7c
nvlsianpu May 7, 2020
b7254d1
zephyr: Change DT_FLASH_AREA_ macros to FLASH_AREA_
galak May 8, 2020
322b11a
zephyr: Change DT_FLASH_AREA_ macros to FLASH_AREA for multimage
nvlsianpu May 11, 2020
1f181dd
sim: Fixup devicetree.h for changes to mcuboot
galak May 11, 2020
e88113b
scripts/assemble: Rework to use EDT library to get devicetree data
galak May 11, 2020
f625267
kconfig: Update to CONFIG_FLOAT to CONFIG_FPU rename in zephyr
joerchan May 19, 2020
4bb0f95
cmake: use find_package to locate Zephyr
tejlmand May 28, 2020
ba7748d
Convert from Zephyr to C99 types
galak May 27, 2020
60cc568
Revert "zephyr: Change DT_FLASH_AREA_ macros to FLASH_AREA_"
nvlsianpu Jun 8, 2020
032eb72
mergeup: merge up to upstream 9b48d08
nvlsianpu Jun 8, 2020
d52aff5
mergeup: merge up to upstream 33fbef5
nvlsianpu Jun 19, 2020
9920005
zephyr: serial: Align with new callback signature
carlescufi Jul 20, 2020
813d29c
mergeup: merge up to upstream 1cb076c
nvlsianpu Aug 3, 2020
0f2c585
mergeup: merge up to upstream 5a6e181
nvlsianpu Aug 14, 2020
3ab5ab3
sample: inclusive language: whitelist -> allow
nashif Aug 26, 2020
f78d1d0
imgtool: fix package's author email
utzig Aug 17, 2020
4804219
zephyr: struct device const-ification
utzig Sep 2, 2020
a5d79cf
boot: zephyr: Fix build issue for multiple conf files
MarekPieta Aug 12, 2020
e8bfc03
zephyr: Fix serial recovery compilation warnings
de-nordic Sep 11, 2020
e312fa2
synch with upstream 296949e
nvlsianpu Oct 7, 2020
e64c5f0
synch with upstream c625da4
nvlsianpu Oct 21, 2020
710ce7f
synch with upstream c74c551
nvlsianpu Oct 29, 2020
c71d218
Merge: Synchronized up to JuulLabs-OSS@c74c551
nvlsianpu Oct 29, 2020
b54f9ac
synch with upstream d2122bc
nvlsianpu Nov 18, 2020
6e3825f
Merge: Synchronized up to mcu-tools@d2122bc
nvlsianpu Nov 23, 2020
cb5a7b3
Merge: Synchronized up to mcu-tools/mcuboot@e512181
henrikbrixandersen Jan 13, 2021
c986a90
Merge: Synchronized up to https://github.com/mcu-tools/mcuboot/commit…
nvlsianpu Jan 14, 2021
915a281
synch with upstream be64e6a
nvlsianpu Jan 14, 2021
6f48e0a
Merge: synchronized up to https://github.com/mcu-tools/mcuboot/commit…
nvlsianpu Jan 14, 2021
52ff566
synch with upstream ce50334
nvlsianpu Jan 15, 2021
3f49b5a
Merge: synchronized up to https://github.com/mcu-tools/mcuboot/commit…
nvlsianpu Jan 20, 2021
770fe67
synch with upstream a513b8e
nvlsianpu Jan 27, 2021
30e0c5a
Merge: synchronized up to mcu-tools@a513b8e
nvlsianpu Jan 27, 2021
2c0608f
synch with upstream 360763d
nvlsianpu Feb 5, 2021
3fc5941
Merge: Synchronized up to https://github.com/zephyrproject-rtos/mcubo…
nvlsianpu Feb 5, 2021
6a7449f
synch with upstream 5b7ed6a
nvlsianpu Mar 2, 2021
846b104
Merge: Synchronized up to 5b7ed6a
nvlsianpu Mar 4, 2021
df55337
synch with upsteram de51807
nvlsianpu Mar 22, 2021
5f00446
Merge synchronized up to de51807
nvlsianpu Mar 22, 2021
6eca8bb
Merge: synchronized up to e20e092
nvlsianpu Apr 30, 2021
3ad36f8
Merge: synchronized up to https://github.com/mcu-tools/mcuboot/commit…
nvlsianpu May 7, 2021
2fce976
Merge: synchronized up to https://github.com/mcu-tools/mcuboot/commit…
nvlsianpu May 18, 2021
7a51968
Merge: synhronize up to https://github.com/mcu-tools/mcuboot/commit/6…
nvlsianpu Jun 9, 2021
62b78ff
boot: zephyr: add integration platforms to the allow list
ioannisg Jul 27, 2021
35576c6
zephyr: remove Kconfig option CONFIG_USB
jfischer-no Aug 2, 2021
3c5eb02
zephyr: get CDC ACM UART device from devicetree
jfischer-no Jul 30, 2021
ca01db4
zephyr: CDC ACM UART node to specific overlays
jfischer-no Aug 20, 2021
a671d92
synch witch upstream commit 85da97f
nvlsianpu Sep 8, 2021
a1d5aea
boot: bootutil: Fix memory alignment of RAM buffer
MarekPieta Jul 15, 2021
26bbc18
boot: Fix IS_ENCRYPTED macro definition
salomethirot-arm Jul 23, 2021
23c9c43
zephyr: update devicetree py package lib files include path in assembly
endiancj Jun 30, 2021
2282da3
cbor_encoder: fix str encoding macros
nvlsianpu Jul 28, 2021
8812dc8
zephyr: Kconfig: fix board references
mbolivar-nordic Jul 28, 2021
9ab84e5
zephyr: do not set defaults for LOG_IMMEDIATE Kconfig
mnkp Jul 24, 2021
f624600
boot_serial: Update cddl-gen version
oyvindronningstad Aug 2, 2021
ff55491
boot_serial: Reintroduce change from fc1ad8d
oyvindronningstad Aug 2, 2021
1e03343
boot: zephyr: Do not use `irq_lock()` if using arm cleanup
sigvartmh Aug 6, 2021
8b668c1
boot_serial: cbor_encode: Fix encoding data length
MarekPieta Aug 18, 2021
d465ab5
boot: zephyr: Fix misaligned #else for `irq_lock`
sigvartmh Aug 20, 2021
b549f67
zephyr/Kconfig: fix deadlock on cryptolib selectors
nvlsianpu Jul 23, 2021
70bfbd2
merge: synchronize up to 85da97f + cherry-pick upstream bugfixes for …
nvlsianpu Sep 14, 2021
9233aef
Preps for 1.8.0-rc2
d3zd3z Aug 27, 2021
1f51559
Merge tag 'v1.8.0-rc2' into zephyr-to-1.8
d3zd3z Oct 4, 2021
c615387
Merge pull request #60 from d3zd3z/zephyr-to-1.8
carlescufi Oct 6, 2021
2c19f9c
synchronize: up to 1a9c6d8495
nvlsianpu Nov 2, 2021
225b024
merge: synchronized with mcutool/mcuboot 1a9c6d8
nvlsianpu Nov 4, 2021
33906b4
Merge: synchronize up to mcu-tools/mcuboot/commit/caa1f6b
nvlsianpu Dec 10, 2021
399720d
Merge: synchronized up to 1eedec3e7936f74872aca43f3962246e7abe6439
nvlsianpu Dec 21, 2021
3f06d75
zephyr/boot_serial_extension: us BOOT_LOG instead of LOG_
nvlsianpu Jan 10, 2022
1c32a04
boot: serial: Adapt to Zephyr's new CRC APIs
carlescufi Feb 10, 2022
89936c3
Merge pull request #72 from nvlsianpu/fix/align_crc_api
carlescufi Feb 10, 2022
7b9e4ee
Merge pull request #73 from nvlsianpu/synch_07III2022
d3zd3z Mar 14, 2022
e86f575
Synch to upstream aa041a2
nvlsianpu Mar 29, 2022
2df4d57
boot: zephyr: Disable CONFIG_USB_DEVICE_REMOTE_WAKEUP
MarekPieta Mar 28, 2022
30889ae
zephyr/Kconfig: fix CONFIG_MCUBOOT_INDICATION_LED usage
nvlsianpu Apr 1, 2022
ccd490c
bootutil: zephyr: Fix not including tinycrypt path when needed
May 3, 2022
75958ec
boot: zephyr: add Kconfig for arm cortex-m that implements a cache
XenuIsWatching May 21, 2022
13296b0
bootutil: zephyr: Fix not linking with mbedtls when needed
May 3, 2022
e58ea98
Merge pull request #78 from nvlsianpu/fixes/for_zephyr_3.1.0-rc2
d3zd3z May 25, 2022
df6249a
espressif:esp32: Move app entry point call back to iram_loader_seg re…
almir-okato May 6, 2022
e7415b5
Merge pull request #79 from nvlsianpu/fixes/cherry-pick-pr1362
d3zd3z May 31, 2022
67cb024
Revert "zephyr/Kconfig: fix CONFIG_MCUBOOT_INDICATION_LED usage"
nvlsianpu Jun 22, 2022
25a3381
Synch up to upstream commit 1270880d2f
nvlsianpu Jun 28, 2022
3b79128
Synch up to upstream mcu-tools 7d2f0bf
nvlsianpu Jun 28, 2022
c216d34
Synch up to upstream mcu-tools 3175182
nvlsianpu Jul 27, 2022
1d44041
Synch up to upstream mcu-tools 8eadf8c
nvlsianpu Aug 1, 2022
9c73736
Synch up to upstream mcu-tools b03c098
nvlsianpu Aug 11, 2022
6e1a577
Merge branch 'mcu-tools:main' into main
galak Aug 12, 2022
21e56a1
Synch with upstream 02a3edd
nvlsianpu Aug 16, 2022
fec7042
Synch up to the mcu-tools/mcuboot rev 4030aac5944e5105f45bf
nvlsianpu Sep 9, 2022
dbe536a
Synch to mcu-tool/mcuboot 2fa1190
nvlsianpu Sep 16, 2022
2fcae1c
zephyr/sample.yaml Limit allowed build platforms
nvlsianpu Sep 16, 2022
13f6397
zephyr/Kconfig: fixed BOOT_WATCHDOG_FEED default value
nvlsianpu Sep 28, 2022
cfec947
synchronized up to the mcu-tool/mcuboot 4eca54f417
nvlsianpu Oct 7, 2022
89673f8
[nrf noup] ci: add downstream-only NCS customizations
thst-nordic Nov 23, 2018
f7de93f
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 12, 2018
d2c6668
[nrf noup] zephyr: Remove duplication from cmake
sigvartmh Mar 26, 2019
192dfe6
[nrf noup] boot: bootutil: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
7abea26
[nrf fromtree] boot: zephyr: remove thingy53_nrf5340_cpuapp.conf boar…
kapi-no Nov 14, 2022
625c84e
[nrf noup] boot: nrf53-specific customizations
sigvartmh Aug 27, 2020
0701661
[nrf noup] boot: add 'minimal' configuration files
mbolivar-nordic Sep 3, 2021
d1f2ef8
[nrf noup] boot: zephyr: add support for Thingy:91
bjda Sep 20, 2019
9dac8ad
[nrf noup] do_boot: clean peripherals state before boot
nvlsianpu Feb 27, 2020
8f299e8
[nrf noup] bootutil: loader: work-around for multi-image builds
sigvartmh Mar 30, 2021
3ab5fbb
[nrf noup] zephyr: Set at least provide EXT_API
Vge0rge Nov 8, 2021
c56439c
[nrf noup] boot: zephyr: remove CONFIG_DEBUG=y in prj.conf
tejlmand Nov 27, 2020
542f51f
[nrf noup] boot: zephyr: Enable zeroize ALT func
Vge0rge Feb 3, 2022
dbcdfae
[nrf noup] Restore default RTC user channel count
Damian-Nordic Mar 21, 2022
bf04817
[nrf noup] boot: zephyr: Align serial recovery config on Thingy:91
MarekPieta Sep 13, 2022
96fe9dd
[nrf fromtree] ext/nrf/cc310_glue.h: Update Zephyr include path
anangl Sep 30, 2022
11c5149
[nrf fromlist] boot_serial: Add unaligned stack buffer writing
nordicjm Nov 30, 2022
db3da7f
[nrf fromlist] boot_serial: Allow using a buffer larger than 512 bytes
nordicjm Dec 1, 2022
78fd7ff
[nrf fromlist] boot_serial: Fix rc not being returned as a signed value
nordicjm Dec 2, 2022
20f8d86
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 8, 2022
7a3357e
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 13, 2022
34b3ac7
[nrf noup] boot: zephyr: Skip updating sec counters for MCUBOOT
SebastianBoe Dec 13, 2022
191a946
[nrf noup] treewide: Fix old Nordic license ID
doki-nordic Dec 15, 2022
9d2f9b5
[nrf fromlist] zephyr: Missing header and definitions in boot_serial
de-nordic Dec 19, 2022
4f775a8
[nrf noup] treewide: Update comment to not mention SPM
joerchan Dec 13, 2022
7147aff
fix: boot_set_confirmed_multi() ignores set/confirm command if "unset"
Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Backport
on:
pull_request:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-18.04
name: Backport
steps:
- name: Backport Bot
uses: Gaurav0/[email protected]
with:
bot_username: NordicBuilder
bot_token: 151a9b45052f9ee8be5a59963d31ad7b92c3ecb5
bot_token_key: 67bb1f1f998d546859786a4088917c65415c0ebd
github_token: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# All these sections are optional, edit this file as you like.
[general]
ignore=title-trailing-punctuation, T3, title-max-length, T1, body-hard-tab, B3, B1
# verbosity should be a value between 1 and 3, the commandline -v flags take precedence over this
verbosity = 3
# By default gitlint will ignore merge commits. Set to 'false' to disable.
ignore-merge-commits=true
# Enable debug mode (prints more output). Disabled by default
debug = false

# Set the extra-path where gitlint will search for user defined rules
# See http://jorisroovers.github.io/gitlint/user_defined_rules for details
extra-path=../../zephyr/scripts/gitlint

[title-max-length-no-revert]
line-length=72

[body-min-line-count]
min-line-count=1

[body-max-line-count]
max-line-count=200

[title-starts-with-subsystem]
regex = ^(?!subsys:)(([^:]+):)(\s([^:]+):)*\s(.+)$

[title-must-not-contain-word]
# Comma-separated list of words that should not occur in the title. Matching is case
# insensitive. It's fine if the keyword occurs as part of a larger word (so "WIPING"
# will not cause a violation, but "WIP: my title" will.
words=wip

[title-match-regex]
# python like regex (https://docs.python.org/2/library/re.html) that the
# commit-msg title must be matched to.
# Note that the regex can contradict with other rules if not used correctly
# (e.g. title-must-not-contain-word).
#regex=^US[0-9]*

[max-line-length-with-exceptions]
# B1 = body-max-line-length
line-length=72

[body-min-length]
min-length=3

[body-is-missing]
# Whether to ignore this rule on merge commits (which typically only have a title)
# default = True
ignore-merge-commits=false

[body-changed-file-mention]
# List of files that need to be explicitly mentioned in the body when they are changed
# This is useful for when developers often erroneously edit certain files or git submodules.
# By specifying this rule, developers can only change the file when they explicitly reference
# it in the commit message.
#files=gitlint/rules.py,README.md
6 changes: 6 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@Library("CI_LIB") _

def pipeline = new ncs.sdk_mcuboot.Main()

pipeline.run(JOB_NAME)

44 changes: 39 additions & 5 deletions boot/boot_serial/src/boot_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@

BOOT_LOG_MODULE_DECLARE(mcuboot);

#define BOOT_SERIAL_INPUT_MAX 512
#ifndef MCUBOOT_SERIAL_MAX_RECEIVE_SIZE
#define MCUBOOT_SERIAL_MAX_RECEIVE_SIZE 512
#endif

#define BOOT_SERIAL_OUT_MAX (128 * BOOT_IMAGE_NUMBER)

#ifdef __ZEPHYR__
Expand Down Expand Up @@ -107,8 +110,8 @@ BOOT_LOG_MODULE_DECLARE(mcuboot);
#define IMAGES_ITER(x)
#endif

static char in_buf[BOOT_SERIAL_INPUT_MAX + 1];
static char dec_buf[BOOT_SERIAL_INPUT_MAX + 1];
static char in_buf[MCUBOOT_SERIAL_MAX_RECEIVE_SIZE + 1];
static char dec_buf[MCUBOOT_SERIAL_MAX_RECEIVE_SIZE + 1];
const struct boot_uart_funcs *boot_uf;
static struct nmgr_hdr *bs_hdr;
static bool bs_entry;
Expand Down Expand Up @@ -508,7 +511,38 @@ bs_upload(char *buf, int len)

BOOT_LOG_INF("Writing at 0x%x until 0x%x", curr_off, curr_off + img_chunk_len);
/* Write flash aligned chunk, note that img_chunk_len now holds aligned length */
#if defined(MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE) && MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE > 0
if (flash_area_align(fap) > 1 &&
(((size_t)img_chunk) & (flash_area_align(fap) - 1)) != 0) {
/* Buffer address incompatible with write address, use buffer to write */
uint8_t write_size = MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE;
uint8_t wbs_aligned[MCUBOOT_SERIAL_UNALIGNED_BUFFER_SIZE];

while (img_chunk_len >= flash_area_align(fap)) {
if (write_size > img_chunk_len) {
write_size = img_chunk_len;
}

memset(wbs_aligned, flash_area_erased_val(fap), sizeof(wbs_aligned));
memcpy(wbs_aligned, img_chunk, write_size);

rc = flash_area_write(fap, curr_off, wbs_aligned, write_size);

if (rc != 0) {
break;
}

curr_off += write_size;
img_chunk += write_size;
img_chunk_len -= write_size;
}
} else {
rc = flash_area_write(fap, curr_off, img_chunk, img_chunk_len);
}
#else
rc = flash_area_write(fap, curr_off, img_chunk, img_chunk_len);
#endif

if (rc == 0 && rem_bytes) {
/* Non-zero rem_bytes means that last chunk needs alignment; the aligned
* part, in the img_chunk_len - rem_bytes count bytes, has already been
Expand Down Expand Up @@ -552,7 +586,7 @@ bs_upload(char *buf, int len)
BOOT_LOG_INF("RX: 0x%x", rc);
zcbor_map_start_encode(cbor_state, 10);
zcbor_tstr_put_lit_cast(cbor_state, "rc");
zcbor_uint32_put(cbor_state, rc);
zcbor_int32_put(cbor_state, rc);
if (rc == 0) {
zcbor_tstr_put_lit_cast(cbor_state, "off");
zcbor_uint32_put(cbor_state, curr_off);
Expand All @@ -578,7 +612,7 @@ bs_rc_rsp(int rc_code)
{
zcbor_map_start_encode(cbor_state, 10);
zcbor_tstr_put_lit_cast(cbor_state, "rc");
zcbor_uint32_put(cbor_state, rc_code);
zcbor_int32_put(cbor_state, rc_code);
zcbor_map_end_encode(cbor_state, 10);
boot_serial_output();
}
Expand Down
43 changes: 43 additions & 0 deletions boot/bootutil/include/bootutil/crypto/ecdsa_p256.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#if (defined(MCUBOOT_USE_TINYCRYPT) + \
defined(MCUBOOT_USE_CC310) + \
defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO) + \
defined(MCUBOOT_USE_MBED_TLS)) != 1
#error "One crypto backend must be defined: either CC310, TINYCRYPT, or MBED_TLS"
#endif
Expand All @@ -35,6 +36,11 @@
#define BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE (4 * 8)
#endif

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)
#include <bl_crypto.h>
#define BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE (4 * 8)
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -158,6 +164,43 @@ static inline int bootutil_ecdsa_p256_verify(bootutil_ecdsa_p256_context *ctx,
}
#endif /* MCUBOOT_USE_MBED_TLS */

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)
typedef uintptr_t bootutil_ecdsa_p256_context;

static inline void bootutil_ecdsa_p256_init(bootutil_ecdsa_p256_context *ctx)
{
(void)ctx;
}

static inline void bootutil_ecdsa_p256_drop(bootutil_ecdsa_p256_context *ctx)
{
(void)ctx;
}

static inline int bootutil_ecdsa_p256_verify(bootutil_ecdsa_p256_context *ctx,
uint8_t *pk, size_t pk_len,
uint8_t *hash,
uint8_t *sig, size_t sig_len)
{
(void)ctx;
(void)pk_len;
(void)sig_len;

/* As described on the compact representation in IETF protocols,
* the first byte of the key defines if the ECC points are
* compressed (0x2 or 0x3) or uncompressed (0x4).
* We only support uncompressed keys.
*/
if (pk[0] != 0x04)
return -1;

pk++;

return bl_secp256r1_validate(hash, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE,
pk, sig);
}
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
}
#endif
Expand Down
32 changes: 32 additions & 0 deletions boot/bootutil/include/bootutil/crypto/sha256.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#if (defined(MCUBOOT_USE_MBED_TLS) + \
defined(MCUBOOT_USE_TINYCRYPT) + \
defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO) + \
defined(MCUBOOT_USE_CC310)) != 1
#error "One crypto backend must be defined: either CC310, MBED_TLS or TINYCRYPT"
#endif
Expand Down Expand Up @@ -139,6 +140,37 @@ static inline int bootutil_sha256_finish(bootutil_sha256_context *ctx,
}
#endif /* MCUBOOT_USE_CC310 */

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)

#include <bl_crypto.h>

typedef bl_sha256_ctx_t bootutil_sha256_context;

static inline void bootutil_sha256_init(bootutil_sha256_context *ctx)
{
bl_sha256_init(ctx);
}

static inline void bootutil_sha256_drop(bootutil_sha256_context *ctx)
{
(void)ctx;
}

static inline int bootutil_sha256_update(bootutil_sha256_context *ctx,
const void *data,
uint32_t data_len)
{
return bl_sha256_update(ctx, data, data_len);
}

static inline int bootutil_sha256_finish(bootutil_sha256_context *ctx,
uint8_t *output)
{
bl_sha256_finalize(ctx, output);
return 0;
}
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions boot/bootutil/src/bootutil_public.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ boot_set_confirmed_multi(int image_index)
break;

case BOOT_MAGIC_UNSET:
/* Already confirmed. */
goto done;
/* Confirm needed; proceed. */
break;

case BOOT_MAGIC_BAD:
/* Unexpected state. */
Expand Down
5 changes: 4 additions & 1 deletion boot/bootutil/src/image_ec256.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
#if defined(MCUBOOT_USE_CC310) || defined(MCUBOOT_USE_MBED_TLS)
#define NUM_ECC_BYTES (256 / 8)
#endif
#ifdef MCUBOOT_USE_NRF_EXTERNAL_CRYPTO
#define NUM_ECC_BYTES (256 / 8)
#endif
#if defined(MCUBOOT_USE_TINYCRYPT) || defined(MCUBOOT_USE_CC310) || \
defined(MCUBOOT_USE_MBED_TLS)
defined(MCUBOOT_USE_MBED_TLS) || defined (MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)
#include "bootutil/sign_key.h"

#include "mbedtls/oid.h"
Expand Down
Loading