1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-04-26 15:08:51 +03:00

17037 Commits

Author SHA1 Message Date
Dave Rodgman
d39cf1e07c Align CONTRIBUTING.md with development
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-01 20:58:30 +00:00
Dave Rodgman
bc1e670fb7 Improve list formatting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-01 20:56:49 +00:00
Dave Rodgman
9a1c38a3c1 Reinstate note about all PRs receiving review
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-01 20:56:45 +00:00
Dave Rodgman
53b65f65ff Update CONTRIBUTING.md, and refer to this from the template
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-01 20:55:32 +00:00
Dave Rodgman
f1d74acb18 Update PR template
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-11-01 20:55:20 +00:00
Dave Rodgman
0bbe75838e
Merge pull request #6191 from daverodgman/invalid-ecdsa-pubkey-backport-2.28
Improve ECDSA verify validation - 2.28 backport
2022-10-31 09:37:38 +00:00
Dave Rodgman
6d61d83f29 Build fix - remove line of dead code
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-28 09:23:09 +01:00
Dave Rodgman
23b79b6c9c Credit Cryptofuzz in the changelog
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-27 20:36:47 +01:00
Dave Rodgman
a66e7edf09 Improve changelog for ECDSA verify fix
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-27 20:34:59 +01:00
Dave Rodgman
584200cf4e Update tests/suites/test_suite_ecdsa.function
Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-27 20:34:56 +01:00
Gilles Peskine
e0917c0346
Merge pull request #6492 from daverodgman/ecp_mul_mxz-timing-leak-2.28
Fix a timing leak in ecp_mul_mxz() - 2.28 backport
2022-10-27 19:46:44 +02:00
Aurelien Jarno
edc110d15a Fix a timing leak in ecp_mul_mxz()
The bit length of m is leaked through through timing in ecp_mul_mxz().
Initially found by Manuel Pégourié-Gonnard on ecp_mul_edxyz(), which has
been inspired from ecp_mul_mxz(), during initial review of the EdDSA PR.
See: https://github.com/Mbed-TLS/mbedtls/pull/3245#discussion_r490827996

Fix that by using grp->nbits + 1 instead, which anyway is very close to
the length of m, which means there is no significant performance impact.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2022-10-27 11:58:15 +01:00
Gilles Peskine
d654171087
Merge pull request #6477 from AndrzejKurek/fix-cipher-deps-2-28
[Backport 2.28] Fix PSA dependencies in test_suite_cipher.[aes|gcm|ccm]
2022-10-26 18:31:39 +02:00
Ronald Cron
2e0a11556e
Merge pull request #6483 from gilles-peskine-arm/psa-pkparse-pkwrite-2.28
Backport 2.28: PSA with RSA requires PK_WRITE and PK_PARSE
2022-10-26 14:57:41 +02:00
Ronald Cron
c527796ecb
Merge pull request #6392 from davidhorstmann-arm/2.28-fix-x509-get-name-cleanup
[Backport 2.28] Fix `mbedtls_x509_get_name()` cleanup
2022-10-26 14:28:04 +02:00
Gilles Peskine
031c8c2815 Add build with a typical configuration for a PSA crypto service
Disable non-crypto features that can't be called through the PSA API, as
well as algorithms that have no PSA interface.

This serves as a non-regression test for #6408 and #6409.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 21:09:49 +02:00
Gilles Peskine
c037ba9c3e Add some missing dependencies on PKCS12 for encrypted keys
This is a PKCS#8 test case using a PKCS#12 algorithm.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 21:08:39 +02:00
Gilles Peskine
8df2748432 Improve test component name
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:32:35 +02:00
Gilles Peskine
21503df752 Add build with a typical configuration for a PSA crypto service
Disable non-crypto features that can't be called through the PSA API, as
well as algorithms that have no PSA interface.

This serves as a non-regression test for #6408 and #6409.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:32:20 +02:00
Gilles Peskine
8fb928f642 Fix PSA+RSA dependencies on PK
The PSA code needs pk_parse as well as pk_write for RSA keys. Fix #6409.
This is independent of PKCS#1v1.5 support. Fix #6408.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:32:02 +02:00
Gilles Peskine
bfcf2d129d test_suite_pk: Add missing dependencies on MBEDTLS_PEM_PARSE_C
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:08:38 +02:00
Gilles Peskine
8f3577a53d test_suite_dhm: Add missing dependencies on MBEDTLS_PEM_PARSE_C
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:08:29 +02:00
Gilles Peskine
4e10fb2396 Add mbedtls_dhm_parse_dhmfile test case with DER input
dh.optlen.der is the result of converting dh.optlen.pem from PEM to DER.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:07:49 +02:00
David Horstmann
6c4226ce95 Change brace initialization to memset
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:30 +01:00
David Horstmann
8eb3ed56f8 Minor fixes to x509_get_name() test function
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:30 +01:00
David Horstmann
670a993dcd Fix incorrect return style
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:30 +01:00
David Horstmann
e6917d05d3 Remove unnecessary NULL assignments
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:30 +01:00
David Horstmann
5ad5e1657d Clarify wording on allocation
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:30 +01:00
David Horstmann
4a67c351a8 Improve X509 DN test naming
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:30 +01:00
David Horstmann
94cbd30a24 Add explanatory comments to raw DER test data
Break down the DER-encoded ASN.1 test data into its structure in a
comment and explain it, to make it easier to understand where the data
came from and how it is corrupted.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-10-24 15:30:28 +01:00
Andrzej Kurek
36b3b7cbee Fix test dependencies for cases that are PSA-based
These should be using PSA-type macros, not MBEDTLS_XXX_C.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-10-24 05:40:55 -04:00
Andrzej Kurek
ed01319962 Add missing ECB requirements for PSA cipher aes tests
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-10-24 05:21:50 -04:00
Janos Follath
9abd09822c
Merge pull request #6424 from gilles-peskine-arm/test_data_generation-pr_6093_followup-2.28
Backport 2.28: Minor fixes to test_data_generation.py
2022-10-18 13:38:17 +01:00
Manuel Pégourié-Gonnard
e5ae132d87
Merge pull request #6420 from mpg/fix-assert-alloc-usage-228
backport 2.28 - Fix usage of ASSERT_ALLOC()
2022-10-17 12:10:55 +02:00
Dave Rodgman
d3a4f2205b
Merge pull request #6414 from daverodgman/update_docs_links_2.28
Update documentation links 2.28
2022-10-14 17:42:50 +01:00
Gilles Peskine
377e7e93ba Documentation typo
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:34:06 +02:00
Gilles Peskine
5d01cc04a0 Don't use parallel jobs for pylint
When pylint runs in parallel, it loses the ability to detect duplicated code
across modules. Duplicated code is usually a bad thing, so give pylint the
opportunity to let us know.

This makes pylint slightly slower, but going from 2 threads to 1 does not
make it anywhere close to twice as slow. On my machine, with Python 3.5,
pylint -j2 takes about 12s while single-threaded pylint takes about 16s
of wall clock time.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:34:06 +02:00
Gilles Peskine
7ff4766115 Unify check_repo_path
We had 4 identical copies of the check_repo_path function. Replace them by a
single copy in the build_tree module where it naturally belongs.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:34:06 +02:00
Gilles Peskine
239765ad3e Use relative imports when importing other modules in the same directory
We were using absolute imports under the assumption that the /scripts
directory is in the path. This worked in normal use because every one of our
Python scripts either were in the /scripts directory, or added the /scripts
directory to the module search path in order to reference mbedtls_dev.
However, this broke things like
```
python3 -m unittest scripts/mbedtls_dev/psa_storage.py
```

Fix this by using relative imports.

Relative imports are only supposed to be used inside a package (Python
doesn't complain, but Pylint does). So make /scripts/mbedtls_dev a proper
package by creating __init__.py.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:34:06 +02:00
Gilles Peskine
ca980c037f Move implementation detail from docstring to comment
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:34:06 +02:00
Gilles Peskine
f8d031fb18 generate_*_tests.py: chdir to mbedtls root
Do this in 2.28 just like it's done in the development branch, so that
code and command line usage that works on one branch doesn't surprisingly
fail on 2.28.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:33:49 +02:00
Gilles Peskine
4881540b06 generate_*_tests.py: simplify test_suite_directory handling
test_suite_directory can be changed by a command line option in the
development branch but not in 2.28. Align the simplified version here with a
change in the development version
("generate_*_tests.py --directory: fix handling of relative path").

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:33:45 +02:00
Gilles Peskine
bd5147c1c0 Clarify the descriptions of test-case-data-related modules
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:24:30 +02:00
Gilles Peskine
69feebd178 More precise name for test data generation
We have Python code both for test code generation
(tests/scripts/generate_test_code.py) and now for test data generation.
Avoid the ambiguous expression "test generation".

This commit renames the Python module and adjusts all references to it. A
subsequent commit will adjust the documentation.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:24:30 +02:00
Gilles Peskine
40de3d3639 Backport build_tree.py from development
Copy of scripts/mbedtls_dev/build_tree.py from mbedtls-3.2.1,
backported to facilitate future backports of python scripts.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-14 15:24:30 +02:00
Dave Rodgman
4c0a21f6b0 Fix capitalisation
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-14 10:56:18 +01:00
Dave Rodgman
8705290c71 Update SUPPORT.md
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-14 10:56:15 +01:00
Dave Rodgman
ed46f6f06b Update SUPPORT.md
Co-authored-by: Paul Elliott <62069445+paul-elliott-arm@users.noreply.github.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-10-14 10:56:12 +01:00
Manuel Pégourié-Gonnard
3495ca309b
Merge pull request #6415 from mprse/aead_driver_test_2_28_backport
2.28 backport: Enable testing of AEAD drivers with libtestdriver1
2022-10-14 11:11:06 +02:00
Manuel Pégourié-Gonnard
d44d3eaa8d Fix usage of ASSERT_ALLOC()
The second argument is the number of elements of the type the first
argument is pointing to, so we shouldn't be using sizeof there.

This was resulting in overly large allocations.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-10-14 09:39:40 +02:00