31731 Commits

Author SHA1 Message Date
Gilles Peskine
f8fdea0fd4 Update framework
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-11 11:13:30 +01: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
Gilles Peskine
fcdebbeeb0 Fix make dir/file not rebuilding existing files
Running `make library/foo`, `make programs/foo` or `make tests/foo` only
rebuilt the given target if it was not an existing file, because the
toplevel makefile does not know the file's dependencies and thus thought
that every such target had empty dependencies. Fix this by always invoking
make recursively.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-11 11:08:14 +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
66ebd9a9ff make: Add missing dependency
Add missing dependency of visualc
file generation on programs and
tests generated files.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-12-10 16:32:12 +01: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
Harry Ramsey
f0dedbaa47 Fix incorrect submodule error message in CMake
This commit fixes a condition where the incorrect submodule error
message was displayed.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-10 15:32:04 +00:00
Harry Ramsey
0fdb404450 Fix incorrect submodule error message in Makefile
This commit fixes a condition where the incorrect submodule error
message was displayed as the check for the directory returns true only
if the directory does not exist

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-12-10 13:54:15 +00:00
Manuel Pégourié-Gonnard
189bf03056
Merge pull request #9789 from eleuzi01/issue-74-backport
[Backport 3.6] Move scripts used by all-core.sh to the framework
2024-12-10 12:31:10 +00:00
Elena Uziunaite
383ae2f0db Update submodule with the merge
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-10 09:43:43 +00:00
Nadav Tasher
aebe857339 Added debug print in tls13 ssl_tls13_write_key_share_ext
Signed-off-by: Nadav Tasher <tashernadav@gmail.com>
2024-12-09 20:16:48 +01:00
Elena Uziunaite
1552e11bb3 Update submodule
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-12-09 15:38:29 +00: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
Manuel Pégourié-Gonnard
2db55a5520
Merge pull request #9824 from Harry-Ramsey/remove-obsolete-ci-scripts-3.6
Backport 3.6: Remove obsolete CI Scripts
2024-12-09 10:49:50 +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
4f65e1f075 Distinguish between MBEDTLS_PSA_CRYPTO_C and MBEDTLS_PSA_CRYPTO_CLIENT
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-04 18:05:46 +01:00
Gilles Peskine
d78d695c46 FFDH in TLS: it's only a limitation for TLS 1.2, not TLS 1.3
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-04 18:04:55 +01:00
Janos Follath
42cb84fc4e
Merge pull request #9812 from SuperIlu/mbedtls-3.6
Mbedtls 3.6: Fix compilation on MS-DOS DJGPP
2024-12-03 09:12:12 +00:00
Gilles Peskine
fbc8687033 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-02 21:46:50 +01:00
SuperIlu
f36f405c05
reworked changelog according to suggestion
Signed-off-by: SuperIlu <superilu@yahoo.com>
2024-12-02 21:25:11 +01:00
SuperIlu
95355befd5 Added changelog
Signed-off-by: SuperIlu <superilu@yahoo.com>
2024-12-01 10:32:07 +01:00
SuperIlu
7e6d4c13a8 Make mbedTLS compile with MS-DOS DJGPP
Signed-off-by: SuperIlu <superilu@yahoo.com>
2024-12-01 10:31:50 +01:00
David Horstmann
968ada439b
Merge pull request #9805 from eleuzi01/project-detection-submodule-update-backport
[Backport 3.6] Update framework submodule
2024-11-28 14:30:23 +00:00
Elena Uziunaite
6d9cd17332 Update submodule to point to main
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-11-28 09:35:20 +00:00
David Horstmann
cbb502191c
Merge pull request #9764 from eleuzi01/issue-39-backport
[Backport 3.6] Add project and branch detection in shell
2024-11-27 16:51:24 +00: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
91f424a72d Fix paths
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
Elena Uziunaite
e0be1f3406 Add project and branch detection in shell
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-11-27 13:21:50 +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
Ronald Cron
c5197adef2
Merge pull request #9787 from ronald-cron-arm/move-back-test-configs
Move back test configs
2024-11-21 13:55:56 +01:00
Gilles Peskine
ad04f962f8 p256-m: allow deterministic ECDSA verification
For ECDSA verification, there is no difference between the deterministic and
randomized algorithm. The PSA core consider the two variants as identical as
far as key policies are concerned, and the built-in implementation accepts
either variant even if only the other variant is supported for signature.

In p256-m, accept to perform an ECDSA verification when the algorithm is
specified as deterministic ECDSA. This makes the behavior identical to the
built-in implementation, which is less surprising for users and saves us
from having to cope with a difference in our testing.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-21 09:48:35 +01: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
Manuel Pégourié-Gonnard
540355ac9a
Merge pull request #9766 from davidhorstmann-arm/move-some-test-helpers-to-framework-3.6
[Backport 3.6] Move some test helpers to the framework
2024-11-20 09:55:48 +00: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
David Horstmann
4c67ae3344 Update framework submodule
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-19 17:08:51 +00: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
Gilles Peskine
808b541316 PSA sign/verify: more uniform error on an unsupported hash
Uniformly return PSA_ERROR_NOT_SUPPORTED if given an algorithm that includes
a hash, but that hash algorithm is not supported. This will make it easier
to have a uniform treatment of unsupported hashes in automatically generated
tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-19 17:36:07 +01:00
David Horstmann
641f56e92e Update framework to add ported test helper changes
Update the framework pointer to reference new changes to
tests/src/psa_exercise.key.c and tests/include/test/psa_exercise_key.h
that have been ported to the framework from the main repo.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 16:43:56 +00:00
David Horstmann
36b68aac82 Update framework submodule
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-11-18 13:38:54 +00:00