31187 Commits

Author SHA1 Message Date
Paul Elliott
9bfe69a815
Merge pull request #9274 from eleuzi01/backport-9250
[Backport 3.6] Fix compiler warnings in test_suite_pk.function
2024-06-24 10:40:49 +00:00
Manuel Pégourié-Gonnard
087d007040
Merge pull request #9305 from valeriosetti/issue9126-backport
[Backport 3.6] Do not perform adjustments on legacy crypto from PSA, when MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C
2024-06-24 07:30:36 +00:00
Valerio Setti
3b665626e8 changelog: add changelog
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-21 13:40:16 +02:00
Valerio Setti
3153ae47a9 config_psa: do not update legacy symbols in client-only PSA build
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-21 13:40:16 +02:00
Gilles Peskine
a9a2c73b7e Update generate_config_tests.py
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
112673f106 Add some missing handling for generated test_suite_config.*.data
Fixes the files not being generated in the build tree.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
d496caad6d Anchor relative paths
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
331d7d053d Driver vs referenee: ignore relevant configuration differences
The driver-vs-reference checks compare test results in different
configurations. Ignore the test results that report differences in
configurations that were the point of the comparison. Do compare other
configuration reports: this will let us know if the configurations diverge
in an unexpected way.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
06fb1803be Generate config test cases for single options
Generate option-on and option-off cases for test_suite_config, for all
boolean options (MBEDTLS_xxx and PSA_WANT_xxx, collected from the mbedtls
and PSA config files).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
1c52e57621 New test suite to report configuration options
Add a test suite intended to report configuration options in the outcome
file: we're only interested in SKIP vs PASS.

Add a few test cases for some interesting combinations of options. The
selection here is just for illustration purposes, more will be added later.

A subsequent commit will automatically generate test cases for single options.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
26d279e35f Clean up generated files enumeration
Avoid having to list multiple generation scripts on the same line.

No intended semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Gilles Peskine
30805a733b Recognize that a double-inclusion guard is not a config setting
Fix PSA_CRYPTO_CONFIG_H being treated as a configuration setting in
include/psa/crypto_config.h.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-21 00:01:20 +02:00
Ronald Cron
cf995d4197
Merge pull request #9289 from ronald-cron-arm/adapt-components-with-psa-crypto-config-enabled-3.6
[Backport 3.6] Partial backport of PR 9185
2024-06-19 13:38:27 +00:00
Ronald Cron
2c891fd165 Update framework submodule to the merge of PR22
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 13:49:24 +02:00
Ronald Cron
7b66beb666 test_when_no_ciphersuites_have_mac: Fix logs
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 10:34:21 +02:00
Ronald Cron
2463ec8d70 tests: src: Fix PSA test wrappers for PAKE
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-19 10:34:21 +02:00
Ronald Cron
81a2d1d421
Merge pull request #9276 from ronald-cron-arm/tree-cleanliness-3.6
[Backport 3.6] Partial backport of #9247
2024-06-18 22:23:48 +00:00
Manuel Pégourié-Gonnard
75ed58723e Add optionally unsafe variant of exp_mod for perf
Attempt to partially solve the performance regression in 3.6.0 without
adding too much code size.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-06-18 12:52:45 +02:00
Ronald Cron
5758749347 Update framework
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-18 11:44:00 +02:00
Elena Uziunaite
f99197122d Changelog Fix
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-06-18 10:28:10 +01:00
Elena Uziunaite
0dbb733a63 Add ChangeLog
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-06-18 10:27:57 +01:00
Ronald Cron
2b22b1e870 Add and update some .gitignore files
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-18 09:14:36 +02:00
Ronald Cron
da22402d5f all.sh: Fix clean-up of Makefiles generated by CMake
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-18 09:12:11 +02:00
Elena Uziunaite
3b7cde48be Code style fix
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-06-17 15:56:01 +01:00
Elena Uziunaite
4c882db6fc Fix compiler warnings in test_suite_pk.function
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-06-17 15:55:51 +01:00
Daan Timmer
6c792cab13 Use CMAKE_C_SIMULATE_ID when available to determine compiler
Signed-off-by: Daan Timmer <8293597+daantimmer@users.noreply.github.com>
2024-06-17 13:19:49 +01:00
Patrick Wildt
38bc960ecf Silence gcc 12.2.0 warning
Unfortunately this compiler complains about a variable potentially being
used un-initialized.  Silence the warning by initializing it to a sane
default.

Signed-off-by: Patrick Wildt <pwildt@google.com>
2024-06-17 12:24:02 +01:00
Tom Cosgrove
8fb5df859c
Merge pull request #9248 from sezrab/fix-function-parameter-3.6
[Backport 3.6] Fix incorrect array length in function prototype
2024-06-13 07:55:57 +00:00
Tom Cosgrove
07f9459a24
Merge pull request #9245 from lhuang04/mbedtls_3_6_psk_null_back_port
Set psk to NULL in ssl_psk_remove -backpor to 3.6
2024-06-12 12:00:28 +00:00
Sam Berry
9722fd133d Fix incorrect array length in function prototype
Issue #9179 (MBEDTLS_SSL_CID_OUT_LEN_MAX changed to
MBEDTLS_SSL_CID_IN_LEN_MAX in library\ssl.h and library\ssl_tls.c)

Signed-off-by: Sam Berry <sam.berry@arm.com>
2024-06-12 11:16:46 +01:00
lhuang04
6d4d94f3d0 Set psk to NULL in ssl_psk_remove -backpor to 3.6
Summary:
Backport [PR 9241](https://github.com/Mbed-TLS/mbedtls/pull/9241) to 3.6
branch.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Signed-off-by: lhuang04 <lhuang04@fb.com>
2024-06-11 13:05:02 -07:00
Gilles Peskine
dcc99bf81b
Merge pull request #9203 from gilles-peskine-arm/ssl-test-no-skip-all-3.6
Backport 3.6: ssl-opt.sh, compat.sh: Error out if not executing any tests
2024-06-11 13:59:13 +00:00
Tom Cosgrove
efa52fb078
Merge pull request #9231 from gilles-peskine-arm/tls13-debug-print-uint32-fix-3.6
Backport 3.6: Fix uint32_t printed as unsigned int
2024-06-10 15:13:38 +00:00
Bence Szépkúti
7927e50021
Merge pull request #9228 from davidhorstmann-arm/check-framework-python-files-3.6
[Backport 3.6] Extend python checks to framework scripts
2024-06-10 11:33:29 +00:00
Ronald Cron
6b41781784
Merge pull request #9234 from davidhorstmann-arm/make-code-style-work-in-commit-hook-3.6
[Backport 3.6] Allow `code_style.py` to work from a git hook
2024-06-07 14:07:50 +00:00
David Horstmann
dfba499c16 Extend python checks to framework scripts
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-06-07 11:10:43 +01:00
David Horstmann
93ee016836 Remove multi-type variable
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-06-06 16:20:58 +01:00
David Horstmann
8eaeb38b3a Allow code_style.py to work from a git hook
When running a git hook, git sets certain environment variables (such
as GIT_INDEX_FILE) which force git to look at the main repository,
overriding other options. This trips up code_style.py whenever it
tries to run a git command on the framework submodule.

Fix this by explicitly clearing git-related environment-variables
before running git commands on the framework. This is recommended
by git's documentation[1]:

> Environment variables, such as GIT_DIR, GIT_WORK_TREE, etc., are
> exported so that Git commands run by the hook can correctly locate
> the repository. If your hook needs to invoke Git commands in a
> foreign repository or in a different working tree of the same
> repository, then it should clear these environment variables so
> they do not interfere with Git operations at the foreign location.

[1] https://git-scm.com/docs/githooks

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-06-06 16:20:58 +01:00
Gilles Peskine
400659b565 Use unsigned long rather than size_t for format string readability
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-05 11:49:51 +02:00
Gilles Peskine
eeb4ff5662 Fix uint32_t printed as unsigned int
This is ok in practice since we don't support 16-bit platforms, but it makes
`arm-none-eabi-gcc-10 -mthumb -Wformat` complain.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-05 11:49:50 +02:00
Bence Szépkúti
2cfa6c9b45
Merge pull request #9208 from davidhorstmann-arm/move-test-generation-files-3.6
[Backport 3.6] Move test generation files to framework
2024-06-04 09:23:23 +00:00
David Horstmann
04e2d69504 Update framework to latest
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-06-03 18:20:09 +01:00
Tom Cosgrove
2eed2a0a43
Merge pull request #9219 from valeriosetti/backport-fix-psa-cmac
[Backport 3.6] adjust_legacy_crypto: enable CIPHER_C when PSA CMAC is builtin
2024-06-03 15:35:37 +00:00
Tom Cosgrove
d2327836c3
Merge pull request #9221 from valeriosetti/backport-fix-psa-doc
[Backport 3.6] fix documentation of psa_hash_compare()
2024-06-03 15:34:22 +00:00
Valerio Setti
1cb31cc5bf crypto.h: fix documentation for some functions
Some functions has input parameters which are erroneously
reported as "param[out]" in the documentation. This commit
fixes them.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-03 11:20:07 +02:00
Valerio Setti
18c70295b5 changelog: add changelog for PSA CMAC fix
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-03 06:54:46 +02:00
Valerio Setti
6b2120f511 adjust_legacy_crypto: enable CIPHER_C when PSA CMAC is builtin
psa_crypto_mac.c uses mbedtls_cipher_xxx() functions to perform
CMAC operations. Therefore we need to enable CIPHER_C when
PSA CMAC is builtin.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-03 06:54:46 +02:00
David Horstmann
b7033ad0d2 Update framework submodule
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-05-31 15:51:41 +01:00
David Horstmann
ea09152be9 Update file paths for moved files
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-05-31 15:51:41 +01:00
David Horstmann
a5eadf45ab Move some test generation files to framework
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-05-31 15:51:41 +01:00