7582 Commits

Author SHA1 Message Date
Gilles Peskine
ff2c049eaf
Merge pull request #9270 from sezrab/silence-2.28
[Backport 2.28] Silence gcc 12.2.0 warning
2024-07-04 14:49:34 +00:00
Gilles Peskine
f514f25f88
Merge pull request #9025 from gilles-peskine-arm/psa-storage-test-cases-never-supported-2.28
Backport 2.28: Fix the detection of not-supported mechanisms in systematically generated PSA tests
2024-06-14 18:23:38 +00:00
Patrick Wildt
ed9a4948b9 Silence gcc 12.2.0 warning
Unfortunately this compiler complains about a variable potentially being
used un-initialized.  Silence the warning by initializing it to a sane
default.

Signed-off-by: Patrick Wildt <pwildt@google.com>
2024-06-14 16:29:47 +01:00
lhuang04
0a2dd6d4eb Set psk to NULL in ssl_psk_remove-backport to 2.28
Summary:
Back port [PR 9241](https://github.com/Mbed-TLS/mbedtls/pull/9241) to
2.28 branch

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
Signed-off-by: lhuang04 <lhuang04@fb.com>
2024-06-11 13:00:28 -07:00
Gilles Peskine
9ebf9aa448
Merge pull request #9153 from gilles-peskine-arm/oid-limits-2.28
2.28 only: Fix the build without check_config.h (inclusion of limits.h)
2024-05-29 16:14:24 +00:00
Gilles Peskine
a8cd2e6421 Fix the build without check_config.h (inclusion of limits.h)
Including `mbedtls/check_config.h` from `mbedtls/config.h` is optional. If
done, `limits.h` gets included. If not done, we were missing the inclusion
of `limits.h` in several source files. Fix this and add a test build that
doesn't include `mbedtls/check_config.h`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-17 19:00:46 +02:00
Gilles Peskine
e32671f0d7
Merge pull request #9086 from nileshkale123/fix/redefinition_warning_for_gnu_source_backport_2.28
Backport 2.28: Fixed issue of redefinition warning messages for _GNU_SOURCE
2024-05-06 12:40:41 +00:00
Gilles Peskine
791331158c
Merge pull request #8544 from Ryan-Everett-arm/8537-2.28
Backport 2.28: Fix error handling for secure element keys in `psa_start_key_creation`
2024-05-02 16:06:11 +00:00
nilesh.kale
52b6fefcc4 Fixed issue of redefinition warning messages for _GNU_SOURCE
Signed-off-by: nilesh.kale <nilesh.kale@espressif.com>
2024-05-02 14:47:54 +05:30
Gilles Peskine
b6e362b82e PSA sign/verify: more uniform error on an unsupported hash
Uniformly return PSA_ERROR_NOT_SUPPORTED if given an algorithm that includes
a hash, but that hash algorithm is not supported. This will make it easier
to have a uniform treatment of unsupported hashes in automatically generated
tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-11 22:00:55 +02:00
Paul Elliott
6766a19027
Merge pull request #8875 from stevenwdv/mbedtls-2.28
[backport] Fix compilation on macOS without apple-clang
2024-03-29 13:59:14 +00:00
Minos Galanakis
6fe0ae026f Version bump for 2.28.8
./scripts/bump_version.sh --version 2.28.8

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-03-21 17:52:54 +00:00
Minos Galanakis
d4b3fe7597 Merge branch 'mbedtls-2.28' into 'mbedtls-2.28-restricted' 2024-03-20 09:27:24 +00:00
Steven WdV
f7acf91e5f Check C/C++ compilers separately for AppleClang ranlib
Signed-off-by: Steven WdV <swdv@cs.ru.nl>
2024-03-19 11:39:22 +01:00
Waleed Elmelegy
98ebf488f5 Fix bug in ALPN loading from serialized session
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-15 14:29:24 +00:00
David Horstmann
5bada225eb Update generated files with inverted option
Achieved by running:

tests/scripts/check-generated-files.sh -u

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-14 11:21:34 +00:00
David Horstmann
4201533196 Invert and rename config option
Replace MBEDTLS_PSA_COPY_CALLER_BUFFERS with inverse:
!MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS. This ensures that buffer
protection is enabled by default without any change to the Mbed TLS
config file.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-14 11:17:56 +00:00
Thomas Daubney
28fe6654d8 Remove LOCAL_OUTPUT_ALLOC_WITH_COPY
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-03-12 17:54:55 +00:00
Thomas Daubney
ca92831a60 Add missing semicolon
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-03-12 17:53:30 +00:00
Gilles Peskine
40895498b7
Merge pull request #8851 from billatarm/mbedtls-2.28-add-pc-files
Mbedtls 2.28 add pc files
2024-03-12 11:30:30 +00:00
David Horstmann
f06494dc9e Merge branch 'mbedtls-2.28' into buffer-sharing-merge-2.28 2024-03-11 16:28:50 +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
Gilles Peskine
a19f6bfcad
Merge pull request #8823 from davidhorstmann-arm/fix-config-bitflag-2.28
[Backport 2.28] Update `SSL_SERIALIZED_SESSION_CONFIG_BITFLAG` with new flags
2024-03-05 13:17:43 +00:00
David Horstmann
fc8cacf9a2 Add missing config guards in comment
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-05 10:46:26 +00:00
Gabor Mezei
f3c3504f5a
Fix merge
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-03-04 17:17:51 +01: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
Biswapriyo Nath
5e5056d6ab
cmake: Use GnuInstallDirs to customize install directories
Replace custom LIB_INSTALL_DIR with standard CMAKE_INSTALL_LIBDIR variable.
For backward compatibility, set CMAKE_INSTALL_LIBDIR if LIB_INSTALL_DIR is set.

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
2024-03-01 12:05:00 -06:00
David Horstmann
f5a6fa2e4a Fix code style
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:31:35 +00:00
David Horstmann
11def97472 Fix naming inconsistencies in config bits
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:15:56 +00:00
David Horstmann
363db7759a Add config guards to ssl session comment
Show which members of the session structure are dependent on
configuration options and which aren't.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-01 12:11:24 +00:00
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
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
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
13a15c2390
Add buffer protection for cipher functions
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-02-29 16:41:03 +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
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
10e44f3fd1 Add missing guards around exit label
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-02-28 14:17:49 +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
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
c2c74b9cef mbedtls_ecp_write_key: no FEATURE_UNAVAILABLE error
When exporting a key, MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE should not happen.
This error indicates that the curve is not supported, but that would prevent
the creation of the key.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-02-26 08:54:25 +01: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
Thomas Daubney
09cf4f2e78 Decouple if statement in psa_raw_key_agreement exit.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-22 11:08:22 +00:00
Thomas Daubney
2ea8d8fa3c Revise how output allocation is checked
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-21 15:16:01 +00:00
Thomas Daubney
0736df33ac Check for output allocation before randomising
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-21 12:28:20 +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
26d1c43821 Check output allocated before randomising
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-02-20 11:26:55 +00:00