Commit graph

22395 commits

Author SHA1 Message Date
Xiaokang Qian
893ad81966 Remove useless early_secrets field
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2022-11-14 03:13:51 +00:00
Xiaokang Qian
911c0cc4f0 Fix format issues in comments
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2022-11-14 03:13:50 +00:00
Xiaokang Qian
0e97d4d16d Add early data indication to client side
Add fields to mbedtls_ssl_context
Add write early data indication function
Add check whether write early data indication
Add early data option to ssl_client2
Add test cases for early data

Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
2022-11-14 03:13:50 +00:00
Minos Galanakis
50de073c84 bignum_mod_raw.py: Added BignumModRawConvertfromMont
This patch adds test class for 'mpi_mod_raw_from_mont_rep()`.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-12 13:21:31 +00:00
Minos Galanakis
a252f6b24c bignum_mod_raw.py: Added BignumModRawConvertToMont
This patch adds test class for 'mpi_mod_raw_to_mont_rep()`.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-12 13:21:31 +00:00
Paul Elliott
aeb8bf2ab0
Merge pull request #6170 from yuhaoth/pr/tls13-cleanup-extensions-parser
TLS 1.3: Add extension check for message parsers
2022-11-11 19:00:46 +00:00
Minos Galanakis
47691fb756 bignum_tests: Refactored mpi_mod_raw_to/fromt_mont_rep
This patch migrates the tests to use the `mbedtls_test_read_mpi_core()`.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-11 10:55:08 +00:00
Minos Galanakis
df070d660d bignum_tests: Added test for mbedtls_mpi_mod_raw_from_mont_rep()
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-11 10:55:08 +00:00
Minos Galanakis
631b491cbf bignum_tests: Added test for mbedtls_mpi_mod_raw_to_mont_rep()
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-11 10:55:08 +00:00
Minos Galanakis
d9299c388e bignum_mod_raw: Refactored Montgomery conversion functions
This patch updates the `mbedtls_mpi_mod_raw_conv_xx()` methods
as follows:

* Renamed for simplicity: conv_fwd -> from_mont_rep, conv_inv -> to_mont_rep.
* Uncoupled the dependency on the legaly bignum interface.
* `mbedtls_mpi` is no longer used for temporary buffer allocation.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-11 10:54:58 +00:00
Hanno Becker
5ad4a93596 bignum_mod_raw: Added conversion methods for internal/public data representation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-11 10:54:58 +00:00
Dave Rodgman
71565cff3a Disable PKCS7 for some TLS 1.3 tests
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-11 10:37:38 +00:00
Janos Follath
9f1ecadc40
Merge pull request #6577 from minosgalanakis/minos/add_bignum_more_raw_base_classes
Bignum: Add BignumModRaw Operation base classes
2022-11-11 10:04:17 +00:00
Dave Rodgman
ebd0caffdf Fix test memory allocation
Fix error in memory allocation in test code, which was triggering an
error in test_memory_buffer_allocator.

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-10 15:33:54 +00:00
Aditya Deshpande
bd2bfa92bd Add Changelog entry
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-11-10 15:30:12 +00:00
Gilles Peskine
fd7aa13671
Merge pull request #6436 from yanrayw/ssl_client2-add-build-version
Add build version to the output of ssl_client2 and ssl_server2
2022-11-10 14:39:38 +01:00
Tom Cosgrove
163d8952b3 Add additional (would fail) test cases for mpi_mod_int with 0 remainder
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-10 12:17:36 +00:00
Tom Cosgrove
9feb19f98d Use mbedtls_mpi_sint not mbedtls_mpi_uint in mpi_mod_int test
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-10 12:05:55 +00:00
Minos Galanakis
855c228b29 bignum_mod_raw.py: Moved Classes outside of slots
This patch moves `BignumModRawOperation` and `BignumModRawOperationArchSplit`
outside of the scaffolding merge slot.

It also renames `r_sqrt` property to `r2`.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-10 11:37:33 +00:00
Minos Galanakis
5566eff657 generate_bignum_tests: Enabled BignumModRaw automatic generation
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-10 11:37:33 +00:00
Minos Galanakis
a461ece810 bignum_mod_raw.py: Refactoring BignumModRawOperation
This patch modifies the BignumModRawOperation class to
provide special access to key members commonly used
in tests.

It binds the module's getters to conversion functions
which enable automatic conversions such as:

* hex to int.
* zero padding hex strings.
* common Montgomery constants such as R, R^2 and R^01
  are now be calculated upon access.

class `BignumModRawOperationArchSplit` is also updated to
utilise the new design.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-10 11:37:33 +00:00
Minos Galanakis
e9c86a100a bignum_mod_raw.py: Added BignumModRawOperation
This patch is adding a basic instantance of `BignumModRawOperation`
and creates an `BignumModRawOperationArchSplit` class, copying
over the implementation of `BignumCoreRawOperationArchSplit`.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2022-11-10 11:37:33 +00:00
Gilles Peskine
b4eb444a5c
Merge pull request #6535 from davidhorstmann-arm/change-test-templating-syntax
Change test templating syntax to be valid C
2022-11-10 12:05:55 +01:00
Dave Rodgman
50e5616553 Fix typo in check_config.h
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-10 10:07:35 +00:00
ihsinme
d21ecd71c0 dh_genprime: Fix issue where the error code returned by mbedtls_mpi_write_file() is incorrectly reported on failure
In 'dh_genprime.c', the following condition can be found inside an 'if' statement:

ret = mbedtls_mpi_write_file( "P = ", &P, 16, fout ) != 0

As the '!=' operator binds closer than the assignment operator ('='), the value assigned to 'ret' will be the boolean result of the comparison (0 or 1) instead of the status code returned by 'mbedtls_mpi_write_file'. This means that the above statement is actually equivalent to:

ret = ( mbedtls_mpi_write_file( "P = ", &P, 16, fout ) != 0 )

What we want instead is for the the status code to be assigned to 'ret'. If the value assigned is non-zero, it will be 'truthy' and the 'if' branch will be taken.

( ret = mbedtls_mpi_write_file( "P = ", &P, 16, fout ) )  != 0

This PR fixes the issue by explicitly specifying the precedence of operations with parentheses.

Signed-off-by: ihsinme <ihsinme@gmail.com>
2022-11-10 12:58:15 +03:00
Dave Rodgman
f58172fe43 Merge remote-tracking branch 'origin/development' into pr3431 2022-11-10 09:54:49 +00:00
Gilles Peskine
9a571ddfd9
Merge pull request #6543 from mpg/improve-test-suites-listing
Improve test suite detection in run-test-suites.pl
2022-11-09 19:03:03 +01:00
Gilles Peskine
ed4b34aa7c
Merge pull request #6570 from gilles-peskine-arm/bignum-mbedtls_test_read_mpi_core-nonempty
Forbid empty mpi_core in test data
2022-11-09 19:02:24 +01:00
David Horstmann
360f8e4429 Minor improvements to test code script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-11-09 17:27:33 +00:00
Nick Child
89e82e1685 pkcs7: Add dependecy on MBEDTLS_MD_C
Signed-off-by: Nick Child <nick.child@ibm.com>
2022-11-09 10:36:10 -06:00
Jerry Yu
97be6a913e fix various issues
- typo error
- replace `ssl->hanshake` with handshake

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-09 22:43:31 +08:00
Przemek Stekiel
93986645d8 Remove reference vs drivers test from outcome-analysis.sh
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-11-09 15:06:44 +01:00
Przemek Stekiel
992de3c562 Make TASK parameter positional and allow more than one task
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-11-09 14:24:49 +01:00
Tom Cosgrove
91e35e3c32 Enable mpi_mod_int test case to take full-range MPI integers
Also add commented-out test cases that currently fail

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-09 11:45:29 +00:00
Przemek Stekiel
be279c7bcc Make a list from ignored tests in TASKS
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-11-09 12:17:08 +01:00
Przemek Stekiel
51f30ff6e6 Make separate components for ref and driver in TASKS
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-11-09 12:07:29 +01:00
Manuel Pégourié-Gonnard
b9581824f7
Merge pull request #6561 from AndrzejKurek/ecjpake-error-injection
Improve error injection in EC J-PAKE tests
2022-11-09 11:48:36 +01:00
Gilles Peskine
95b5addcd6 Don't test mbedtls_mpi_core_lt_ct with 0 limbs
A core MPI must have at least 1 limb. We can no longer test with 0 limbs,
and we don't need to anyway, so don't try.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-09 11:18:38 +01:00
Przemek Stekiel
6856f4c70d Fix typos and comments
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-11-09 10:50:29 +01:00
Gilles Peskine
0b7e07904e Forbid empty mpi_core in test data
This way static analyzers have a chance of knowing we don't expect the
bignum functions to support empty inputs. As things are, Coverity keeps
complaining about it.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-09 10:45:15 +01:00
Gilles Peskine
dae43401e1
Merge pull request #6568 from mfischer/development
include: mbedtls: Add missing private_access header
2022-11-09 10:18:50 +01:00
Moritz Fischer
ab45425623 include: mbedtls: Add missing private_access header
This adds a missing private access header.

Signed-off-by: Moritz Fischer <moritzf@google.com>
2022-11-08 14:55:32 -08:00
Gilles Peskine
69ae1ee4fe
Merge pull request #6552 from gstrauss/bignum-aliasing
Add comments for some forbidden aliasing in bignum.h interfaces
2022-11-08 17:15:37 +01:00
Gilles Peskine
d4bd38ba5d
Merge pull request #6544 from KloolK/development
Fix outdated reference in debug message
2022-11-08 17:12:20 +01:00
Gilles Peskine
4a480ac5a1
Merge pull request #6265 from Kabbah/x509-info-hwmodulename-hex
`x509_info_subject_alt_name`: Render HardwareModuleName as hex
2022-11-08 17:11:07 +01:00
Jerry Yu
616ba75c23 move test cases and mark tls13-kex-modes.sh as locked
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-08 23:51:39 +08:00
Jerry Yu
7de2ff0310 Refactor extension list print
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-08 23:51:39 +08:00
Jerry Yu
79aa721ade Rename ext print function and macro
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-08 23:51:39 +08:00
Jerry Yu
b95dd3683b Add missing mask set and tls13 unrecognized extension
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2022-11-08 23:51:38 +08:00
Andrzej Kurek
c018204019 Improve error injection in EC J-PAKE tests
Instead of corrupting the public key part of the message,
corrupt the proof part. A proof is conceptually similar to a signature,
and changing anything in it should make it invalid with 
a high probability.
Also, instead of shifting data, perform a bitflip.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-11-08 08:12:56 -05:00