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
26d1c43821
Check output allocated before randomising
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-20 11:26:55 +00:00
Janos Follath
53e5adfca4
Merge pull request #8841 from BensonLiou/use_init_api-228
...
use mbedtls_ssl_session_init() to init session variable
2024-02-19 15:49:29 +00:00
Benson Liou
6805ff7892
use mbedtls_ssl_session_init() to init session variable
...
Use mbedtls_ssl_session_init() to init variable just like
session-family APIs described
Signed-off-by: Benson Liou <benson.liou@sony.com>
2024-02-17 00:19:10 +08:00
Gilles Peskine
049ea32931
Fix copypasta
...
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-15 15:32:47 +01:00
Thomas Daubney
3c0c6b1c4b
Conditionally include exit label
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-15 14:25:08 +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
Thomas Daubney
9da359fc65
Add buffer protection to psa_key_derivation_key_agreement
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-15 14:15:46 +00:00
Thomas Daubney
4304276539
Add buffer protection to psa_raw_key_agreement
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-15 13:47:08 +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
Paul Elliott
7ebb3c5d01
Add metatests for failing TEST_EQUAL and TEST_LE_*
...
After getting caught with deadlock issues when these tests fail, add a
metatest to test them failing.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-02-14 15:07:40 +00:00
Gilles Peskine
039c903e7b
Merge pull request #8818 from forkiee2/mbedtls-2.28
...
Backport 2.28: move entropy init prior arguments number recognition
2024-02-14 13:43:32 +00:00
Tom Cosgrove
75c8e61ce0
Merge pull request #8814 from gilles-peskine-arm/rsa-bitlen-fix-2.28
...
Backport 2.28: Fix mbedtls_pk_get_bitlen for a key size that is not a multiple of 8
2024-02-14 11:18:28 +00:00
PiotrBzdrega
c609654665
newline at end of changelog file
...
Signed-off-by: PiotrBzdrega <piotrbzdrega@yandex.com>
2024-02-13 22:12:23 +01:00
David Horstmann
eb77b6f418
Add session config bit for KEEP_PEER_CERTIFICATE
...
This config option decides whether the session stores the entire
certificate or just a digest of it, but was missing from the
serialization config bitflag.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-13 18:59:07 +00:00
David Horstmann
a2fd778868
Merge pull request #1148 from tom-daubney-arm/backport_hash_buffer_protection
...
[Backport] - Hash buffer protection
2024-02-13 18:17:57 +00:00
PiotrBzdrega
14e4727d0e
fill out missing dot in changelog
...
Signed-off-by: PiotrBzdrega <piotrbzdrega@yandex.com>
2024-02-13 17:09:40 +01:00
PiotrBzdrega
7c1cd5ae1c
move entropy init prior arguments number recognition
...
Signed-off-by: PiotrBzdrega <piotrbzdrega@yandex.com>
2024-02-13 16:59:05 +01:00
Janos Follath
09cd7dd96a
Merge pull request #8660 from ivq/fix_ecp_comment
...
Fix a comment in ecp
2024-02-13 12:12:10 +00:00
Gilles Peskine
0196f4886a
Fix mbedtls_pk_get_bitlen() for RSA with non-byte-aligned sizes
...
Add non-regression tests. Update some test functions to not assume that
byte_length == bit_length / 8.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-12 17:00:48 +01:00
Gilles Peskine
c89f9ceb41
Don't define pk_sign_verify in configurations where it's unused
...
In some configurations (e.g. ECDH but no ECDSA or RSA), the PK module is
useful but cannot perform any signatures. Then modern GCC complains:
```
../source/tests/suites/test_suite_pk.function: In function ‘test_pk_sign_verify’:
../source/tests/suites/test_suite_pk.function:1136:12: error: array subscript 0 is outside array bounds of ‘unsigned char[0]’ [-Werror=array-bounds]
../source/tests/suites/test_suite_pk.function:1094:19: note: while referencing sig’
…
```
This fixes test-ref-configs.pl with a modern GCC (specifically with
config-thread.h).
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-12 14:33:41 +01:00
Gilles Peskine
0af7a90329
depends.py: set unique configuration names in outcome file
...
Set unique configuration names in the outcome file. This was lost in the
rewrite from depends-*.pl to depends.py.
Fix #7290
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-12 14:30:59 +01: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
1a6137bbac
Implement safe buffer copying in asymm. encryption
...
Use local copy buffer macros to implement safe
copy mechanism in asymmetric encryption API.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 13:03:16 +00:00
Thomas Daubney
480347d682
Add mac not NULL check before calling memset
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 12:21:46 +00:00
Thomas Daubney
301491d70c
Modify allocation in sign_finish
...
Allocate immediately after declaration.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 12:21:46 +00:00
Thomas Daubney
f298f657c4
Fix code style
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 12:21:46 +00:00
Thomas Daubney
2bb3a1fa25
Conditionally include exit label
...
...on functions where the label was only added
due to the modifications required by this PR.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 12:21:46 +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
324f7de1dd
Implement safe buffer copying in MAC API
...
Use buffer local copy macros to implement safe
copy mechanism in MAC API.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 12:20:39 +00:00
Thomas Daubney
cbf0921530
Fix code style
...
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 11:51:41 +00:00
Thomas Daubney
5e6b84ae12
Conditionally include exit label
...
...on hash functions where the label was only added
due to the modifications required by this PR.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 11:51:41 +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
Thomas Daubney
62cb36a5f2
Implement safe buffer copying in hash API
...
Use local copy buffer macros to implement safe
copy mechanism in hash API.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-12 11:50:51 +00:00
Ryan Everett
d0d12fb42f
Conditionally guard exit label to deter unused label error
...
Co-authored-by: David Horstmann <david.horstmann@arm.com>
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-12 09:19:29 +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
6f68206b18
Add buffer copying to psa_key_derivation_input_bytes
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-09 16:18:39 +00:00
Ryan Everett
08bd24635d
Add buffer copying to psa_key_derivation_output_bytes
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-09 16:15:32 +00:00
Tom Cosgrove
ede909f99a
Merge pull request #8798 from ivq/8665-backport
...
Backport 2.28: Reduce many unnecessary static memory consumption
2024-02-07 23:26:24 +00:00
David Horstmann
4fc2b9b80f
Merge pull request #1175 from davidhorstmann-arm/cipher-multipart-test-fix-backport
...
[Backport 2.28] Fix a multipart test that overwrites the same buffer twice
2024-02-07 17:18:52 +00:00
Chien Wong
b6d57934bc
Reduce many unnecessary static memory consumption
...
.data section of ssl_client1 becomes 128 bytes smaller on AMD64.
Signed-off-by: Chien Wong <m@xv97.com>
2024-02-07 21:48:12 +08:00
Gilles Peskine
856bf3ad09
Merge pull request #8781 from silabs-Kusumit/kdf_incorrect_initial_capacity_backport
...
Backport 2.28: Fix KDF Incorrect Initial Capacity
2024-02-06 17:29:33 +00:00
David Horstmann
7274590ef6
Update buffer start and length in multipart test
...
This fixes a test failure in which the buffer was not properly filled.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-06 17:15:52 +00:00
David Horstmann
448bc018d0
Add testcase to fail multipart cipher tests
...
Encrypt more than 2 blocks of data, causing both update() calls to
output data as well as the call to finish().
This exposes a test bug where the pointer to a buffer is not updated
as it is filled with data.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-06 17:15:51 +00:00
Dave Rodgman
5a2e95dcfa
Merge pull request #1164 from daverodgman/update-2.28-restricted
2024-02-02 17:45:18 +00:00
David Horstmann
8f7a5f6682
Merge pull request #1157 from Ryan-Everett-arm/key-management-buffer-protection-backport
...
[Backport] Key management buffer protection
2024-02-02 17:43:34 +00:00
Kusumit Ghoderao
bfa27e33ff
Fix kdf incorrect initial capacity
...
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2024-02-02 19:56:37 +05:30
Ryan Everett
081803d6ec
Remove unnecessary dependencies from psa_crypto_helpers.h
...
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-02-02 10:50:51 +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