Commit Graph

256 Commits (4f95298669883f7596ec55343f1e8e1200014de7)

Author SHA1 Message Date
Simon Butcher 7bf33f01f9 Parameterise repo used in Mbed TLS importer script
This commit makes the repo used to import new Mbed TLS versions into Mbed OS
a parameter, to allow CI scripts (and any other script or users) to specify
specific repos to use for testing.
2019-01-11 13:51:19 +00:00
Alastair D'Silva 2617c5d55b Don't use define checks on DEVICE_FOO macros (mbed code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 10:16:42 +11:00
ccli8 ca44675086 [Nuvoton] Fix crypto AC management
1. For SHA AC, use atomic flag to manage its ownership.
   (1) Nuvoton SHA AC doesn't support SHA context save & restore, so S/W
       SHA fallback has been supported before. To make non-blocking 'acquire'
       semantics clearer, introduce 'try_acquire' to substitute for 'acquire'.
   (2) No biting CPU due to mechanism above.
   (3) No deadlock due to mechanism above.
2. For AES/DES/ECC AC, change to mutex to manage their ownership.
   (1) Change crypto-misc.c to crypto-misc.cpp to utilize C++ SingletonPtr
       which guarantees thread-safe mutex construct-on-first-use.
   (2) With change to crypto-misc.cpp, add 'extern "C"' modifier to CRYPTO_IRQHandler()
       to avoid name mangling in C++.
   (3) No priority inversion because mutex has osMutexPrioInherit attribute
       bit set.
   (4) No deadlock because these AC are all locked for a short sequence
       of operations rather than the whole lifetime of mbedtls context.
   (5) For double mbedtls_internal_ecp_init() issue, it has been fixed in upper
       mbedtls layer. So no need to change ecc init/free flow.
2018-12-19 10:17:39 +08:00
ccli8 b16b1dbeb9 [M487] Fix return error code when ECC H/W acceleratioin is failed 2018-12-14 17:28:30 +08:00
Janos Follath 71387e33f1 Mbed TLS: Fix ECC hardware double initialization
We initialized the ECC hardware before calling
mbedtls_ecp_mul_shortcuts(). This in turn calls
mbedtls_ecp_mul_restartable(), which initializes and frees the hardware
too. This issue has been introduced by recent changes and caused some
accelerators to hang.

We move the initialization after the mbedtle_ecp_mul_shortcuts() calls
to avoid double initialization.
2018-12-07 11:18:40 +00:00
Cruz Monrreal 3325070701
Merge pull request #8936 from RonEld/reduce_default_mpi_max_size
Reduce default MBEDTLS_MPI_MAX_SIZE
2018-12-04 12:22:15 -06:00
Martin Kojtal e02a8ab2f1
Merge pull request #8925 from Patater/crypto-storage-config-fixes
Fix PSA storage typo
2018-12-04 14:34:15 +01:00
Martin Kojtal 992bcbafdb
Merge pull request #8926 from Patater/mbedtls-2.15.1
mbedtls: Update Mbed TLS to 2.15.1
2018-12-04 09:32:30 +01:00
Ron Eldor edc09cf087 Add comment for reasoning for changing default
Add a comment in the `adjust-config.sh` script, for effects
and benefits of the new value.
2018-12-03 18:59:25 +02:00
Ron Eldor 097996c25a Reduce default MBEDTLS_MPI_MAX_SIZE
Reduce the default size of `MBEDTLS_MPI_MAX_SIZE` to 512 bytes,
as the default 1024 consumes much stack, and supporting RSA 4096 bit
may suffice at the moment.
2018-12-03 18:59:25 +02:00
Juho Eskeli 361d804e2e STM32L4: before calling HAL_CRYP_DeInit initialize the Instance member 2018-12-03 16:07:49 +02:00
Jaeden Amero f9417ac12b crypto: storage: Fix PSA_PS_ERROR_OFFSET typo
Correct typo of PSA_PS_ERROR_OFFSET to PSA_ITS_ERROR_OFFSET.
2018-11-30 15:36:22 +00:00
Jaeden Amero 74f93271ab mbedtls: Update Mbed TLS to 2.15.1 2018-11-30 15:29:34 +00:00
Netanel Gonen f1c5aeb70e add MBEDTLS_PSA_CRYPTO_C defined to K64F PSA target 2018-11-27 14:02:55 +02:00
Mohammad AboMokh 819594477c Refactor trng_get_bytes() 2018-11-27 12:15:52 +02:00
Mohammad AboMokh b9ea334f1f Change __WEAK to MBED_WEAK 2018-11-27 12:15:26 +02:00
mohammad1603 4cef73d2eb Update output_length in trng_get_bytes() provided by psa. 2018-11-27 11:56:58 +02:00
Danny Shavit e72d910754 Add a weak implementation for trng_get_bytes() 2018-11-27 11:56:49 +02:00
Netanel Gonen 4816266205 add comment to explain why (-1 * rc) is returned 2018-11-27 11:56:44 +02:00
Netanel Gonen ae0fa609a9 remove psa_its_get_info from seed read function 2018-11-27 11:56:42 +02:00
Mohammad AboMokh 0fde6af120 change MBEDTLS_RANDOM_SEED_ITS_UID define to be PSA_CRYPTO_ITS_RANDOM_SEED_UID 2018-11-27 11:56:36 +02:00
Mohammad AboMokh 7b2c924ac7 Adding defualt behaviour for platforms without TRNG.
If setting the MBEDTLS_PLATFORM_NV_SEED_ALT and MBEDTLS_ENTROPY_NV_SEED flags and not
setting MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_NV_SEED_READ_MACRO flags
mbed-os will add an entropy source to the relevent partition - SPE in case of daul core or
in case of single core V7 to the main partition.

The defualt behaviour will be to read or write the data from the ITS.
2018-11-27 11:56:31 +02:00
Martin Kojtal 7a77e66472
Merge pull request #8643 from RonEld/feature_unsupported_error_support
Modify HW accelerator drivers to new error code
2018-11-26 10:59:14 +01:00
Jaeden Amero 3900b81d02 Update Mbed TLS to mbedtls-2.15.0 2018-11-23 22:54:09 +00:00
Hanno Becker 70f9497918 Mbed TLS importer: Call `config.pl --force` to accept unknown option
The new PSA-aware Mbed TLS importer script calls `config.pl` on the
Mbed TLS config.h to set the PSA configuration option
MBEDTLS_PSA_CRYPTO_STORAGE_C which isn't documented in config.h.
config.pl therefore fails, and so does the importer.

This commit fixes this by calling `config.pl` with the `--force`
option which amends the given `config.h` by a `#define` for the
requested option if the option isn't present in the file.
2018-11-23 22:54:07 +00:00
Mohammad AboMokh 1f4584fc70 Add mbed_lib.json for Mbed Crypto 2018-11-23 22:54:05 +00:00
itayzafrir b85db484b0 Update adjust-config.sh to enable persistent keys
In adjust-config.h, set and unset Mbed Crypto storage configuration options
in order to use persistent keys with PSA ITS storage.
2018-11-23 22:54:04 +00:00
Mohammad AboMokh 15945687bc Record Mbed Crypto version
Record the version of Mbed Crypto into VERSION.txt for easy reference.
2018-11-23 22:54:03 +00:00
Mohammad AboMokh 7ba359a4a6 Update mbedtls importer to import mbed-crypto 2018-11-23 22:54:01 +00:00
Ron Eldor 9f4e752ef3 Modify HW accelerator drivers to new error code
Have the HW accelearation drivers return the platform module
errors about feature unsupported, and hw acceleration failure,
because the moduel specific errors will be removed.
2018-11-11 09:59:18 +02:00
Mel W 495c875871
...remainder of file... to [remainder of file] 2018-10-26 11:17:52 +03:00
Mel W 56bced4ed1
Reformatting heading levels 2018-10-26 11:15:25 +03:00
Cruz Monrreal II 8cfdec1087 Merge branch 'readme-update' of ssh://github.com/sbutcher-arm/mbed into rollup 2018-10-25 21:49:49 -05:00
Amanda Butler 8bf4981807
Edit README.md
Edit file, mostly for active voice and removal of marketing language.
2018-10-25 15:30:40 -05:00
Melinda Weed 8c2bd401d2 editorial changes, passive to active, removing redundancy 2018-10-25 10:35:05 +03:00
Simon Butcher 650d8dc355 Improve Mbed TLS README.md
Improves the language, formatting and clarity of the Mbed TLS README.md.
2018-10-24 17:07:02 +01:00
Martin Kojtal 8faf40e3b0
Merge pull request #8434 from RonEld/change_platform_error
Change Mbed TLS platform error code and value
2018-10-16 07:17:33 -07:00
Ron Eldor 2620508e12 Change Mbed TLS platform error code and value
Change error from `MBEDTLS_PLATFORM_HW_FAILED` to
`MBEDTLS_PLATFORM_HW_ACCEL_FAILED` and the value to 0x70,
as the previous value cannot be used as a low level error code.
2018-10-15 16:21:54 +03:00
Cruz Monrreal 0cf26eb1cb
Merge pull request #7877 from TomoYamanaka/improve_nv_seed_of_tls
Improve the config ajustment script of TLS for ENTROPY_NV_SEED
2018-10-10 08:40:06 -05:00
Martin Kojtal bc706f0329
Merge pull request #8142 from moranpeker/disable-HW-acceleration
Disable MBEDTLS_CONFIG_HW_SUPPORT on STM targets.
2018-10-06 07:46:13 +02:00
Simon Butcher fee476e481 Update Mbed TLS README.md followng review
Numerous changes to language, grammar, and corrections, following review.
2018-10-03 12:16:50 +01:00
Moran Peker 333f087386 Disable MBEDTLS_SHA256_ALT on STM targets. 2018-10-02 14:35:22 +03:00
Simon Butcher 0fd0de6f31 Update the Mbed TLS README.md
Add content missing from the README.md taken from the Yotta/Mbed OS 3 Readme.
2018-09-26 16:33:17 +01:00
ccli8 d2c8be678f [M487] Add missing mbedtls_device.h for NUMAKER_IOT_M487 2018-09-11 18:25:14 +08:00
Simon Butcher 15785191e7 Update Mbed TLS version to 2.13.1 2018-09-06 19:32:03 +01:00
Martin Kojtal dd91b90149
Merge pull request #7974 from sbutcher-arm/update-mbedtls
Update Mbed TLS to version 2.13.0
2018-09-04 08:22:19 +02:00
Krzysztof Stachowiak 7d7b8d4a07 Disable the OFB cipher mode in Mbed TLS 2018-09-03 16:20:55 +01:00
Krzysztof Stachowiak f1d76691b6 Update to Mbed TLS 2.13.0 2018-09-03 16:20:46 +01:00
Cruz Monrreal 3be076c196
Merge pull request #7099 from RonEld/platform_context_reference_count
Add reference counter for platform context
2018-09-02 20:47:19 -05:00
Ron Eldor a2531b5674 Fix build error on IAR
IAR fails to build when a variable is initialized with empty curly braces.
Added `{ { 0 } }` to fix that.
2018-09-02 10:48:31 +03:00