Commit Graph

381 Commits (tools-release-6.1.0)

Author SHA1 Message Date
Jaeden Amero 4961d4a52d psa: Configure Mbed TLS to use PSA as needed
Configure Mbed TLS to automatically enable PSA as needed. When Mbed OS
is configured to use PSA, configure Mbed TLS to use PSA. This prevents
leaking of the "how to make Mbed TLS use PSA" knowledge up into
targets.json, and thus makes porting simpler. There is now one place
where "how to make TLS use PSA" exists rather than repeated throughout
targets.json for each target that can't inherit from PSA_Target.
2020-06-18 12:18:12 +01:00
Jaeden Amero 0961f312c6 Make PSA util compatible with Mbed Crypto 3.0.1
Mbed Crypto 3.0.1 ships with TF-M. To make Mbed TLS 2.22.0 compatible
with Mbed Crypto 3.0.1, changes are needed in psa_util.h (which
abstracts some portions of the PSA Crypto API for use with TLS) to deal
with new ECC curve define changes.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-06-18 12:16:25 +01:00
Devaraj Ranganna 76e911c5ef psa: Replace Mbed PSA with TF-M
Add TF-M to Mbed OS, replacing the previous PSA implementation for
TF-M-capable targets. This commit adds files imported from TF-M, without
modification. The version of TF-M imported can be found in
`features/FEATURE_PSA/TARGET_TFM/VERSION.txt`.

These changes switch to TF-M as the sole PSA implementation for v8-M and
dual core targets, with TF-M running on the secure side and Mbed OS
running on the non-secure side. Single core v7-M targets will continue
to have PSA implemented via PSA emulation, implemented by Mbed OS.

Move or remove many PSA-implementing files, as PSA will be provided by
TF-M on non-single-v7-M targets. Delete any files that are not relevant
for PSA emulation mode.
 - Remove imported TF-M SPM
 - Remove Mbed SPM and tests
 - Remove Mbed-implemented PSA services and tests
 - Remove PSA_SRV_IMPL, PSA_SRV_IPC, PSA_SRV_EMUL and NSPE.
 - Replace PSA_SRV_EMUL and PSA_SRV_IMPL with MBED_PSA_SRV
 - Remove any files autogenerated by
   "tools/psa/generate_partition_code.py", which no longer exists.

Add new feature `PSA` to support PSA in Mbed OS.

Move the Mbed OS implementation of PSA services for v7-M targets (which
employ PSA emulation, and don't yet use TF-M) to
features/FEATURE_PSA/TARGET_MBED_PSA_SRV. Update the `requires`
attribute in TESTS/configs/baremetal.json to avoid breaking baremetal
testing builds.

Update .astyleignore to match new directory structure

Update Mbed TLS importer to place files into FEATURE_PSA

Create the following generic PSA targets:

* `PSA_Target` (Root level PSA generic target)
* `PSA_V7_M` (Single v7-M PSA generic target)
* `PSA_DUAL_CORE` (Dual-core PSA generic target)
* `PSA_V8_M` (v8-M PSA generic target)

Flatten MUSCA_NS and private MUSCA targets into public MUSCA targets.

Move mcuboot.bin to flat location (removing prebuilt folder)

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-06-18 12:16:20 +01:00
Martin Kojtal 0bdc712167
Merge pull request #12998 from sbutcher-arm/fix-adjust-config
Fix Mbed TLS `adjust-config.sh` script
2020-06-18 09:43:59 +02:00
jeromecoutant e3862d3430 STM32 MBEDTLS_ALT use singleton 2020-06-12 10:23:50 +02:00
jeromecoutant d0e572225c STM32 MBEDTLS: create mbedtls_device.h for all L562 targets 2020-06-08 13:54:14 +02:00
jeromecoutant 073bbf7b73 STM32 MBEDTLS: create mbedtls_device.h for all WB55 targets 2020-06-08 13:54:13 +02:00
jeromecoutant 904ced2150 STM32 MBEDTLS: create mbedtls_device.h for all L443 and L486 targets 2020-06-08 13:54:06 +02:00
jeromecoutant f71b09173a STM32 MBEDTLS: create mbedtls_device.h for all F756 targets 2020-06-08 13:51:35 +02:00
jeromecoutant 46566f492e STM32 MBEDTLS: create mbedtls_device.h for all F437 and F439 targets 2020-06-08 13:51:34 +02:00
jeromecoutant 3f42dfd47f STM32 MBEDTLS: AES/CCM/GCM/MD5/SHA1/SHA256 ALT implementation 2020-06-08 13:51:34 +02:00
jeromecoutant f62e3842ba STM32 MBEDTLS: common STM32 API for ST CRYP IP 2020-06-08 13:51:33 +02:00
jeromecoutant e6f4629ba6 STM32 MBEDTLS: common STM32 API for ST HASH IP 2020-06-08 13:51:33 +02:00
jeromecoutant aa09e7d409 STM32 MBEDTLS: Keep specific STM32L4 implementation 2020-06-08 13:51:32 +02:00
jeromecoutant 47aba83c2c STM32 MBEDTLS: Remove specific STM32F4 & STM32F7 implementation
All families (except STM32L4) will be aligned
2020-06-08 13:51:32 +02:00
Darryl Green 0e07dff0a4 Move TARGET_MBED_PSA_SRV to FEATURE_EXPERIMENTAL_API
Signed-off-by: Darryl Green <darryl.green@arm.com>
2020-05-29 13:19:12 +01:00
Darryl Green 5fa5176727 Move mbedtls/platform/TARGET_PSA to FEATURE_EXPERIMENTAL_API/TARGET_PSA
Signed-off-by: Darryl Green <darryl.green@arm.com>
2020-05-29 13:19:12 +01:00
Jaeden Amero 8b5a2ff2d9 psa: Fix style in psa_hrng.c 2020-05-29 13:19:11 +01:00
Jaeden Amero 5d6ec71171 crypto: Move PSA Crypto headers to MBED_PSA_SRV
TF-M provides its own PSA headers for TF-M targets. Single v7-M targets
need to get PSA crypto from Mbed Crypto.

Note that we don't yet move crypto_struct.h to its new location. This is
to avoid breaking v8-M targets for the time being. When TF-M provides
the PSA implementation on v8-M, we will add crypto_struct.h to the
correct place.

Likewise, none of the PSA-implementing source is moved out of
COMPONENT_PSA_SRV_IMPL yet, as still must not be built for PSA NS
targets. When PSA NS targets switch to using TF-M provided
implementations rather than MBED_PSA_SRV, we can take the source out of
COMPONENT_PSA_SRV_IMPL.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-05-29 13:19:11 +01:00
Simon Butcher 5b0316832d Fix Mbed TLS adjust-config.sh script
The Mbed TLS import script is quite fragile, and depends on certain lines to be
present in the files it adjusts to be able to do the modifications it needs to
to allow Mbed TLS to build within Mbed OS.

Thsi commit changes the `adjust-config.sh` script to look for a the end of the
config.h file, defined as "#endif /* MBEDTLS_CONFIG_H */" rather than the
include line for "check_config.h".

That's because the inclusion of "check_config.h" is being removed upstream in
Mbed TLS to fix another issue.
2020-05-19 23:19:38 +01:00
Martin Kojtal af4c8a94f3
Merge pull request #12757 from dgreen-arm/test-remerge
Update Mbed OS with Mbed Crypto merged into Mbed TLS
2020-04-30 16:06:32 +02:00
Darryl Green 1a6a8495ef Define mbedtls_ecc_group_to_psa inline for NS world
Signed-off-by: Darryl Green <darryl.green@arm.com>
2020-04-30 11:28:26 +01:00
Darryl Green fc07e5ba93 Update Mbed TLS to latest version
As Mbed Crypto has been remerged into Mbed TLS, remove Mbed Crypto
at the same time.

Signed-off-by: Darryl Green <darryl.green@arm.com>
2020-04-30 11:28:05 +01:00
Darryl Green b91fe62c96 Adjust Mbed TLS importer and config script
Mbed Crypto has been remerged back into Mbed TLS. Update the
Mbed TLS importer script with the relevant parts of the
Mbed Crypto importer.

Signed-off-by: Darryl Green <darryl.green@arm.com>
2020-04-30 11:27:54 +01:00
Marcelo Salazar a7b026bd14 Rename ADV_WISE_1510 target 2020-04-30 09:56:35 +01:00
Marcelo Salazar 92cbd9a734 Rename ADV_WISE_1570 target 2020-04-30 09:56:35 +01:00
Jaeden Amero fcf427ac11 psa: Remove S-mode only code
Remove all PSA S-mode only code, as it is unused. Only PSA S targets
would use the code, and we've removed those targets in a previous
commit.

Ensure all tests for S-mode code we are deleting is also removed, even
if that code would run in NS-mode. Keep any tests that also test our PSA
emulation support (for single v7-M targets).

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-27 09:51:13 +01:00
Jaeden Amero 6b3a9cb4fa psa: Remove v8-M S targets
Remove PSA v8-M S target binaries will be built outside of Mbed OS and
added in as binaries which NS targets consume. Mbed OS no longer
implements PSA for v8-M targets, so there is no reason for it to build
PSA S targets.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-27 09:51:09 +01:00
Martin Kojtal 68f1ef2df6
Merge pull request #12716 from OpenNuvoton/nuvoton_m487_bsp
M487: Update BSP
2020-04-15 09:07:10 +02:00
MarceloSalazar a15f6a43ad General clean-up of unsupported targets 2020-04-09 15:36:21 +01:00
Martin Kojtal 74ace63eaa
Merge pull request #12729 from AnttiKauppila/mbedtls_fixes
Mbedtls fixes
2020-04-03 08:59:14 +02:00
Chun-Chieh Li d709c775b4 M487: Add SPDX license identifier 2020-04-01 13:55:45 +08:00
Chun-Chieh Li 3b9492fdbc M487: Update BSP
Relevant modifications:
1. Support degrading QSPI0/1 to SPI4/5 for normal SPI transfer
2. Fix with BSP crypto driver API change
3. Fix with BSP PDMA driver API change
4. Make necessary modifications to pass FPGA CI Test Shield tests
5. Don't distinguish pinmap among parts e.g. M480 LG. Application users must take care.
2020-04-01 13:55:12 +08:00
Antti Kauppila 5f19b6b03a Licence updated 2020-03-31 16:16:30 +03:00
Antti Kauppila 69c6f29ab6 trace group defiined for shared_rng
Unittests fixed

2 mbedtls functions were updated to reflect the api
2020-03-31 14:21:45 +03:00
Teppo Järvelin c5d5d21f05 Added missing optimizations based on mbedtls/baremetal.h config 2020-03-31 14:21:45 +03:00
Teppo Järvelin 17e513891b Added new global rng, needed for MbedTLS optimisations 2020-03-31 14:21:44 +03:00
jeromecoutant 4b9a7fa86a STM32F4 V1.19.0 -> V1.25.0 : MBEDTLS adaptation 2020-03-31 11:04:57 +02:00
Martin Kojtal e71ab0d0f0
Merge pull request #12590 from devran01/importer-remove-license-file
Importer script: remove apache-2.0.txt
2020-03-09 09:01:04 +00:00
Simon Butcher 19b208f211 Update the contribution guidelines for Mbed TLS
This commit changes the contribution guidelines to refer the user to the
contribution guidelines in the Mbed TLS repo. It also removes the outdated references to the
CLA, and CLA not being required for trivial changes.

Signed-off-by: Simon Butcher <simon.butcher@arm.com>
2020-03-06 17:32:17 +00:00
Devaraj Ranganna 4773a219b8 tls: Remove apache-2.0.txt from importer script
Both Mbed TLS and Mbed Crypto libraries doesn't contain
`apache-2.0.txt` anymore. Do not access those files in the importer
script.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2020-03-06 11:26:45 +00:00
Jaeden Amero 9ae0868410 crypto: Update to Mbed Crypto 3.0.1 2020-03-03 12:56:07 +00:00
Martin Kojtal deb4995dae
Merge pull request #12150 from Patater/update-tls-crypto-20191220
Update Mbed TLS and Mbed Crypto to latest as of 2019-12-20
2020-02-10 13:04:12 +00:00
PARKJIHOON 4460d26eab Default use BEDTLS_SHA512_SMALLER for SW fallback
Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
2020-01-22 14:40:51 +09:00
Andrew Chong dc64bd8a05 Changed 2018 or 2019 copyright to 2020 via sed auto change. 2020-01-22 14:40:51 +09:00
Andrew Chong 3677b1b04e Applied the latest astyle. 2020-01-22 14:40:51 +09:00
Andrew Chong 65e9cac918 Updated the code fix of timer and Mbed TLS. 2020-01-22 14:40:51 +09:00
Andrew Chong d242850de4 Ran astyle on features/mbedtls/targets/TARGET_Samsung. 2020-01-22 14:40:50 +09:00
PARKJIHOON 26f7e26568 tidy up PR comments #3
Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
2020-01-22 14:40:50 +09:00
PARKJIHOON 2e0ff5d145 tidy up PR comments #1
Signed-off-by: PARKJIHOON <jh6186.park@samsung.com>
2020-01-22 14:40:50 +09:00