Commit graph

26930 commits

Author SHA1 Message Date
David Horstmann
98af198a30 Correctly detect presence of the built library
Use the repo-specific test not just the Mbed TLS specific one.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-29 10:25:54 +01:00
David Horstmann
58cf7c6c38 Use repo detection functions at start of all.sh
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-29 10:15:05 +01:00
David Horstmann
d02b5f8f56 Separate directory discernment into 2 functions
Have separate in_mbedtls_repo() and in_psa_crypto_repo() functions

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-29 09:55:56 +01:00
David Horstmann
2fde99962d Improve directory coverage in PSA repo detection
Check for the 'drivers' and 'programs' directories additionally to the
ones that are already there.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-29 09:50:16 +01:00
Dave Rodgman
e97de40e7b Typo fix
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:47:35 +01:00
Dave Rodgman
6d5261e38f Fix typo in doxygen for mbedtls_ct_memcpy_offset
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:42:14 +01:00
Dave Rodgman
b69239c604 Improve docs in mbedtls_mpi_lt_mpi_ct
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:42:14 +01:00
Dave Rodgman
d44dd96132 Improve docs re duplicate declarations
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:42:14 +01:00
Dave Rodgman
0cf9dd1056 Whitespace - tidy up asm and make it more consistent
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:42:14 +01:00
Dave Rodgman
81673bba77 Add x86 const-time assembly
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:42:14 +01:00
Dave Rodgman
664fea481c Add x86-64 const-time assembly
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-29 09:42:14 +01:00
Dave Rodgman
d395590597
Merge pull request #7579 from daverodgman/safer-ct-asm
Arm assembly implementation of constant time primitives
2023-08-28 08:26:29 +00:00
Gilles Peskine
8ca2041145
Merge pull request #8074 from tgonzalezorlandoarm/tg/allowlist
Implement allowlist of test cases that are legitimately not executed
2023-08-24 18:03:20 +00:00
Gilles Peskine
2a296729d0
Merge pull request #8084 from AgathiyanB/remove-type-qualifier-in-assignment-casts
Remove type qualifier in assignment casts
2023-08-24 18:02:11 +00:00
David Horstmann
0ac57ca6c6 Rename is_psa_crypto -> in_psa_crypto_repo
(For consistency with all.sh)

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
7f93d22ad9 Rename psa_crypto_lib_filename to just crypto_lib_filename
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
4dcddcfae2 Parameterize out of source build directory
Use CMake to build the library out-of-source (rather than make)
in tests/scripts/test_psa_compliance.py and add a script argument for
the out-of-source build directory.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
76a7738537 Invert logic for repo detection in all.sh
Instead of:
    ! in_psa_crypto_repo()
use
    in_mbedtls_repo()

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
e31014a681 Tweak test_psa_compliance pylint annotations
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
42f42f4394 Support psa-crypto repo in psa_storage.py
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
1d09184291 Modify test_psa_compliance.py for psa-crypto repo
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
795d8b523d Modify build_tree.py for the PSA Crypto repo
When detecting the root dir, look both for PSA Crypto and Mbed TLS
directories.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:18 +01:00
David Horstmann
9a6c45b436 Make all.sh PSA-crypto-friendly
Introduce changes needed to run all.sh in the psa-crypto repo. Where
behaviour must differ, detect that we are in the psa-crypto repo by
checking for the 'core' directory.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-24 15:18:11 +01:00
Tomás González
d43cab3f5c Correct analyze_outcomes identation
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-08-24 09:12:40 +01:00
Gilles Peskine
ef483255db Announce that #7420 is fixed
This is part of a bigger issue https://github.com/Mbed-TLS/mbedtls/issues/7609
which is still pending since there are still configurations that are not
handled correctly. However https://github.com/Mbed-TLS/mbedtls/issues/7420
itself was fixed by https://github.com/Mbed-TLS/mbedtls/pull/7611.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-23 18:08:45 +02:00
Tom Cosgrove
41d689f389
Merge pull request #7985 from tom-cosgrove-arm/single-source-of-truth-for-licensing
Single source of truth for licensing
2023-08-22 16:27:21 +00:00
Agathiyan Bragadeesh
1515f351a1 Remove IAR warning fixes to 2.28 from changelog
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-08-22 15:24:38 +01:00
Agathiyan Bragadeesh
c5eb13d2a9 Reword IAR changelog for fixing compiler warnings
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-08-22 15:13:04 +01:00
Tom Cosgrove
3d2d599d3e
Merge pull request #7996 from gilles-peskine-arm/small_primes-gaps
Reduce the size of the small primes table used by primality testing
2023-08-22 12:48:56 +00:00
Gilles Peskine
e65bba4dd2
Merge pull request #7803 from gilles-peskine-arm/psa-low-hash-mac-size
Start testing the PSA built-in drivers: hashes
2023-08-22 11:19:41 +00:00
Tomás González
a0631446b5 Correct analyze_outcomes.py identation
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-08-22 12:18:04 +01:00
Gilles Peskine
30b0378008 Fix off-by-one error
The value of p after adding the last entry in the gap table is not used.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 11:06:47 +02:00
Tomás González
5022311c9d Tidy up allow list definition
* Don't break string literals in the allow list definition
 * Comment each test that belongs to the allow list is there.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-08-22 09:54:28 +01:00
Tomás González
7ebb18fbd6 Make non-executed tests that are not in the allow list an error
* Turn the warnings produced when finding non-executed tests that
   are not in the allow list into errors.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-08-22 09:47:49 +01:00
Gilles Peskine
ad7725d95d Fix type annotation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 09:59:50 +02:00
Gilles Peskine
6d14c2b858 Remove dead code
Do explain why we don't test a smaller buffer in addition to testing the
nominal size and a larger buffer.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 09:59:50 +02:00
Gilles Peskine
c9187c5866 New test suite for the low-level hash interface
Some basic test coverage for now:

* Nominal operation.
* Larger output buffer.
* Clone an operation and use it after the original operation stops.

Generate test data automatically. For the time being, only do that for
hashes that Python supports natively. Supporting all algorithms is future
work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 09:59:42 +02:00
Dave Rodgman
e20d688463
Fix missing operand modifier
Co-authored-by: Yanray Wang <yanray.wang@arm.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-22 08:46:18 +01:00
Tom Cosgrove
17d5081ffb
Merge pull request #8099 from gilles-peskine-arm/split-config_psa-prepare
Prepare to split config_psa.h
2023-08-22 07:30:46 +00:00
Gilles Peskine
d50562c33c
Merge pull request #7827 from davidhorstmann-arm/reword-net-free-description-2544
Reword the description of `mbedtls_net_free()`
2023-08-21 22:23:08 +00:00
David Horstmann
43f7602fcc Fixup incorrectly-formatted ChangeLog entry
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-08-21 17:34:45 +01:00
Gilles Peskine
fdb722384b Move PSA information and dependency automation into their own module
This will let us use these features from other modules (yet to be created).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-21 18:32:11 +02:00
Dave Rodgman
0c99a9083e Avoid signed right shift UB
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-21 17:06:24 +01:00
Tom Cosgrove
31b2d7414d
Merge pull request #8053 from gilles-peskine-arm/mpi_exp_mod-remove_initial_copy
mbedtls_mpi_exp_mod: remove spurious copy of the output variable
2023-08-21 15:50:28 +00:00
Gilles Peskine
796bc2b8f9
Merge pull request #7486 from AndrzejKurek/calloc-also-zeroizes
Document mbedtls_calloc zeroization
2023-08-21 15:47:21 +00:00
Gilles Peskine
0addbe6dc7
Merge pull request #8069 from paul-elliott-arm/fix_ecjpake_deadcode
Fix logical dead code found by Coverity
2023-08-21 14:44:36 +00:00
Gilles Peskine
d686c2a822
Merge pull request #7971 from AgathiyanB/fix-data-files-makefile
Fix server1.crt.der in tests/data_files/Makefile
2023-08-21 14:43:07 +00:00
Dave Rodgman
65204f8fc8
Merge pull request #8035 from daverodgman/aesce-support-perf
Make mbedtls_aesce_has_support more efficient
2023-08-21 14:39:08 +00:00
Gilles Peskine
ea4fc97cd0 Restore a comment and fix it
aca31654e6 removed a sentence with copypasta
refering to PBKDF2 instead of XTS. Restore that comment but fix the
copypasta.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-21 16:16:24 +02:00
Gilles Peskine
9af413bcc5 Don't try to include mbedtls/config_*.h
They're included by build_info.h and must not be included directly.

Currently, this only concerns one file: config_psa.h. It's technically a bug
to include it, but a harmless one because that header has already been
included by build_info.h except in configurations where it
effectively had no effect (enabling PSA options with PSA turned off).

We plan to split config_psa.h into multiple headers that are less
independent, which could make the inclusion more problematic.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-21 16:12:36 +02:00