Commit Graph

455 Commits

Author SHA1 Message Date
Ronald Cron
5d3036e6d5 tests: ssl: Add max_early_data_size option
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-01 09:03:51 +01:00
Ronald Cron
9b4e964c2c
Merge pull request #8760 from ronald-cron-arm/tls13-write-early-data
TLS 1.3: Add mbedtls_ssl_write_early_data() API
2024-02-29 14:31:55 +00:00
Gilles Peskine
0aab69d2eb
Merge pull request #8807 from gilles-peskine-arm/pk_import_into_psa-implement_import
Implement mbedtls_pk_import_into_psa
2024-02-21 15:45:17 +00:00
Gilles Peskine
dd49c739f0 Merge remote-tracking branch 'development' into pk_import_into_psa-implement_import
Conflicts:
* tests/suites/test_suite_pk.function: consecutive changes to the
  depends_on line of pk_sign_verify and its argument list.
2024-02-21 12:10:40 +01:00
Manuel Pégourié-Gonnard
0ecb5fd6f5
Merge pull request #8574 from ronald-cron-arm/ssl-tickets
Fix and align ticket age check in ssl_ticket.c for TLS 1.2 and TLS 1.3
2024-02-21 09:38:46 +00:00
Gilles Peskine
6fe8a06f7e New test helper: mbedtls_test_key_consistency_psa_pk
Test that a PK key and a PSA key are consistent, i.e. that they have the
same type (or are a key pair and the corresponding public key) and that
they have the same public key.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-15 17:21:17 +01:00
Ronald Cron
b9a9b1f5a5 tls13: Fix/Improve comments
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-15 17:19:14 +01:00
Manuel Pégourié-Gonnard
e6c80bc6e5
Merge pull request #8755 from ronald-cron-arm/tls13-client-early-data-status
TLS 1.3: Refine and test client early data status
2024-02-13 20:36:42 +00:00
Gilles Peskine
465e4ed56b Prioritize SHA2 over MD5 for KNOWN_SUPPORTED_HASH_ALG
This fixes the ability to exercise keys in configurations where MD5 is
supported for direct use, but not inside some accelerated algorithms. This
is the case in `all.sh test_psa_crypto_config_accel_ecc_ecp_light_only` and
some other accelerated-ECC components of `all.sh`, where the driver is built
without MD5 support but built-in MD5 remains enabled.

This is only a hack, not a theoretically correct fix, but a correct fix is
out of scope of my current work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-12 19:54:53 +01:00
Gilles Peskine
34955677e5 Don't exercise if the algorithm is not supported
Parsing a key and importing it into PSA may result in a policy that
specifies an algorithm that is not included in the build. This happens if
the key type is supported, but not the algorithm, e.g. in a build with
MBEDTLS_ECP_C but not MBEDTLS_ECDSA_C.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-12 19:31:55 +01:00
Paul Elliott
5d2bcc63cd Fix typo / improve documentation for test step fns
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-09 14:41:24 +00:00
Paul Elliott
54ad01efed Merge remote-tracking branch 'upstream/development' into make_tests_thread_safe 2024-02-09 14:33:58 +00:00
Janos Follath
7a28738205
Merge pull request #8636 from paul-elliott-arm/new_test_thread_interface
New test thread interface
2024-02-08 12:35:40 +00:00
Paul Elliott
292b1dc1e1
Merge pull request #8789 from paul-elliott-arm/fix_tsan_gcc
Stop platform test failures with GCC and TSAN
2024-02-07 11:32:39 +00:00
Manuel Pégourié-Gonnard
1d7bc1ecdf
Merge pull request #8717 from valeriosetti/issue8030
PSA FFDH: feature macros for parameters
2024-02-07 10:06:03 +00:00
Paul Elliott
e053cb2f12 Stop platform test failures with GCC and TSAN
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-06 18:10:43 +00:00
Ronald Cron
1f6e4e4a49 tests: ssl: Add helper function to get a TLS 1.3 ticket
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-06 16:43:33 +01:00
Ronald Cron
ced99be007 tests: ssl: Add early data handshake option
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-06 16:43:33 +01:00
Ronald Cron
fb53647b0b tests: ssl: Move group list to options
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-02-06 16:43:33 +01:00
Paul Elliott
79e2e5d2d0 Add comment to set/increment step functions
These functions are thread safe, but using them from within multiple
threads at the same time may not have the intended effect, given order
cannot be guaranteed. Also, standardise header comment formatting.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-06 15:10:03 +00:00
Dave Rodgman
e883870cc7
Merge branch 'development-restricted' into update-development-r
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-02 18:03:29 +00:00
Paul Elliott
098e2d82cd Revert accidental formatting change
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-02 17:59:26 +00:00
Ryan Everett
8d606857da Remove unnecessary dependencies from psa_crypto_helpers.h
The psa_test_wrappers.h inclusion was breaking the examples in programs/
on functions with poisoning added

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-02 10:33:09 +00:00
Ronald Cron
11cc41265b
Merge pull request #8711 from ronald-cron-arm/tls13-ticket-and-early-data-unit-test
Add TLS 1.3 ticket and early data unit tests
2024-02-01 13:15:55 +00:00
Paul Elliott
ae942ece47 Fix style issues
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-01 12:44:01 +00:00
Paul Elliott
24e9a32c83 Refactor to help future other implementations
Improve the definition of mbedtls_test_thread_t to assist adding future
threading implementations, when they happen.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-01 12:26:23 +00:00
David Horstmann
b2c9f0e2df Disable poisoning with PSA_CRYPTO_DRIVER_TEST
This option causes nested calls to PSA functions, so is not compatible
with memory poisoning as it currently stands.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-31 14:38:15 +00:00
Dave Rodgman
047c724c22 Merge remote-tracking branch 'restricted/development-restricted' into update-development-r
Conflicts:
	programs/Makefile
	tests/scripts/check-generated-files.sh
2024-01-26 12:42:51 +00:00
Sergei Trofimovich
da2a33de0f 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-01-25 21:29:56 +00:00
David Horstmann
9c5c9c351d
Merge pull request #1141 from davidhorstmann-arm/memory-poisoning-runtime-enable
Enable and disable memory poisoning at runtime
2024-01-24 14:46:43 +00:00
Ronald Cron
77abfe67db ssl_helpers.c: Add ticket write/parse test functions
Add ticket write/parse test functions as defined
by mbedtls_ssl_ticket_write/parse_t. They are
intended to be used in negative testing
involving tickets.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-01-22 09:37:45 +01:00
Paul Elliott
3d2db89d5c Access the test data mutex via accessor
Remove the use of extern and instead use an accessor to get the address
of the test info mutex (defined only if MBEDTLS_TEST_MUTEX_USAGE is
defined, to hopefully stop more general usage)

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-19 20:44:32 +00:00
Paul Elliott
ed3ba3cc8e Fix documentation typos.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-19 16:44:23 +00:00
Valerio Setti
4f34b155f5 test_driver_key_management: keep mbedtls_test_opaque_wrap_key() private
Only mbedtls_test_opaque_unwrap_key() is actually needed by other
test drivers to deal with opaque keys. mbedtls_test_opaque_wrap_key()
can be kept private to test_driver_key_management.c.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-01-18 08:44:13 +01:00
David Horstmann
d3efb92922 Add underflow check to UNPOISON counter decrement
Make sure that extra UNPOISON calls do not cause the poisoning counter
to underflow and wrap around.

Memory that is unpoisoned multiple times should remain unpoisoned.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-17 15:27:50 +00:00
Valerio Setti
1161b44981 crypto_config_test_driver_extension: support accelaration of DH groups
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-01-17 15:57:06 +01:00
David Horstmann
fad038c501 Change memory poisoning flag to a count
This allows unusually-nested memory poisoning to work correctly, since
it keeps track of whether any buffers are still poisoned, rather than
just disabling poisoning at the first call to the UNPOISON() macro.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-17 14:23:20 +00:00
Gilles Peskine
4411c9c1f8 Disable PSA wrappers psa_collect_statuses builds
`psa_collect_statuses.py` runs `make RECORD_PSA_STATUS_COVERAGE_LOG=1`,
which builds with `RECORD_PSA_STATUS_COVERAGE_LOG`. In this mode, the build
includes wrappers for PSA functions, which conflict with the newly
introduced wrappers that are enabled whenever `MBEDTLS_TEST_HOOKS` is
enabled. In the future, the collect-statuses mechanism should use the new
generic wrapper mechanism. For the time being, keep the old wrappers and
avoid the new wrappers when doing the collect-statuses build.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-15 19:30:48 +01:00
Gilles Peskine
8e7960b685 Remove the manually written poisoning wrapper
This fixes the build with ASan + MBEDTLS_TEST_HOOKS.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-15 19:22:15 +01:00
Gilles Peskine
90d14d7fc2 Update generated PSA wrappers
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-15 19:21:36 +01:00
Gilles Peskine
2b106dec8b Enable generated PSA wrappers
Code in unit tests (`tests/suites/*.function`) and in test support
code (`tests/src/**.c`) will now go through the wrapper functions when they
call a PSA API function and `MBEDTLS_TEST_HOOKS` is enabled.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-15 19:16:16 +01:00
Gilles Peskine
6e4332cc24 Commit generated PSA wrappers
Commit files generated by `tests/scripts/generate_psa_wrappers.py`. As of
this commit, the new code is neither useful (the wrappers just call the
underlying functions) nor used (the wrapper functions are not called from
anywhere). This will change in subsequent commits.

This is a deviation from our normal practice of generating
configuration-independent platform-independent files as part of the build in
the development branch. The PSA test wrappers will be committed to the
repository for some time for two reasons:

* In the short term, we will review the generated code but not fully review
  the generator script.
* The build scripts cannot yet accommodate a generated header file.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-15 19:12:05 +01:00
Valerio Setti
66a827fc83 test_driver_key_management: make opaque [un]wrapping functions public
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-01-15 15:00:52 +01:00
Ronald Cron
7b1921ac57 Add endpoint in TLS 1.2 session serialization data
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-01-15 08:58:19 +01:00
David Horstmann
8174478f82 Use thread-local flag to enable memory poisoning
Allow memory poisoning to be enabled and disabled at runtime using a
thread-local flag. This allows poisoning to be disabled whenever a PSA
function is called but not through the test wrappers, removing false
positive use-after-poisons.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-12 15:13:54 +00:00
Paul Elliott
65064265c2 Protect test info access with mutex
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-09 18:01:58 +00:00
Paul Elliott
c7a1e9936a Move bignum flag for negative zero into test_info
Add accessors ready for protection with test_info mutex.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-09 18:01:58 +00:00
Paul Elliott
3a4d2f14a8 Add test thread create/join abstraction
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-05 21:04:52 +00:00
Paul Elliott
17c119a5e3 Migrate to threading_helpers.h
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-05 21:04:52 +00:00
Paul Elliott
5c498f355d Use mbedtls_test_info accessors internally as well
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-05 19:13:43 +00:00
Paul Elliott
4580d4d829 Add accessor helpers for mbedtls_test_info
Step one of being able to control access to mbedtls_test_info with
a mutex.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-01-05 19:13:43 +00:00
David Horstmann
2de5abf284 Only poison memory when buffer copying is enabled
Make sure that we don't enable memory poisoning when
MBEDTLS_PSA_COPY_CALLER_BUFFERS is disabled.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-20 11:26:40 +00:00
David Horstmann
83ece2fe49 Add extra MBEDTLS_PSA_CRYPTO_C guard for header
Do not include psa_memory_poisoning_wrappers.h unless
MBEDTLS_PSA_CRYPTO_C is set.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-18 15:34:06 +00:00
David Horstmann
853f9f97eb Add missing newline at end of file
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-14 17:17:20 +00:00
Valerio Setti
10e9aa26c5 tests: add PSA_INIT/PSA_DONE to CCM and GCM test suites
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-14 18:08:14 +01:00
David Horstmann
7de0928fd1 Move wrapper include to psa_crypto_helpers.h
This makes memory poisoning wrappers available to (almost) all tests.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-14 16:09:07 +00:00
David Horstmann
a7cde5d296 Move test hook setup functions into a C file
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-14 16:09:07 +00:00
David Horstmann
b7a5b6ed35 Add comment explaining the purpose of header
Explain why we have the wrappers in psa_memory_poisoning_wrappers.h

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
bbd44a767f Add missing license header
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
e138dce329 Change to use test-hook-based approach
Since we are applying hooks transparently to all tests, we cannot setup
and teardown test hooks in the tests. Instead we must do this in the
test wrappers which are used to pre-poison and unpoison memory.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
David Horstmann
8f35a4f003 Create memory poisoning wrapper for cipher encrypt
Use the preprocessor to wrap psa_cipher_encrypt in a wrapper that
poisons the input and output buffers.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-12-11 17:58:56 +00:00
Valerio Setti
302a487499 test_driver_key_management: rename counter for export_public_key() hits
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:42 +01:00
Valerio Setti
829ce0facf test_driver_cipher: add forced return status for encrypt and set_iv
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:42 +01:00
Valerio Setti
7ef35a9b3c test_suite_psa_crypto_driver_wrappers: add counter for failing psa_cipher_update()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:42 +01:00
Valerio Setti
7448367f68 test_suite_psa_crypto_slot_management: modify check on open key slots
This commit
- Reverts changes previously done to psa_crypto_helpers.[c,h]
- Implements a new check for open key slots in
  mbedtls_test_helper_is_psa_leaking():
   - when CTR_DRBG does not use AES_C or PSA does not have an external
     RNG, then we allow 1 key slot (it's the one holding the AES key)
   - when the above conditions are not met, then we fallback to the
     usual check for "no open key slots remaining"

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:42 +01:00
Valerio Setti
45337a8895 test_suite_psa_crypto_driver_wrappers: add counter for cipher_update()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:42 +01:00
Valerio Setti
6ef82ae39d test_suite_psa_crypto_driver_wrappers: improving driver access counters
When AES_C is not defined CTR_DRBG relies on PSA to get AES-ECB. This
means that, when AES-ECB is accelerated, each random operation goes through
driver access as well. This might result in unexpectedly increased
counters for driver's access.
We add extra counters in test_driver_[cipher/key_management].c to be
more specific on which driver functions are accessed and ignore
extra accesses due to CTR_DRBG.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:42 +01:00
Valerio Setti
dc32ac20fd test_suite_[ctr_drbg/random]: initialize/close PSA in tests
This commit also adds AES_PSA_[INIT/DONE] in "psa_crypto_helpers.h". Its
scope is to call PSA_[INIT/DONE] only when AES_C is not defined (which is
when PSA is effectively required for CTR_DRBG).

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:41 +01:00
Valerio Setti
402cfba4dc psa: free RNG implementation before checking for remaining open key slots
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-12-04 11:04:41 +01:00
Yanray Wang
a72bc9adf7 ssl_helpers: remove guard for rng_get()
After adding a check in ssl_conf_check(), we have configured RNG via
mbedtls_ssl_conf_rng() for TLS tests in both test_suite_ssl.function
and test_suite_debug.function. As a result, rng_get() is not only
available when MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED enabled.
Therefore, we remove the guard for rng_get() to make it accessible for
TLS tests which have call for mbedtls_ssl_setup().

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-12-04 11:07:00 +08:00
Yanray Wang
f88e529de3 ssl_helpers: make rng_get available for other test cases
This is a pre-step to configure random number generator in some
TLS tests.

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-12-04 10:50:34 +08:00
Gilles Peskine
81f8132bd5 Avoid unused variable warnings in some plausible usage
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 19:42:36 +01:00
Gilles Peskine
abfad78655 Use the existing definition of MBEDTLS_TEST_HAVE_ASAN
A definition now exists in tests/helpers.h, which is a better place.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 19:41:58 +01:00
Gilles Peskine
0bdb6dc079 Fix memory poisoning with Asan on arbitrary byte boundaries
Asan poisons memory with an 8-byte granularity. We want to make sure that
the whole specified region is poisoned (our typical use case is a
heap-allocated object, and we want to poison the whole object, and we don't
care about the bytes after the end of the object and up to the beginning of
the next object). So align the start and end of the region to (un)poison to
an 8-byte boundary.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 19:22:03 +01:00
Gilles Peskine
d29cce91d0 Add memory poisoning framework
While an area of memory is poisoned, reading or writing from it triggers a
sanitizer violation.

Implemented for ASan.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 19:22:03 +01:00
Gilles Peskine
3fd3d05196 New files for memory-related test functions
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-29 19:22:03 +01:00
Janos Follath
c6f1637f8c
Merge pull request #8534 from paul-elliott-arm/fix_mutex_abstraction
Make mutex abstraction and tests thread safe
2023-11-29 13:26:23 +00:00
Dave Rodgman
c3cd410acf
Merge pull request #8286 from gilles-peskine-arm/check_mbedtls_calloc_overallocation-disable_with_asan
Fix test_suite_platform failure with Asan on modern Clang
2023-11-28 16:48:31 +00:00
Paul Elliott
f25d831123 Ensure mutex test mutex gets free'd
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-11-23 18:49:43 +00:00
Gilles Peskine
fa8ec2611e Detect enabled GCC/Clang sanitizers
Occasionally we want tests to take advantage of sanitizers, or work around
them.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-22 17:56:26 +01:00
Valerio Setti
776981ba42 psa_exercise_key: add missing #else for KNOWN_SUPPORTED_BLOCK_CIPHER
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-11-15 09:18:14 +01:00
Valerio Setti
a4b60593c1 psa_exercise_key: replace legacy symbols with PSA_WANT ones
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-11-15 09:18:14 +01:00
Valerio Setti
a765eaa33e test_driver_extension: fix acceleration support for CCM and CCM*
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-11-15 09:18:14 +01:00
Manuel Pégourié-Gonnard
bce640b7e3
Merge pull request #8499 from valeriosetti/issue8488
Clean up libtestdriver1 config: unconditonal removals
2023-11-15 04:25:14 +00:00
Valerio Setti
b9015385fd test_driver_extension: use same def/undef pattern for all accelerated symbols
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-11-08 13:11:10 +01:00
Pengyu Lv
ba6825e37b ssl: use MBEDTLS_SSL_HAVE_* in tests
Done by commands:

```
sed -i "s/MBEDTLS_\(AES\|CAMELLIA\|ARIA\|CHACHAPOLY\)_C/MBEDTLS_SSL_HAVE_\1/g" tests/{suites,include,src}/**/*ssl*
sed -i "s/MBEDTLS_\(GCM\|CCM\)_C/MBEDTLS_SSL_HAVE_\1/g" tests/{suites,include,src}/**/*ssl*
sed -i "s/MBEDTLS_CIPHER_MODE_\(CBC\)/MBEDTLS_SSL_HAVE_\1/g" tests/{suites,include,src}/**/*ssl*
```

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-11-08 14:09:16 +08:00
Gilles Peskine
e9f50bf161
Merge pull request #8443 from valeriosetti/issue8274
Clean up curves handling in libtestdriver1 config
2023-11-04 15:04:42 +00:00
Dave Rodgman
16799db69a update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-02 19:47:20 +00:00
Valerio Setti
05c25cbaf9 test_driver_extension: manage curves' acceleration the same as other PSA_WANT symbols
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-30 11:07:18 +01:00
Valerio Setti
221d8aa8e7 libtestdriver1: fix acceleration for ALG_STREAM_CIPHER/ALG_ECB_NO_PADDING
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-23 15:06:30 +02:00
Yanray Wang
af5003a157 CMAC: accelerate CMAC in accel_cipher
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-10-19 16:13:34 +08:00
Valerio Setti
02a634decd md: remove unnecessary inclusions of mbedtls/md.h
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-10-11 13:15:58 +02:00
Gilles Peskine
ca1e605b9c Merge remote-tracking branch 'upstream-public/development' into development-restricted-merge-20230925
Conflicts:
* `include/mbedtls/build_info.h`: a new fragment to auto-enable
  `MBEDTLS_CIPHER_PADDING_PKCS7` was added in
  c9f4040f7f in `development-restricted`.
  In `development`, this section of the file has moved to
  `include/mbedtls/config_adjust_legacy_crypto.h`.
* `library/bignum.c`: function name change in `development-restricted` vs
  comment change in development. The comment change in `development` is not
  really relevant, so just take the line from `development-restricted`.
2023-09-25 16:16:26 +02:00
Manuel Pégourié-Gonnard
cc21ad441a Add SHA-3 support to libtestdriver1
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-09-24 09:48:45 +02:00
Gilles Peskine
ae3cda9541
Merge pull request #8092 from silabs-Kusumit/PBKDF2_output_key
PBKDF2: test output_key
2023-09-22 18:01:06 +00:00
Gilles Peskine
193f94276e
Merge pull request #1071 from gilles-peskine-arm/ssl_decrypt_stream_short_buffer
Fix buffer overread in mbedtls_ssl_decrypt_buf with stream cipher
2023-09-22 11:43:03 +02:00
Dave Rodgman
986006e567 Make TEST_CALLOC_NONNULL more robust
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-19 18:30:25 +01:00
Dave Rodgman
a328635305 Introduce TEST_CALLOC_NONNULL
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-09-19 17:34:39 +01:00
Gilles Peskine
9099d3fd76 Refactoring: create mbedtls_test_ssl_prepare_record_mac()
No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-18 17:21:15 +02:00
Kusumit Ghoderao
7c61ffcc44 Rename parse_binary_string function
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-09-05 19:29:47 +05:30