Commit graph

15628 commits

Author SHA1 Message Date
Hanno Becker
c5722d1fb1 Add missing MBEDTLS_X509_REMOVE_INFO guards to ssl-opt.sh
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-27 17:20:56 +01:00
Hanno Becker
7ac83f91bf Print X.509 verify info strings even if MBEDTLS_X509_REMOVE_INFO
The new compile-time option MBEDTLS_X509_REMOVE_INFO removes various
X.509 debugging strings and functionality, including

```
  mbedtls_x509_crt_verify_info()
```

which ssl_client2.c and ssl_server2.c use to print human readable
descriptions of X.509 verification failure conditions. Those
conditions are also grepped for in numerous ssl-opt.sh tests.

Instead of disabling those tests if MBEDTLS_X509_REMOVE_INFO is set,
this commit essentially moves mbedtls_x509_crt_verify_info() to
ssl_client2.c and ssl_server2.c. However, instead of just copy-pasting
the code from x509_crt.c, the following approach is used:

A macro MBEDTLS_X509_CRT_ERROR_INFO_LIST is introduced which for each
verification failure condition invokes a user-defined macro X509_CRT_ERROR_INFO
with (a) the numerical error code, (b) the string presentation of the
corresponding error macro, (c) the info string for the error condition.
This macro can thus be used to generate code which somehow iterates over
the verifiation failure conditions, but the list of error conditions and
information strings is nowhere duplicated.

This is then used to re-implement mbedtls_x509_crt_verify_info() in
x509_crt.c and to provide a functionally equivalent (yet slightly different)
version in ssl_client2.c and ssl_server2.c in case MBEDTLS_X509_REMOVE_INFO
is set.

This way, little changes to ssl-opt.sh will be necessary in case
MBEDTLS_X509_REMOVE_INFO is set because the info strings for the
verification failure conditions will be printed regardless of whether
MBEDTLS_X509_REMOVE_INFO is set or not.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-04-27 17:20:56 +01:00
Hanno Becker
e111356194 Remove MBEDTLS_X509_REMOVE_INFO from scripts/config.pl full
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-27 17:20:52 +01:00
Hanno Becker
5d4c4b1f95 Add missing dependencies on !MBEDTLS_X509_REMOVE_INFO
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-27 17:18:52 +01:00
Hanno Becker
612a2f1504 Rename MBEDTLS_X509_INFO to !MBEDTLS_X509_REMOVE_INFO
The introduction of positive options to control the presence
of pre-existing functionality breaks the build for users of
handwritten configurations.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-04-27 17:18:52 +01:00
Peter Kolbus
9a969b66c1 Reduce code size when mbedtls_x509_*_info() unused
Introduce MBEDTLS_X509_INFO to indicate the availability of the
mbedtls_x509_*_info() function and closely related APIs. When this is
not defined, also omit name and description from
mbedtls_oid_descriptor_t, and omit OID arrays, macros, and types that
are entirely unused. This saves several KB of code space.

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-27 17:18:52 +01:00
Dave Rodgman
0c37b4f826 Improve changelog entry for #4217
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-04-27 17:01:24 +01:00
Ronald Cron
cee427002b Remove MBEDTLS_ENABLE_WEAK_CIPHERSUITES configuration option
Fix 4416

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2021-04-27 09:34:14 +02:00
Bence Szépkúti
58d8518eb1 Update changelog
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2021-04-27 04:41:43 +02:00
Bence Szépkúti
bd98df7715 Update documentation of AEAD output size macros
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2021-04-27 04:37:18 +02:00
Dave Rodgman
12f93f4fc2
Merge pull request #4407 from ARMmbed/dev3_signoffs
Merge development_3.0 into development
2021-04-26 19:48:16 +01:00
TRodziewicz
87bfa20f1c Removing trailing space from ChangeLog file
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-26 20:08:53 +02:00
Chris Jones
860f509421 Clarify case when high level error code is incorrect
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-26 16:31:16 +01:00
Dave Rodgman
dca8509bb6 Update future Mbed TLS version in Changelog
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-04-26 16:23:22 +01:00
Dave Rodgman
10ba553c2e Update Changelog
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-04-26 16:23:22 +01:00
Dave Rodgman
ddb8ea6847 Fix Changelog entry
Rename a Changelog.d file, so that it gets picked up as expected by
scripts/assemble_changelog.py.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-04-26 16:23:21 +01:00
Dave Rodgman
a00e8502c9 Documentation updates for Mbed TLS 3.0
Update documentation to reflect the branch changes.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-04-26 16:23:21 +01:00
TRodziewicz
ede3085563 Add ChangeLog file and fix comment in config.h
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-26 15:44:25 +02:00
TRodziewicz
d7a21a1ec5 Fix failing test_when_no_ciphersuites_have_mac test.
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-26 13:38:08 +02:00
Steven Cooreman
c338cef74b Add notes to the documentation about CMAC_ALT algorithm support
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
2021-04-26 11:24:44 +02:00
Dave Rodgman
5ec6906964 Add sign-off for some older commits which are missing it.
This sign-off applies to:

c258a0fa65
7bdbc45275
bfa03e3bc9

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2021-04-23 15:12:56 +01:00
TRodziewicz
1f98424508 Correction fixing the test_when_no_ciphersuites_have_mac falure
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-23 14:57:39 +02:00
TRodziewicz
7c1d41da52 Correction fixing the test_everest_curve25519_only falure
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-23 13:33:44 +02:00
Chris Jones
4f91d8d7ad Change "high level error" to "high level module ID"
Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-23 12:07:25 +01:00
TRodziewicz
85aff9f07a Correction fixing the test_depends_curves_psa falure
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-23 10:47:26 +02:00
Chris Jones
456d29c20b Rename mbedtls_error_add_ext to mbedtls_error_add
This function was previously called mbedtls_error_add_ext because there
was a macro called mbedtls_error_add. That later got capitalised which
allows the function to now be named mbedtls_error_add.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-23 09:24:05 +01:00
Ronald Cron
b5939e814e
Merge pull request #4160 from stevew817/feature/driver_builtin_keys
Add implementation for MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS

Merging as it has been ready for four days now and I prefer not having to go through other rebases especially given the coming change of scope of development (3.0 rather than 2.2x).
2021-04-23 09:40:31 +02:00
Steven Cooreman
894b9c4635 Add documentation for change in CMAC self-test behaviour
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
2021-04-23 08:19:43 +02:00
Manuel Pégourié-Gonnard
c102164a54
Merge pull request #4339 from TRodziewicz/remove_depr_error_codes
Remove deprecated error codes.
2021-04-22 22:28:00 +02:00
Chris Jones
e11e81413d Improve documentation for error code checking
Improve comments explaining error code checking, fix incorrect comments
and make a small formatting fix.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
2021-04-22 15:28:56 +01:00
Tomasz Rodziewicz
b13360514c
Test why the test_depends_curves_psa fails in CI 2021-04-22 15:14:17 +02:00
TRodziewicz
7062796844 Testing the failed ubuntu test
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-22 14:11:10 +02:00
Ronald Cron
2bbb5bc6bf
Merge pull request #4380 from paul-elliott-arm/bignum_unchecked_return
Fix unchecked return value in bignum
2021-04-22 13:08:57 +02:00
Tomasz Rodziewicz
9a97a13d3e
Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-22 12:53:15 +02:00
Manuel Pégourié-Gonnard
f6b677ea98
Merge pull request #4349 from mpg/apply-4334-3.0
Apply 4334 to development-3.0
2021-04-22 12:42:40 +02:00
Manuel Pégourié-Gonnard
e8e450a394
Merge pull request #4254 from mstarzyk-mobica/remove_libpkcs11-helper
Remove PKCS#11 library wrapper.
2021-04-22 12:39:54 +02:00
TRodziewicz
1818d967fe Four config.h defaults have been changed.
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-22 12:06:32 +02:00
Manuel Pégourié-Gonnard
1216233949
Merge pull request #4391 from gilles-peskine-arm/error-on-removed-options-20210421
Error on removed options
2021-04-22 08:55:53 +02:00
Gilles Peskine
cc26e3bf25 Remove extraneous word
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-04-21 19:01:59 +02:00
Gilles Peskine
fa4e4b8645 Error out if attempting to use a removed feature
If the compile-time configuration enables an option that was removed
in Mbed TLS 3.0, and the effect of removing the option would likely
not be detected at build time, #error out in check_config.h.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-04-21 18:48:09 +02:00
Gilles Peskine
b683776181 Per-line opt-out of check-names typo check
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-04-21 18:45:08 +02:00
Tomasz Rodziewicz
bfa03e3bc9
Update psa_util.h
Remove the conditional include after the code review
2021-04-21 17:14:31 +02:00
Tomasz Rodziewicz
7bdbc45275
Update issue4283.txt
Corrections in the ChangeLog file after a review.
2021-04-21 16:50:15 +02:00
TRodziewicz
3408d60225 revert the error.h file include in psa_util.c
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-21 13:25:25 +02:00
TRodziewicz
e022938ec7 error.c re-generated once more
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-21 13:14:04 +02:00
Tomasz Rodziewicz
d6c246f5bf
Merge branch 'development_3.0' into remove_depr_error_codes 2021-04-21 12:31:43 +02:00
TRodziewicz
1fbdb25d60 error.c re-generated
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-21 12:24:59 +02:00
TRodziewicz
33946bbf16 Two platform error codes moved to error.h to fix _without_platform test
Signed-off-by: TRodziewicz <tomasz.rodziewicz@mobica.com>
2021-04-21 12:06:23 +02:00
Bence Szépkúti
1dda21c4a4 Make sure we don't underflow in the size macros
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2021-04-21 11:09:50 +02:00
Bence Szépkúti
b639d43538 Move and rename PSA_ALG_AEAD_IS_BASE_EQUAL
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2021-04-21 11:06:00 +02:00