Commit Graph

336 Commits (af1ea31546c7705acf2d636c6bb3769489f61275)

Author SHA1 Message Date
Jaeden Amero 07a84ec10a psa: Remove MBED_SPM code
All MBED_SPM targets have been removed previously, via commits
5cc66282dd ("PSOC6: remove PSA targets") and 115b09aba43b ("psoc6:
Remove FUTURE_SEQUANA and FUTURE_SEQUANA_M0"). Remove all the dead
MBED_SPM code, as no targets use it.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-16 14:10:54 +01:00
Hugues Kamba 0d626e04b9 TFM: Remove ARM Compiler 5 considerations
ARM Compiler 5 is no longer actively supported and was superseded in
Mbed OS by ARM Compiler 6.
2020-03-26 11:32:47 +00:00
Martin Kojtal fc5f3259de
Merge pull request #12458 from GaborAbonyi/add_musca_b1_platform
Add Musca B1 target
2020-02-27 13:53:58 +00:00
Gabor Abonyi a5b15a75be Add ioctl platform service
Define weak functions that the platforms can overwrite

Change-Id: I3d6f3e59a9c5b88456875a495fa6decc1337683e
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-02-21 14:31:42 +01:00
Martin Kojtal c43f808f3d component psa: fix SPDX identifiers 2020-02-21 07:01:08 +00:00
Martin Kojtal b9e00de2d9 psa: fix licenses + SPDX 2020-02-21 07:01:05 +00:00
Martin Kojtal bde0f5660b
Merge pull request #12392 from GaborAbonyi/psa_crypto_fix
Fix psa_key_management_operations
2020-02-12 13:11:27 +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
Gabor Abonyi c94b3e41ee Fix psa_key_management_operations
At these locations, psa_key_attribute variables are used without
initialisation. The function getting it (psa_get_key_attributes),
is freeing attributes->domain_parameters, which can contain random
address from the stack.

Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-02-07 16:23:20 +01:00
Maciej Bocianski 57ac6c83d6 component PSA: keep SVCHandler_main/tfm_pendsv_do_schedule symbol in LTO builds
Add a "used" attribute to SVCHandler_main/tfm_pendsv_do_schedule to fix ARMC6 build with
the "-flto" flag.

This attribute, attached to a function/variable, means that code must be emitted
for the function even if it appears that the function is not referenced.
2020-02-04 12:38:38 +01:00
Chun-Chieh Li 85dfc1a971 TFM: Change NS lock functions to weak
Default NS lock functions use mutex to guarantee serialization into secure world.
But this mechanism doesn't support pre-rtos and interrupt-disabled.
This commit changes these functions to weak so that platform can override them to provide another mechanism.
This approach is just what TF-M repository is adopting.

https://review.trustedfirmware.org/c/trusted-firmware-m/+/1460
2020-01-06 15:46:09 +08:00
Ron Eldor dadb621a97 Change size embedded in the temp_ram_page_data
The size stated in the struct header was 0xB0, however
the actual size(including the header) is 0xAC. Changed the
len value in the header, to avoid memory corruption.
Raised in #12171
2019-12-29 17:28:56 +02:00
Jaeden Amero 689274b6b4 crypto: Update the service for Mbed Crypto 3.x
Update Mbed OS's PSA Crypto service to work with Mbed Crypto 3.x.

- psa_asymmetric_verify() is now called psa_verify_hash().
- psa_asymmetric_sign() is now called psa_sign_hash().

Compatibilty wrappers are provided via crypto_compat.h for source-level
backwards compatibility.
2019-12-20 16:01:17 +00:00
Veijo Pesonen 060a1c6df7 NVStore: deprecated implementation removed 2019-12-03 15:36:31 +02:00
Hugues Kamba 20f41a0540 LPC55S69_NS: Fix baremetal compilation error
As the `psa` library is not included in the baremetal profile, perform
a TFM system reset only if the `psa` library is included in
the build otherwise perform a normal CMSIS system reset.
2019-11-28 14:53:31 +00:00
Martin Kojtal d556bf698f
Merge pull request #11821 from rajkan01/feature-baremetal-greentea-psa
Skip Bare Metal green tea test for PSA component
2019-11-12 11:07:16 +01:00
RAJKUMAR KANAGARAJ 829e90afc8 Incorporated review comments 2019-11-08 07:07:12 -08:00
Vikas Katariya f4a1945911 Add PSA auto-generated files to components
To support online compiler build for PSA targets, some files are
auto-generated (LPC55S69_NS and ARM_MUSCA_A1_NS) by the script
from offline build system. Since these files are identical for these
V8-M targets it would be good to check them in to support online
compiler as they are COMPONENT_SPE and services related.

In folder: components/TARGET_PSA/
  --TARGET_MBED_SPM
    --COMPONENT_SPE
      psa_setup.c
  --TARGET_TFM
    --COMPONENT_SPE
      --inc
	tfm_partition_defs.inc
        tfm_partition_list.inc
        tfm_service_list.inc
        tfm_spm_signal_defs.h
  --services
    --inc
      autogen_sid.h
      mbed_spm_partitions.h

Signed-off-by: Vikas Katariya <Vikas.Katariya@arm.com>
2019-11-08 14:57:06 +00:00
RAJKUMAR KANAGARAJ f30dd1cef2 Enable the Bare Metal green tea test
-PSA test framework uses the RTOS threads to run test cases so added MBED_CONF_RTOS_PRESENT to all the test cases.
2019-11-06 03:15:49 -08:00
Vikas Katariya c1486eaf41 Fix enum type to align with psa-arch-tests
This is related to https://github.com/ARMmbed/mbed-os/issues/11256
When TARGET_PSA is enabled on Cortex-A boards, the SECURE
is redeclared. So to minimize the impact we can redeclare this in
val.h which is used only by Mbed. And `security_t` itself is used in
mbed-os\components\TARGET_PSA\TESTS, but the SECURE string is not used.

Renamed to `caller_security_t` which aligns with
https://github.com/ARM-software/psa-arch-tests
2019-10-02 16:37:58 +01:00
Martin Kojtal 567479792c
Merge pull request #11392 from hugueskamba/hk-remove-minor-warnings
Remove minor build warnings
2019-09-05 09:59:39 +02:00
Hugues Kamba 9f44c2c4d2 Sync with TF upstream code as much as possible to remove warning 2019-09-03 13:47:06 +01:00
Jaeden Amero 43af68d630 attestation: Don't create attestation key twice
If psa_attestation_inject_key() is called twice, exit with a non-fatal
error status without attempting to create another attestation key. The
key already exists and doesn't need to be added again.
2019-09-02 17:10:59 +01:00
Jaeden Amero 3d1b8363db Use PSA Crypto API 1.0b3
The PSA Crypto API has moved on from 1.0b2 to 1.0b3, bringing along with
it some breaking changes. Update Mbed OS to use the 1.0b3 API.
2019-09-02 17:10:59 +01:00
Hugues Kamba e65a0c0a99 Remove minor build warnings 2019-09-02 15:04:58 +01:00
Jaeden Amero 3e53118727 crypto: Add IPC for psa_copy_key() 2019-08-29 14:55:21 +01:00
Jaeden Amero 4eb4b32910 psa: Update crypto service for PSA Crypto 1.0b3 2019-08-29 14:55:21 +01:00
Jaeden Amero 0758d23f00 crypto: Make service parameter names match API
Make the service implementation use the same names as the API as
declared in the crypto.h header. This improves readability and
maintainability of the service.
2019-08-23 17:16:10 +01:00
Jaeden Amero b0c83501a4 crypto: Make IPC declaration order follow crypto.h
Order the IPC functions in the same order as the functions are listed in
crypto.h for improved readability.
2019-08-23 17:16:10 +01:00
Jaeden Amero dafbf27340 crypto: Fix "refence count" typo
Rename the reference count variable to something shorter and avoid using
the mispelling "refence".
2019-08-23 17:16:10 +01:00
Jaeden Amero 97447677ba crypto: Remove duplicate PSA_CRYPTO_INIT
PSA_CRYPTO_INIT is defined as a service identifier. We don't need to
redefine it as a secure function. There is only one function under this
service identifier, so no secure function definitions are necessary to
differentiate between.
2019-08-23 17:16:10 +01:00
Jaeden Amero dda4c47a4b crypto: Match styles of crypto struct headers
Make crypto_struct_ipc.h (for use with PSA Crypto clients) match style
with the file it is based on, crypto_struct.h (from Mbed Crypto). This
helps to keep the file diff minimal so it's easy to see the meaningful
(non-style) changes.
2019-08-23 17:16:10 +01:00
Jaeden Amero 273c62516d crypto: Remove old compliance tests
We'll use the new ARM-software/psa-arch-tests directly instead for PSA
Crypto API 1.0b3. This commit removes the crypto compliance tests only
for now, leaving attestation and storage tests.
2019-08-21 19:43:58 +01:00
Hugues Kamba 27e4ca18cf Fix inclusion of test related directories by build tool 2019-08-09 10:20:48 +01:00
David Saada fb3559d841 PSA storage: Conform to "PSA 1.0.0" spec release
- Add the no confidentiality & no replay protection flags
- Add actual size parameter in PS/ITS get APIs
- Change a few size parameters from uint32_t to size_t
2019-07-14 18:50:47 +03:00
Martin Kojtal 1aad06b394
Merge pull request #10829 from devran01/feature_trusted-firmware-m_e7efdc6
PSA: TFM import
2019-07-01 14:35:54 +01:00
Martin Kojtal 85c477c1dc
Merge pull request #10609 from kjbracey-arm/us_ticker_optimise
wait_us optimization
2019-06-28 14:29:00 +01:00
Kevin Bracey c5b9779858 Remote "static" from MBED_FORCEINLINE
Static keyword causes problems when trying to use force-inlined
functions from normal inlined functions. This is not legal:

    static inline void forced() { }

    inline void normal() { forced(); }

You cannot reference internal-linkage things from external-linkage
inline functions.

Removal of the static implies that in C there would need to be a
non-inline definition in case anyone calls it non-inlined, but if the
force attribute is doing its job, that should not happen.

Only significant in-tree user of the MBED_FORCEINLINE macro is
the atomic operations - making this change permits atomic operations
from non-static inline functions.
2019-06-27 16:12:30 +03:00
Devaraj Ranganna 6e899b3cc9 TF-M patch/workaround related to (TF-M issue #T240)
- Link to bug tracking: https://developer.trustedfirmware.org/T240

The issue is fixed by TF-M team. However they autogenerate region details
(code, ro, rw, zi and stack ) using linker scripts and in mbed-os we
also autogenerate region details but using mix of service definition in
json file and other template files.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-26 14:58:19 +01:00
Devaraj Ranganna 9a5110561a TF-M patch: Remove secure_fw/core/tfm_func_api.c which is required only
when TFM_PSA_API is not set

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-26 14:23:26 +01:00
Devaraj Ranganna cb748c5608 TF-M patch: Change #if TFM_PSA_API to #ifdef TFM_PSA_API to avoid
compiler errors as mbed-cli only generates "-D" macros only for
"macros" defined in targets.json

TF-M task link: https://developer.trustedfirmware.org/T396

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-26 14:23:26 +01:00
Devaraj Ranganna cb8f2c07a1 1. Include MBEDTLS_CONFIG_FILE before evaluating MBEDTLS_PSA_CRYPTO_C
2. Remove macro MBEDTLS_PSA_CRYPTO_C from PSA targets

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-06-24 14:33:04 +01:00
Michael Schwarcz 910a402ce6 TF-M patch: Fix tfm_psa_call_venner wrong argument type (TF-M issue #241)
- Link to bug tracking: https://developer.trustedfirmware.org/T241

(cherry picked from commit da01e3411f)
(cherry picked from commit 280715f9b7)
2019-06-06 16:08:34 +01:00
Michael Schwarcz 35938a4071 TF-M patch: Fix service handles not cleared issue (TF-M issue #230)
- Link to bug tracking: https://developer.trustedfirmware.org/T230

(cherry picked from commit 0c23e86989)
(cherry picked from commit 9c1e080e39)
2019-06-06 16:08:33 +01:00
Michael Schwarcz 795e6418d0 TF-M patch: Fix tfm_ns_lock_init issue (TF-M issue #239)
- Link to bug tracking: https://developer.trustedfirmware.org/T239

(cherry picked from commit 5f2e4b3911)
(cherry picked from commit 5d41a2aeae)
2019-06-06 16:08:33 +01:00
Michael Schwarcz 11bff3f3cb TF-M patch: General modifications
- Remove un-needed files
- Disable printf and uart
- Modify include paths
- Guard macros from mbed_lib with ifndef

(cherry picked from commit 1f30b52488)
(cherry picked from commit 71cd34df32)
(cherry picked from commit 185d2865da)
(cherry picked from commit fb068d2cb4)
2019-06-06 14:49:41 +01:00
Devaraj Ranganna b0fe59df00 [trusted-firmware-m]: Updated to e7efdc6 2019-06-06 14:47:00 +01:00
David Saada dcd2c292af PSA protected storage: Add encrypt & RB protect flags by default to set. 2019-06-03 16:32:55 +03:00
Martin Kojtal 303d0f0c0c SPE: fix inject entropy macro
Use new TLS macro
2019-05-27 11:50:09 +01:00
Anna Bridge 9fb4429379
Merge pull request #10520 from kjbracey-arm/build_tz_heuristic
Permit non-TrustZone ARMv8 build
2019-05-17 11:06:55 +01:00