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

ASN.1 Decoding bypass that allows to reduce size of flash when ED25519 is used #347

Open
wants to merge 239 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
239 commits
Select commit Hold shift + click to select a range
195145b
[nrf noup] github: Add a commit tags check workflow
carlescufi Oct 10, 2023
312ba86
[nrf noup] zephyr: Remove duplication from cmake
sigvartmh Mar 26, 2019
cd1c995
[nrf noup] zephyr: add 'minimal' configuration files
mbolivar-nordic Sep 3, 2021
a53f78d
[nrf noup] boards: add support for Thingy:91
bjda Sep 20, 2019
0faa8b2
[nrf noup] boot: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
a42e9cc
[nrf noup] crypto: ecdsa: Add required signature decoding
de-nordic Apr 21, 2023
895c76b
[nrf noup] crypto: ecdsa: Fix shared crypto MCUBoot EXT_ABI
sigvartmh Oct 10, 2023
ff53382
[nrf noup] zephyr: Set at least provide EXT_API
Vge0rge Nov 8, 2021
cffdc52
[nrf noup] zephyr: Restore default RTC user channel count
Damian-Nordic Mar 21, 2022
916a9dc
[nrf noup] boards: thingy91x: add board config
maxd-nordic Dec 8, 2023
9555ca7
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 12, 2018
cab8ef9
[nrf noup] boot: nrf53-specific customizations
sigvartmh Aug 27, 2020
c033da0
[nrf noup] zephyr: clean peripherals state before boot
nvlsianpu Feb 27, 2020
cc6103b
[nrf noup] zephyr: Clean up non-secure RAM if enabled
sigvartmh Jan 6, 2023
a3d0772
[nrf noup] loader: Fix reading reset addr to support ext flash
chrta Feb 10, 2022
6f1ba91
[nrf noup] zephyr: Fix path variables
nordicjm Jul 11, 2023
5fe56c9
[nrf noup] loader: Do not check reset vector for XIP image
de-nordic Sep 22, 2023
33effae
[nrf noup] zephyr: Add RAM flash configuration to cache for sysbuild
nordicjm Sep 18, 2023
62b5dc1
[nrf noup] zephyr: Boot even if EXT_ABI is not provided
sigvartmh Oct 17, 2023
b045778
[nrf noup] loader: Add firmware version check downgrade prevention
sigvartmh Sep 27, 2023
7377421
[nrf noup] boards: thingy53: disable GPIO ISR support
nika-nordic Oct 9, 2023
0fcc1f8
[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg
nvlsianpu Apr 11, 2024
843ee8e
[nrf noup] loader: work-around for multi-image builds
sigvartmh Mar 30, 2021
f15d384
[nrf noup] loader: Fix missing PCD define check
nordicjm Aug 31, 2023
ce42cac
[nrf noup] boot: Add support for NSIB and multi-image
sigvartmh May 31, 2023
6cecb1c
[nrf noup] sysflash: Move partition manager definitions to pm_sysflash.h
de-nordic Aug 10, 2023
d2d11bf
[nrf noup] sysflash: Add support for three images
de-nordic Aug 11, 2023
ee67c04
[nrf noup] loader: introduced cleanup of unusable secondary slot
nvlsianpu Feb 15, 2024
ec59c38
[nrf noup] boards: nrf54l15: Disable FPROTECT
gchwier Apr 16, 2024
3853d26
[nrf noup] loader: remove cleanup for direct xip mode
gchwier May 17, 2024
b305c3d
[nrf noup] zephyr: Clean up non-secure RAM if enabled
de-nordic Apr 19, 2024
826a407
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition
nvlsianpu Apr 15, 2024
0656a67
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update
nvlsianpu May 20, 2024
152f641
[nrf noup] boards: thingy91x: enable serial recovery
maxd-nordic Mar 12, 2024
f0a0c50
[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANNER is used
rlubos May 17, 2024
f3ae1af
[nrf noup] boot/zephyr: fix fw_info search
nvlsianpu May 27, 2024
0f317a2
[nrf noup] Revert of zephyr: arm: Update reading the flash image rese…
de-nordic May 28, 2024
cc42516
[nrf noup] zephyr: disabled EXT_API_ATLEAST_OPTIONAL
nvlsianpu Jun 3, 2024
4f84ba9
[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay
nvlsianpu Jun 5, 2024
d639f90
[nrf noup] boot: zephyr: Add NCS boot banner
nordicjm Jun 11, 2024
d9fe011
[nrf noup] boot/../loader: skip downgrade prevention for s1/s0
nvlsianpu Jun 13, 2024
daf2946
[nrf noup] boot/../loader: reboot after updating s0/s1
nvlsianpu Jun 18, 2024
e66169a
[nrf noup] Remove secure boot debug Kconfig
nordicjm Sep 4, 2024
5db1981
[nrf noup] bootutil: loader: Fix netcore address checking
nordicjm Aug 29, 2024
9ac6f76
[nrf fromtree] boot: zephyr: boards: Add nrf54l15dk configuration
nvlsianpu Sep 16, 2024
f30dce1
[nrf noup] boards: nrf54l15dk: Disable FPROTECT
nvlsianpu Sep 18, 2024
0c07689
[nrf fromtree] bootutil: loader: Add state to boot_is_header_valid() …
nordicjm Aug 22, 2024
4e81dcd
[nrf fromtree] bootutil: loader: Verify image header before checking …
nordicjm Aug 22, 2024
4e74426
[nrf fromtree] docs: release-notes: Add note on bootutil changes
nordicjm Aug 22, 2024
da14989
[nrf fromtree] bootutil: Add compressed image flags and TLV
nordicjm Jul 31, 2024
53722da
[nrf fromtree] zephyr: Add Kconfig for decompression
nordicjm Aug 23, 2024
16e15ce
[nrf fromtree] bootutil: loader: Remove encrypted/compressed images w…
nordicjm Aug 23, 2024
cd557e1
[nrf fromtree] bootutil: loader: Remove images with conflicting flags
nordicjm Aug 23, 2024
7d67371
[nrf fromtree] bootutil: loader: Add protected TLV size to image size…
nordicjm Aug 23, 2024
21bac2b
[nrf fromtree] booutil: swap_scratch: Do not check sectors with compr…
nordicjm Aug 23, 2024
5eaeac3
[nrf fromtree] docs: release-notes: Add note on changes
nordicjm Aug 23, 2024
92121b1
[nrf noup] zephyr: Add support for compressed image updates
nordicjm Aug 22, 2024
c92b293
Revert "[nrf noup] crypto: ecdsa: Fix shared crypto MCUBoot EXT_ABI"
de-nordic Sep 25, 2024
3f541bf
Revert "[nrf noup] crypto: ecdsa: Add required signature decoding"
de-nordic Sep 25, 2024
2b1a6a4
Revert "[nrf noup] zephyr: disabled EXT_API_ATLEAST_OPTIONAL"
de-nordic Sep 26, 2024
48bf175
Revert "[nrf noup] zephyr: Set at least provide EXT_API"
de-nordic Sep 26, 2024
0cdbc88
Revert "[nrf noup] boot: Add shared crypto for ECDSA and SHA"
de-nordic Sep 26, 2024
2d66e66
[nrf fromtree] boot: SHA512 verification
michalek-no May 20, 2024
c2ff45b
[nrf noup] boot: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
5e33dac
[nrf fromtree] imgtool: Fix verify command for edcsa-p384 signed images
rustammendel Nov 27, 2023
300c41c
[nrf fromtree] imgtool: Add --non-bootable flag
mateusz- Feb 26, 2024
7aaeb63
[nrf fromlist] imgtool: Add support for calculating SHA512
de-nordic Aug 22, 2024
647a928
[nrf fromtree] boot: Fix ASN.1 for mbedtls >= 3.1
d3zd3z Jun 27, 2024
3a8716b
[nrf fromtree] bootutil: Keep image encrypted in scratch area
taltenbach Apr 25, 2024
eb5042b
[nrf fromtree] boot: Remove pointless slot identification
de-nordic Jul 12, 2024
dd38c00
[nrf fromtree] boot: Rename boot_enc_decrypt to boot_decrypt_key
de-nordic Jul 12, 2024
8d04aa0
[nrf fromtree] boot: Move encryption context invalidation to boot_enc…
de-nordic Jul 17, 2024
852f9af
[nrf fromtree] boot: Change boot_enc_load to take slot number instead…
de-nordic Jul 12, 2024
c77f411
[nrf fromtree] boot: Reduce repeating code in boot_decrypt_and_copy_i…
de-nordic Jul 18, 2024
a923568
[nrf fromtree] Fix style issues
utzig Jul 15, 2024
8b0d958
[nrf fromtree] boot: Remove image_index from boot_encrypt
de-nordic Jul 17, 2024
c04fb82
[nrf fromtree] boot: Simplify copy loop in boot_copy_region
de-nordic Jul 18, 2024
3d1c64b
[nrf fromtree] boot: Make boot_enc_valid take slot instead of image i…
de-nordic Jul 12, 2024
b1b4ec3
[nrf fromlist] boot: Replace boot_encrypt by boot_enc_encrypt and boo…
de-nordic Jul 18, 2024
be3637e
[nrf noup] PSA configuration required changes
de-nordic Jul 24, 2024
5f95fec
[nrf noup] PSA implementation of x25519 and ed25519 verification
de-nordic May 29, 2024
5721744
[nrf noup] Exclude PSA source on non-PSA crypto configuration
de-nordic Oct 1, 2024
273c106
[nrf noup] bootutil: Provide support for SHA512 with ED25519
de-nordic Aug 2, 2024
e1591c0
[nrf noup] bootutil: Enable hash calculation directly on storage
de-nordic Sep 5, 2024
de524e9
[nrf noup] bootutil: PureEdDSA using ED25519
de-nordic Sep 6, 2024
f79e6db
[nrf noup] There is only one SHA supported at once
de-nordic Oct 2, 2024
763edd6
[nrf noup] bootutil: Fix typo in identifier
de-nordic Oct 2, 2024
4927e39
[nrf fromlist] scripts: imgtool: compression
michalek-no Aug 9, 2024
3909498
[nrf noup] boot: zephyr: kconfig: Select PM_USE_CONFIG_SRAM_SIZE when…
nordicjm Oct 2, 2024
9101a24
[nrf noup] Add missing selection of MBEDTLS_PSA_CRYPTO_C
de-nordic Oct 1, 2024
112b13c
Revert "[nrf noup] Add missing selection of MBEDTLS_PSA_CRYPTO_C"
bjarki-andreasen Oct 4, 2024
ecba253
Revert "[nrf noup] boot: zephyr: kconfig: Select PM_USE_CONFIG_SRAM_S…
bjarki-andreasen Oct 4, 2024
d406289
Revert "[nrf fromlist] scripts: imgtool: compression"
bjarki-andreasen Oct 4, 2024
6309d08
Revert "[nrf noup] bootutil: Fix typo in identifier"
bjarki-andreasen Oct 4, 2024
b9ac2e0
Revert "[nrf noup] There is only one SHA supported at once"
bjarki-andreasen Oct 4, 2024
821fa3e
Revert "[nrf noup] bootutil: PureEdDSA using ED25519"
bjarki-andreasen Oct 4, 2024
979469c
Revert "[nrf noup] bootutil: Enable hash calculation directly on stor…
bjarki-andreasen Oct 4, 2024
5ed9f8a
Revert "[nrf noup] bootutil: Provide support for SHA512 with ED25519"
bjarki-andreasen Oct 4, 2024
161a140
Revert "[nrf noup] Exclude PSA source on non-PSA crypto configuration"
bjarki-andreasen Oct 4, 2024
54397f6
Revert "[nrf noup] PSA implementation of x25519 and ed25519 verificat…
bjarki-andreasen Oct 4, 2024
65979ce
Revert "[nrf noup] PSA configuration required changes"
bjarki-andreasen Oct 4, 2024
fa52384
Revert "[nrf fromlist] boot: Replace boot_encrypt by boot_enc_encrypt…
bjarki-andreasen Oct 4, 2024
ab0e70c
Revert "[nrf fromtree] boot: Make boot_enc_valid take slot instead of…
bjarki-andreasen Oct 4, 2024
302b002
Revert "[nrf fromtree] boot: Simplify copy loop in boot_copy_region"
bjarki-andreasen Oct 4, 2024
7e2f568
Revert "[nrf fromtree] boot: Remove image_index from boot_encrypt"
bjarki-andreasen Oct 4, 2024
8d87b78
Revert "[nrf fromtree] Fix style issues"
bjarki-andreasen Oct 4, 2024
98f83a1
Revert "[nrf fromtree] boot: Reduce repeating code in boot_decrypt_an…
bjarki-andreasen Oct 4, 2024
499864b
Revert "[nrf fromtree] boot: Change boot_enc_load to take slot number…
bjarki-andreasen Oct 4, 2024
d2e060b
Revert "[nrf fromtree] boot: Move encryption context invalidation to …
bjarki-andreasen Oct 4, 2024
9553f40
Revert "[nrf fromtree] boot: Rename boot_enc_decrypt to boot_decrypt_…
bjarki-andreasen Oct 4, 2024
30e5e62
Revert "[nrf fromtree] boot: Remove pointless slot identification"
bjarki-andreasen Oct 4, 2024
69a1d52
Revert "[nrf fromtree] bootutil: Keep image encrypted in scratch area"
bjarki-andreasen Oct 4, 2024
174d00b
Revert "[nrf fromtree] boot: Fix ASN.1 for mbedtls >= 3.1"
bjarki-andreasen Oct 4, 2024
520a6c6
Revert "[nrf fromlist] imgtool: Add support for calculating SHA512"
bjarki-andreasen Oct 4, 2024
ae6870f
Revert "[nrf fromtree] imgtool: Add --non-bootable flag"
bjarki-andreasen Oct 4, 2024
ffa22ae
Revert "[nrf fromtree] imgtool: Fix verify command for edcsa-p384 sig…
bjarki-andreasen Oct 4, 2024
c2b6231
Revert "[nrf noup] boot: Add shared crypto for ECDSA and SHA"
bjarki-andreasen Oct 4, 2024
7308a08
Revert "[nrf fromtree] boot: SHA512 verification"
bjarki-andreasen Oct 4, 2024
031671d
Revert "[nrf noup] zephyr: Add support for compressed image updates"
bjarki-andreasen Oct 4, 2024
8682273
Revert "[nrf fromtree] docs: release-notes: Add note on changes"
bjarki-andreasen Oct 4, 2024
2144256
Revert "[nrf fromtree] booutil: swap_scratch: Do not check sectors wi…
bjarki-andreasen Oct 4, 2024
f30510b
Revert "[nrf fromtree] bootutil: loader: Add protected TLV size to im…
bjarki-andreasen Oct 4, 2024
4b1c47d
Revert "[nrf fromtree] bootutil: loader: Remove images with conflicti…
bjarki-andreasen Oct 4, 2024
a9d9b88
Revert "[nrf fromtree] bootutil: loader: Remove encrypted/compressed …
bjarki-andreasen Oct 4, 2024
89db1d5
Revert "[nrf fromtree] zephyr: Add Kconfig for decompression"
bjarki-andreasen Oct 4, 2024
ded8b9c
Revert "[nrf fromtree] bootutil: Add compressed image flags and TLV"
bjarki-andreasen Oct 4, 2024
b6c79e1
Revert "[nrf fromtree] docs: release-notes: Add note on bootutil chan…
bjarki-andreasen Oct 4, 2024
9e0a3d5
Revert "[nrf fromtree] bootutil: loader: Verify image header before c…
bjarki-andreasen Oct 4, 2024
df974c8
Revert "[nrf fromtree] bootutil: loader: Add state to boot_is_header_…
bjarki-andreasen Oct 4, 2024
c414806
Revert "[nrf noup] boards: nrf54l15dk: Disable FPROTECT"
bjarki-andreasen Oct 4, 2024
5998c07
Revert "[nrf fromtree] boot: zephyr: boards: Add nrf54l15dk configura…
bjarki-andreasen Oct 4, 2024
92ae47f
Revert "[nrf noup] bootutil: loader: Fix netcore address checking"
bjarki-andreasen Oct 4, 2024
8166a7c
Revert "[nrf noup] Remove secure boot debug Kconfig"
bjarki-andreasen Oct 4, 2024
efc3998
Revert "[nrf noup] boot/../loader: reboot after updating s0/s1"
bjarki-andreasen Oct 4, 2024
8cc9b03
Revert "[nrf noup] boot/../loader: skip downgrade prevention for s1/s0"
bjarki-andreasen Oct 4, 2024
ab42bfc
Revert "[nrf noup] boot: zephyr: Add NCS boot banner"
bjarki-andreasen Oct 4, 2024
c44b097
Revert "[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay"
bjarki-andreasen Oct 4, 2024
c52da26
Revert "[nrf noup] Revert of zephyr: arm: Update reading the flash im…
bjarki-andreasen Oct 4, 2024
27de2af
Revert "[nrf noup] boot/zephyr: fix fw_info search"
bjarki-andreasen Oct 4, 2024
2fb1126
Revert "[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANN…
bjarki-andreasen Oct 4, 2024
0a3f530
Revert "[nrf noup] boards: thingy91x: enable serial recovery"
bjarki-andreasen Oct 4, 2024
120c32c
Revert "[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update"
bjarki-andreasen Oct 4, 2024
a419c13
Revert "[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition"
bjarki-andreasen Oct 4, 2024
7e23c7c
Revert "[nrf noup] zephyr: Clean up non-secure RAM if enabled"
bjarki-andreasen Oct 4, 2024
fd15c7d
Revert "[nrf noup] loader: remove cleanup for direct xip mode"
bjarki-andreasen Oct 4, 2024
c8b99ac
Revert "[nrf noup] boards: nrf54l15: Disable FPROTECT"
bjarki-andreasen Oct 4, 2024
52152fd
Revert "[nrf noup] loader: introduced cleanup of unusable secondary s…
bjarki-andreasen Oct 4, 2024
414b7f9
Revert "[nrf noup] sysflash: Add support for three images"
bjarki-andreasen Oct 4, 2024
e648319
Revert "[nrf noup] sysflash: Move partition manager definitions to pm…
bjarki-andreasen Oct 4, 2024
5161b82
Revert "[nrf noup] boot: Add support for NSIB and multi-image"
bjarki-andreasen Oct 4, 2024
dab516b
Revert "[nrf noup] loader: Fix missing PCD define check"
bjarki-andreasen Oct 4, 2024
adc5521
Revert "[nrf noup] loader: work-around for multi-image builds"
bjarki-andreasen Oct 4, 2024
7ca5e89
Revert "[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg"
bjarki-andreasen Oct 4, 2024
5d709c9
Revert "[nrf noup] boards: thingy53: disable GPIO ISR support"
bjarki-andreasen Oct 4, 2024
298973d
Revert "[nrf noup] loader: Add firmware version check downgrade preve…
bjarki-andreasen Oct 4, 2024
ad45a1c
Revert "[nrf noup] zephyr: Boot even if EXT_ABI is not provided"
bjarki-andreasen Oct 4, 2024
9c3aaa2
Revert "[nrf noup] zephyr: Add RAM flash configuration to cache for s…
bjarki-andreasen Oct 4, 2024
aef3d0a
Revert "[nrf noup] loader: Do not check reset vector for XIP image"
bjarki-andreasen Oct 4, 2024
1d60ea2
Revert "[nrf noup] zephyr: Fix path variables"
bjarki-andreasen Oct 4, 2024
1e6838c
Revert "[nrf noup] loader: Fix reading reset addr to support ext flash"
bjarki-andreasen Oct 4, 2024
984cacc
Revert "[nrf noup] zephyr: Clean up non-secure RAM if enabled"
bjarki-andreasen Oct 4, 2024
a02c59d
Revert "[nrf noup] zephyr: clean peripherals state before boot"
bjarki-andreasen Oct 4, 2024
a8b9934
Revert "[nrf noup] boot: nrf53-specific customizations"
bjarki-andreasen Oct 4, 2024
9b95757
Revert "[nrf noup] treewide: add NCS partition manager support"
bjarki-andreasen Oct 4, 2024
bfe238c
Revert "[nrf noup] boards: thingy91x: add board config"
bjarki-andreasen Oct 4, 2024
dd75051
Revert "[nrf noup] zephyr: Restore default RTC user channel count"
bjarki-andreasen Oct 4, 2024
7ea58be
Revert "[nrf noup] boards: add support for Thingy:91"
bjarki-andreasen Oct 4, 2024
ae0e3ea
Revert "[nrf noup] zephyr: add 'minimal' configuration files"
bjarki-andreasen Oct 4, 2024
28859c1
Revert "[nrf noup] zephyr: Remove duplication from cmake"
bjarki-andreasen Oct 4, 2024
a539a78
Revert "[nrf noup] github: Add a commit tags check workflow"
bjarki-andreasen Oct 4, 2024
ae23763
[nrf mergeup] Merge upstream up to commit 84b56b61118a1140e1afcb8802e…
bjarki-andreasen Oct 4, 2024
00f5860
[nrf noup] github: Add a commit tags check workflow
carlescufi Oct 10, 2023
6bc65a9
[nrf noup] zephyr: Remove duplication from cmake
sigvartmh Mar 26, 2019
bee9475
[nrf noup] zephyr: add 'minimal' configuration files
mbolivar-nordic Sep 3, 2021
49e2872
[nrf noup] boards: add support for Thingy:91
bjda Sep 20, 2019
93bb567
[nrf noup] zephyr: Restore default RTC user channel count
Damian-Nordic Mar 21, 2022
c473f8e
[nrf noup] boards: thingy91x: add board config
maxd-nordic Dec 8, 2023
6facec9
[nrf noup] treewide: add NCS partition manager support
SebastianBoe Dec 12, 2018
56934f9
[nrf noup] boot: nrf53-specific customizations
sigvartmh Aug 27, 2020
50c5cdb
[nrf noup] zephyr: clean peripherals state before boot
nvlsianpu Feb 27, 2020
d04dd27
[nrf noup] zephyr: Clean up non-secure RAM if enabled
sigvartmh Jan 6, 2023
a3a50e7
[nrf noup] loader: Fix reading reset addr to support ext flash
chrta Feb 10, 2022
76d0d9a
[nrf noup] zephyr: Fix path variables
nordicjm Jul 11, 2023
5a8e708
[nrf noup] loader: Do not check reset vector for XIP image
de-nordic Sep 22, 2023
9599724
[nrf noup] zephyr: Add RAM flash configuration to cache for sysbuild
nordicjm Sep 18, 2023
5b37400
[nrf noup] zephyr: Boot even if EXT_ABI is not provided
sigvartmh Oct 17, 2023
2011395
[nrf noup] loader: Add firmware version check downgrade prevention
sigvartmh Sep 27, 2023
39bbebf
[nrf noup] boards: thingy53: disable GPIO ISR support
nika-nordic Oct 9, 2023
6f3eb68
[nrf noup] boot/zephyr/boards: nRF54l15pdk ext flash cfg
nvlsianpu Apr 11, 2024
6f9c198
[nrf noup] loader: work-around for multi-image builds
sigvartmh Mar 30, 2021
dced866
[nrf noup] loader: Fix missing PCD define check
nordicjm Aug 31, 2023
a7cea4e
[nrf noup] boot: Add support for NSIB and multi-image
sigvartmh May 31, 2023
fbe4075
[nrf noup] sysflash: Move partition manager definitions to pm_sysflash.h
de-nordic Aug 10, 2023
e80e793
[nrf noup] sysflash: Add support for three images
de-nordic Aug 11, 2023
51e36d8
[nrf noup] loader: introduced cleanup of unusable secondary slot
nvlsianpu Feb 15, 2024
592a0f1
[nrf noup] boards: nrf54l15: Disable FPROTECT
gchwier Apr 16, 2024
948c3ad
[nrf noup] loader: remove cleanup for direct xip mode
gchwier May 17, 2024
a3545cd
[nrf noup] zephyr: Clean up non-secure RAM if enabled
de-nordic Apr 19, 2024
1347dfb
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash partition
nvlsianpu Apr 15, 2024
8b7d37f
[nrf noup] boot/zephyr/boards: nrf54l15pdk ext-flash update
nvlsianpu May 20, 2024
6b95cd6
[nrf noup] boards: thingy91x: enable serial recovery
maxd-nordic Mar 12, 2024
220096b
[nrf noup] boot: zephyr: Disable boot banner if NCS_BOOT_BANNER is used
rlubos May 17, 2024
592f636
[nrf noup] boot/zephyr: fix fw_info search
nvlsianpu May 27, 2024
ad75809
[nrf noup] Revert of zephyr: arm: Update reading the flash image rese…
de-nordic May 28, 2024
48e6e27
[nrf noup] zephyr/boards: fix nrf54l15pdk ext flash dts overlay
nvlsianpu Jun 5, 2024
0148f96
[nrf noup] boot: zephyr: Add NCS boot banner
nordicjm Jun 11, 2024
cc78118
[nrf noup] boot/../loader: skip downgrade prevention for s1/s0
nvlsianpu Jun 13, 2024
29fdb63
[nrf noup] boot/../loader: reboot after updating s0/s1
nvlsianpu Jun 18, 2024
28fdae8
[nrf noup] Remove secure boot debug Kconfig
nordicjm Sep 4, 2024
fcf0a31
[nrf noup] bootutil: loader: Fix netcore address checking
nordicjm Aug 29, 2024
123454f
[nrf noup] boards: nrf54l15dk: Disable FPROTECT
nvlsianpu Sep 18, 2024
a242e91
[nrf noup] zephyr: Add support for compressed image updates
nordicjm Aug 22, 2024
756c5bf
[nrf fromtree] boot: SHA512 verification
michalek-no May 20, 2024
4e0dee6
[nrf noup] boot: Add shared crypto for ECDSA and SHA
sigvartmh Feb 14, 2019
3a28585
[nrf fromlist] imgtool: Add support for calculating SHA512
de-nordic Aug 22, 2024
18781c5
[nrf fromlist] boot: Replace boot_encrypt by boot_enc_encrypt and boo…
de-nordic Jul 18, 2024
6400cc8
[nrf noup] PSA configuration required changes
de-nordic Jul 24, 2024
e874cf8
[nrf noup] PSA implementation of x25519 and ed25519 verification
de-nordic May 29, 2024
2d7b4a6
[nrf noup] Exclude PSA source on non-PSA crypto configuration
de-nordic Oct 1, 2024
ccb9552
[nrf noup] bootutil: Provide support for SHA512 with ED25519
de-nordic Aug 2, 2024
258b369
[nrf noup] bootutil: Enable hash calculation directly on storage
de-nordic Sep 5, 2024
d1b85af
[nrf noup] bootutil: PureEdDSA using ED25519
de-nordic Sep 6, 2024
910045d
[nrf noup] There is only one SHA supported at once
de-nordic Oct 2, 2024
4a5d2ae
[nrf noup] bootutil: Fix typo in identifier
de-nordic Oct 2, 2024
237b8b9
[nrf fromlist] scripts: imgtool: compression
michalek-no Aug 9, 2024
f3a288d
[nrf noup] boot: zephyr: kconfig: Select PM_USE_CONFIG_SRAM_SIZE when…
nordicjm Oct 2, 2024
c020cd0
[nrf noup] Add missing selection of MBEDTLS_PSA_CRYPTO_C
de-nordic Oct 1, 2024
12e9928
[nrf noup] boot/zephyr/Kconfig: conditionally disable BOOT_MAX_IMG_SE…
nvlsianpu Sep 19, 2024
e295db1
[nrf fromlist] zephyr/Kconfig.serial_recovery: limit Slot info command
nvlsianpu Sep 24, 2024
d44d7bc
[nrf fromtree] boot: bootutil: loader: Fix slot info for directXIP/RA…
nordicjm Sep 25, 2024
22adc04
[nrf fromtree] boot: bootutil: loader: Fix issue with using pointers
nordicjm Sep 27, 2024
10f3dbe
[nrf fromtree] scripts: imgtool: compression
michalek-no Aug 9, 2024
b245ccd
[nrf noup] zephyr: Fix compressed image support
nordicjm Oct 7, 2024
8c814cb
[nrf fromlist] boot: bootutil: swap_scratch: Fix compressed image sec…
nordicjm Oct 7, 2024
0ea935a
[nrf noup] zephyr: Add support for ARM thumb filter
nordicjm Sep 2, 2024
94212b4
[nrf fromlist] scripts: imgtool: compression ARM thumb filter
michalek-no Oct 4, 2024
54b6307
[nrf fromlist] bootutil: Allow bypassing ASN.1 encoding for ED25519 k…
de-nordic Oct 8, 2024
36fc9d3
[nrf fromlist] zephyr: Add Kconfig option CONFIG_BOOT_KEY_IMPORT_BYPA…
de-nordic Oct 8, 2024
8c99a50
[nrf noup] Add ASN.1 bypass to bootutil_verify_img
de-nordic Oct 9, 2024
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
31 changes: 31 additions & 0 deletions .github/workflows/commit-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Commit tags

on: pull_request

jobs:
commit_tags:
runs-on: ubuntu-22.04
name: Run commit tags checks on patch series (PR)
steps:
- name: Update PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Checkout the code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Install python dependencies
run: |
pip3 install setuptools
pip3 install wheel
pip3 install gitlint

- name: Run the commit tags
uses: nrfconnect/action-commit-tags@main
with:
target: '.'
baserev: origin/${{ github.base_ref }}
revrange: 'none'
2 changes: 1 addition & 1 deletion boot/boot_serial/src/boot_serial_encryption.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ decrypt_region_inplace(struct boot_loader_state *state,
blk_sz = tlv_off - (off + bytes_copied);
}
}
boot_encrypt(BOOT_CURR_ENC(state), slot,
boot_enc_decrypt(BOOT_CURR_ENC(state), slot,
(off + bytes_copied + idx) - hdr->ih_hdr_size, blk_sz,
blk_off, &buf[idx]);
}
Expand Down
38 changes: 36 additions & 2 deletions boot/bootutil/include/bootutil/crypto/aes_ctr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "mcuboot_config/mcuboot_config.h"

#if (defined(MCUBOOT_USE_MBED_TLS) + \
defined(MCUBOOT_USE_TINYCRYPT)) != 1
#error "One crypto backend must be defined: either MBED_TLS or TINYCRYPT"
defined(MCUBOOT_USE_TINYCRYPT) + defined(MCUBOOT_USE_PSA_CRYPTO)) != 1
#error "One crypto backend must be defined: either MBED_TLS or TINYCRYPT or PSA"
#endif

#if defined(MCUBOOT_USE_MBED_TLS)
Expand All @@ -38,12 +38,46 @@
#define BOOTUTIL_CRYPTO_AES_CTR_BLOCK_SIZE TC_AES_BLOCK_SIZE
#endif /* MCUBOOT_USE_TINYCRYPT */


#if defined(MCUBOOT_USE_PSA_CRYPTO)
#include <psa/crypto.h>
#include "bootutil/enc_key_public.h"
#define BOOTUTIL_CRYPTO_AES_CTR_KEY_SIZE BOOT_ENC_KEY_SIZE
#define BOOTUTIL_CRYPTO_AES_CTR_BLOCK_SIZE (16)
#endif

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

#if defined(MCUBOOT_USE_PSA_CRYPTO)
typedef struct {
/* Fixme: This should not be, here, psa_key_id should be passed */
uint8_t key[BOOT_ENC_KEY_SIZE];
} bootutil_aes_ctr_context;

void bootutil_aes_ctr_init(bootutil_aes_ctr_context *ctx);

static inline void bootutil_aes_ctr_drop(bootutil_aes_ctr_context *ctx)
{
memset(ctx, 0, sizeof(ctx));
}

static inline int bootutil_aes_ctr_set_key(bootutil_aes_ctr_context *ctx, const uint8_t *k)
{
memcpy(ctx->key, k, sizeof(ctx->key));

return 0;
}

int bootutil_aes_ctr_encrypt(bootutil_aes_ctr_context *ctx, uint8_t *counter,
const uint8_t *m, uint32_t mlen, size_t blk_off, uint8_t *c);
int bootutil_aes_ctr_decrypt(bootutil_aes_ctr_context *ctx, uint8_t *counter,
const uint8_t *c, uint32_t clen, size_t blk_off, uint8_t *m);
#endif

#if defined(MCUBOOT_USE_MBED_TLS)
typedef mbedtls_aes_context bootutil_aes_ctr_context;
static inline void bootutil_aes_ctr_init(bootutil_aes_ctr_context *ctx)
Expand Down
64 changes: 58 additions & 6 deletions boot/bootutil/include/bootutil/crypto/ecdsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#if (defined(MCUBOOT_USE_TINYCRYPT) + \
defined(MCUBOOT_USE_CC310) + \
defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO) + \
defined(MCUBOOT_USE_PSA_OR_MBED_TLS)) != 1
#error "One crypto backend must be defined: either CC310/TINYCRYPT/MBED_TLS/PSA_CRYPTO"
#endif
Expand Down Expand Up @@ -70,12 +71,18 @@
#include "bootutil/sign_key.h"
#include "common.h"

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

#ifdef __cplusplus
extern "C" {
#endif

#if (defined(MCUBOOT_USE_TINYCRYPT) || defined(MCUBOOT_USE_MBED_TLS) || \
defined(MCUBOOT_USE_CC310)) && !defined(MCUBOOT_USE_PSA_CRYPTO)
defined(MCUBOOT_USE_CC310) || defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)) \
&& !defined(MCUBOOT_USE_PSA_CRYPTO)
/*
* Declaring these like this adds NULL termination.
*/
Expand Down Expand Up @@ -127,8 +134,6 @@ static int bootutil_import_key(uint8_t **cp, uint8_t *end)
}
#endif /* (MCUBOOT_USE_TINYCRYPT || MCUBOOT_USE_MBED_TLS || MCUBOOT_USE_CC310) && !MCUBOOT_USE_PSA_CRYPTO */

#if defined(MCUBOOT_USE_TINYCRYPT)
#ifndef MCUBOOT_ECDSA_NEED_ASN1_SIG
/*
* cp points to ASN1 string containing an integer.
* Verify the tag, and that the length is 32 bytes. Helper function.
Expand Down Expand Up @@ -178,8 +183,8 @@ static int bootutil_decode_sig(uint8_t signature[NUM_ECC_BYTES * 2], uint8_t *cp
}
return 0;
}
#endif /* not MCUBOOT_ECDSA_NEED_ASN1_SIG */

#if defined(MCUBOOT_USE_TINYCRYPT)
typedef uintptr_t bootutil_ecdsa_context;
static inline void bootutil_ecdsa_init(bootutil_ecdsa_context *ctx)
{
Expand Down Expand Up @@ -248,16 +253,20 @@ static inline int bootutil_ecdsa_verify(bootutil_ecdsa_context *ctx,
{
(void)ctx;
(void)pk_len;
(void)sig_len;
(void)hash_len;
uint8_t dsig[2 * NUM_ECC_BYTES];

if (bootutil_decode_sig(dsig, sig, sig + sig_len)) {
return -1;
}

/* Only support uncompressed keys. */
if (pk[0] != 0x04) {
return -1;
}
pk++;

return cc310_ecdsa_verify_secp256r1(hash, pk, sig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE);
return cc310_ecdsa_verify_secp256r1(hash, pk, dsig, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE);
}

static inline int bootutil_ecdsa_parse_public_key(bootutil_ecdsa_context *ctx,
Expand Down Expand Up @@ -613,6 +622,49 @@ static inline int bootutil_ecdsa_parse_public_key(bootutil_ecdsa_context *ctx,

#endif /* MCUBOOT_USE_MBED_TLS */

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)
typedef uintptr_t bootutil_ecdsa_context;
static inline void bootutil_ecdsa_init(bootutil_ecdsa_context *ctx)
{
(void)ctx;
}

static inline void bootutil_ecdsa_drop(bootutil_ecdsa_context *ctx)
{
(void)ctx;
}

static inline int bootutil_ecdsa_verify(bootutil_ecdsa_context *ctx,
uint8_t *pk, size_t pk_len,
uint8_t *hash, size_t hash_len,
uint8_t *sig, size_t sig_len)
{
(void)ctx;
(void)pk_len;
(void)hash_len;
uint8_t dsig[2 * NUM_ECC_BYTES];

if (bootutil_decode_sig(dsig, sig, sig + sig_len)) {
return -1;
}

/* Only support uncompressed keys. */
if (pk[0] != 0x04) {
return -1;
}
pk++;

return bl_secp256r1_validate(hash, BOOTUTIL_CRYPTO_ECDSA_P256_HASH_SIZE, pk, dsig);
}

static inline int bootutil_ecdsa_parse_public_key(bootutil_ecdsa_context *ctx,
uint8_t **cp,uint8_t *end)
{
(void)ctx;
return bootutil_import_key(cp, end);
}
#endif /* MCUBOOT_USE_NRF_EXTERNAL_CRYPTO */

#ifdef __cplusplus
}
#endif
Expand Down
47 changes: 43 additions & 4 deletions boot/bootutil/include/bootutil/crypto/sha.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,21 @@

#if (defined(MCUBOOT_USE_PSA_OR_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/TINYCRYPT/PSA_CRYPTO"
#endif

#if defined(MCUBOOT_SIGN_EC384)
#if defined(MCUBOOT_SHA512)
#define IMAGE_HASH_SIZE (64)
#define EXPECTED_HASH_TLV IMAGE_TLV_SHA512
#elif defined(MCUBOOT_SIGN_EC384)
#define IMAGE_HASH_SIZE (48)
#define EXPECTED_HASH_TLV IMAGE_TLV_SHA384
#else
#define IMAGE_HASH_SIZE (32)
#define EXPECTED_HASH_TLV IMAGE_TLV_SHA256
#endif /* MCUBOOT_SIGN_EC384 */
#endif /* MCUBOOT_SIGN */

/* Universal defines for SHA-256 */
#define BOOTUTIL_CRYPTO_SHA256_BLOCK_SIZE (64)
Expand Down Expand Up @@ -82,7 +86,9 @@ typedef psa_hash_operation_t bootutil_sha_context;
static inline int bootutil_sha_init(bootutil_sha_context *ctx)
{
*ctx = psa_hash_operation_init();
#if defined(MCUBOOT_SIGN_EC384)
#if defined(MCUBOOT_SHA512)
psa_status_t status = psa_hash_setup(ctx, PSA_ALG_SHA_512);
#elif defined(MCUBOOT_SIGN_EC384)
psa_status_t status = psa_hash_setup(ctx, PSA_ALG_SHA_384);
#else
psa_status_t status = psa_hash_setup(ctx, PSA_ALG_SHA_256);
Expand All @@ -107,7 +113,9 @@ static inline int bootutil_sha_finish(bootutil_sha_context *ctx,
{
size_t hash_length = 0;
/* Assumes the output buffer is at least the expected size of the hash */
#if defined(MCUBOOT_SIGN_EC384)
#if defined(MCUBOOT_SHA512)
return (int)psa_hash_finish(ctx, output, PSA_HASH_LENGTH(PSA_ALG_SHA_512), &hash_length);
#elif defined(MCUBOOT_SIGN_EC384)
return (int)psa_hash_finish(ctx, output, PSA_HASH_LENGTH(PSA_ALG_SHA_384), &hash_length);
#else
return (int)psa_hash_finish(ctx, output, PSA_HASH_LENGTH(PSA_ALG_SHA_256), &hash_length);
Expand Down Expand Up @@ -206,6 +214,37 @@ static inline int bootutil_sha_finish(bootutil_sha_context *ctx,
}
#endif /* MCUBOOT_USE_CC310 */

#if defined(MCUBOOT_USE_NRF_EXTERNAL_CRYPTO)

#include <bl_crypto.h>

typedef bl_sha256_ctx_t bootutil_sha_context;

static inline void bootutil_sha_init(bootutil_sha_context *ctx)
{
bl_sha256_init(ctx);
}

static inline void bootutil_sha_drop(bootutil_sha_context *ctx)
{
(void)ctx;
}

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

static inline int bootutil_sha_finish(bootutil_sha_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: 3 additions & 1 deletion boot/bootutil/include/bootutil/enc_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ int boot_enc_load(struct enc_key_data *enc_state, int slot,
const struct image_header *hdr, const struct flash_area *fap,
struct boot_status *bs);
bool boot_enc_valid(struct enc_key_data *enc_state, int slot);
void boot_encrypt(struct enc_key_data *enc_state, int slot,
void boot_enc_encrypt(struct enc_key_data *enc_state, int slot,
uint32_t off, uint32_t sz, uint32_t blk_off, uint8_t *buf);
void boot_enc_decrypt(struct enc_key_data *enc_state, int slot,
uint32_t off, uint32_t sz, uint32_t blk_off, uint8_t *buf);
void boot_enc_zeroize(struct enc_key_data *enc_state);

Expand Down
4 changes: 4 additions & 0 deletions boot/bootutil/include/bootutil/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ struct flash_area;
#define IMAGE_TLV_PUBKEY 0x02 /* public key */
#define IMAGE_TLV_SHA256 0x10 /* SHA256 of image hdr and body */
#define IMAGE_TLV_SHA384 0x11 /* SHA384 of image hdr and body */
#define IMAGE_TLV_SHA512 0x12 /* SHA512 of image hdr and body */
#define IMAGE_TLV_RSA2048_PSS 0x20 /* RSA2048 of hash output */
#define IMAGE_TLV_ECDSA224 0x21 /* ECDSA of hash output - Not supported anymore */
#define IMAGE_TLV_ECDSA_SIG 0x22 /* ECDSA of hash output */
#define IMAGE_TLV_RSA3072_PSS 0x23 /* RSA3072 of hash output */
#define IMAGE_TLV_ED25519 0x24 /* ed25519 of hash output */
#define IMAGE_TLV_SIG_PURE 0x25 /* Whatever signature has been selected, it will be used
* as "pure" where signature is verified over entire
* image rather than hash of an image */
#define IMAGE_TLV_ENC_RSA2048 0x30 /* Key encrypted with RSA-OAEP-2048 */
#define IMAGE_TLV_ENC_KW 0x31 /* Key encrypted with AES-KW 128 or 256*/
#define IMAGE_TLV_ENC_EC256 0x32 /* Key encrypted with ECIES-EC256 */
Expand Down
3 changes: 3 additions & 0 deletions boot/bootutil/src/bootutil_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ struct boot_loader_state {
fih_ret bootutil_verify_sig(uint8_t *hash, uint32_t hlen, uint8_t *sig,
size_t slen, uint8_t key_id);

fih_ret bootutil_verify_img(const uint8_t *img, uint32_t size,
uint8_t *sig, size_t slen, uint8_t key_id);

fih_ret boot_fih_memequal(const void *s1, const void *s2, size_t n);

int boot_find_status(int image_index, const struct flash_area **fap);
Expand Down
Loading
Loading