Commit graph

24633 commits

Author SHA1 Message Date
Valerio Setti
6f820cccb8 test: fix comments in test_psa_crypto_config_accel_ecc()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-03-28 16:26:47 +02:00
Valerio Setti
1c3de61ba8 test: remove previous tests for accelerated ECDSA/ECDH/ECJPAKE coverage analysis
All these EC based algs are now tested all at once in
test_psa_crypto_config_[accel/reference]_all_ec_algs_use_psa()
functions.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-03-28 16:26:47 +02:00
Valerio Setti
1fa5c56863 ssl_tls: fix guard symbols for EC accelerated tests
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-03-28 16:26:47 +02:00
Valerio Setti
42d5f1959f test: add a test with all EC based algs accelerated
Actually this adds both the accelerated test as well as the
reference. Both of them are used to evaluate the driver's
coverage with analyze_outcomes.py script.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-03-28 16:26:47 +02:00
Janos Follath
0f5086847c
Merge pull request #7343 from minosgalanakis/ecp/sec-384-update-test-macro-deps
ecp: Updated ecp384 depedency macro
2023-03-28 15:04:10 +01:00
David Horstmann
2717f622b8 Add _build/ and api/ to gitignore
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-03-28 15:00:24 +01:00
Gabor Mezei
d8c0e1aa8d
Fix comments
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:34:49 +02:00
Gabor Mezei
c33a36b5df
Typo: reorder testing classes
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:32:47 +02:00
Gabor Mezei
a8d0da3880
Add test cases for P256 fast reduction testing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:31:05 +02:00
Gabor Mezei
54ad647e8d
Add test cases for P384 fast reduction testing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:30:32 +02:00
Gabor Mezei
fede276392
Typo: reformat numbers
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:29:40 +02:00
David Horstmann
c1f2eef43a Clean the breathe-apidoc files with make clean
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-03-28 14:24:47 +01:00
Gabor Mezei
a9a68728b3
Add test cases for P521 fast reduction testing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:09:35 +02:00
Gabor Mezei
64a229f6ac
Add test cases for P224 fast reduction testing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:09:35 +02:00
Gabor Mezei
62adc726d0
Add test cases for P192 fast reduction testing
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:09:35 +02:00
Gabor Mezei
514806bbe9
Add a second round of carry reduction for P192 fast reduction
The first round of carry reduction can generate a carry so a
second round is needed.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-28 15:09:34 +02:00
Paul Elliott
da018175de
Merge pull request #1012 from paul-elliott-arm/mbedtls-3.4.0_mergeback
Mbedtls 3.4.0 merge back
2023-03-28 13:43:52 +01:00
Paul Elliott
69034388e9 Fix conflict between restricted and development
MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA was removed in
development and replaced with MBEDTLS_MD_CAN_SHA384.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-03-27 21:24:45 +01:00
Paul Elliott
f04848cc3b Revert "Add generated files"
This reverts commit df2b5da57f.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-03-27 21:20:52 +01:00
Minos Galanakis
37bdd93730 ecp_mod_p224_raw: Added MBEDTLS_ECP_DP_SECP224R1_ENABLED as a dependency
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-03-27 18:19:22 +01:00
Paul Elliott
d01a3bca05 Merge tag 'v3.4.0' into mbedtls-3.4.0_mergeback
Mbed TLS 3.4.0
2023-03-27 18:09:49 +01:00
Paul Elliott
1873d3bfc2
Merge pull request #1010 from AndrzejKurek/fix-error-translation
psa_util: fix for correctly computing elements in array
2023-03-27 18:05:28 +01:00
Janos Follath
445c3bfcac
Merge pull request #7222 from minosgalanakis/bignum/6851_extract_Secp384r1_fast_reduction
Bignum:  Extract secp384r1 fast reduction from the prototype
2023-03-27 16:56:30 +01:00
Valerio Setti
ab9dc667ff psa_util: fix for correctly computing elements in array
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-03-27 11:25:10 -04:00
David Horstmann
9251ed55a8 Revert "Add exemption for make.bat in checks for tabs"
This is no longer needed as make.bat has been removed. We do not support
building the documentation on Windows.

This reverts commit d50daedcca.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-03-27 15:31:25 +01:00
David Horstmann
434fc5ecbd Remove make.bat for documentation
Building the docs on Windows is not supported in any case, as the apidoc
target in the main Makefile will not run on Windows.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-03-27 15:24:37 +01:00
David Horstmann
9bca03a2b2 Improve docs Makefile to do full build
Include the make apidoc and breathe-apidoc steps in the documentation
Makefile for ease of use. In this way, depart from the Makefile
generated automatically by Sphinx.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-03-27 15:21:27 +01:00
Gabor Mezei
2f73edbbc4
Prevent mpi_mod_write from corrupting the input
Allocate a working buffer to store the converted value needed for the
mpi_mod_write function.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-03-27 15:53:14 +02:00
Manuel Pégourié-Gonnard
0048d15036
Merge pull request #7330 from mpg/hashes-wrapup
Driver-only hashes: wrap-up
2023-03-27 13:19:45 +02:00
Pengyu Lv
4e70724396 ssl_cache: Add descriptions of returns of cache accessors
Add descriptions of the return values of mbedtls_ssl_cache_get
and mbedtls_ssl_cache_set.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-03-27 11:29:49 +08:00
Paul Elliott
a33da45009
Merge pull request #1005 from paul-elliott-arm/mbedtls-3.4.0rc0-pr
Mbedtls 3.4.0rc0 pr - DO NOT MERGE
2023-03-24 15:55:34 +00:00
Manuel Pégourié-Gonnard
530da90081
Merge pull request #7327 from mpg/entropy-md-light
Entropy: use MD light
2023-03-24 13:36:39 +01:00
Yanray Wang
5663e74f91 tests/.gitignore: ignore *.o under tests/src/test_helpers
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-03-24 18:03:48 +08:00
Manuel Pégourié-Gonnard
b38c9c888f Fix a typo
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
86efa852df Mention EC J-PAKE opaque passwords.
Unrelated to the other changes, other than I noticed it was missing
while making the other edits.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
2ca08c8409 Try again to clarify USE_PSA_CRYPTO
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
a22857b710 Fix documented dependencies on TLS 1.2
The check in check_config.h was fixed in a previous PR, but the
documentation hadn't been updated accordingly.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
a71594538f Add a ChangeLog entry for driver-only hashes
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
3dd9add294 Use PSA Crypto: try clarifying what it means
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
03cb87ea3c Update psa-limitations.md
For recent work and latest plans.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
52f7edb6ad Update psa-migration/strategy.md
- Update for the new hashes strategy, in part by adding references to
md-cipher-dispatch.md
- General update about the status of things since the last update

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:44:59 +01:00
Manuel Pégourié-Gonnard
70a1b6d828 Fix typos
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
5a51d0d789 Fix depends.py failure with correct TLS 1.2 deps
TLS 1.2 has never been able to work with only SHA-512, it just happened
to pass previously because the declared dependencies were too lax.
(Probably related to the fact that in the past we didn't distinguish
between SHA-512 and SHA-384 in dependencies.)

So, just disable all of TLS in SHA-512-only builds. While at it, tune
build_info.h to make this easier - it already had partial support for
disabling TLS 1.2 or TLS 1.3 in an easier way, but not both of them at
the same time.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
c584c27426 Disable built-in SHA-256 in accel_hash too
Now that Entropy doesn't need it any more, we can have driver-only
SHA-256 (and 224 with it) in the non-USE_PSA component too.

This reveals a missing PSA_INIT in a PK test using SHA-256.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
a31ddb98dc Fix and simplify TLS hash dependency declarations
Fixes #6441

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
bb21c5afa7 Use helper macros for hashes in check_config.h
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
e9319772b3 Fix failures in test_suite_random
Appeared after the dependencies were changed to use MD_CAN.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
33783b4646 Manually fix two remaining instances of old macros
Unless I missed something, all remaining instance of all macros are in
files where it makes sense to use these. I went over the output of:

    git grep -c -E 'MBEDTLS_(MD5|RIPEMD160|SHA[0-9]*)_C'

and I think all the files listed fall into one of the following
acceptable categories:

- documentation and historical documents: Changelog, docs/**/*.md
- config files and related: mbedtls_config.h, configs/*.h,
  check_config.h, config_psa.h, etc.
- scripts that build/modify configs: all.sh, depends.py,
  set_psa_test_dependencies.py, etc.
- implementation of MD or PSA or related: md.h, psa_util.h, etc. and
  corresponding test suites
- implementation of hashes: md5.c, sha256.h, etc. and corresponding test
  suites
- two example programs using a low-level hash API: hash/hello.c,
  pkey/ecdsa.c
- test/benchmark.c, test/selftest.c: actually want our built-in
  implementations
- a function in test_suite_psa_crypto_storage_format that is
  specifically for checking if the hash is built in.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
93302422fd Fix instances of old feature macros being used
sed -i -f md.sed include/mbedtls/ssl.h library/hmac_drbg.c programs/pkey/*.c programs/x509/*.c tests/scripts/generate_pkcs7_tests.py tests/suites/test_suite_random.data

Then manually revert programs/pkey/ecdsa.c as it's using a low-level
hash API.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00
Manuel Pégourié-Gonnard
4011eb49dc Fix entropy-related feature macros
Was causing testing disparities picked by analyze_outcomes.py

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-03-24 10:43:40 +01:00