David Horstmann
43c128db3e
Update wrapper generation script and regenerate
...
Update the guards generated by the wrapper generation script to use
!MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS and regenerate the PSA test
wrappers.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-14 11:18:22 +00:00
David Horstmann
4698e692e8
Flip logic of PSA memory poisoning generation
...
Change to excluding mbedtls_psa_inject_entropy() (not a PSA function)
rather than explicitly including every PSA function.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-12 14:15:38 +00:00
tom-daubney-arm
7c89d1f8de
Merge branch 'mbedtls-2.28-restricted' into backport_key_agreement_buffer_protection
...
Signed-off-by: tom-daubney-arm <74920390+tom-daubney-arm@users.noreply.github.com>
2024-03-06 17:35:59 +00:00
Gábor Mezei
26bbd8dd4e
Merge branch 'mbedtls-2.28-restricted' into bp228_buffer_protection_for_cipher
...
Signed-off-by: Gábor Mezei <63054694+gabor-mezei-arm@users.noreply.github.com>
2024-03-04 15:39:35 +00:00
Gabor Mezei
50bcca26b3
Update test wrapper functions for ciper buffer protection
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:44:23 +00:00
Gabor Mezei
143864c121
Add test wrapper functions for cipher buffer protection
...
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:41:49 +00:00
David Horstmann
98397f0bba
Merge branch 'mbedtls-2.28-restricted' into generate-random-buffer-protection-backport
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-29 14:27:16 +00:00
tom-daubney-arm
24d60ad716
Merge branch 'mbedtls-2.28-restricted' into backport_asymmetric_encrypt_buffer_protection
...
Signed-off-by: tom-daubney-arm <74920390+tom-daubney-arm@users.noreply.github.com>
2024-02-28 15:43:48 +00:00
David Horstmann
80de1475a1
Fix incorrect conflict resolution
...
A return statement was missing in the wrapper generation script.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-28 15:16:44 +00:00
David Horstmann
4e8215057c
Generate test wrappers for psa_generate_random()
...
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-26 18:26:06 +00:00
Thomas Daubney
be060f1e85
Suppress pylint
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-26 13:55:42 +00:00
tom-daubney-arm
8eafe1525d
Merge branch 'mbedtls-2.28-restricted' into backport_mac_buffer_protection
...
Signed-off-by: tom-daubney-arm <74920390+tom-daubney-arm@users.noreply.github.com>
2024-02-22 15:28:49 +00:00
David Horstmann
0ce9589e36
Merge pull request #1133 from davidhorstmann-arm/copying-aead-2.28
...
[Backport 2.28] Copy buffers in AEAD
2024-02-20 16:07:36 +00:00
Thomas Daubney
db5d607cb1
Generate test wrappers
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-15 14:18:02 +00:00
David Horstmann
a9cc4cd1cb
Merge pull request #1179 from Ryan-Everett-arm/key-derivation-buffer-protection-backport
...
[Backport] Add buffer copying to the Key Derivation API
2024-02-15 11:54:28 +00:00
Thomas Daubney
2b614f9dad
Generate all test wrappers
...
One was missed due to typo
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 13:07:48 +00:00
Thomas Daubney
d8adccf45d
Generate test wrappers
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 13:07:43 +00:00
Thomas Daubney
6b91503602
Generate test wrappers for MAC functions
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 12:21:43 +00:00
Thomas Daubney
ebf9329d88
Generate test wrappers for hash functions
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 11:51:38 +00:00
Ryan Everett
6c9e69d53b
Add key derivation testing wrappers
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-09 16:23:25 +00:00
Ryan Everett
c8b6c05014
Update tests/scripts/generate_psa_wrappers.py
...
Co-authored-by: David Horstmann <david.horstmann@arm.com>
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-02 10:50:51 +00:00
Ryan Everett
cb4f855456
Fix line-too-long in script
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-02 10:50:51 +00:00
Ryan Everett
810421ccc6
Re-add cipher_encrypt buffer copying
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-02 10:50:51 +00:00
Ryan Everett
dcbc1d3750
Generate test wrappers for key management
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-02 10:50:51 +00:00
Thomas Daubney
c63e31af8b
Generate test wrappers
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-01-30 13:33:14 +00:00
David Horstmann
436b2ef633
Generate poisoning wrappers for AEAD
...
Modify wrapper generation script to generate poisoning calls and
regenerate wrappers.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-01-24 14:58:05 +00:00
Gilles Peskine
a980aa0894
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-04 21:07:35 +01:00
Gilles Peskine
b3d457ce2f
PSA wrappers: don't poison buffers when buffer copying is disabled
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-04 20:33:29 +01:00
Gilles Peskine
7c7b7d5db3
Add review exception warning
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-04 17:28:59 +01:00
Gilles Peskine
c8b22d0713
Generated PSA wrappers: poison/unpoison buffer parameters
...
For now, only instrument the one function for which buffer copying has been
implemented, namely `psa_cipher_encrypt`.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-04 16:58:23 +01:00
Gilles Peskine
17a14f1711
Adapt wrapper generators from 3.5 to 2.28
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-04 16:41:30 +01:00
Gilles Peskine
8519dc9c7e
PSA wrapper generator
...
The new script `tests/scripts/generate_psa_wrappers.py` generates the
implementation of wrapper functions for PSA API functions, as well as a
header that defines macros that redirect calls to the wrapper functions. By
default, the wrapper functions just call the underlying library function.
With `--log`, the wrapper functions log the arguments and return values.
This commit only introduces the new script. Subsequent commits will
integrate the wrappers in the build.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-01-04 16:38:17 +01:00