This commit also fixes related errors in test suites. In all
cases those failures are related to the use of raw keys whose
size cannot be determined a-priori.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This helps reducing heap memory usage and, if heap memory is
not used anywhere else in an embedded device, it also reduces
code footprint since there is no need for heap management code
in this case.
A new build symbol is added for this purpose, named
MBEDTLS_PSA_STATIC_KEY_SLOTS. It's disabled by default so that
normal usage of Mbed TLS library is not affected.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit replaces #includes "error.h" with #include "error_common.h"
since error.h no longer exists in tf-psa-crypto.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
With the `depend.py` using the crypto config the `PBKDF2_HMAC` can be
enabled so thest cases can be run.
The equivalence (synonym) between `PSA_WANT_ALG_RSA_PSS_ANY_SALT` and
`PSA_WANT_ALG_RSA_PSS` is now done properly, the test can be run.
Dependencies for `MBEDTLS_CIPHER_PADDING_PKCS7' has been updated and
now it can be actually disabled.
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
In the test examples and real usage scenarios, 'mbedtls_net_free' is called after 'mbedtls_net_connect' fails, which will cause the problem of double close the same fd. It is possible to close this closed fd which has been applied by other link.
Signed-off-by: makejian <makejian@xiaomi.com>
This commit fixes a linking error with psa_sim_crypto_server.c where
mbedtls_test_hook_error_add was undefined.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
The PSA and MbedTLS options can switch the same functionality separately
so add a check to ensure the cpnsistency.
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit fixes the error test suite to depend on MBEDTLS_ERROR_C
rather than MBEDTLS_ERRORCOMMON_C.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit fixes include issues with error.c. Since error_common.h now
defines error codes, this is a mandatory include. The macro
MBEDTLS_ERROR_C guards functions for strerror which is now found in
error.h.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit disables printing strerror messages in test programs. This
is due to moving the functions back to Mbed TLS and wanting to keep
dependencies of programs small. The code has not been removed but simply
commented out for when these functions are reimplemented.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
We cannot add the equivalent of
cmake_package_install yet as the build in
tf-psa-crypto still references some headers
in ./include/mbedtls like mbedtls_config.h.
We cannot add the equivalent of
cmake_subproject yet as currently only
the case of the Mbed TLS parent project is
supported.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Use MBEDTLS/TF_PSA_CRYTPO_AS_SUBPROJECT
instead of using the test employed to set
MBEDTLS/TF_PSA_CRYTPO_AS_SUBPROJECT value.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
Let the projects using some CMakeLists.txt files
without the top CMakeLists.txt define the variables
that the top CMakeLists.txt set for all.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit adds Mbed TLS x509 as a library dependency for utility
programs. This is necessary for strerror.c to work correctly.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit refactors tf-psa-crypto to include error_common.h instead of
error.h as these files have been split and the relevant error codes are
now inside error_common.h.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit updates the build scripts for error.c generation to be
generated in the Mbed TLS library directory.
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>