Commit graph

22969 commits

Author SHA1 Message Date
Manuel Pégourié-Gonnard
30d9466762 Only run what we need from compat.sh
Also, comment why we run those tests.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-11-30 12:38:58 +01:00
Tom Cosgrove
fc2ac75453 Fix the name of basic-build-test.sh within the file
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-30 11:13:00 +00:00
Ronald Cron
7df787c019
Merge pull request #6538 from yuhaoth/pr/tls13-add-early-data-transform-computation 2022-11-30 09:56:00 +01:00
Gilles Peskine
787c79dc1a Remove changelog entry for an internal change
We removed internal code left over after removing a feature in Mbed TLS 3.0.
The removal of the internal code is not user-visible.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 22:27:03 +01:00
Gilles Peskine
d622c7de56 Changelog entry files must have a .txt extension
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 22:18:05 +01:00
Gilles Peskine
d8c0803821 Preserve line breaks in comments before test functions
This way line numbers match better in error messages.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 22:04:45 +01:00
Gilles Peskine
72bffe02b7
Merge pull request #6663 from davidhorstmann-arm/fix-typo-unsupported
Fix typo 'unsupoported' -> 'unsupported'
2022-11-29 21:44:27 +01:00
Gilles Peskine
edaa17b350
Merge pull request #6547 from yanesca/extract_mod_exp_from_prototype
Bignum: Extract mod exp from prototype
2022-11-29 21:40:07 +01:00
Gilles Peskine
d1bc6da3d3 Fix the build with MBEDTLS_TEST_HOOKS && !MBEDTLS_USE_PSA_CRYPTO
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:14:19 +01:00
Aditya Deshpande
b6bc7524f9 Minor formatting fixes to address code review comments
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-11-29 16:53:29 +00:00
Valerio Setti
661b9bca75 test: psa_pake: add specific log message for the opaque password
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-29 17:28:17 +01:00
Valerio Setti
77e8315f5b fix formatting and typos
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-29 17:28:04 +01:00
Gilles Peskine
9ec14f6dcb programs/fuzz: set sensible default CFLAGS
Running make from programs/fuzz didn't set any optimization flags (running
make from programs or from the root inherited the parent's optimization
flags). Default to -O2.

There were no -W flags. Default to -Wall -Wextra, but not -Werror in line
with the other makefiles.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 17:23:19 +01:00
Gilles Peskine
0c67160b00 Valgrind for constant flow: skip non-CF test suites
When testing under Valgrind for constant flow, skip test suites that don't
have any constant-flow annotations, since the testing wouldn't do anything
more that testing with ordinary Valgrind (component_test_valgrind and
component_test_valgrind_psa). This is a significant time saving since
testing with Valgrind is very slow.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 16:46:06 +01:00
Gilles Peskine
df3dd4c3bc Test MBEDTLS_USE_PSA_CRYPTO with Valgrind
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 16:46:06 +01:00
Gilles Peskine
3ffd6bce81 Create a separate test suite for constant-time functions
This is the first step in arranging that functions from constant_time.c are
tested in test_suite_constant_time.function.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 15:44:21 +01:00
Gilles Peskine
77e68c3176 Move constant-time HMAC testing to its own suite
These are very CPU-intensive, so make it easy to skip them. And conversely,
make it easy to run them without the growing body of SSL tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 15:42:36 +01:00
Gilles Peskine
bfec9d0df7
Merge pull request #6676 from davidhorstmann-arm/cmake-get-skip-test-from-env
Tell cmake to get SKIP_TEST_SUITES from ENV
2022-11-29 14:25:50 +01:00
Manuel Pégourié-Gonnard
7f5bc5c40f
Merge pull request #6681 from mpg/changelog-6264
Add ChangeLog entry for DTLS Connection ID
2022-11-29 11:34:11 +01:00
Valerio Setti
d572a82df9 tls: psa_pake: add test for opaque password
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-29 11:30:56 +01:00
Manuel Pégourié-Gonnard
0b9b560770
Merge pull request #6601 from valeriosetti/issue6502
Avoid assumptions about implementation in EC J-PAKE tests
2022-11-29 11:21:23 +01:00
Manuel Pégourié-Gonnard
f9720cfa78
Merge pull request #6670 from gilles-peskine-arm/pkcs7-use-after-free-20221127
PKCS7: Fix some memory management errors
2022-11-29 11:17:27 +01:00
Manuel Pégourié-Gonnard
37d41c79b8 Add ChangeLog entry for DTLS Connection ID
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-11-29 10:20:15 +01:00
Manuel Pégourié-Gonnard
ffc330fafa
Merge pull request #6264 from hannestschofenig/rfc9146_2
CID update to RFC 9146
2022-11-29 09:25:14 +01:00
Manuel Pégourié-Gonnard
66f09834ea Enable optimisation with Asan with make in all.sh
All builds using ASAN_CFLAGS were with Asan but no optimisation, making
them particularly slow. Indeed, we were overwriting CFLAGS which
defaults to -O2 and not using any -O in the replacement. (CMake already has
optimisations on with ASan.)

While at it, also remove -Wall -Wextra which are redundant as they are
already part of WARNING_CFLAGS which we are not overwriting.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-11-29 09:12:12 +01:00
Jerry Yu
aec08b3f42 fix various format issues
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-29 15:19:27 +08:00
Gilles Peskine
a13f5eb7b8 Add missing dependency for the fuzzer-constructed test data
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-28 21:30:04 +01:00
Janos Follath
97915c8685
Merge pull request #6619 from minosgalanakis/bignum/add_high_lv_IO_methods
Bignum: Adding High level I/O methods
2022-11-28 17:27:48 +00:00
Valerio Setti
a9a97dca63 psa_pake: add support for opaque password
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-28 18:26:16 +01:00
Dave Rodgman
6d23ff60dd Make use of optimised bswap from bignum
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-28 15:41:13 +00:00
Dave Rodgman
f7f1f748e3 Support built-in byteswap routines from clang, gcc, MSVC
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-28 15:41:13 +00:00
Dave Rodgman
a5110b0d79 Make use of efficient unaligned access functions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-28 15:41:13 +00:00
Dave Rodgman
6298b24127 Add byteswap routines
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-28 15:41:13 +00:00
Dave Rodgman
e5c42594e5 Add byte order detection macro
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-28 15:41:13 +00:00
Dave Rodgman
a360e1987a Add efficent unaligned get/put functions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-28 15:41:04 +00:00
Dave Rodgman
d98ac8b75e Merge remote-tracking branch 'dave/fast_xor' into fast_unaligned 2022-11-28 15:06:25 +00:00
Janos Follath
1f8afa22a4 Bignum Mod: improve documentation and style
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-28 14:58:08 +00:00
Aditya Deshpande
1ac41dec09 Add test function for opaque driver (simply returns PSA_ERROR_NOT_SUPPORTED), and address other review comments.
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-11-28 14:46:30 +00:00
Manuel Pégourié-Gonnard
095c4756ee
Merge pull request #6674 from AndrzejKurek/ecjpake-changelog
Add a changelog entry explaining usage of PSA in TLS 1.2 EC J-PAKE
2022-11-28 12:44:38 +01:00
Valerio Setti
a34d0308cc test: psa_pake: fix dependency
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-28 11:46:36 +01:00
Janos Follath
84bee4c492 mbedtls_mpi_mod_write: improve readability
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-28 10:27:14 +00:00
David Horstmann
3861062f6b Tell cmake to get SKIP_TEST_SUITES from ENV
If the variable SKIP_TEST_SUITES is not defined with -D, but is defined
in an environment variable, tell cmake to get it from there.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-11-28 10:18:05 +00:00
Jerry Yu
3d78e08ac0 erase early secrets and transcripts
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
a5db6c0ce3 fix coding style issues.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
e31688b7fa fix comments issue
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
a8771839e8 Refactor make_traffic_keys
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
3ce61ffca6 fix comments and function name issues
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
b094e124f2 fix various issues
- Alignments
- comment words in doxygen paragraph

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
91b560f38d Add compute early transform
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00
Jerry Yu
3d9b590f02 guards transform_earlydata
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-28 17:34:06 +08:00