18798 Commits

Author SHA1 Message Date
Gabor Mezei
ff783e0bda
Do not copy the content to the local output buffer with allocation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:46:12 +00:00
Gabor Mezei
7f4b7dd382
Remove write check in driver wrappers tests
This check is intended to ensure that we do not write intermediate
results to the shared output buffer. This check will be made obselete
by generic memory-poisoning-based testing for all functions.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:44:24 +00:00
Gabor Mezei
8677edda6e
Fix buffer protection handling for cipher_generate_iv
Use the `LOCAL_OUTPUT_` macros for buffer protection instead of the existing
local variable.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:44:24 +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
282bb53edc
Add buffer protection for cipher_generate_iv and cipher_set_iv
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:44:23 +00:00
Gabor Mezei
ed96d687d7
Move local buffer allocation just before usage
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:41:50 +00:00
Gabor Mezei
69f680ac9c
Add LOCAL_OUTPUT_ALLOC_WITH_COPY macro if buffer protection is disabled
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:41:49 +00:00
Gabor Mezei
92905be298
Fix ASAN error for psa_cipher_update
The ASAN gives an error for `psa_cipher_update` when the `input_length`
is 0 and the `input` buffer is `NULL`. The root cause of this issue is
`mbedtls_cipher_update` always need a valid pointer for the
input buffer even if the length is 0.
This fix avoids the `mbedtls_cipher_update` to be called if the
input buffer length is 0.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:41:49 +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
Gabor Mezei
13a15c2390
Add buffer protection for cipher functions
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:41:03 +00:00
Dave Rodgman
9f1003b381 blank line for readability
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 15:01:29 +00:00
Dave Rodgman
7a659102f5 Use export to set VERBOSE_LOGS
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:59:40 +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
Signed-off-by: Steven WdV
ffdd957049 Fix compilation on macOS without apple-clang
Signed-off-by: Steven WdV <swdv@cs.ru.nl>
2024-02-29 15:23:01 +01:00
David Horstmann
be49b6b239
Merge pull request #1154 from tom-daubney-arm/backport_asymmetric_encrypt_buffer_protection
[Backport] Asymmetric encrypt buffer protection
2024-02-29 14:17:10 +00:00
Dave Rodgman
f4aa1ce006 Fix docs
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:14:53 +00:00
Dave Rodgman
c2a27492bc simplify printf call
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:13:35 +00:00
Dave Rodgman
b93ae3b453 improve docs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
03b232ae4e Add editor hint for emacs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
7c84471ed7 Rename quiet to quiet.sh
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
04e0f41f08 Send printed command to stderr
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
cdf57d1ddc remove trailing space from printed command
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
f57529903d Improve simplified quoting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
a8e671d7bb remove shebang from quiet
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
043325d191 Improve docs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
6122cb1013 Quote directory name from cmake wrapper
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
62ba696bae Undo not-needed change
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
e2317649dd Allow wrappers to be missing; quote directory name from make
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
0b069bd5b1 Avoid infinite loop
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
57783d7459 Extract common parts of quiet wrapper
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
6529f12d35 Tidy up quiet wrappers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:50 +00:00
Dave Rodgman
4cb98a930c Move quiet wrapper setup
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:48 +00:00
Dave Rodgman
634fe908b7 Improve quote_args output readability
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
d4a5563417 Improve output from make/cmake wrapper
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
59f9df999d Always display make/cmake invocation command
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
75da313166 Pacify check_files
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
8470d114e2 Spelling fix
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:16 +00:00
Dave Rodgman
a0b7c08b60 Use quiet make wrappers from all.sh
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:11:14 +00:00
Dave Rodgman
99fa0d08d3 Create quiet wrappers for make and cmake
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-02-29 14:09:58 +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
10e44f3fd1 Add missing guards around exit label
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-28 14:17:49 +00:00
Manuel Pégourié-Gonnard
cb086af4bc
Merge pull request #8860 from gilles-peskine-arm/ecp-write-doc-2.28
Backport 2.28: Document ECP write functions
2024-02-28 11:04:27 +00:00
David Horstmann
6b01954e09
Merge pull request #1150 from tom-daubney-arm/backport_mac_buffer_protection
[Backport] - MAC buffer protection
2024-02-26 19:06:45 +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
David Horstmann
65bf12ce6b Add buffer copying to psa_generate_random()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-26 18:26:00 +00:00
Thomas Daubney
be060f1e85 Suppress pylint
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-26 13:55:42 +00:00
Gilles Peskine
9721b868a2 Allow null buffers when the length is 0
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 12:38:16 +01:00
Gilles Peskine
84dc44b9b5 Note that ecp read/write functions don't support Curve448 yet
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 09:05:45 +01:00
Gilles Peskine
7ce99c0f3a mbedtls_ecp_write_key: document that this function doesn't detect unset data
Fixes #8803.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 09:04:29 +01:00