11694 Commits

Author SHA1 Message Date
Gilles Peskine
a6c1f56a36 Add ignore list entries for ECDH/FFDH algorithm without key type
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-20 15:55:56 +01:00
Gilles Peskine
a2a0c394dd Remove test coverage exceptions that are no longer needed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-01-20 15:55:56 +01:00
Valerio Setti
bb71bb568b components-build-system.sh: align component_test_cmake_as_package
Align component_test_cmake_as_package to the "development" branch
version.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-14 09:48:05 +01:00
Valerio Setti
167b329e03 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

tests/scripts/pkgconfig.sh

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-14 09:48:05 +01:00
Valerio Setti
87f988545a component-basic-checks: fix paths of files moved to framework
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-09 17:05:21 +01:00
Valerio Setti
7892bcc18b Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

tests/scripts/check_names.py

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-09 17:05:21 +01:00
Gilles Peskine
905899839d
Merge pull request #9796 from gilles-peskine-arm/psa-storage-test-cases-never-supported-positive-3.6
Backport 3.6: Switch generate_psa_test.py to automatic dependencies for positive test cases
2025-01-09 13:53:11 +00:00
Valerio Setti
b90d12490c scripts: fix paths for files moved to framework
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-08 10:03:49 +01:00
Valerio Setti
81e0abc440 Move files out of Mbed TLS
The following files are moved to the framework repo (deleted here):

scripts/assemble_changelog.py
tests/scripts/check-doxy-blocks.pl
tests/scripts/check-python-files.sh
tests/scripts/doxygen.sh
scripts/apidoc_full.sh
tests/scripts/recursion.pl

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-01-08 10:02:35 +01:00
Gilles Peskine
b62279d960 Remove test coverage exceptions that are no longer needed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-24 20:03:29 +01:00
Gilles Peskine
bc3f917fb3 crypto_config.h: Don't list mechanisms that are not implemented
Don't list mechanisms that are not implemented in
`include/psa/crypto_config.h`, even commented out. Uncommenting them
wouldn't help anyway: they don't work. Having them listed, even commented
out, causes `find_dependencies_not_implemented()` in `psa_test_case.py` to
consider those mechanisms to be implemented, and thus causes
`generate_psa_tests.py` to generate test cases that cannot be executed.

The affected mechanisms are:

* `PSA_ALG_CBC_MAC` (`PSA_WANT_ALG_CBC_MAC`)
* `PSA_ALG_XTS` (`PSA_WANT_ALG_XTS`)
* `PSA_ECC_FAMILY_SECP_K1` 224-bit (`PSA_WANT_ECC_SECP_K1_224`)

Also remove the affected mechanisms from configuration adjustment files,
since that is code that can never be triggered.

There were already no generated test cases for SECP224K1 because
`PSA_WANT_ECC_SECP_K1_224` was already detected as a dependency that cannot
be implemented, because that is not a valid size: PSA defines SECP224K1 as
225-bit, and `crypto_knowledge.py` follows suite, so `generate_psa_tests.py`
saw `PSA_WANT_ECC_SECP_K1_225` in its enumeration but skipped it because it
was never mentioned in `crypto_config.h`.

This causes generated PSA tests to no longer include positive test cases for
`PSA_ALG_CBC_MAC` and `PSA_ALG_XTS`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-24 20:03:29 +01:00
Gilles Peskine
e7d92315ab Merge remote-tracking branch 'mbedtls-3.6' into psa-storage-test-cases-never-supported-positive-3.6
Update framework submodule to the tip of main.
2024-12-20 20:30:02 +01:00
Elena Uziunaite
4d6a2aa895 Adujst paths
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-19 10:43:03 +02:00
Elena Uziunaite
24157795a0 Move files out of Mbed TLS
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-19 10:43:03 +02:00
Elena Uziunaite
993df66645 Adjust paths
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-18 12:19:20 +02:00
Paul Elliott
cd40fa1f09
Merge pull request #9838 from waleed-elmelegy-arm/mbedtls-3.6
Backport 3.6: Fix Invalid opaque key testing
2024-12-11 17:47:34 +00:00
Ronald Cron
4497d5f39a
Merge pull request #9832 from ronald-cron-arm/finalize-split-preparation-2_3.6
Move test_keys.h to include/test
2024-12-11 13:39:26 +00:00
Gilles Peskine
edb89ff9c9 Create a new Python module used by generate_psa_tests.py
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-11 11:11:55 +01:00
Janos Follath
a770f30ee9
Merge pull request #9782 from gilles-peskine-arm/psa-storage-test-cases-never-supported-preliminaries-3.6
Backport 3.6: Make some edge cases of not-supported or invalid mechanisms more uniform
2024-12-10 18:16:05 +00:00
Waleed Elmelegy
f12b5e907c Remove Invalid import/export key test
The test is supposed to be an opaque key test but the
testing function does not support specifying an
opaque driver.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-12-10 17:39:57 +00:00
Waleed Elmelegy
68d6c79602 Fix export public-key opaque key test paramters
The test is marked as opaque but the parameter was set
to PSA_KEY_LIFETIME_VOLATILE.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-12-10 17:39:22 +00:00
Ronald Cron
4eaf54e646 Move test_keys.h to include/test
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-10 16:32:07 +01:00
Elena Uziunaite
e26f20e745 Adapt paths for scripts/quiet
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-09 15:37:49 +00:00
Elena Uziunaite
58172ae15e Adapt paths for output_env.sh
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-09 15:37:49 +00:00
Elena Uziunaite
9837ad316a Move files out of Mbed TLS
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-09 15:37:48 +00:00
Harry Ramsey
816c7c27f4 Refactor scripts to use config.py instead of config.pl
This commit refactors scripts to use config.py which replaces config.pl.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-05 10:55:31 +00:00
Harry Ramsey
8fae4b05ef Remove obsolete tcp_client.pl
This commit removes tcp_client.pl and removes it from ssl-opt.sh as it
has been replaced by test_suite_ssl.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-05 10:54:39 +00:00
Harry Ramsey
b5cfc05e89 Remove obsolete Travis CI scripts
This commit removes obsolete Travis CI scripts that are no longer
required due to the transition to a publically available CI image.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-05 10:53:47 +00:00
Harry Ramsey
454cb09a3a Remove obsolete Docker CI scripts
This commit removes Docker CI scripts from the repository as they are no
longer necessary with CI images being publically available.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-05 10:53:37 +00:00
Gilles Peskine
fbc8687033 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-02 21:46:50 +01:00
Elena Uziunaite
695810a093 Define FRAMEWORK
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-11-27 13:21:53 +00:00
Elena Uziunaite
f1099cb77e Use new functions
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-11-27 13:21:53 +00:00
David Horstmann
e60b395aa5
Merge pull request #9762 from Harry-Ramsey/update-gcm-doc-3.6
[Backport 3.6] Fix doc on GCM API
2024-11-21 17:35:53 +00:00
Gilles Peskine
8a8aa59f52 PSA interruptible sign/verify: detect unsupported mechanism in start
In particular, if interruptible ECDSA is supported but not the deterministic
variant, detect this in psa_sign_hash_start(), whereas before start() would
succeed and psa_sign_hash_complete() would fail. This avoids an
inconsistency between psa_sign_hash() and psa_sign_hash_start() that would
be annoying to handle in test_suite_psa_crypto_op_fail.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-21 09:48:35 +01:00
Gilles Peskine
6bf0b2e678 Add missing resource cleanup on test failure
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-21 09:48:35 +01:00
Gilles Peskine
8729b10f26 Fix edge case with half-supported ECDSA (manual test cases)
ECDSA has two variants: deterministic (PSA_ALG_DETERMINISTIC_ECDSA) and
randomized (PSA_ALG_ECDSA). The two variants are different for signature but
identical for verification. Mbed TLS accepts either variant as the algorithm
parameter for verification even when only the other variant is supported,
so we need to handle this as a special case when generating not-supported
test cases.

In this commit:

* Add manually written not-supported test cases for the signature
  operation when exactly one variant is supported.
* Add manually written positive test cases for the verification
  operation when exactly one variant is supported.
* Register that !ECDSA but DETERMINISTIC_ECDSA is not tested yet
  (https://github.com/Mbed-TLS/mbedtls/issues/9592).

A commit in the framework will take care of automatically generated test cases.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-21 09:48:35 +01:00
Ronald Cron
83d21cc8f4 Move back *config_test_driver* headers from the framework
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-11-20 13:22:54 +01:00
Gilles Peskine
85bc82c280 Add some missing test case dependencies
Following "PSA sign/verify: more uniform error on an unsupported hash", some
error cases are detected earlier, so there is some sloppiness in test case
dependencies that is not longer acceptable.

* In test_suite_psa_crypto, one test case for a hash+sign algorithm now
  returns NOT_SUPPORTED rather than INVALID_ARGUMENT when the hash is not
  supported and the key is invalid.
* In test_suite_psa_crypto_se_driver_hal_mocks, some test cases now error
  out before reaching the mocks rather than after when they attempt to
  use an unsupported hash.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-19 22:11:42 +01:00
Gilles Peskine
67cd8dbbe1 import_not_supported: edge case of unsupported curves
Allow imports of an ECC public key on an unsupported curve to return
INVALID_ARGUMENT rather than NOT_SUPPORTED. This can happen in our library
code in edge cases when only certain curve families are supported, and it's
acceptable.

The new code does not trigger yet, but it will be useful for a future commit
"Do run not-supported test cases on not-implemented mechanisms"
(forward port of 995d7d4c15406b0a115cadf3f5ec69becafdf20f).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-19 17:36:07 +01:00
David Horstmann
b25eaca940 Properly clean instrument_record_status.h
The paths to this header in clean: targets were missed previously when
changing paths to reflect the move of the header to the framework.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:50 +00:00
David Horstmann
44a9f2ff5f Add missing dependency to hash testsuite
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:49 +00:00
David Horstmann
cbf530dde7 Disable test hooks when checking missing symbols
The function mbedtls_test_hook_error_add() is declared in the library
but supplied by test helpers in framework/tests/src, so it is undefined
in library-only builds. This messes up our checks for missing symbols,
so disable MBEDTLS_TEST_HOOKS when we are building to check missing
symbols.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:49 +00:00
David Horstmann
501e9a9fee Update paths to generated PSA test wrappers
These are not moving to the framework, so their paths are fine to stay
as they are, undo the update done through global search-replace.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
c54f0b3e37 Update generate path to instrument_record_status.h
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
b19374f548 Update path to PSA crypto alt headers
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
61b7b1e780 Update make clean target with moved test helpers
Test helpers that are now moved to the framework must be cleaned
properly.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
4d47ee4146 Update test_keys.h generation in Makefile
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
685c19447f Update libtestdriver paths in tests/Makefile
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
45c83caf59 Add tests/Makefile targets for moved test helpers
Everything that has been moved to tests/src needs a Makefile target in
order to be built.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00
David Horstmann
4c4e0864f2 Add the framework/tests/include path to testsuites
These need to include from the framework path as this is where most test
helpers have been moved to.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-14 14:19:42 +00:00