Commit Graph

9771 Commits

Author SHA1 Message Date
Paul Elliott
19f1f786fc Backport OPENSSL_NEXT to ssl-opt.sh
Add support for a newer version of OpenSSL, as well as a legacy version.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2021-10-13 18:42:19 +01:00
Gilles Peskine
9e0402b040 Merge pull request #5036 from gilles-peskine-arm/readme-add-contacts-2.16
Backport 2.16: Add contact information directly on the home page
2021-10-06 19:35:37 +02:00
Gilles Peskine
1c9137d8d1 Merge pull request #5034 from gilles-peskine-arm/all.sh-makeflags-nproc-2.16
Backport 2.16: Limit make parallelism to the number of CPUs in all.sh
2021-10-06 19:35:19 +02:00
Gilles Peskine
0bf8f98743 Add contact information directly on the home page
This information was already present in SECURITY.md and SUPPORT.md, but that
wasn't very apparent.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-10-06 17:52:51 +02:00
Gilles Peskine
bbce37755a Limit make parallelism to the number of CPUs
Don't default to unbridled -j, which causes a load spike and isn't really
faster.

"Number of CPUs" is implemented here as a reasonable compromise between
portability, correctness and simplicity. This is just a default that can be
overridden by setting MAKEFLAGS in the environment.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-10-06 17:23:24 +02:00
Gilles Peskine
ccfc2bff6f Merge pull request #4958 from gilles-peskine-arm/make-tests-v-2.16
Backport 2.16: Facilitate reproducing unit tests from all.sh
2021-09-30 16:09:01 +02:00
Gilles Peskine
24180accf5 'make test': show failing test cases when cmake does
When building with make, `make test` runs `run-test-suites.pl` which has a
verbose mode that reports the failing test cases, but it didn't provide a
way to enable this verbose mode. With the present commit, you can run `make
test TEST_FLAGS=-v` to use verbose mode.

Base the default for verbose mode on the same environment variable that
`make test` uses when building with CMake: default off, but enabled if
`CTEST_OUTPUT_ON_FAILURE` is true. In particular, verbose mode will now be
on when building from `all.sh`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-09-21 09:41:58 +02:00
Gilles Peskine
c68b9e0839 Merge pull request #4948 from gilles-peskine-arm/muladdc-amd64-memory-2.16
Backport 2.16: Fix x86_64 assembly for bignum multiplication
2021-09-20 22:23:45 +02:00
Gilles Peskine
666e3df80b Update the list of issues fixed
This had actually been reported multiple times.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-09-15 17:04:31 +02:00
Gilles Peskine
7c847235e8 x86_64 MULADDC assembly: add missing constraints about memory
MULADDC_CORE reads from (%%rsi) and writes to (%%rdi). This fragment is
repeated up to 16 times, and %%rsi and %%rdi are s and d on entry
respectively. Hence the complete asm statement reads 16 64-bit words
from memory starting at s, and writes 16 64-bit words starting at d.

Without any declaration of modified memory, Clang 12 and Clang 13 generated
non-working code for mbedtls_mpi_mod_exp. The constraints make the unit
tests pass with Clang 12.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-09-15 15:52:30 +02:00
Gilles Peskine
c7bd734063 Merge pull request #4904 from kennethsoerensen/pkparse-warning_2_16
Backport 2.16: Remove compiler warning if only MBEDTLS_PK_PARSE_C is …
2021-09-01 16:53:54 +02:00
Kenneth Soerensen
806ac52be3 Backport 2.16: Remove compiler warning if only MBEDTLS_PK_PARSE_C is defined
Warning reported with IAR compiler:
"mbedtls\library\pkparse.c",1167  Warning[Pe550]: variable "ret" was set but never used

Signed-off-by: Kenneth Soerensen <knnthsrnsn@gmail.com>
2021-09-01 11:27:17 +02:00
Janos Follath
5e5ca8e3c7 Merge pull request #4893 from davidhorstmann-arm/4044-chglog-take2
Create ChangeLog entry correcting the record on #4044
2021-08-26 16:25:10 +01:00
Janos Follath
f1b0c70faf Merge pull request #4044 from darrenkrahn/mbedtls-2.16
[Backport 2.16] Mark basic constraints critical as appropriate.
2021-08-26 16:23:58 +01:00
David Horstmann
68e5a221ba Create ChangeLog entry explaining #4044
The change made by PR #4044 was previously advertised in the
2.16.10 ChangeLog, however #4044 had not yet been merged.
Create a new entry for #4044, with a note that the previous
entry was in error.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2021-08-24 12:16:28 +01:00
Manuel Pégourié-Gonnard
e115547417 Merge pull request #4874 from mpg/bio_recv_ret_0_eof-2.16
Backport 2.16: Document that returning 0 from the recv callback means EOF
2021-08-17 10:31:08 +02:00
Hanno Becker
0f54b357e4 Document that returning 0 from the recv callback means EOF
Signed-off-by: Hanno Becker <hanno.becker@arm.com>
2021-08-16 13:03:24 +02:00
Manuel Pégourié-Gonnard
e8466a7a77 Merge pull request #4856 from mpg/add-arm-linux-build-2.16
Backport 2.16: Add arm-linux-gnueabi-gcc build
2021-08-12 13:16:09 +02:00
Manuel Pégourié-Gonnard
0a1a9e7571 Fix missing dependency on Travis
Was getting errors like:

In file included from /usr/include/limits.h:25:0,
                 from /usr/lib/gcc-cross/arm-linux-gnueabi/5/include-fixed/limits.h:168,
                 from /usr/lib/gcc-cross/arm-linux-gnueabi/5/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc-cross/arm-linux-gnueabi/5/include-fixed/limits.h:34,
                 from ../include/mbedtls/check_config.h:30,
                 from ../include/mbedtls/build_info.h:81,
                 from common.h:26,
                 from asn1write.c:20:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory

There are two packages to choose from: armhf or armel. Since the comment
in all.sh says we're trying to be close to Debian's "armel"
architecture, choose that, and fix a comment that was mentioning
gnueabihf for no apparent reason.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2021-08-09 12:24:50 +02:00
Manuel Pégourié-Gonnard
3d04f63dfc Enable arm-linux-gnueabi-gcc build on Travis
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2021-08-09 12:24:50 +02:00
Manuel Pégourié-Gonnard
9d9445279e Add arm-linux-gnueabi-gcc build to all.sh
Currently it can't be mandatory, since we can't install the required toolchain
on Jenkins right away.

Also, while at it, remove `SHELL='sh -x'` from the other arm5vte component; it
was a leftover from debugging.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2021-08-09 12:24:48 +02:00
Gilles Peskine
f762433785 Merge pull request #4697 from yutotakano/fix-ssl-opt.sh-hard-abort-2.16
Backport 2.16: ssl-opt.sh: Skip tests instead of conditional hard abort
2021-08-04 10:16:24 +02:00
Gilles Peskine
8b5bbda156 Merge pull request #4828 from gilles-peskine-arm/generate_errors-multiline-2.16
Backport 2.16: Move MBEDTLS_ERR_xxx Doxygen comments before the definition
2021-08-03 13:46:26 +02:00
Gilles Peskine
3418c24d8c Merge pull request #4830 from spencer-burke/fixing_4222-2.16
2.16 Backport of #4659
2021-08-03 12:53:23 +02:00
Spencer Burke
9fd9ce7b16 Remove the duplicate code in mbedtls/include/mbedtls/check_config.h
Removing the extra preprocessor directives found within the specified
source file.

Signed-off-by: Spencer Burke <info.spencer.burke@gmail.com>
2021-08-03 09:40:33 +02:00
Gilles Peskine
915f258c32 Show warnings if something looks wrong
This makes no difference to the output.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-08-02 22:59:16 +02:00
Gilles Peskine
000a231e3c Document the big regex
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-08-02 22:59:16 +02:00
Gilles Peskine
1990fab5a9 Move MBEDTLS_ERR_xxx Doxygen comments before the definition
Now that descriptions of error codes no longer have to be on the same line
for the sake of generate_errors.pl, move them to their own line before the
definition. This aligns them with what we do for other definitions, and
means that we no longer need to have very long lines containing both the C
definition and the comment.

```
perl -i -pe 's~^(#define +MBEDTLS_ERR_\w+ +-\w+) */\*[*!]<(.*)\*/~/**$2*/\n$1~' include/mbedtls/*.h
```

This commit does not change the output of generate_errors.pl.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-08-02 22:59:16 +02:00
Gilles Peskine
63518ead7c Better support multiline comments for MBEDTLS_ERR_xxx
They were recognized by a prior commit. In this commit, replace line
breaks (with optional comment continuation marker) by spaces.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-08-02 22:58:39 +02:00
Gilles Peskine
2638a62f1c More flexible parsing of Doxygen comments for MBEDTLS_ERR_xxx
Before this commit, definitions of error codes must match a strict pattern,
with a Doxygen comment following the definition on the same line and
starting with "/**<". Change how generate_errors.pl so that the Doxygen
comment can be before the definition instead of after, and doesn't have to
be on the same line.

Also allow spaces between "#" and "define", and allow Doxygen comments to
start with "/*!" rather than "/**". Starting with "///" or "//!" is not
supported.

This commit does not change the output of generate_errors.pl.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-08-02 22:58:39 +02:00
Gilles Peskine
7b89d9faa4 Remove reference to compat-1.2.h
This has been irrelevant since Mbed TLS 2.0.0.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-08-02 22:58:39 +02:00
Manuel Pégourié-Gonnard
1689ba41ac Merge pull request #4804 from gilles-peskine-arm/save-coverage-summary-2.16
Backport 2.16: Save the basic-build-test.sh test report summary to coverage-summary.txt
2021-07-29 10:52:52 +02:00
Manuel Pégourié-Gonnard
4576c8b18b Merge pull request #4798 from gilles-peskine-arm/make-test-python-windows-2.16
Backport 2.16: Fix python in tests/Makefile, etc.
2021-07-29 09:58:36 +02:00
Ronald Cron
ae466e78f4 Merge pull request #4787 from gilles-peskine-arm/fix-clang12-Wstring-concatenation-2.16
Backport 2.16: Prevent triggering Clang 12 -Wstring-concatenation warning
2021-07-23 14:07:58 +02:00
Gilles Peskine
31bf22c06a Fix mixup about the directory containing the success indicator file
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 20:00:18 +02:00
Gilles Peskine
a6b4582add More robust failure detection for the coverage report generation
The previous implementation was hard to understand and could in principle
fail to notice if there was a test case failure and the writing of the
line "Note: $TOTAL_FAIL failures." failed. KISS.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 20:00:18 +02:00
Gilles Peskine
3a8d854d73 Explain the final error checking
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 20:00:18 +02:00
Gilles Peskine
d9437e6863 Save the coverage report to a file
Save the "Test Report Summary" to a file. This can help both CI scripts and
human readers who want the summary after the fact without having to copy the
console output.

Take care to exit with a nonzero status if there is a failure while
generating the test report summary.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 20:00:18 +02:00
Gilles Peskine
499abc90f8 Show the udp_proxy seed in the console log
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 20:00:18 +02:00
Gilles Peskine
bd7222d526 Only run an unbridled parallel make (make -j) if MAKEFLAGS is unset
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 20:00:13 +02:00
Gilles Peskine
78c8e828e8 Add a few echo statements to make the logs easier to follow
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-22 19:58:14 +02:00
Gilles Peskine
e739fbb6c4 Merge pull request #4778 from yutotakano/fix-reserved-identifier-clash-2.16
Backport 2.16: Replace reserved identifier clashes with suitable replacements
2021-07-22 16:21:02 +02:00
Gilles Peskine
c221e5360c Fix typo in test dependencies
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-21 19:30:22 +02:00
Gilles Peskine
cf3c4497ed Use python3 when building on non-Windows for Windows
The makefiles look for python3 on Unix-like systems where python is often
Python 2. This uses sh code so it doesn't work on Windows. On Windows, the
makefiles just assume that python is Python 3.

The code was incorrectly deciding not to try python3 based on WINDOWS_BUILD,
which indicates that the build is *for* Windows. Switch to checking WINDOWS,
which indicates that the build is *on* Windows.

Fix #4774

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2021-07-21 19:30:13 +02:00
Guido Vranken
70bdf8d1df Use single-line string literals.
Signed-off-by: Guido Vranken <guidovranken@gmail.com>
2021-07-18 16:16:44 +02:00
Guido Vranken
4a78d58f25 Prevent triggering Clang 12 -Wstring-concatenation warning
Wrap multi-line string literals in parentheses
to prevent a Clang 12 -Wstring-concatenation warning
(activated by -Wall), which caused the build to fail.

Fixes https://github.com/ARMmbed/mbedtls/issues/3586

Signed-off-by: Guido Vranken <guidovranken@gmail.com>
2021-07-18 16:16:43 +02:00
Yuto Takano
2f7f574cfa Add ChangeLog entry for reserved identifier replacments
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-14 15:04:20 +01:00
Yuto Takano
1cded872a8 Replace _RR with prec_RR to prevent reserved identifier clashes
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-14 15:04:11 +01:00
Yuto Takano
d7cd60fba0 Replace _B with B to prevent reserved identifier clashes
Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-14 15:03:09 +01:00
Yuto Takano
c75df63718 Add content length constraint to tests that use max_frag_len
Includes:
- DTLS fragmenting tests
- SSLv3 with extensions test (backport only)

Signed-off-by: Yuto Takano <yuto.takano@arm.com>
2021-07-12 09:18:01 +01:00