Ronald Cron
e0ebf55a19
Move back *config_test_driver* headers from the framework
...
config_test_driver.h and
crypto_config_test_driver_extension.h are
configuration files thus they better fit in
mbedtls branches than in the framework.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-21 15:51:58 +01:00
David Horstmann
5b93d97b95
Update references to test helpers
...
Replace:
* tests/src -> framework/tests/src
* tests/include -> framework/tests/include
Except for occurrences of:
* tests/src/test_helpers (since this only contains ssl_helpers.c)
* tests/src/test_certs.h
* tests/include/alt_dummy
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 15:50:44 +00:00
Janos Follath
fe4b02cc69
Merge pull request #9602 from paul-elliott-arm/add_key_agreement_negative_tests
...
Add key agreement negative tests
2024-11-18 13:02:03 +00:00
Ronald Cron
fee08b45e2
Merge pull request #9760 from ronald-cron-arm/tf-psa-crypto-cmake
...
Finalize the integration of the TF-PSA-Crypto build system into the Mbed TLS one
2024-11-15 17:05:16 +00:00
Paul Elliott
c54fcc765e
Add new psa_key_agreement() to key_agreement_fail()
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-11-15 14:09:03 +00:00
Ronald Cron
b7d0e52e16
cmake: Rename mbedcrypto target to tfpsacrypto
...
Rename mbedcrypto target to tfpsacrypto and
prefix all cmake related variables with
tfpsacrypto instead of mbedcrypto.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:27 +01:00
Ronald Cron
020e026779
cmake: tf-psa-crypto: Add cmake_subproject test program
...
The empty framework directory is temporary. It will be
removed when TF-PSA-Crypto uses its framework submodule.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:28:21 +01:00
Ronald Cron
2609fe9155
cmake: tf-psa-crypto: Rename mbedtls_test to tf_psa_crypto_test
...
To avoid conflict between the two targets when
the integration of the TF-PSA-Crypto cmake build
system into the Mbed TLS one is completed.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:47 +01:00
Ronald Cron
13a7ccec76
Align all.sh tf-psa-crypto components naming
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-14 09:06:29 +01:00
Manuel Pégourié-Gonnard
30e8eb9847
Update path to all-core.sh
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-11-12 11:57:46 +01:00
Janos Follath
241b9012a0
Merge pull request #9490 from waleed-elmelegy-arm/add-iop-key-agrmnt-api
...
Add PSA interruptible key agreement APIs
2024-11-11 09:29:16 +00:00
Manuel Pégourié-Gonnard
e248de54bf
Merge pull request #9720 from mpg/all.sh-tf-psa-crypto-dev
...
All.sh add support for tf-psa-crypto components
2024-11-07 08:49:44 +00:00
Paul Elliott
fc140d0c6b
Merge pull request #9672 from gilles-peskine-arm/coverity-20241004
...
Fix edge cases of mbedtls_psa_raw_to_der and mbedtls_psa_der_to_raw
2024-11-06 19:03:13 +00:00
Gilles Peskine
b48d5263c5
Merge pull request #9758 from gilles-peskine-arm/move-test_suite_psa_crypto_ecp
...
Move new test suite to the tf-psa-crypto directory
2024-11-06 17:56:30 +00:00
Waleed Elmelegy
3783acae26
Improve key agreement iop basic testing
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
57fb2a687c
Refactor interuptible key agreement testing helper function
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
a7fc0a676e
Add PSA interruptible key agreement tests
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Janos Follath
6eb9df7fc5
Merge pull request #9752 from gilles-peskine-arm/psa_init-20241104-dev
...
Fix MD_PSA_INIT called before initializing some data structures
2024-11-06 09:15:32 +00:00
Janos Follath
502ff7bcef
Merge pull request #9639 from waleed-elmelegy-arm/add-iop-key-gen-setup
...
Add PSA interruptible key generation setup & abort APIs
2024-11-06 09:10:42 +00:00
Gilles Peskine
ae5353bb62
Move new test suite to the tf-psa-crypto directory
...
It's a crypto test suite, but it was added in the main tree in a careless
forward port from 3.6.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 17:43:02 +01:00
Waleed Elmelegy
1ea62b11e1
Remove generate key brainpool160r1 & SECP224K1 test cases
...
Remove generate key brainpool160r1 & SECP224K1 test cases
as they are scheduled to be removed in 4.0 .
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-05 12:39:16 +00:00
Waleed Elmelegy
df186be8f5
Add extra tests cases for different Weierstrass curves for key generation
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-04 17:28:54 +00:00
Waleed Elmelegy
1f5075b23f
Revert "Add testing valid attributes after aborting an invalid input in iop key generation"
...
This reverts commit 005b78c307
.
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-04 17:28:34 +00:00
Gilles Peskine
9602ce7d8b
Fix MD_PSA_INIT called before initializing some data structures
...
This fixes accesses to uninitialized memory in test code if
`psa_crypto_init()` fails.
A lot of those were pointed out by Coverity. I quickly reviewed all calls to
`MD_PSA_INIT()` manually, rather than follow any particular list.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 18:28:01 +01:00
Waleed Elmelegy
005b78c307
Add testing valid attributes after aborting an invalid input in iop key generation
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-01 17:08:57 +00:00
Waleed Elmelegy
e3abcc3ff5
Improve interuptible key generation testing
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:39:02 +00:00
Waleed Elmelegy
1c3c5b15c2
Add Testing interuptible key generation initialization
...
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:35:38 +00:00
Bence Szépkúti
15baf8b027
Merge pull request #9708 from ronald-cron-arm/target-compile-options
...
cmake: Define compile and link options target by target
2024-10-29 18:59:07 +00:00
Gilles Peskine
8ed4d94166
Merge pull request #9614 from gilles-peskine-arm/use_psa_crypto-always_on
...
Always enable MBEDTLS_USE_PSA_CRYPTO in all.sh
2024-10-29 14:58:55 +00:00
David Horstmann
f8d13d8fad
Merge pull request #9721 from paul-elliott-arm/fix_new_coverity_issues
...
Fix new coverity issues
2024-10-25 16:43:37 +00:00
Ronald Cron
d093edd2bd
cmake: tests: Set test specific compile options target by target
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:40 +02:00
Ronald Cron
b2478989e2
cmake: GNU GCC: Set base compile options target by target
...
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-10-25 18:09:33 +02:00
Ronald Cron
5f6e69dae5
Merge pull request #9693 from Harry-Ramsey/split-revert-error-development
...
Split error.h and move back error.c to mbedtls
2024-10-25 13:12:58 +00:00
Gilles Peskine
4e9d77e6e7
Merge pull request #9703 from valeriosetti/fix-9690-workarounds
...
Revert & fix #9690 workarounds
2024-10-25 11:47:44 +00:00
Paul Elliott
a87a906a4c
Move AES_PSA_INIT to after drbg init
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 12:27:36 +01:00
Paul Elliott
da510d6390
Fix double free in case of test failure
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-24 14:58:22 +01:00
Paul Elliott
65b276c613
Add missing check of return
...
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-24 14:58:22 +01:00
Paul Elliott
7c6686014b
Fix tests where tests were done prior to init
...
Variables that are in any way destructed on exit should be initialised
prior to any tests that might jump to exit, to save potential
uninitialised memory accesses.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-24 14:58:14 +01:00
Manuel Pégourié-Gonnard
a4f0227669
all.sh: prevent a silly mistake
...
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-24 10:05:36 +02:00
Gilles Peskine
202b69c2b6
Merge pull request #9302 from valeriosetti/psa-use-static-slots
...
PSA: use static key slots to store keys
2024-10-24 07:27:48 +00:00
Ronald Cron
ed230c4fb3
Merge pull request #9706 from ronald-cron-arm/pkg-install-doc-lcov
...
tf-psa-crypto: cmake: Add support for pkg install, doc, lcov
2024-10-24 06:39:58 +00:00
Manuel Pégourié-Gonnard
8bcad48ca5
Add tf-psa-crypto's own all.sh
...
With a first component.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-23 10:41:15 +02:00
Gilles Peskine
8fd2117360
Remove !MBEDTLS_USE_PSA_CRYPTO test cases that have a USE_PSA alternate
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-22 22:10:42 +02:00
Valerio Setti
cac061f1d4
test_suite_psa_crypto.data: fix some depends_on
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
a35c8a0a7e
test_suite_psa_crypto: use finer grained checks on the key slot buffer size
...
Instead of skipping some tests when !MBEDTLS_PSA_STATIC_KEY_SLOTS,
add a proper check in the depends_on to verify if
MBEDTLS_PSA_KEY_BUFFER_MAX_SIZE is actually large enough to contain
the key used in such test.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
175a494d01
psa_crypto_helpers: enhance definitions for static key slot related test symbols
...
- MBEDTLS_TEST_STATIC_KEY_SLOTS_SUPPORT_RSA_[2048/4096] are always
defined because they are only used in test_suite_psa_crypto
tests.
- MBEDTLS_TEST_ALLOW_RSA_4096 was renamed as
MBEDTLS_TEST_PK_ALLOW_RSA_KEY_PAIR_4096 because this is only used in
PK related test suites.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
69d19e7bdd
psa_crypto_helpers: add MBEDTLS_TEST_ prefix to newly created symbols
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
2b9d180f8e
test_suite_psa_crypto_storage_format: improve input bit length specification for static key buffer
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
4d9a8219ac
test: properly select MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE value
...
This value should be:
- OK for all EC/FFDH key pairs/public keys;
- OK for all supported public RSA keys;
- OK for RSA key pairs up to 2048 bits;
- FAIL for RSA key pairs above 2048 bits.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00
Valerio Setti
c975d5e602
test: add test with persitent key whose length is larger than MBEDTLS_PSA_STATIC_KEY_SLOT_BUFFER_SIZE
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-10-22 17:56:36 +02:00