Commit Graph

18870 Commits

Author SHA1 Message Date
Harry Ramsey
7220652204 Update GCM buffer overlap documentation
This commit updates GCM buffer overlap documentation to explicitly
support overlapping encryption/decryption buffers for GCM.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-13 10:38:41 +00:00
Paul Elliott
89c68e206b Merge pull request #9736 from mpg/drop-armcc5-2.28
[2.28] Drop armcc5 support in all.sh
2024-10-30 12:29:32 +00:00
Gilles Peskine
89a87b5353 Merge pull request #9729 from paul-elliott-arm/fix_new_coverity_issues_2.28
[Backport 2.28] Fix new coverity issues
2024-10-29 14:58:39 +00:00
Bence Szépkúti
0f2c45a78a Merge pull request #9734 from bensze01/graviton-testing-2.28
[Backport 2.28] Add default config tests for the A64, A32, Thumb 1 and Thumb 2 instruction sets
2024-10-29 12:24:56 +00:00
Manuel Pégourié-Gonnard
a674e988c9 Drop building with armcc5 in all.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 11:52:49 +01:00
Bence Szépkúti
61da0ddb07 Add override arguments for new gcc targets
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:33:48 +01:00
Bence Szépkúti
b14dd763c3 Clarify GCC version requirement
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:33:09 +01:00
Bence Szépkúti
478730eed2 Split up the Thumb-1 test component
The Thumb-1 tests are by far the slowest, so split the -O0 and -Os tests
into their own components.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:32:41 +01:00
Bence Szépkúti
73d8640bd3 Remove superfluous invocations of make clean
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:31:55 +01:00
Bence Szépkúti
f92112d7be Update component speed estimates
The estimates are based on the most recent CI run.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:30:20 +01:00
Bence Szépkúti
a56b61c6ee Initialize result caching variables
This prevents interference from identically named environment variables.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:29:49 +01:00
Bence Szépkúti
63a10d0726 Use true/false in place of integers
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:29:20 +01:00
Bence Szépkúti
08c14d1412 Ignore missing temporary files during cleanup
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:29:06 +01:00
Bence Szépkúti
26822ab1b6 Fix copypasta in gcc_version
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:28:50 +01:00
Bence Szépkúti
915fa3e6c7 Add AArch64 default config test
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:28:18 +01:00
Bence Szépkúti
86aa780e5a Add Arm eabi default config tests
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:27:39 +01:00
Gilles Peskine
987092107a Merge pull request #9609 from gilles-peskine-arm/outcome-check-repeated-configurations-all.sh-preliminaries-2.28
Backport 2.28: Fix some all.sh components with sub-components
2024-10-25 14:59:09 +00:00
Paul Elliott
417b8d92a1 Pair inits with declarations
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 12:47:23 +01:00
Paul Elliott
9488b8c513 Fix double free in case of test failure
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 12:00:05 +01:00
Paul Elliott
1348b6a861 Add missing check of return
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 11:59:59 +01:00
Paul Elliott
181564bb89 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-25 11:59:11 +01:00
David Horstmann
f87e85508b Merge pull request #9715 from ThePassionate/mbedtls-1022-2.8
[Backport 2.28] net/mbedtls_net_connect: Preventing double close problem
2024-10-22 16:49:14 +00:00
makejian
aa6ae3f649 net/mbedtls_net_connect: Preventing double close problem
In the test examples and real usage scenarios, 'mbedtls_net_free' is called after 'mbedtls_net_connect' fails, which will cause the problem of double close the same fd. It is possible to close this closed fd which has been applied by other link.

Signed-off-by: makejian <makejian@xiaomi.com>
2024-10-22 20:06:10 +08:00
Gilles Peskine
bfe4fc6749 Use -O2 for build+test with earliest compilers
The compilation is slower but we get more potential warnings and running the
tests is faster.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:58 +02:00
Gilles Peskine
8214340bb0 Fix spurious * in regex
`grep mbedtls_des*` would pick up e.g. mbedtls_derive_xxx.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:48 +02:00
Gilles Peskine
c61187f508 Don't set LD to a path with a typo for mingw
Our makefiles don't use $(LD) so the typo was harmless.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:02 +02:00
Paul Elliott
17d2fb8521 Merge pull request #9529 from jaimeMF/backport-gcc-14-calloc-fix
[Backport 2.28] tests: fix calloc() argument list (gcc-14 fix)
2024-09-04 08:49:04 +00:00
Sergei Trofimovich
990a88cd53 tests: fix calloc() argument list (gcc-14 fix)
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `mbedtls`:

    In file included from /build/mbedtls/tests/include/test/ssl_helpers.h:19,
                     from /build/mbedtls/tests/src/test_helpers/ssl_helpers.c:11:
    /build/mbedtls/tests/src/test_helpers/ssl_helpers.c: In function 'mbedtls_test_init_handshake_options':
    /build/mbedtls/tests/include/test/macros.h:128:46:
      error: 'calloc' sizes specified with 'sizeof' in the earlier argument
        and not in the later argument [-Werror=calloc-transposed-args]
      128 |             (pointer) = mbedtls_calloc(sizeof(*(pointer)),  \
          |                                              ^

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
2024-09-02 22:09:13 +02:00
David Horstmann
42c82aefed Merge pull request #1287 from Mbed-TLS/mbedtls-2.28.9_mergeback
Mbedtls 2.28.9 mergeback
2024-08-30 13:38:32 +01:00
David Horstmann
5e146adef6 Merge pull request #1284 from mpg/mbedtls-2.28.9rc0-pr
Mbedtls 2.28.9rc0 pr DO NOT MERGE
mbedtls-2.28.9 v2.28.9
2024-08-29 15:24:32 +01:00
Manuel Pégourié-Gonnard
c45a5e881d Add CVE ID to the ChangeLog
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-29 10:02:39 +02:00
Manuel Pégourié-Gonnard
2cb0cc26a4 Update BRANCHES.md
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:49:28 +02:00
Manuel Pégourié-Gonnard
c0743dd5c6 Assemble ChangeLog
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:48:10 +02:00
Manuel Pégourié-Gonnard
9f7cc4c14f Bump version to 2.28.9
Soversions unchanged.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:44:41 +02:00
Manuel Pégourié-Gonnard
18e5f888f0 Merge pull request #1283 from gilles-peskine-arm/merge-2.28-restricted-20240823
Merge 2.28 into -restricted
2024-08-26 12:07:17 +02:00
Gilles Peskine
69555ea884 Merge remote-tracking branch 'mbedtls-2.28' into mbedtls-2.28-restricted 2024-08-23 11:15:46 +02:00
David Horstmann
d1d27337bb Merge pull request #1280 from gilles-peskine-arm/memory_allocation_cleanup_psa_crypto_rsa-changelog-2.28
Backport 2.28: Changelog entry for the RSA memory leak
2024-08-22 15:45:11 +01:00
Gilles Peskine
578f66e5f0 Changelog entry for the RSA memory leak
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-22 13:01:29 +02:00
Tom Cosgrove
7c5160c491 Merge pull request #1273 from gowthamsk-arm/mem-alloc-cleanup-2.28
Backport 2.28: Fix: Memory allocation cleanup in internal crypto api functions
2024-08-19 15:50:30 +01:00
Gowtham Suresh Kumar
d9e16c4870 Free allocated memory where methods were returning without freeing
Signed-off-by: Sam Berry <sam.berry@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2024-08-19 13:22:35 +01:00
Gilles Peskine
36548eefa4 Merge pull request #9256 from gilles-peskine-arm/psa-keystore-dynamic-backport-2.28
Backport 2.28: prepare for dynamically sized key store
2024-08-09 08:00:01 +00:00
Gilles Peskine
4c9d43fb18 Improve documentation in some tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:57 +02:00
Gilles Peskine
d0ba2b0d1f Fix inverted assertion message
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:48 +02:00
Manuel Pégourié-Gonnard
b492272bab Merge pull request #1262 from mpg/merge-2.28
[2.28] merge public into 2.28-restricted
2024-08-08 12:25:12 +02:00
Manuel Pégourié-Gonnard
55aa72fe21 Merge remote-tracking branch 'public/mbedtls-2.28' into merge-2.28
* public/mbedtls-2.28: (88 commits)
  tests/ssl_helpers: Check that message queue is popped
  Upgrade python dependencies in requirements file
  Fix some typo for include folder
  Adjust TLS protocol cases for 2.28
  Fix copypasta
  Declare the new generated files
  Add generated config tests
  Remove some settings that don't exist in 2.28
  Adjust generate_config_tests.py for 2.28
  Terminology: use "dependencies" for a list of settings
  Terminology: consistently use "setting", not "option"
  Explain why we require TLS client and server simultaneously
  Fix missing negation
  Pacify mypy
  Detect sub-options
  Generate config test cases for single options
  Anchor relative paths
  New test suite to report configuration options
  Recognize that a double-inclusion guard is not a config setting
  Add and update some .gitignore files
  ...
2024-08-08 10:03:24 +02:00
Gilles Peskine
3a51fdc8c6 Improve full-key-store tests
Split the "many transient keys" test function in two: one that expects to
successfully create many keys, and one that expects to fill the key store.
This will make things easier when we add a dynamic key store where filling
the key store is not practical unless artificially limited.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Gilles Peskine
70de13d920 Improve the documentation of MBEDTLS_PSA_KEY_SLOT_COUNT
The description was misleading: setting the option doesn't “restrict” the
number of slots, that restriction exists anyway. Setting the option merely
determines the value of the limit.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Gilles Peskine
18f659b1e7 Assert that the key ID range for volatile keys is large enough
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Gilles Peskine
f16263e286 Assert that key ID ranges don't overlap
Ensure that a key ID can't be in range for more than one of volatile keys,
persistent (i.e. user-chosen) keys or built-in keys.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Gilles Peskine
91773db331 Add a test for the built-in key range
Restricting the built-in key range would be an API break since applications
can hard-code a built-in key value and expect that it won't clash with
anything else. Make it harder to accidentally break the API.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00