Commit graph

22010 commits

Author SHA1 Message Date
Valerio Setti
79f6b6bb1b tls: psa_pake: fixing mbedtls_psa_ecjpake_write_round()
It might happen that the psa_pake_output() function returns
elements which are not exactly 32 or 65 bytes as expected, but
1 bytes less.
As a consequence, insted of hardcoding the expected value for
the length in the output buffer, we write the correct one as
obtained from psa_pake_output()

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-21 14:17:03 +01:00
Valerio Setti
61ea17d30a tls: psa_pake: fix return values in parse functions
Ensure they all belong to the MBEDTLS_ERR_SSL_* group

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-18 12:11:00 +01:00
Valerio Setti
aca21b717c tls: psa_pake: enforce not empty passwords
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 18:20:50 +01:00
Valerio Setti
819de86895 tls: removed extra white spaces and other minor fix
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 18:05:19 +01:00
Valerio Setti
6b3dab03b5 tls: psa_pake: use a single function for round one and two in key exchange read/write
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 17:14:54 +01:00
Valerio Setti
9bed8ec5d8 tls: psa_pake: make round two reading function symmatric to the writing one
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 16:36:19 +01:00
Valerio Setti
30ebe11f86 tls: psa_pake: add a check on read size on both rounds
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 16:35:02 +01:00
Valerio Setti
a988364767 tls: psa_pake: fix missing new round one parsing function on tls12 server
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 16:35:02 +01:00
Valerio Setti
a08b1a40a0 tls: psa_pake: move move key exchange read/write functions to ssl_tls.c
Inlined functions might cause the compiled code to have different sizes
depending on the usage and this not acceptable in some cases.
Therefore read/write functions used in the initial key exchange are
moved to a standard C file.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-17 16:34:59 +01:00
Valerio Setti
6f1b5741ae tls12: psa_pake: simplify EC info parsing in server's 2nd round
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-16 14:50:13 +01:00
Valerio Setti
4a9caaa0c9 tls12: psa_pake: check elliptic curve's TLS ID on handshake
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-16 14:50:10 +01:00
Valerio Setti
fbbc1f3812 tls12: psa_pake: use proper defines for the output size of each step in ECJPAKE
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-16 14:49:52 +01:00
Valerio Setti
02c25b5f83 tls12: psa_pake: use common code for parsing/writing round one and round two data
Share a common parsing code for both server and client for parsing
round one and two.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-16 13:56:12 +01:00
Valerio Setti
9f0ec53c4c add a test for EC-JPAKE compatibility in TLS1.2
This is to ensure that the MbedTLS based implementation of EC-JPAKE
is compatible with the PSA crypto one

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-15 16:49:55 +01:00
Neil Armstrong
e2977b6901 Remove TLS 1.2 exception about EC J-PAKE and PSA Crypto
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2022-11-08 10:58:54 +01:00
Neil Armstrong
ca7d506556 Use PSA PAKE API when MBEDTLS_USE_PSA_CRYPTO is selected
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-11-08 10:58:45 +01:00
Gilles Peskine
faefe62013
Merge pull request #6390 from mpg/fix-ecjpake-psa-format
Fix ecjpake PSA format
2022-11-07 17:35:44 +01:00
Gilles Peskine
bf249accc7
Merge pull request #6498 from yuhaoth/pr/fix-session-resumption-fail-when-hostname-is-not-localhost
BUG: Fix session resumption fail when hostname is not localhost
2022-11-07 17:33:38 +01:00
Gilles Peskine
34c09469f3
Merge pull request #5396 from SiliconLabs/codegen_1.1
Driver dispatch Codegen 1.1
2022-11-07 15:27:41 +01:00
Janos Follath
49e9fbd6bc
Merge pull request #6532 from yanesca/bignum_common_merge_slots
Add merge slots to bignum_common.py
2022-11-04 08:37:07 +00:00
Janos Follath
f8b3b72910 Add merge slots to bignum_common.py
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-03 14:46:18 +00:00
Janos Follath
4feb94a965
Merge pull request #6530 from yanesca/bignum_merge_scaffolding
Bignum merge scaffolding
2022-11-03 11:29:32 +00:00
Asfandyar Orakzai
9b656d3c80 removed stray whitespaces from change logs
Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
2022-11-03 11:39:36 +01:00
Asfandyar Orakzai
65cd8a4a23 fixed formating issues in psa_crypto_code_gen_1_1.txt
Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
2022-11-03 11:16:40 +01:00
Asfandyar Orakzai
4f63ac4358 fixed changelog formating
Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
2022-11-03 10:18:05 +01:00
Janos Follath
d820ca5d07
Fix bignum test generator class names
Co-authored-by: minosgalanakis <30719586+minosgalanakis@users.noreply.github.com>
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-03 08:42:54 +00:00
Asfandyar Orakzai
ee2b637d03 Fixed change log issue
Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
2022-11-02 21:50:27 +01:00
Janos Follath
c1a81bc998 Remove trailing new lines
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:33:11 +00:00
Janos Follath
9cf14cd6b0 Make pylint happy
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:28:39 +00:00
Janos Follath
6642cafae3 Fix merge separator position
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:28:39 +00:00
Janos Follath
be13652296 Use comments for merge separators in .data files
We do have a comment syntax for .data files, there is no need for dummy
test cases.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:28:37 +00:00
Janos Follath
1be322a795 Add merge slots to raw and mod_raw test generation
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:27:36 +00:00
Janos Follath
b99b056f0a Add script for generating mod test cases
This commit only adds the boilerplate, no actual tests are added.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:27:36 +00:00
Janos Follath
df8239b846 Add script for generating mod_raw test cases
This commit only adds the boilerplate, no actual tests are added.

Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:27:36 +00:00
Janos Follath
5933f691a2 Add merge slots to Bignum files
Legacy Bignum is excluded as it doesn't get regular extensions like new
ones.

Each slot uses comments of their respective filetype. Since .data files
don't have a syntax for comments, dummy test cases are used. (These test
cases will never be executed and no noise will be added to tests.)

Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:27:25 +00:00
Janos Follath
2a8bcf8c6f Add bignum merge scaffolding
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 17:25:48 +00:00
Janos Follath
7b96f52b39
Merge pull request #6450 from gilles-peskine-arm/bignum-core-fill_random
Bignum core: fill_random
2022-11-02 17:23:31 +00:00
Asfandyar Orakzai
9bd28dc1e1 Update changed log
Signed-off-by: Asfandyar Orakzai <asfandyar.orakzai@silabs.com>
2022-11-02 16:36:14 +01:00
Gilles Peskine
22cdd0ccd3 Update some internal comments
The refactoring of fill_random had left some obsolete bits in comments.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-02 16:00:01 +01:00
Gilles Peskine
dd54324765 Increase iterations for some statistical tests
I ran into a sequence where the assertion `stats[8] > 0` failed for the
range 1..272 with 100 iterations.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-02 16:00:01 +01:00
Gilles Peskine
009d195a56 Move mbedtls_mpi_core_fill_random to the proper .c file
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-02 16:00:01 +01:00
Gilles Peskine
5980f2bd36 Implement mbedtls_mpi_core_fill_random
Turn mpi_fill_random_internal() into mbedtls_mpi_core_fill_random(). It
had basically the right code except for how X is passed to the function.

Write unit tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-02 15:59:36 +01:00
Gilles Peskine
909e03c52f Bignum core: fill_random: prototype
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-02 15:59:16 +01:00
Janos Follath
f1ed5815ba
Merge pull request #6512 from yanesca/extract_uint_table_lookup_core
Implement mbedtls_mpi_core_ct_uint_table_lookup()
2022-11-02 13:58:19 +00:00
Dave Rodgman
90c6836271
Merge pull request #6524 from daverodgman/fix-duplicate-header
Remove duplicate function prototype
2022-11-02 13:06:08 +00:00
Dave Rodgman
ea63f69303
Merge pull request #6514 from daverodgman/update_pr_template
Update PR template
2022-11-02 13:05:09 +00:00
Janos Follath
28f85e6683 Fix const time in mpi_core_ct_uint_table_lookup test
Signed-off-by: Janos Follath <janos.follath@arm.com>
2022-11-02 10:20:35 +00:00
Dave Rodgman
340846ec7e
Merge pull request #6515 from daverodgman/psalinks
Update PSA links in README.md
2022-11-02 10:02:19 +00:00
Dave Rodgman
0877dc8f55 Improve documentation for psa_crypto_cipher.h
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-02 09:29:50 +00:00
Dave Rodgman
1630447eed Move declaration of mbedtls_cipher_info_from_psa into psa_crypto_cipher.h
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-02 09:25:38 +00:00