1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-01 09:41:40 +03:00
Commit Graph

892 Commits

Author SHA1 Message Date
8c31148af0 fix wrong typo and indent issue
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-06 10:04:42 +08:00
af0b58d21a Add asn1crypto to python maintainer requirements
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-06 10:04:42 +08:00
2fd6505b33 add script for server9_bad_saltlen
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-06 10:04:42 +08:00
6805037a45 Add build preset full_no_platform
Add build preset as above, and utilise it in
all.sh:component_test_no_platform.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-11-03 19:24:56 +00:00
7ff7965561 Update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-03 12:04:52 +00:00
9043a2fc0b Fix type annotation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-31 09:32:36 +00:00
2bff1bfd47 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>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-31 09:32:35 +00:00
734d22c03e 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>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-31 09:31:20 +00:00
0ee9dacb4d Merge pull request #8122 from gilles-peskine-arm/ssl-test-no-legacy-2.28
Backport 2.28: Remove GNUTLS_LEGACY and OPENSSL_LEGACY (partly)
2023-10-18 07:13:15 +00:00
3c6b7c8efc Move check into list_files_to_merge
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-02 17:20:08 +01:00
68cb9359a6 Check for incorrect changelog extensions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-02 17:03:47 +01:00
f08ca83b4f Update spelling "mbed TLS" to "Mbed TLS"
The official spelling of the trade mark changed from all-lowercase "mbed"
to normal proper noun capitalization "Mbed" a few years ago. We've been
using the new spelling in new text but still have the old spelling in a
lot of text. This commit updates most occurrences of "mbed TLS":

```
sed -i -e 's/mbed TLS/Mbed TLS/g' $(git ls-files ':!ChangeLog' ':!tests/data_files/**' ':!tests/suites/*.data' ':!programs/x509/*' ':!configs/tfm*')
```

Justification for the omissions:

* `ChangeLog`: historical text.
* `test/data_files/**`, `tests/suites/*.data`, `programs/x509/*`: many
  occurrences are significant names in certificates and such. Changing
  the spelling would invalidate many signatures and tests.
* `configs/tfm*`: this is an imported file. We'll follow the upstream
  updates.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-12 19:21:54 +02:00
bd44d93ee9 Allow "Mbed TLS" as the project name in Doxygen
Previously the code only recognized the old spelling "mbed TLS", so it
missed doxygen/input/doc_mainpage.h.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-12 19:21:37 +02:00
3a11771bae Pacify pylint
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-08 11:17:09 +02:00
937b91eb6f Fix boolean options in the wrong section
Boolean options that modify the behavior of a module are supposed to be in
the "feature support" section, not in the "configuration options" support:
that section is documented to contain commented-out definitions with a
value, for which the comment contains the default version. In particular,
merely uncommenting a definition in the "configuration options" section is
not supposed to change anything.

Move the offending boolean options to the proper section.

This causes those options to be enabled by `config.py full` unless
explicitly excluded. For the moved options:

* Everest is already explicitly excluded.
* The ALT options need to link against a custom function, so exclude them.
* `MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE` is ok for testing, and is
  currently never tested in `all.sh`. With this commit, we will now test the
  library with it enabled in configurations based on `full`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-07 17:40:16 +02:00
549a96120e Remove GNUTLS_LEGACY
It isn't used anywhere.

Keep the command line options of all.sh to avoid breaking any wrapper
scripts that people might have.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-27 21:50:06 +02:00
fb806b68ed Merge pull request #7969 from gowthamsk-arm/use_earliest_latest_compilers_2.28
Backport 2.28: Use earliest latest compilers 2.28
2023-08-01 23:50:14 +00:00
2afb24f96a Use variables for selecting compilers
The latest and earliest clang/GCC compilers are now used through
variables instead of symlinks and also the all.sh script is updated
to support options for overriding the default values.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:45:57 +01:00
dd7b24c3bf whitespace fix
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-07-27 20:01:04 +01:00
e67ffd6d20 pylint tidy-up
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:50:50 +01:00
73b87e39d6 Make code_style.py -s default to -s=mbedtls-2.28
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:44:52 +01:00
b96dbc6486 Make code_style.py -s more precise
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:44:45 +01:00
1e3af2485f Update test scripts to use latest/earliest compilers
The Ubuntu 16.04 and 22.04 docker images have been updated with
earliest and latest versions of gcc and clang respectively.
This patch adds the necessary component and support functions
required for the CI to run these compilers.

For FreeBSD we invoke the function by name so a condition is added
to disable the existing test_clang_opt function for linux.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-07-26 16:55:39 +01:00
73521b0715 Tests: provide necessary functions for MBEDTLS_PSA_INJECT_ENTROPY
The build option MBEDTLS_PSA_INJECT_ENTROPY requires some extra platform
functions, for historical reasons. To enable us to test this option, provide
a version of these functions for testing.

(These versions would actually work in production, but providing them in the
library in a way that doesn't break existing users might be slightly tricky,
so it's out of scope of this commit.)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-20 18:08:24 +02:00
7b780491f0 Handle deleted files correctly
Don't attempt to run on a file that isn't present now.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-04 15:47:02 +02:00
8ceeba4f22 Add --since option to check files modified since a given commit
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-04 15:47:01 +02:00
0f1053c13b Clean up subprocess invocation in get_src_files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-04 15:46:59 +02:00
02501f6ba1 Replace references to Mbed Crypto with Mbed TLS through-out documentation and comments.
Signed-off-by: Fredrik Hesse <fredrik@hesse.se>
2023-05-15 15:28:39 +01:00
5b673a828d Replace references to Mbed Crypto with Mbed TLS through-out documentation and comments.
Signed-off-by: Fredrik Hesse <fredrik@hesse.se>
2023-05-15 15:27:54 +01:00
e95df0bd70 Fix CI failure
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
4a37eef78f Only check files known to git
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
bae83d25eb Improve readability
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
44b75a605b adjust help message
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
75e11d3703 print skipped file names to stdout
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
a4b9b7700a code_style.py: Add helpers to print warning and skipped files
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
b1c9cc3ae4 code_style.py: Apply exclusions to the file list
This commit rename `--files` options to `--subset` and
it means to check a subset of the files known to git.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-16 18:12:51 +08:00
d6bb16a5b8 Merge pull request #6976 from davidhorstmann-arm/2.28-c-build-helper-improvements
[Backport 2.28] Minor improvements to `c_build_helper.py`
2023-02-07 10:26:03 +01:00
9a10538f20 Merge pull request #6965 from davidhorstmann-arm/2.28-code-style-improvements
[Backport 2.28] Improvements to code style script
2023-01-31 21:22:59 +01:00
e28f2ee685 Add docstring for new compile function.
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-30 09:52:01 +00:00
0b1b97badf Make c_build_helper module respect HOSTCC
If HOSTCC is set, use that to generate files, otherwise use CC. This
should make cross-compilation with generated files slightly easier.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-27 19:56:49 +00:00
ddb09e4f17 c_build_helper.py: Move compile to helper
Move compilation to a separate helper function in c_build_helper.py to
allow more generic use.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-27 19:56:47 +00:00
27276fcb97 Merge pull request #6844 from gilles-peskine-arm/test_suite_psa_crypto_metadata-20221215-2.28
Backport 2.28: Add metadata tests for CCM* and TLS1.2-ECJPAKE-to-PMS
2023-01-27 10:05:04 +01:00
04aaa45ee1 Remove unnecessary '\' linebreak characters
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-25 11:39:45 +00:00
659d905cf9 Give proper Dict type hints in crypto_knowledge.py
This prevents a return type error in a later function that uses the
dictionaries here properly typed.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 19:01:31 +00:00
6956cb58ac Don't wrap stdout and stderr in UTF-8 wrapper
This is no longer needed as we only print ASCII text directly

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
5682e80266 Output diff without capturing it
Instead of capturing the output of diff and printing it, let diff do its
own outputting and se the return code to decide what to do.

This also means that the conversion of stdout to UTF-8 is not necessary,
as the reason it was needed was for printing diffs of files with UTF-8
characters in them.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
6d02f0cfa0 Add basic output on success
Whilst it is true that "silence is golden", no output at all could be
disconcerting and it makes searching in a CI log more difficult.

Add a simple status message that says "Checked N files, style ok".

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
3febe15114 Remove overly verbose output on success
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
64827e4611 Change print to print_err for an error message
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
a27d872228 Document that the script must be run from the root
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00