Commit Graph

1074 Commits

Author SHA1 Message Date
Valerio Setti 41389fbb81 mbedtls: add a kconfig to use the p256-m directly (without PSA interface)
For sake of memory footprint it might be required to shrink
down the memory footprint as much as possible. Unfortunately Mbed TLS
PSA interface brings in some extra code for key management which makes
it larger than the TinyCrypt counterpart when it comes to p256-m
interfacing. For this reason it might be useful to directly access
the p256-m driver directly.

This commit adds this support and it also updates the corresponding
test in order to make use of this condition.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-12 01:53:58 -07:00
Valerio Setti 69fa93bb79 mbedtls: add psa_crypto_init() when Mbed TLS acts a PSA crypto client
Ensure psa_crypto_init() is called during initialization when
Mbed TLS acts as a PSA crypto client. This will setup the PSA
crypto server for further calls.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-12 01:53:58 -07:00
Valerio Setti 185ec2bf78 mbedtls: add support for the P256M driver
Add support for the CortexM optimized implementation of secp256r1
code. It supports:
- import & export
- key agreement
- sign & verify

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-12 01:53:58 -07:00
Lucas Romero 69c5ef9665 lorawan: services: frag transport: prepare for pluggable decoder
by wrapping decoder implementation specific bits in #ifdefs

Signed-off-by: Lucas Romero <luqasn@gmail.com>
2024-06-11 16:09:23 +03:00
Przemyslaw Bida 7dc830e9db net: openthread: Add new kconfig OT options.
Adding:
	- `OPENTHREAD_BORDER_AGENT_EPHEMERAL_KEY_ENABLE`
	- `OPENTHREAD_CHANNEL_MANAGER_CSL`
	- `OPENTHREAD_PLATFORM_LOG_CRASH_DUMP`
	- `OPENTHREAD_MULTICAST_DNS`
	- `OPENTHREAD_VERHOEFF_CHECKSUM`

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-06-11 10:05:04 +02:00
Przemyslaw Bida 4c34e95904 net: openthread: Add implementation of TCAT advertisement.
Adds implementation of tcat advertisement API.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-06-11 10:05:04 +02:00
Reto Schneider d92e1e709e modules: Move away from SOC_VENDOR_SILABS
This allows to remove SOC_VENDOR_SILABS in a later commit.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-06-10 15:15:34 -05:00
Piotr Koziar 17a3c6dc24 modules: hal_nordic: turn off temperature update by default for nRF54H20.
Adds an appropriate condition to the Kconfig as
the temperature driver is not supported for nRF54H20 devices yet.

Without this change, a build with NRF 802.15.4 libraries produces
Kconfig error.

Signed-off-by: Piotr Koziar <piotr.koziar@nordicsemi.no>
2024-06-10 15:00:01 +03:00
Piotr Koziar 89c4afa3b8 modules: hal_nordic: implement hfclk start/stop for nRF54H20.
Clock_control is currently not supported on nRF54H20.
This commit adds new way of handling the hfclk targeted for nRF54H20.

This solution shall be replaced once the clock_control is supported
for nRF54H20.

Signed-off-by: Piotr Koziar <piotr.koziar@nordicsemi.no>
2024-06-10 15:00:01 +03:00
Daniel DeGrasse 7981ea0056 fs: fat_fs: make IOCTL call to de-initialize disk in fatfs_unmount()
Make call to de-initialize disk in fatfs_unmount(). This will permit the
disk to be reinitialized when it is mounted with fatfs_mount().

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-06-07 18:16:01 +01:00
Krzysztof Chruściński 17c3a23157 modules: hal_nordic: nrfx: nrfx_glue: Improve GPIOTE_CHANNELS_USED
Channels owned by a child core shall also be included in the mask of
used channels (channels that cannot be allocated by the GPIOTE channel
allocator).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-06-07 15:08:04 +02:00
Fengming Ye edd0ed7339 mbedtls: add kconfig options
Add MBEDTLS_NIST_KW_C, MBEDTLS_DHM_C and X509 CRL, CSR options.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-06 20:07:38 -04:00
Fengming Ye 1bfa73d036 hostap: add enterprise source files in cmake
Add enterprise needed source files.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-06 20:07:38 -04:00
Fengming Ye bdb0768882 hostap: remove CONFIG_NO_PBKDF2 and CONFIG_NO_CONFIG_BLOBS in cmake
Remove CONFIG_NO_PBKDF2 and CONFIG_NO_CONFIG_BLOBS definition
and let them be decided in kconfig.
CONFIG_NO_PBKDF2 is default y when crypto backend is
WIFI_NM_WPA_SUPPLICANT_CRYPTO_NONE.
CONFIG_NO_CONFIG_BLOBS is default y when both DPP and enterprise disable.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-06 20:07:38 -04:00
Fengming Ye 271d7084b5 hostap: add DPP support
Add kconfig and cmake to support DPP (Easy Connect).

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-06 20:07:38 -04:00
Fengming Ye d3b3aa1c35 hostap: add PSA apis support for mbedtls 3.x
Add Platform Secure Architecture support support to use
HW acceleration, which needs to be called under PSA driver wrapper
in mbedtls 3.x.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-06 20:07:38 -04:00
Fengming Ye 6f0c836337 hostap: add crypto backend alt for enterprise and DPP
Add kconfig CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT to get more mbedtls
functionality for enterprise and DPP.
Split cmake sources related to hostap SME and crypto backend.
Default backend CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO use internal crypto
and some mbedtls apis.
Backend CONFIG_WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT use most mbedtls apis
and PSA apis, except some apis no longer supported in mbedtls 3.x,
or called in the middle of hostap and mbedtls.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-06-06 20:07:38 -04:00
Lorenz Clijnen d7e5451799 modules: lvgl: input: Fix invalid encoder readout
When the encoder button was pressed, it would send a LV_KEY_LEFT/RIGHT
instead of a LV_KEY_ENTER event.
This clears the enc_diff field, and set the key field to LV_KEY_ENTER
for button events.

Fixes #73529

Signed-off-by: Lorenz Clijnen <lorenz_reclame@outlook.be>
2024-06-06 15:46:20 +01:00
Ilhan Ates ee4a20de15 modules: hal_nordic: nrfx: Use soc compatible definition
CONFIG_SOC_SERIES_NRF53X is replaced with SOC_COMPATIBLE_NRF53X
to have support for nrf5340bsim

Signed-off-by: Ilhan Ates <ilhan.ates@nordicsemi.no>
2024-06-05 17:37:31 -05:00
Valerio Setti 9360b6e1aa mbedtls: remove unused kconfigs for Blowfish, ARC4 and MD4
As of Mbed TLS 3.6 (which is the currently used version in Zephyr)
Blowfish, ARC4 and MD4 are no more supported so existing kconfigs
have no effect at all. Moreover they are not even used anywhere
in Zephyr.
This commit just removes them all and it also updates the migration
guide document.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-05 01:39:04 -07:00
Valerio Setti 87dbd81168 tfm: do not enable all PSA features by default when BUILD_WITH_TFM
Do not enable all PSA features by default when BUILD_WITH_TFM

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-05 01:38:22 -07:00
Axel Le Bourhis 8f5892a830 mcux: add Kconfig to configure NXP BLE monolithic feature
The monolithic feature allows to link the binary blobs with
the application during the build.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-04 19:12:45 -04:00
Chris Friedt 0fa97326c7 posix: create kconfig options for pse51, pse52, pse53
Create Kconfig "shortcuts" for PSE51, PSE52, and PSE53.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt 3f29b17bd1 posix: deprecate POSIX_SIGNAL in favour of POSIX_SIGNALS
This change deprecates CONFIG_POSIX_SIGNAL in favour of
the plural CONFIG_POSIX_SIGNALS, which maps directly to the
name of the standard POSIX Option Group POSIX_SIGNALS.

Additionally, mark signals as experimental.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt fcebe60090 posix: deprecate PTHREAD_IPC _MUTEX _COND and _KEY
Zephyr's POSIX API is moving toward using the standard
nomenclature from IEEE 1003.1-2017 for as much as possible. In
particular, we want to have consistent naming between Zephyr's
POSIX API Kconfig options and the naming for POSIX Options and
Option Groups.

The Kconfig option CONFIG_PTHREAD_IPC has been (ab)used for a
very long time for a variety of different purposes. However,
the standard Option / feature test macro for POSIX Threads is,
intuitively _POSIX_THREADS. There is a corresponding sysconf()
key named _SC_POSIX_THREADS.

Annoyingly, the POSIX Option Group that corresponds to the
Option is POSIX_THREADS_BASE, which is a minor inconsistency
in the standard.

The _POSIX_THREADS Option already includes mutexes, condition
variables, and thread-specific storage (keys). So with this
change, we also deprecate the redundant Kconfig variables that
do not have a corresponding match in the standard.

- CONFIG_PTHREAD_IPC
- CONFIG_PTHREAD
- CONFIG_PTHREAD_COND
- CONFIG_PTHREAD_MUTEX
- CONFIG_PTHREAD_KEY

Additionally, create Kconfig variables for those configurables
which we are lacking:

- CONFIG_POSIX_THREADS_EXT
- CONFIG_POSIX_THREAD_ATTR_STACKSIZE
- CONFIG_POSIX_THREAD_ATTR_STACKADDR
- CONFIG_POSIX_THREAD_PRIORITY_SCHEDULING
- CONFIG_POSIX_THREAD_PRIO_INHERIT
- CONFIG_POSIX_THREAD_PRIO_PROTECT
- CONFIG_POSIX_THREAD_SAFE_FUNCTIONS

Some Kconfig variables were renamed to more properly match the spec:

- CONFIG_MAX_PTHREAD_COUNT -> CONFIG_POSIX_THREAD_THREADS_MAX
- CONFIG_MAX_PTHREAD_KEY_COUNT -> CONFIG_POSIX_THREAD_KEYS_MAX

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt bc4374b5fe posix: deprecate POSIX_MAX_FDS and add POSIX_DEVICE_IO
The POSIX_MAX_FDS option does not correspond to any standard
POSIX option. It was used to define the size of the file
descriptor table, which is by no means exclusively used by
POSIX (also net, fs, ...).

POSIX_MAX_FDS is being deprecated in order to ensure that
Zephyr's POSIX Kconfig variables correspond to those defined in
the specification, as of IEEE 1003.1-2017. Namely,
POSIX_OPEN_MAX. CONFIG_POSIX_MAX_OPEN_FILES is being deprecated
for the same reason.

To mitigate any possible layering violations, that option is
not user selectable. It tracks the newly added
CONFIG_ZVFS_OPEN_MAX option, which is native to Zephyr.

With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":

* CONFIG_POSIX_DEVICE_IO

Similarly, with this deprecation, we introduce the following
Kconfig options that map directly to standard POSIX Options by
simply removing "CONFIG":

* CONFIG_POSIX_OPEN_MAX

In order to maintain parity with the current feature set, we
introduce the following Kconfig options.

* CONFIG_POSIX_DEVICE_IO_ALIAS_CLOSE
* CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN
* CONFIG_POSIX_DEVICE_IO_ALIAS_READ
* CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE

Gate open(), close(), read(), and write() via the
CONFIG_POSIX_DEVICE_IO Kconfig option and move
implementations into device_io.c, to be conformant with the
spec.

Lastly, stage function names for upcoming ZVFS work, to be
completed as part of the LTSv3 Roadmap (e.g. zvfs_open(), ..).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt 4a5c4e5f73 posix: timers: deprecate CONFIG_POSIX_CLOCK and TIMER
The POSIX_CLOCK option does not correspond to any standard
option. It was used to active features of several distinct
POSIX Options and Option Groups, which complicated API and
application configuration as a result.

POSIX_CLOCK is being deprecated in order to ensure that Zephyr's
POSIX Kconfig variables correspond to those defined in the
specification, as of IEEE 1003.1-2017.

Additionally, CONFIG_TIMER is being deprecated because it does
not match the corresponding POSIX Option (_POSIX_TIMERS).

With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":

* CONFIG_POSIX_TIMERS

Similarly, we introduce the following Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":

* CONFIG_POSIX_CLOCK_SELECTION
* CONFIG_POSIX_CPUTIME
* CONFIG_POSIX_DELAYTIMER_MAX
* CONFIG_POSIX_MONOTONIC_CLOCK
* CONFIG_POSIX_TIMEOUTS
* CONFIG_POSIX_TIMER_MAX

In order to maintain parity with the current feature set, we
introduce the following Kconfig options that map directly to
standard POSIX Option Groups by simply removing "CONFIG_":

* CONFIG_POSIX_MULTI_PROCESS - sleep()

Similarly, in order to maintain parity with the current feature
set, we introduce the following additional Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":

* CONFIG_XSI_SINGLE_PROCESS - gettimeofday()

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Fabian Blatz 81bc939553 modules: lvgl: lvgl_fs: Free file on close
Add missing call to LV_MEM_CUSTOM_FREE when closing a file to prevent
memory from leaking.

Resolves issue #73148.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-06-04 14:07:16 -05:00
Tomi Fontanilles c1342b3aa9 modules: mbedtls: remove the default enabling of features
In an effort to shave off code size, remove out-of-the-box
enabling of crypto features (except SHA-256).

Configurations are adjusted to enable what they need.

Bonuses:

- When enabled, AES now defaults to using a smaller version
(`CONFIG_MBEDTLS_AES_ROM_TABLES` isn't default enabled anymore,
and if enabled, `CONFIG_MBEDTLS_AES_FEWER_TABLES` defaults to y).

- Conditions around Mbed TLS Kconfig options have been improved
to reflect the reality of the dependencies.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-31 16:33:06 -05:00
Georgij Cernysiov 048b7552eb modules: lvgl: fix pointer input for normal orientation
Add missing break statement for normal orientation.

Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
2024-05-30 09:46:13 -05:00
Gerard Marull-Paretas 7ff30b6d9f modules: hal_nordic: require nrf-regtool 5.3.0
>=5.3.0 is required for proper CAN support.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-05-30 05:20:50 -07:00
Tomi Fontanilles 1eaa14090c modules: tf-m: support MCUboot signature types other than RSA-3072
With TF-M updated to 2.1.0 it now makes the signature type default
to EC-P256 for the mps2/an521/cpu0/ns board.
So far Zephyr had only supported and assumed that it was RSA-3072.

This brings support for other signature types, and changes the global
default to EC-P256.
The switch from RSA-3072 to EC-P256 reduces the flash usage by ~3.3KB
while having a negligible impact on RAM usage (increase of ~70 bytes)
when compiling the tfm_psa_test sample on mps2/an521/cpu0/ns and
nrf9160dk/nrf9160/ns without explicit optimizations.

The TFM_KEY_FILE_{S,NS} Kconfig options are moved inside an
`if TFM_BL2` as they are only used if MCUboot is included in TF-M.

The TF-M CMake variables MCUBOOT_KEY_{S,NS} are now set so that it's
possible to use signing keys located elsewhere than the default
location.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles c294069b7d modules: tf-m: restore check on CONFIG_TFM_PARTITION_INITIAL_ATTESTATION
Restore the check that was introduced in
cd8d4ccad5 and removed in
cac7f4058f, rather than checking only
CONFIG_TFM_PSA_TEST_INITIAL_ATTESTATION in the tfm_psa_test sample.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles 925d2ca052 modules: tf-m: fix unused CMake variable warning
Define and pass down PSA_ARCH_TESTS_PATH only in the sample that
needs it (tfm_psa_test).
Otherwise, it provokes a CMake warning because the variable does not
get used in TF-M.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles 2c575190bb Revert "tf-m: Silence harmless version warning"
This reverts commit 33786b55ab.

Reverting it because the upstream PR has been abandoned, and
this extra CMake variable is causing the warning
"Manually-specified variables were not used by the project".

As of now the version warning doesn't come up.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles 9ad1a7c8d2 modules: tf-m: disable tf-m-tests revision checks
Permanently disable the revision checks made in the tf-m-tests
repository that were introduced with TF-M 2.1.0.

They fail because the expected upstream tags are not found in Zephyr's
tf-m-tests.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 04:56:40 -07:00
Tomi Fontanilles 3efdbe6c0c modules: mbedtls: rename CONFIG_MBEDTLS_MAC_*_ENABLED and rm duplicates
Remove the `_MAC` part because those Kconfig options enable only hash
algorithms, nothing MAC-related, and the `_ENABLED` part to align the
naming to the Mbed TLS defines (plus we don't need such a part).

As a bonus, enabling SHA-256 does not automatically enable SHA-224
anymore.

See the migration guide entries for more details on the practical
changes.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-05-29 08:39:26 +02:00
Yong Cong Sin 0dac6c132b build: namespace `autoconf.h` with `zephyr/`
Namespace the generated `autoconf.h` file with `zephyr/`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Adam Kondraciuk cac0da313b drivers: timer: grtc: Update GRTC driver
This commit aligns the GRTC driver to changes introduced in
hal_nordic. Some of the features regarding GRTC sleep/wakeup
functionality has been modified and moved out to the nrfx
driver's code.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2024-05-28 18:53:39 +02:00
Krzysztof Chruściński 1f563b7821 modules: hal_nordic: Add NRFX_GPIOTE130_CHANNELS_USED mask
On SoC like nrf54h20 GPIOTE channels are split between cores. They
are reserved at compile time in devicetree. We need to ensure that
dynamically allocated channels are used only from pool assigned to
the given core. This is done using NRFX_GPIOTE130_CHANNELS_USED mask
which contains data from the device tree.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-28 10:08:09 +02:00
Glenn Andrews a70bf0e488 modules: lvgl: Fix inverting x/y if screen is rotated
https://github.com/zephyrproject-rtos/zephyr/pull/70541 has an
issue where if the screen has been rotated, values calculated if
invert-x or invert-y are set will be overwritten.

This breaks the adafruit_2_8_tft_touch_v2 touchscreen as the
display is rotated by 90 degrees but uses invert-x and invert-y.

This change makes the invert-x and invert-y options independent
of screen rotation.

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-05-27 12:30:05 -07:00
Aaron Ye d84874309e drivers: spi: create Ambiq SPI BLEIF driver
Some Ambiq Apollox Blue SOC (e.g. Apollo3 Blue) uses internal designed
BLEIF module which is different from the general IOM module for SPI
transceiver. The called HAL API will also be independent. This driver is
implemented for the BLEIF module usage scenarios.

Signed-off-by: Aaron Ye <aye@ambiq.com>
2024-05-27 03:27:43 -07:00
Krzysztof Chruściński 59415697c4 modules: hal_nordic: nrfx: nrfx_config: Fix SPIS137 config
Fixing a bug where wrong instance was enabled when SPIS137 was supposed
to be used.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-27 02:09:34 -07:00
Axel Le Bourhis 6ffbcd4990 modules: Add Kconfig to Kconfig.mcux for BLE support
Added NXP_FW_LOADER for NXP platforms.
Added NXP_RF_IMU for NXP platforms.
Added MONOLITHIC Flags for NXP platforms.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2024-05-25 11:23:04 +03:00
Sreeram Tatapudi f96e6ccbc0 boards: arm: Introduce Infineon CYW920829M2EVK-02 board
- Add initial version of CYW920829M2EVK-02 board
- [drivers: clock_control] Make it possible to set up both iho and imo
  clocks instead of just one or the other

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2024-05-24 18:05:11 -04:00
Andrzej Głąbek 2e8f104425 modules: hal_nordic: nrfx_glue: Remove NRFX_GPIOTE_CHANNELS_USED
This definition is no longer supported by the nrfx_gpiote driver (since
nrfx 3.2.0, reserved channels need to be defined per GPIOTE instance),
so remove it to not mislead users.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-05-24 07:47:15 -04:00
Valerio Setti 11920e35a0 mbedtls: reduce heap usage when building PSA crypto
By default PSA crypto library copies all the buffers that are passed
in into the heap before further processing them. This is required
when the PSA crypto library is on the secure side and it accepts
buffers from a non-secure code. However this case in Zephyr
is already handled by TF-M, so when the PSA crypto library is
built (CONFIG_MBEDTLS_PSA_CRYPTO_C) then it will be on the
non-secure side. Therefore this malloc copy is useless and
it consumes heap memory. Setting MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS
at Mbed TLS build time helps in removing this mechanism and
it saves heap memory.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 09:03:20 -07:00
Valerio Setti 210e08be5d bluetooth: mesh: update BT_MESH_USES_MBEDTLS_PSA selected symbols
Instead of selecting legacy MBEDTLS symbols, use corresponding
PSA_WANT ones when possible (note: some legacy symbols do not
have a PSA correspondance).

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti a1a7c9081a mbedtls: add new source file from MbedTLS 3.6 release
Add "sha3.c" source file that was previously missing from
CMakeLists.txt and that has been added in MbedTLS 3.6 release.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00
Valerio Setti 12ff947568 mbedtls: add new PSA_CRYPTO_CLIENT config
Using MBEDTLS_PSA_CRYPTO_CLIENT to guard all PSA_WANT symbols is
not completely correct because:

1. the prefix MBEDTLS suggests that it's something related to
   MbedTLS, while actually PSA APIs can be provided also
   by other implementations (ex: TFM)

2. there might applications which are willing to use PSA APIs
   without using MbedTLS at all. For example computing an hash
   can be as simple as writing psa_hash_compute() and, if the
   PSA function is provided thorugh TFM, then MbedTLS is not
   required at all

Therefore this commit:

- moves MBEDTLS_PSA_CRYPTO_CLIENT to Kconfig.tls-generic since
  that symbol belongs to MbedTLS

- adds a new symbol named PSA_CRYPTO_CLIENT as a generic way
  to state that there is "some" PSA crypto API provider

- let MBEDTLS_PSA_CRYPTO_CLIENT automatically select
  PSA_CRYPTO_CLIENT, since the former is an implementation of
  the latter.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-05-23 11:53:02 -04:00