Commit Graph

6668 Commits

Author SHA1 Message Date
Gilles Peskine
eb39b9b729 Minor cleanups to component name gathering
Bring the code in line with the version in Mbed TLS 2.16+.
2019-01-10 18:28:17 +01:00
Gilles Peskine
3fbdd21ca5 Add conditional component inclusion facility
Add a conditional execution facility: if a function support_xxx exists
and returns false then component_xxx is not executed (except when the
command line lists an explicit set of components to execute).

Use this facility for the 64-bit-specific or amd64-specific components.
2019-01-10 18:28:17 +01:00
Gilles Peskine
7120f77889 all.sh: fix MAKEFLAGS setting
MAKEFLAGS was set to -j if it was already set, instead of being set if
not previously set as intended. So now all.sh will do parallel builds
if invoked without MAKEFLAGS in the environment.
2019-01-10 18:28:17 +01:00
Gilles Peskine
770ad7e2c9 all.sh: don't insist on Linux; always run Valgrind
Don't bail out of all.sh if the OS isn't Linux. We only expect
everything to pass on a recent Linux x86_64, but it's useful to call
all.sh to run some components on any platform.

In all.sh, always run both MemorySanitizer and Valgrind. Valgrind is
slower than ASan and MSan but finds some things that they don't.

Run MSan unconditionally, not just on Linux/x86_64. MSan is supported
on some other OSes and CPUs these days.

Use `all.sh --except test_memsan` if you want to omit MSan because it
isn't supported on your platform. Use `all.sh --except test_memcheck`
if you want to omit Valgrind because it's too slow.

Portability: ecognize amd64 (FreeBSD arch string) as well as x86_64
(Linux arch string) for `uname -m`. The `make` utility must still
be GNU make.
2019-01-10 18:28:17 +01:00
Gilles Peskine
4e7b323fd8 Use CMAKE_BUILD_TYPE to do Asan builds
Use `cmake -D CMAKE_BUILD_TYPE=Asan` rather than manually setting
`-fsanitize=address`. This lets cmake determine the necessary compiler
and linker flags.

With UNSAFE_BUILD on, force -Wno-error. This is necessary to build
with MBEDTLS_TEST_NULL_ENTROPY.
2019-01-10 18:28:17 +01:00
Gilles Peskine
72adb432bc Back up and restore config.h systematically
In all.sh, always save config.h before running a component, instead of
doing it manually in each component that requires it (except when we
forget, which has happened). This would break a script that requires
config.h.bak not to exist, but we don't have any of those.
2019-01-10 18:28:17 +01:00
Gilles Peskine
11ddca6b74 Add the current component name to msg output and the final report 2019-01-10 18:28:17 +01:00
Gilles Peskine
6e9842315a Add --except mode: run all components except a list
Allow the list to use wildcards, e.g. you can run the sanity checks with
all.sh --except "test_*" "build_*"
2019-01-10 18:28:17 +01:00
Gilles Peskine
91bd8b78ed all.sh: with non-option arguments, run only these components 2019-01-10 18:28:17 +01:00
Gilles Peskine
3484ed8797 Move test-ref-configs into its own component 2019-01-10 18:28:16 +01:00
Gilles Peskine
2f300dbb2f Remove duplicate component for RSA_NO_CRT 2019-01-10 18:28:16 +01:00
Gilles Peskine
1a2ca72ddc Break up the tests into components
Split the long list of tests into individual functions. Each time the
test code called the `cleanup` function, I start a new function called
`component_xxx`.

Run all the components by enumerating the `component_xxx` functions.
After running each component, call `cleanup`.

A few sanity checks didn't have calls to `cleanup` because they didn't
need them. I put them into separate components anyway, so there are
now a few extra harmless calls to `cleanup`.
2019-01-10 18:28:16 +01:00
Gilles Peskine
57db6ff938 Move the code into functions. No behavior change.
Move almost all the code of this script into functions. There is no
intended behavior change. The goal of this commit is to make
subsequent improvements easier to follow.

A very large number of lines have been reintended. To see what's going
on, ignore whitespace differences (e.g. diff -w).

I followed the following rules:

* Minimize the amount of code that gets moved.
* Don't change anything to what gets executed or displayed.
* Almost all the code must end up in a function.

This commit is in preparation for breaking up the sequence of tests
into individual components that can run independently.
2019-01-08 22:04:31 +01:00
Simon Butcher
3187e7ca98
Merge pull request #545 from ARMmbed/version-2.7.9
Update the version of the library to 2.7.9
2018-12-21 12:21:10 +00:00
Simon Butcher
b22a808cc6 Update the version of the library to 2.7.9 2018-12-21 10:52:37 +00:00
Simon Butcher
3112d10abd Merge remote-tracking branch 'public/pr/2144' into mbedtls-2.7 2018-12-20 01:17:45 +00:00
Jaeden Amero
b85e35d8d2 Merge remote-tracking branch 'upstream-public/pr/2102' into mbedtls-2.7 2018-12-07 16:15:46 +00:00
Jaeden Amero
e4cf723a70 Merge remote-tracking branch 'upstream-public/pr/2168' into mbedtls-2.7 2018-12-07 16:07:37 +00:00
Jaeden Amero
3ee55795e3 test: Make basic-build-test.sh see summary statuses
We've changed the behavior of "-v" to no longer output test summary
statuses. Update basic-build-test.sh to use the test runner's verbosity
option "-v 2", so that the basic-build-test.sh script can get the summary
statuses it needs.
2018-12-07 13:35:55 +00:00
Jaeden Amero
48d2f1e2d4 Merge remote-tracking branch 'upstream-public/pr/2220' into mbedtls-2.7 2018-12-06 16:17:15 +00:00
Jaeden Amero
a7e5cbd4f4 Merge remote-tracking branch 'upstream-public/pr/2179' into mbedtls-2.7 2018-12-06 16:11:22 +00:00
Jaeden Amero
93bfd1da0c Merge remote-tracking branch 'upstream-public/pr/2132' into mbedtls-2.7 2018-12-06 16:06:21 +00:00
Jaeden Amero
5e264e37d8 Merge remote-tracking branch 'upstream-public/pr/2129' into mbedtls-2.7 2018-12-06 16:02:43 +00:00
Jaeden Amero
a7d16ba3a1 Merge remote-tracking branch 'upstream-public/pr/2150' into mbedtls-2.7 2018-12-06 16:02:06 +00:00
Jaeden Amero
a507910e16 Merge remote-tracking branch 'upstream-public/pr/2064' into mbedtls-2.7 2018-12-06 15:58:27 +00:00
Jaeden Amero
6ef6efbd8e Merge remote-tracking branch 'upstream-public/pr/1984' into mbedtls-2.7 2018-12-06 15:54:38 +00:00
Jaeden Amero
ac021d901b Merge remote-tracking branch 'upstream-public/pr/2143' into mbedtls-2.7 2018-12-06 15:52:01 +00:00
Simon Butcher
2297157dd6
Merge pull request #541 from ARMmbed/version-2.7.8
Update the library version to 2.7.8
2018-12-02 13:21:10 +00:00
Simon Butcher
4a908ca6bb Update library version number to 2.7.8 2018-12-01 23:12:40 +00:00
Simon Butcher
be16e38102 Clarify attribution for the Bleichenbacher's Cat fix 2018-12-01 23:04:54 +00:00
Simon Butcher
4303f7619e Merge remote-tracking branch 'restricted/pr/513' into mbedtls-2.7-restricted 2018-11-29 17:27:35 +00:00
Simon Butcher
e34a4f5825 Merge remote-tracking branch 'restricted/pr/536' into mbedtls-2.7-restricted 2018-11-29 17:26:43 +00:00
Simon Butcher
a0d3e1d570 Merge remote-tracking branch 'restricted/pr/518' into mbedtls-2.7-restricted 2018-11-29 17:26:25 +00:00
Gilles Peskine
5db9c830f1 Add changelog entry for mbedtls_mpi_write_binary fix 2018-11-29 12:47:02 +01:00
Gilles Peskine
813bdeb663 Tweak RSA vulnerability changelog entry
* Correct the list of authors.
* Add the CVE number.
* Improve the impact description.
2018-11-29 12:46:47 +01:00
Gilles Peskine
220cc17165 mbedtls_mpi_write_binary: don't leak the exact size of the number
In mbedtls_mpi_write_binary, avoid leaking the size of the number
through timing or branches, if possible. More precisely, if the number
fits in the output buffer based on its allocated size, the new code's
trace doesn't depend on the value of the number.
2018-11-26 12:45:35 +01:00
Gilles Peskine
da6ccfca68 check-files: detect merge artifacts
Detect Git merge artifacts. These are lines starting with "<<<<<<",
"|||||||" or ">>>>>>>" followed by a space, or containing just
"=======". For "=======", exempt Markdown files, because this can be
used to underline a title, as a compromise between false negatives and
false positives.
2018-11-23 22:42:42 +01:00
Gilles Peskine
232fae37e3 Factor record_issue into its own method 2018-11-23 22:42:40 +01:00
Simon Butcher
e26f79ba67
Merge pull request #533 from sbutcher-arm/version-2.7.7
Bump Mbed TLS Version to 2.7.7
2018-11-19 18:50:34 +00:00
Simon Butcher
20f30d97a8 Update library version number to 2.7.7 2018-11-19 18:32:22 +00:00
Simon Butcher
7fd58a9e4f Refine the language in the ChangeLog
Fix the language and descriptions in the ChangeLog following review of the
Release Notes for the next release.
2018-11-19 16:01:15 +00:00
Simon Butcher
357fbee3fd Fix language and formatting in ChangeLog
Changed the formatting and language in the ChangeLog to the house-style.
2018-11-08 13:47:21 +00:00
Simon Butcher
58012321b8 Merge remote-tracking branch 'restricted/pr/521' into mbedtls-2.7-restricted-proposed 2018-11-07 13:36:00 +00:00
Simon Butcher
02d3b1cfbb Merge remote-tracking branch 'restricted/pr/523' into mbedtls-2.7-restricted-proposed 2018-11-07 13:35:07 +00:00
Simon Butcher
9136dab9c3 Merge remote-tracking branch 'public/pr/2138' into mbedtls-2.7-restricted-proposed 2018-11-07 13:34:42 +00:00
Simon Butcher
c37966239c Merge remote-tracking branch 'public/pr/2080' into mbedtls-2.7-restricted-proposed 2018-11-07 13:34:27 +00:00
Simon Butcher
ce8c509b3e Merge remote-tracking branch 'public/pr/2135' into mbedtls-2.7-restricted-proposed 2018-11-07 13:33:09 +00:00
Simon Butcher
a5c0071cd2 Merge remote-tracking branch 'public/pr/2153' into mbedtls-2.7-restricted-proposed 2018-11-07 13:32:53 +00:00
Simon Butcher
b7d2d5c933 Merge remote-tracking branch 'public/pr/2155' into mbedtls-2.7-restricted-proposed 2018-11-07 13:32:04 +00:00
Simon Butcher
0afa2ef6c4 Merge remote-tracking branch 'public/pr/2176' into mbedtls-2.7-restricted-proposed 2018-11-07 13:31:39 +00:00