Commit Graph

161 Commits

Author SHA1 Message Date
Janos Follath
49e6115443
Merge pull request #9651 from waleed-elmelegy-arm/add-iop-key-gen-complete
Add PSA interruptible key generation complete API
2024-11-26 18:34:40 +00:00
David Horstmann
3aefa5b705
Merge pull request #7977 from ivq/update_gcm_doc
Fix doc on GCM API
2024-11-21 17:35:52 +00:00
Ronald Cron
93ba625b96 Remove MBEDTLS_PSA_CRYPTO_CONFIG configuration option
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-21 15:52:06 +01:00
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
Waleed Elmelegy
bd36c4746a Stop IOP generate key complete test in case expected value is not success
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-13 13:08:26 +00: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
Harry Ramsey
8ad56b822b Fix TEST_CALLOC issues with GCM buffer overlap tests
This commit fixes issues with TEST_CALLOC in GCM buffer overlap tests
cases.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-11 10:09:01 +00: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
30437e6408 Add PSA interruptible key generation complete API
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:57:47 +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
Harry Ramsey
099623c8e9 Improve GCM buffer overlap test cases
This commit fixes an issue with GCM testing to handle edge cases by
replacing malloc with calloc. Additionally, fix an issue where different
buffers were used for encryption.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-04 11:02:29 +00:00
Harry Ramsey
415d1bc99c Fix issues with new GCM overlap buffer test cases
This commit code style and initialisation issues with the new buffer
overlap test cases for GCM.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-04 11:02:29 +00:00
Harry Ramsey
2e2036c84b Fix indentation in test_suite_gcm.function
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-04 11:02:29 +00:00
Harry Ramsey
b070eb6c52 Add test cases for AES GCM input and output buffer overlap
This commit adds test cases for input and output buffer overlap. The
data for the test cases is a duplicate of existing encrypt/decrypt test
cases.

The two test functions gcm_<encrypt/decrypt>_input_output_buffer_overlap
are modified to use a single malloc buffer rounded to the nearest
128-bits/16-bytes for input and output.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-04 11:02:29 +00: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