blob: 134fad2ded7a344379975231f794bd413c018e10 [file] [log] [blame]
Andres AG31f9b5b2016-10-04 17:14:38 +01001#! /usr/bin/env sh
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01002
Simon Butcher3ea7f522016-03-07 23:22:10 +00003# all.sh
4#
SimonB2e23c822016-04-16 21:54:39 +01005# This file is part of mbed TLS (https://tls.mbed.org)
6#
Gilles Peskine192c72f2017-12-21 15:59:21 +01007# Copyright (c) 2014-2017, ARM Limited, All Rights Reserved
8
9
10
11################################################################
12#### Documentation
13################################################################
14
Simon Butcher3ea7f522016-03-07 23:22:10 +000015# Purpose
Gilles Peskine192c72f2017-12-21 15:59:21 +010016# -------
Simon Butcher3ea7f522016-03-07 23:22:10 +000017#
SimonB2e23c822016-04-16 21:54:39 +010018# To run all tests possible or available on the platform.
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +010019#
Gilles Peskine192c72f2017-12-21 15:59:21 +010020# Notes for users
21# ---------------
22#
SimonB2e23c822016-04-16 21:54:39 +010023# Warning: the test is destructive. It includes various build modes and
24# configurations, and can and will arbitrarily change the current CMake
Gilles Peskine192c72f2017-12-21 15:59:21 +010025# configuration. The following files must be committed into git:
26# * include/mbedtls/config.h
27# * Makefile, library/Makefile, programs/Makefile, tests/Makefile
28# After running this script, the CMake cache will be lost and CMake
29# will no longer be initialised.
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +010030#
Gilles Peskine192c72f2017-12-21 15:59:21 +010031# The script assumes the presence of a number of tools:
32# * Basic Unix tools (Windows users note: a Unix-style find must be before
33# the Windows find in the PATH)
34# * Perl
35# * GNU Make
36# * CMake
37# * GCC and Clang (recent enough for using ASan with gcc and MemSan with clang, or valgrind)
Andrzej Kurek05be06c2018-06-28 04:41:50 -040038# * G++
Gilles Peskine192c72f2017-12-21 15:59:21 +010039# * arm-gcc and mingw-gcc
40# * ArmCC 5 and ArmCC 6, unless invoked with --no-armcc
Gilles Peskine192c72f2017-12-21 15:59:21 +010041# * OpenSSL and GnuTLS command line tools, recent enough for the
42# interoperability tests. If they don't support SSLv3 then a legacy
43# version of these tools must be present as well (search for LEGACY
44# below).
45# See the invocation of check_tools below for details.
46#
47# This script must be invoked from the toplevel directory of a git
48# working copy of Mbed TLS.
49#
50# Note that the output is not saved. You may want to run
51# script -c tests/scripts/all.sh
52# or
53# tests/scripts/all.sh >all.log 2>&1
54#
55# Notes for maintainers
56# ---------------------
57#
Gilles Peskine8f073122018-11-27 15:58:47 +010058# The bulk of the code is organized into functions that follow one of the
59# following naming conventions:
60# * pre_XXX: things to do before running the tests, in order.
61# * component_XXX: independent components. They can be run in any order.
Gilles Peskinec70637a2019-01-09 22:29:17 +010062# * component_check_XXX: quick tests that aren't worth parallelizing.
63# * component_build_XXX: build things but don't run them.
64# * component_test_XXX: build and test.
Gilles Peskine878cf602019-01-06 20:50:38 +000065# * support_XXX: if support_XXX exists and returns false then
66# component_XXX is not run by default.
Gilles Peskine8f073122018-11-27 15:58:47 +010067# * post_XXX: things to do after running the tests.
68# * other: miscellaneous support functions.
69#
Gilles Peskinec70637a2019-01-09 22:29:17 +010070# Each component must start by invoking `msg` with a short informative message.
71#
72# The framework performs some cleanup tasks after each component. This
73# means that components can assume that the working directory is in a
74# cleaned-up state, and don't need to perform the cleanup themselves.
75# * Run `make clean`.
76# * Restore `include/mbedtks/config.h` from a backup made before running
77# the component.
78# * Check out `Makefile`, `library/Makefile`, `programs/Makefile` and
79# `tests/Makefile` from git. This cleans up after an in-tree use of
80# CMake.
81#
82# Any command that is expected to fail must be protected so that the
83# script keeps running in --keep-going mode despite `set -e`. In keep-going
84# mode, if a protected command fails, this is logged as a failure and the
85# script will exit with a failure status once it has run all components.
86# Commands can be protected in any of the following ways:
87# * `make` is a function which runs the `make` command with protection.
88# Note that you must write `make VAR=value`, not `VAR=value make`,
89# because the `VAR=value make` syntax doesn't work with functions.
90# * Put `report_status` before the command to protect it.
91# * Put `if_build_successful` before a command. This protects it, and
92# additionally skips it if a prior invocation of `make` in the same
93# component failed.
94#
Gilles Peskine192c72f2017-12-21 15:59:21 +010095# The tests are roughly in order from fastest to slowest. This doesn't
96# have to be exact, but in general you should add slower tests towards
97# the end and fast checks near the beginning.
Gilles Peskine192c72f2017-12-21 15:59:21 +010098
99
100
101################################################################
102#### Initialization and command line parsing
103################################################################
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100104
SimonB2e23c822016-04-16 21:54:39 +0100105# Abort on errors (and uninitialised variables)
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100106set -eu
107
Gilles Peskine8f073122018-11-27 15:58:47 +0100108pre_check_environment () {
Gilles Peskinea16c2b12019-01-06 19:58:02 +0000109 if [ -d library -a -d include -a -d tests ]; then :; else
Gilles Peskine8f073122018-11-27 15:58:47 +0100110 echo "Must be run from mbed TLS root" >&2
111 exit 1
112 fi
113}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100114
Gilles Peskine8f073122018-11-27 15:58:47 +0100115pre_initialize_variables () {
116 CONFIG_H='include/mbedtls/config.h'
117 CONFIG_BAK="$CONFIG_H.bak"
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200118
Gilles Peskine8f073122018-11-27 15:58:47 +0100119 MEMORY=0
120 FORCE=0
121 KEEP_GOING=0
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100122
Antonin Décimod5f47592019-01-23 15:24:37 +0100123 # Default commands, can be overridden by the environment
Gilles Peskine8f073122018-11-27 15:58:47 +0100124 : ${OPENSSL:="openssl"}
125 : ${OPENSSL_LEGACY:="$OPENSSL"}
126 : ${OPENSSL_NEXT:="$OPENSSL"}
127 : ${GNUTLS_CLI:="gnutls-cli"}
128 : ${GNUTLS_SERV:="gnutls-serv"}
129 : ${GNUTLS_LEGACY_CLI:="$GNUTLS_CLI"}
130 : ${GNUTLS_LEGACY_SERV:="$GNUTLS_SERV"}
131 : ${OUT_OF_SOURCE_DIR:=./mbedtls_out_of_source_build}
132 : ${ARMC5_BIN_DIR:=/usr/bin}
133 : ${ARMC6_BIN_DIR:=/usr/bin}
Andres AGdc192212016-08-31 17:33:13 +0100134
Gilles Peskine8f073122018-11-27 15:58:47 +0100135 # if MAKEFLAGS is not set add the -j option to speed up invocations of make
Gilles Peskinea1fc4b52019-01-06 20:15:26 +0000136 if [ -z "${MAKEFLAGS+set}" ]; then
Gilles Peskine8f073122018-11-27 15:58:47 +0100137 export MAKEFLAGS="-j"
138 fi
Gilles Peskine878cf602019-01-06 20:50:38 +0000139
Gilles Peskineff26b042019-10-21 17:11:33 +0200140 # CFLAGS and LDFLAGS for Asan builds that don't use CMake
Gilles Peskineac479062019-10-21 19:06:33 +0200141 ASAN_CFLAGS='-Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all'
Gilles Peskineff26b042019-10-21 17:11:33 +0200142
Gilles Peskine878cf602019-01-06 20:50:38 +0000143 # Gather the list of available components. These are the functions
144 # defined in this script whose name starts with "component_".
145 # Parse the script with sed, because in sh there is no way to list
146 # defined functions.
147 ALL_COMPONENTS=$(sed -n 's/^ *component_\([0-9A-Z_a-z]*\) *().*/\1/p' <"$0")
148
149 # Exclude components that are not supported on this platform.
150 SUPPORTED_COMPONENTS=
151 for component in $ALL_COMPONENTS; do
152 case $(type "support_$component" 2>&1) in
153 *' function'*)
154 if ! support_$component; then continue; fi;;
155 esac
156 SUPPORTED_COMPONENTS="$SUPPORTED_COMPONENTS $component"
157 done
Gilles Peskine8f073122018-11-27 15:58:47 +0100158}
Andres AG38495a32016-07-12 16:54:33 +0100159
Gilles Peskinea28db922019-01-10 00:05:18 +0100160# Test whether the component $1 is included in the command line patterns.
161is_component_included()
Gilles Peskine81b96ed2018-11-27 21:37:53 +0100162{
163 set -f
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000164 for pattern in $COMMAND_LINE_COMPONENTS; do
Gilles Peskine81b96ed2018-11-27 21:37:53 +0100165 set +f
166 case ${1#component_} in $pattern) return 0;; esac
167 done
168 set +f
169 return 1
170}
171
Simon Butcher41eeccf2016-09-07 00:07:09 +0100172usage()
SimonB2e23c822016-04-16 21:54:39 +0100173{
Gilles Peskine709346a2017-12-10 23:43:39 +0100174 cat <<EOF
Gilles Peskine92525112018-11-27 18:15:35 +0100175Usage: $0 [OPTION]... [COMPONENT]...
Gilles Peskine348fb9a2018-11-27 17:04:29 +0100176Run mbedtls release validation tests.
Gilles Peskine92525112018-11-27 18:15:35 +0100177By default, run all tests. With one or more COMPONENT, run only those.
Gilles Peskinea28db922019-01-10 00:05:18 +0100178COMPONENT can be the name of a component or a shell wildcard pattern.
179
180Examples:
181 $0 "check_*"
182 Run all sanity checks.
183 $0 --no-armcc --except test_memsan
184 Run everything except builds that require armcc and MemSan.
Gilles Peskine348fb9a2018-11-27 17:04:29 +0100185
186Special options:
187 -h|--help Print this help and exit.
Gilles Peskine878cf602019-01-06 20:50:38 +0000188 --list-all-components List all available test components and exit.
189 --list-components List components supported on this platform and exit.
Gilles Peskine709346a2017-12-10 23:43:39 +0100190
191General options:
192 -f|--force Force the tests to overwrite any modified files.
Gilles Peskine7c652162017-12-11 00:01:40 +0100193 -k|--keep-going Run all tests and report errors at the end.
Gilles Peskine709346a2017-12-10 23:43:39 +0100194 -m|--memory Additional optional memory tests.
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100195 --armcc Run ARM Compiler builds (on by default).
Gilles Peskinea28db922019-01-10 00:05:18 +0100196 --except Exclude the COMPONENTs listed on the command line,
197 instead of running only those.
Gilles Peskinebca6ab92017-12-19 18:24:31 +0100198 --no-armcc Skip ARM Compiler builds.
Gilles Peskine38d81652018-03-21 08:40:26 +0100199 --no-force Refuse to overwrite modified files (default).
200 --no-keep-going Stop at the first error (default).
201 --no-memory No additional memory tests (default).
Gilles Peskine709346a2017-12-10 23:43:39 +0100202 --out-of-source-dir=<path> Directory used for CMake out-of-source build tests.
Gilles Peskine38d81652018-03-21 08:40:26 +0100203 --random-seed Use a random seed value for randomized tests (default).
Gilles Peskine709346a2017-12-10 23:43:39 +0100204 -r|--release-test Run this script in release mode. This fixes the seed value to 1.
205 -s|--seed Integer seed value to use for this test run.
206
207Tool path options:
208 --armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory.
209 --armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory.
210 --gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests.
211 --gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests.
212 --gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests.
213 --gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests.
214 --openssl=<OpenSSL_path> OpenSSL executable to use for most tests.
215 --openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3.
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100216 --openssl-next=<OpenSSL_path> OpenSSL executable to use for recent things like ARIA
Gilles Peskine709346a2017-12-10 23:43:39 +0100217EOF
SimonB2e23c822016-04-16 21:54:39 +0100218}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100219
220# remove built files as well as the cmake cache/config
221cleanup()
222{
Gilles Peskinea71d64c2018-03-21 12:16:57 +0100223 if [ -n "${MBEDTLS_ROOT_DIR+set}" ]; then
224 cd "$MBEDTLS_ROOT_DIR"
225 fi
226
Gilles Peskine7c652162017-12-11 00:01:40 +0100227 command make clean
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200228
Gilles Peskine31b07e22018-03-21 12:15:06 +0100229 # Remove CMake artefacts
Simon Butcher3ad2efd2018-05-02 14:49:38 +0100230 find . -name .git -prune \
Gilles Peskine31b07e22018-03-21 12:15:06 +0100231 -iname CMakeFiles -exec rm -rf {} \+ -o \
232 \( -iname cmake_install.cmake -o \
233 -iname CTestTestfile.cmake -o \
234 -iname CMakeCache.txt \) -exec rm {} \+
235 # Recover files overwritten by in-tree CMake builds
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +0000236 rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile
Paul Bakkerfe0984d2014-06-13 00:13:45 +0200237 git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
238 git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200239
240 if [ -f "$CONFIG_BAK" ]; then
241 mv "$CONFIG_BAK" "$CONFIG_H"
242 fi
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100243}
244
Gilles Peskine7c652162017-12-11 00:01:40 +0100245# Executed on exit. May be redefined depending on command line options.
246final_report () {
247 :
248}
249
250fatal_signal () {
251 cleanup
252 final_report $1
253 trap - $1
254 kill -$1 $$
255}
256
257trap 'fatal_signal HUP' HUP
258trap 'fatal_signal INT' INT
259trap 'fatal_signal TERM' TERM
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200260
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100261msg()
262{
Gilles Peskineffcdeff2018-12-04 12:49:28 +0100263 if [ -n "${current_component:-}" ]; then
264 current_section="${current_component#component_}: $1"
265 else
266 current_section="$1"
267 fi
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100268 echo ""
269 echo "******************************************************************"
Gilles Peskineffcdeff2018-12-04 12:49:28 +0100270 echo "* $current_section "
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +0000271 printf "* "; date
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100272 echo "******************************************************************"
273}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100274
Gilles Peskine8f073122018-11-27 15:58:47 +0100275armc6_build_test()
276{
277 FLAGS="$1"
Andres AGa5cd9732016-10-17 15:23:10 +0100278
Gilles Peskine8f073122018-11-27 15:58:47 +0100279 msg "build: ARM Compiler 6 ($FLAGS), make"
280 ARM_TOOL_VARIANT="ult" CC="$ARMC6_CC" AR="$ARMC6_AR" CFLAGS="$FLAGS" \
281 WARNING_CFLAGS='-xc -std=c99' make lib
282 make clean
283}
Andres AGa5cd9732016-10-17 15:23:10 +0100284
Andres AGd9eba4b2016-08-26 14:42:14 +0100285err_msg()
286{
287 echo "$1" >&2
288}
289
290check_tools()
291{
292 for TOOL in "$@"; do
Andres AG98393602017-01-31 17:04:45 +0000293 if ! `type "$TOOL" >/dev/null 2>&1`; then
Andres AGd9eba4b2016-08-26 14:42:14 +0100294 err_msg "$TOOL not found!"
295 exit 1
296 fi
297 done
298}
299
Andrzej Kurek991f9fe2018-07-02 09:08:21 -0400300check_headers_in_cpp () {
Peter Kolbus30987072019-02-01 17:19:08 -0600301 ls include/mbedtls | grep "\.h$" >headers.txt
Andrzej Kurek991f9fe2018-07-02 09:08:21 -0400302 <programs/test/cpp_dummy_build.cpp sed -n 's/"$//; s!^#include "mbedtls/!!p' |
303 sort |
304 diff headers.txt -
305 rm headers.txt
306}
307
Gilles Peskine8f073122018-11-27 15:58:47 +0100308pre_parse_command_line () {
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000309 COMMAND_LINE_COMPONENTS=
Gilles Peskinea28db922019-01-10 00:05:18 +0100310 all_except=0
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000311 no_armcc=
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000312
Gilles Peskine8f073122018-11-27 15:58:47 +0100313 while [ $# -gt 0 ]; do
Gilles Peskine55f7c942019-01-09 22:28:21 +0100314 case "$1" in
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000315 --armcc) no_armcc=;;
Gilles Peskine55f7c942019-01-09 22:28:21 +0100316 --armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";;
317 --armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";;
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000318 --except) all_except=1;;
Gilles Peskine55f7c942019-01-09 22:28:21 +0100319 --force|-f) FORCE=1;;
320 --gnutls-cli) shift; GNUTLS_CLI="$1";;
321 --gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";;
322 --gnutls-legacy-serv) shift; GNUTLS_LEGACY_SERV="$1";;
323 --gnutls-serv) shift; GNUTLS_SERV="$1";;
324 --help|-h) usage; exit;;
325 --keep-going|-k) KEEP_GOING=1;;
Gilles Peskine878cf602019-01-06 20:50:38 +0000326 --list-all-components) printf '%s\n' $ALL_COMPONENTS; exit;;
327 --list-components) printf '%s\n' $SUPPORTED_COMPONENTS; exit;;
Gilles Peskine55f7c942019-01-09 22:28:21 +0100328 --memory|-m) MEMORY=1;;
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000329 --no-armcc) no_armcc=1;;
Gilles Peskine55f7c942019-01-09 22:28:21 +0100330 --no-force) FORCE=0;;
331 --no-keep-going) KEEP_GOING=0;;
332 --no-memory) MEMORY=0;;
333 --openssl) shift; OPENSSL="$1";;
334 --openssl-legacy) shift; OPENSSL_LEGACY="$1";;
335 --openssl-next) shift; OPENSSL_NEXT="$1";;
336 --out-of-source-dir) shift; OUT_OF_SOURCE_DIR="$1";;
337 --random-seed) unset SEED;;
338 --release-test|-r) SEED=1;;
339 --seed|-s) shift; SEED="$1";;
340 -*)
341 echo >&2 "Unknown option: $1"
342 echo >&2 "Run $0 --help for usage."
343 exit 120
344 ;;
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000345 *) COMMAND_LINE_COMPONENTS="$COMMAND_LINE_COMPONENTS $1";;
Gilles Peskine55f7c942019-01-09 22:28:21 +0100346 esac
347 shift
Gilles Peskine8f073122018-11-27 15:58:47 +0100348 done
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000349
Gilles Peskinea28db922019-01-10 00:05:18 +0100350 # With no list of components, run everything.
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000351 if [ -z "$COMMAND_LINE_COMPONENTS" ]; then
352 all_except=1
353 fi
354
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000355 # --no-armcc is a legacy option. The modern way is --except '*_armcc*'.
356 # Ignore it if components are listed explicitly on the command line.
Gilles Peskinea28db922019-01-10 00:05:18 +0100357 if [ -n "$no_armcc" ] && [ $all_except -eq 1 ]; then
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000358 COMMAND_LINE_COMPONENTS="$COMMAND_LINE_COMPONENTS *_armcc*"
359 fi
360
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000361 # Build the list of components to run.
Gilles Peskinea28db922019-01-10 00:05:18 +0100362 RUN_COMPONENTS=
363 for component in $SUPPORTED_COMPONENTS; do
364 if is_component_included "$component"; [ $? -eq $all_except ]; then
365 RUN_COMPONENTS="$RUN_COMPONENTS $component"
366 fi
367 done
Gilles Peskinebeb3a812019-01-06 22:11:25 +0000368
369 unset all_except
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000370 unset no_armcc
Gilles Peskine8f073122018-11-27 15:58:47 +0100371}
SimonB2e23c822016-04-16 21:54:39 +0100372
Gilles Peskine8f073122018-11-27 15:58:47 +0100373pre_check_git () {
374 if [ $FORCE -eq 1 ]; then
Gilles Peskine53190e62019-01-09 23:17:35 +0100375 rm -rf "$OUT_OF_SOURCE_DIR"
Gilles Peskine8f073122018-11-27 15:58:47 +0100376 git checkout-index -f -q $CONFIG_H
377 cleanup
378 else
SimonB2e23c822016-04-16 21:54:39 +0100379
Gilles Peskine8f073122018-11-27 15:58:47 +0100380 if [ -d "$OUT_OF_SOURCE_DIR" ]; then
381 echo "Warning - there is an existing directory at '$OUT_OF_SOURCE_DIR'" >&2
382 echo "You can either delete this directory manually, or force the test by rerunning"
383 echo "the script as: $0 --force --out-of-source-dir $OUT_OF_SOURCE_DIR"
384 exit 1
385 fi
386
Gilles Peskined1174cf2019-01-09 22:30:01 +0100387 if ! git diff --quiet include/mbedtls/config.h; then
Gilles Peskine8f073122018-11-27 15:58:47 +0100388 err_msg "Warning - the configuration file 'include/mbedtls/config.h' has been edited. "
389 echo "You can either delete or preserve your work, or force the test by rerunning the"
390 echo "script as: $0 --force"
391 exit 1
392 fi
Andres AGdc192212016-08-31 17:33:13 +0100393 fi
Gilles Peskine8f073122018-11-27 15:58:47 +0100394}
Andres AGdc192212016-08-31 17:33:13 +0100395
Gilles Peskine8f073122018-11-27 15:58:47 +0100396pre_setup_keep_going () {
Gilles Peskine7c652162017-12-11 00:01:40 +0100397 failure_summary=
398 failure_count=0
399 start_red=
400 end_color=
401 if [ -t 1 ]; then
Gilles Peskine9736b9d2018-01-02 21:54:17 +0100402 case "${TERM:-}" in
Gilles Peskine7c652162017-12-11 00:01:40 +0100403 *color*|cygwin|linux|rxvt*|screen|[Eex]term*)
404 start_red=$(printf '\033[31m')
405 end_color=$(printf '\033[0m')
406 ;;
407 esac
408 fi
409 record_status () {
410 if "$@"; then
411 last_status=0
412 else
413 last_status=$?
414 text="$current_section: $* -> $last_status"
415 failure_summary="$failure_summary
416$text"
417 failure_count=$((failure_count + 1))
418 echo "${start_red}^^^^$text^^^^${end_color}"
419 fi
420 }
421 make () {
422 case "$*" in
423 *test|*check)
424 if [ $build_status -eq 0 ]; then
425 record_status command make "$@"
426 else
427 echo "(skipped because the build failed)"
428 fi
429 ;;
430 *)
431 record_status command make "$@"
432 build_status=$last_status
433 ;;
434 esac
435 }
436 final_report () {
437 if [ $failure_count -gt 0 ]; then
438 echo
439 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
440 echo "${start_red}FAILED: $failure_count${end_color}$failure_summary"
441 echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
Jaeden Amero7c1258d2018-07-20 16:42:14 +0100442 exit 1
Gilles Peskine7c652162017-12-11 00:01:40 +0100443 elif [ -z "${1-}" ]; then
444 echo "SUCCESS :)"
445 fi
446 if [ -n "${1-}" ]; then
447 echo "Killed by SIG$1."
448 fi
449 }
Gilles Peskine8f073122018-11-27 15:58:47 +0100450}
451
Gilles Peskine7c652162017-12-11 00:01:40 +0100452if_build_succeeded () {
453 if [ $build_status -eq 0 ]; then
454 record_status "$@"
455 fi
456}
457
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +0200458# to be used instead of ! for commands run with
459# record_status or if_build_succeeded
460not() {
461 ! "$@"
462}
463
Gilles Peskine8f073122018-11-27 15:58:47 +0100464pre_print_configuration () {
465 msg "info: $0 configuration"
466 echo "MEMORY: $MEMORY"
467 echo "FORCE: $FORCE"
468 echo "SEED: ${SEED-"UNSET"}"
469 echo "OPENSSL: $OPENSSL"
470 echo "OPENSSL_LEGACY: $OPENSSL_LEGACY"
471 echo "OPENSSL_NEXT: $OPENSSL_NEXT"
472 echo "GNUTLS_CLI: $GNUTLS_CLI"
473 echo "GNUTLS_SERV: $GNUTLS_SERV"
474 echo "GNUTLS_LEGACY_CLI: $GNUTLS_LEGACY_CLI"
475 echo "GNUTLS_LEGACY_SERV: $GNUTLS_LEGACY_SERV"
476 echo "ARMC5_BIN_DIR: $ARMC5_BIN_DIR"
477 echo "ARMC6_BIN_DIR: $ARMC6_BIN_DIR"
478}
Andres AG87bb5772016-09-27 15:05:15 +0100479
Gilles Peskine87964262019-01-06 22:40:00 +0000480# Make sure the tools we need are available.
Gilles Peskine8f073122018-11-27 15:58:47 +0100481pre_check_tools () {
Gilles Peskinecc9f0b92019-01-06 22:46:21 +0000482 # Build the list of variables to pass to output_env.sh.
483 set env
484
Gilles Peskine87964262019-01-06 22:40:00 +0000485 case " $RUN_COMPONENTS " in
486 # Require OpenSSL and GnuTLS if running any tests (as opposed to
487 # only doing builds). Not all tests run OpenSSL and GnuTLS, but this
488 # is a good enough approximation in practice.
489 *" test_"*)
490 # To avoid setting OpenSSL and GnuTLS for each call to compat.sh
491 # and ssl-opt.sh, we just export the variables they require.
492 export OPENSSL_CMD="$OPENSSL"
493 export GNUTLS_CLI="$GNUTLS_CLI"
494 export GNUTLS_SERV="$GNUTLS_SERV"
495 # Avoid passing --seed flag in every call to ssl-opt.sh
496 if [ -n "${SEED-}" ]; then
497 export SEED
498 fi
Gilles Peskinecc9f0b92019-01-06 22:46:21 +0000499 set "$@" OPENSSL="$OPENSSL" OPENSSL_LEGACY="$OPENSSL_LEGACY"
500 set "$@" GNUTLS_CLI="$GNUTLS_CLI" GNUTLS_SERV="$GNUTLS_SERV"
501 set "$@" GNUTLS_LEGACY_CLI="$GNUTLS_LEGACY_CLI"
502 set "$@" GNUTLS_LEGACY_SERV="$GNUTLS_LEGACY_SERV"
Gilles Peskine87964262019-01-06 22:40:00 +0000503 check_tools "$OPENSSL" "$OPENSSL_LEGACY" "$OPENSSL_NEXT" \
504 "$GNUTLS_CLI" "$GNUTLS_SERV" \
505 "$GNUTLS_LEGACY_CLI" "$GNUTLS_LEGACY_SERV"
506 ;;
507 esac
Andres AGd9eba4b2016-08-26 14:42:14 +0100508
Gilles Peskine87964262019-01-06 22:40:00 +0000509 case " $RUN_COMPONENTS " in
510 *_doxygen[_\ ]*) check_tools "doxygen" "dot";;
511 esac
Andres AGb2fdd042016-09-22 14:17:46 +0100512
Gilles Peskine87964262019-01-06 22:40:00 +0000513 case " $RUN_COMPONENTS " in
514 *_arm_none_eabi_gcc[_\ ]*) check_tools "arm-none-eabi-gcc";;
515 esac
Andres AG7770ea82016-10-10 15:46:20 +0100516
Gilles Peskine87964262019-01-06 22:40:00 +0000517 case " $RUN_COMPONENTS " in
518 *_mingw[_\ ]*) check_tools "i686-w64-mingw32-gcc";;
519 esac
520
521 case " $RUN_COMPONENTS " in
522 *" test_zeroize "*) check_tools "gdb";;
523 esac
524
525 case " $RUN_COMPONENTS " in
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000526 *_armcc*)
Gilles Peskine87964262019-01-06 22:40:00 +0000527 ARMC5_CC="$ARMC5_BIN_DIR/armcc"
528 ARMC5_AR="$ARMC5_BIN_DIR/armar"
529 ARMC6_CC="$ARMC6_BIN_DIR/armclang"
530 ARMC6_AR="$ARMC6_BIN_DIR/armar"
Gilles Peskine5331c6e2019-01-06 22:23:42 +0000531 check_tools "$ARMC5_CC" "$ARMC5_AR" "$ARMC6_CC" "$ARMC6_AR";;
532 esac
Gilles Peskinecc9f0b92019-01-06 22:46:21 +0000533
534 msg "info: output_env.sh"
535 case $RUN_COMPONENTS in
536 *_armcc*)
537 set "$@" ARMC5_CC="$ARMC5_CC" ARMC6_CC="$ARMC6_CC" RUN_ARMCC=1;;
538 *) set "$@" RUN_ARMCC=0;;
539 esac
540 "$@" scripts/output_env.sh
Gilles Peskine8f073122018-11-27 15:58:47 +0100541}
Gilles Peskine192c72f2017-12-21 15:59:21 +0100542
543
Gilles Peskinecc9f0b92019-01-06 22:46:21 +0000544
Gilles Peskine192c72f2017-12-21 15:59:21 +0100545################################################################
546#### Basic checks
547################################################################
Andres AGd9eba4b2016-08-26 14:42:14 +0100548
SimonB2e23c822016-04-16 21:54:39 +0100549#
550# Test Suites to be executed
551#
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200552# The test ordering tries to optimize for the following criteria:
Manuel Pégourié-Gonnard89d69b32014-11-20 13:48:53 +0100553# 1. Catch possible problems early, by running first tests that run quickly
Manuel Pégourié-Gonnard61bc57a2014-08-14 11:29:06 +0200554# and/or are more likely to fail than others (eg I use Clang most of the
555# time, so start with a GCC build).
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200556# 2. Minimize total running time, by avoiding useless rebuilds
557#
558# Indicative running times are given for reference.
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100559
Gilles Peskine8f073122018-11-27 15:58:47 +0100560component_check_recursion () {
561 msg "test: recursion.pl" # < 1s
562 record_status tests/scripts/recursion.pl library/*.c
563}
Manuel Pégourié-Gonnardea29d152014-11-20 17:32:33 +0100564
Gilles Peskine8f073122018-11-27 15:58:47 +0100565component_check_generated_files () {
566 msg "test: freshness of generated source files" # < 1s
567 record_status tests/scripts/check-generated-files.sh
568}
Manuel Pégourié-Gonnardb3b8e432015-02-13 14:52:19 +0000569
Gilles Peskine8f073122018-11-27 15:58:47 +0100570component_check_doxy_blocks () {
571 msg "test: doxygen markup outside doxygen blocks" # < 1s
572 record_status tests/scripts/check-doxy-blocks.pl
573}
Manuel Pégourié-Gonnardd09a6b52015-04-09 17:19:23 +0200574
Gilles Peskine8f073122018-11-27 15:58:47 +0100575component_check_files () {
576 msg "test: check-files.py" # < 1s
Gilles Peskine8f073122018-11-27 15:58:47 +0100577 record_status tests/scripts/check-files.py
578}
Darryl Greena07039c2018-03-13 16:48:16 +0000579
Gilles Peskine8f073122018-11-27 15:58:47 +0100580component_check_names () {
581 msg "test/build: declared and exported names" # < 3s
Gilles Peskine473f2d42019-05-15 17:52:22 +0200582 record_status tests/scripts/check-names.sh -v
Gilles Peskine8f073122018-11-27 15:58:47 +0100583}
Manuel Pégourié-Gonnarda687baf2015-04-09 11:09:03 +0200584
Gilles Peskine8f073122018-11-27 15:58:47 +0100585component_check_doxygen_warnings () {
586 msg "test: doxygen warnings" # ~ 3s
Gilles Peskine8f073122018-11-27 15:58:47 +0100587 record_status tests/scripts/doxygen.sh
588}
Manuel Pégourié-Gonnard1d552e72016-01-04 16:49:09 +0100589
Gilles Peskine192c72f2017-12-21 15:59:21 +0100590
591
592################################################################
593#### Build and test many configurations and targets
594################################################################
595
k-stachowiak11f38e22019-06-04 13:14:58 +0200596component_test_large_ecdsa_key_signature () {
597
598 SMALL_MPI_MAX_SIZE=136 # Small enough to interfere with the EC signatures
599
600 msg "build: cmake + MBEDTLS_MPI_MAX_SIZE=${SMALL_MPI_MAX_SIZE}, gcc, ASan" # ~ 1 min 50s
601 scripts/config.pl set MBEDTLS_MPI_MAX_SIZE $SMALL_MPI_MAX_SIZE
602 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
603 make
604
605 INEVITABLY_PRESENT_FILE=Makefile
606 SIGNATURE_FILE="${INEVITABLY_PRESENT_FILE}.sig" # Warning, this is rm -f'ed below
607
608 msg "test: pk_sign secp521r1_prv.der for MBEDTLS_MPI_MAX_SIZE=${SMALL_MPI_MAX_SIZE} (ASan build)" # ~ 5s
609 if_build_succeeded programs/pkey/pk_sign tests/data_files/secp521r1_prv.der $INEVITABLY_PRESENT_FILE
610 rm -f $SIGNATURE_FILE
611}
612
Gilles Peskine99a33102019-04-08 17:00:15 +0200613component_test_default_out_of_box () {
614 msg "build: make, default config (out-of-box)" # ~1min
615 make
616
617 msg "test: main suites make, default config (out-of-box)" # ~10s
618 make test
619
620 msg "selftest: make, default config (out-of-box)" # ~10s
621 programs/test/selftest
622}
623
Gilles Peskine8f073122018-11-27 15:58:47 +0100624component_test_default_cmake_gcc_asan () {
625 msg "build: cmake, gcc, ASan" # ~ 1 min 50s
Gilles Peskine8f073122018-11-27 15:58:47 +0100626 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
627 make
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100628
Gilles Peskine8f073122018-11-27 15:58:47 +0100629 msg "test: main suites (inc. selftests) (ASan build)" # ~ 50s
630 make test
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200631
Gilles Peskine8f073122018-11-27 15:58:47 +0100632 msg "test: ssl-opt.sh (ASan build)" # ~ 1 min
633 if_build_succeeded tests/ssl-opt.sh
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200634
Gilles Peskine8f073122018-11-27 15:58:47 +0100635 msg "test: compat.sh (ASan build)" # ~ 6 min
636 if_build_succeeded tests/compat.sh
637}
Manuel Pégourié-Gonnard57255b12014-06-09 11:21:49 +0200638
Hanno Beckerf8799e82019-02-26 14:27:09 +0000639component_test_full_cmake_gcc_asan () {
640 msg "build: full config, cmake, gcc, ASan"
641 scripts/config.pl full
642 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
643 make
644
645 msg "test: main suites (inc. selftests) (full config, ASan build)"
646 make test
647
648 msg "test: ssl-opt.sh (full config, ASan build)"
649 if_build_succeeded tests/ssl-opt.sh
650
651 msg "test: compat.sh (full config, ASan build)"
652 if_build_succeeded tests/compat.sh
653}
654
Gilles Peskine782f4112018-11-27 16:11:09 +0100655component_test_ref_configs () {
656 msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s
657 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
658 record_status tests/scripts/test-ref-configs.pl
659}
660
Gilles Peskine8f073122018-11-27 15:58:47 +0100661component_test_sslv3 () {
662 msg "build: Default + SSLv3 (ASan build)" # ~ 6 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100663 scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3
664 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
665 make
Simon Butcher3ea7f522016-03-07 23:22:10 +0000666
Gilles Peskine8f073122018-11-27 15:58:47 +0100667 msg "test: SSLv3 - main suites (inc. selftests) (ASan build)" # ~ 50s
668 make test
Simon Butcher3ea7f522016-03-07 23:22:10 +0000669
Gilles Peskine8f073122018-11-27 15:58:47 +0100670 msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min
671 if_build_succeeded tests/compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2'
672 if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" tests/compat.sh -m 'ssl3'
Simon Butcher3ea7f522016-03-07 23:22:10 +0000673
Gilles Peskine8f073122018-11-27 15:58:47 +0100674 msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min
675 if_build_succeeded tests/ssl-opt.sh
676}
Simon Butcher3ea7f522016-03-07 23:22:10 +0000677
Gilles Peskine8f073122018-11-27 15:58:47 +0100678component_test_no_renegotiation () {
679 msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100680 scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION
681 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
682 make
Hanno Becker134c2ab2017-10-12 15:29:50 +0100683
Gilles Peskine8f073122018-11-27 15:58:47 +0100684 msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s
685 make test
Hanno Becker134c2ab2017-10-12 15:29:50 +0100686
Gilles Peskine8f073122018-11-27 15:58:47 +0100687 msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min
688 if_build_succeeded tests/ssl-opt.sh
689}
Manuel Pégourié-Gonnard246978d2014-11-20 13:29:53 +0100690
Hanno Beckere562e7d2019-05-10 14:45:37 +0100691component_test_no_pem_no_fs () {
692 msg "build: Default + !MBEDTLS_PEM_PARSE_C + !MBEDTLS_FS_IO (ASan build)"
693 scripts/config.pl unset MBEDTLS_PEM_PARSE_C
694 scripts/config.pl unset MBEDTLS_FS_IO
695 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
696 make
697
698 msg "test: !MBEDTLS_PEM_PARSE_C !MBEDTLS_FS_IO - main suites (inc. selftests) (ASan build)" # ~ 50s
699 make test
700
701 msg "test: !MBEDTLS_PEM_PARSE_C !MBEDTLS_FS_IO - ssl-opt.sh (ASan build)" # ~ 6 min
702 if_build_succeeded tests/ssl-opt.sh
703}
704
Gilles Peskine8f073122018-11-27 15:58:47 +0100705component_test_rsa_no_crt () {
706 msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100707 scripts/config.pl set MBEDTLS_RSA_NO_CRT
708 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
709 make
Hanno Beckerd5ba5ef2017-09-28 12:53:51 +0100710
Gilles Peskine8f073122018-11-27 15:58:47 +0100711 msg "test: RSA_NO_CRT - main suites (inc. selftests) (ASan build)" # ~ 50s
712 make test
Hanno Beckerd5ba5ef2017-09-28 12:53:51 +0100713
Gilles Peskine8f073122018-11-27 15:58:47 +0100714 msg "test: RSA_NO_CRT - RSA-related part of ssl-opt.sh (ASan build)" # ~ 5s
715 if_build_succeeded tests/ssl-opt.sh -f RSA
Hanno Beckerd5ba5ef2017-09-28 12:53:51 +0100716
Gilles Peskine8f073122018-11-27 15:58:47 +0100717 msg "test: RSA_NO_CRT - RSA-related part of compat.sh (ASan build)" # ~ 3 min
718 if_build_succeeded tests/compat.sh -t RSA
719}
Hanno Beckerd5ba5ef2017-09-28 12:53:51 +0100720
Gilles Peskine8f073122018-11-27 15:58:47 +0100721component_test_small_ssl_out_content_len () {
722 msg "build: small SSL_OUT_CONTENT_LEN (ASan build)"
Gilles Peskine8f073122018-11-27 15:58:47 +0100723 scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384
724 scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
725 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
726 make
Angus Grattonc4dd0732018-04-11 16:28:39 +1000727
Gilles Peskine8f073122018-11-27 15:58:47 +0100728 msg "test: small SSL_OUT_CONTENT_LEN - ssl-opt.sh MFL and large packet tests"
729 if_build_succeeded tests/ssl-opt.sh -f "Max fragment\|Large packet"
730}
Angus Grattonc4dd0732018-04-11 16:28:39 +1000731
Gilles Peskine8f073122018-11-27 15:58:47 +0100732component_test_small_ssl_in_content_len () {
733 msg "build: small SSL_IN_CONTENT_LEN (ASan build)"
Gilles Peskine8f073122018-11-27 15:58:47 +0100734 scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 4096
735 scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 16384
736 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
737 make
Angus Grattonc4dd0732018-04-11 16:28:39 +1000738
Gilles Peskine8f073122018-11-27 15:58:47 +0100739 msg "test: small SSL_IN_CONTENT_LEN - ssl-opt.sh MFL tests"
740 if_build_succeeded tests/ssl-opt.sh -f "Max fragment"
741}
Angus Grattonc4dd0732018-04-11 16:28:39 +1000742
Gilles Peskine8f073122018-11-27 15:58:47 +0100743component_test_small_ssl_dtls_max_buffering () {
744 msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0"
Gilles Peskine8f073122018-11-27 15:58:47 +0100745 scripts/config.pl set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000
746 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
747 make
Hanno Becker2f5aa4c2018-08-24 14:43:44 +0100748
Gilles Peskine8f073122018-11-27 15:58:47 +0100749 msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0 - ssl-opt.sh specific reordering test"
750 if_build_succeeded tests/ssl-opt.sh -f "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg"
751}
Hanno Becker2f5aa4c2018-08-24 14:43:44 +0100752
Gilles Peskine8f073122018-11-27 15:58:47 +0100753component_test_small_mbedtls_ssl_dtls_max_buffering () {
754 msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1"
Gilles Peskine8f073122018-11-27 15:58:47 +0100755 scripts/config.pl set MBEDTLS_SSL_DTLS_MAX_BUFFERING 240
756 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
757 make
Hanno Becker2f5aa4c2018-08-24 14:43:44 +0100758
Gilles Peskine8f073122018-11-27 15:58:47 +0100759 msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1 - ssl-opt.sh specific reordering test"
760 if_build_succeeded tests/ssl-opt.sh -f "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket"
761}
Hanno Becker2f5aa4c2018-08-24 14:43:44 +0100762
Gilles Peskine8f073122018-11-27 15:58:47 +0100763component_test_full_cmake_clang () {
764 msg "build: cmake, full config, clang" # ~ 50s
Gilles Peskine8f073122018-11-27 15:58:47 +0100765 scripts/config.pl full
Gilles Peskine8f073122018-11-27 15:58:47 +0100766 CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On .
767 make
Manuel Pégourié-Gonnard3895f5a2014-03-27 14:44:04 +0100768
Gilles Peskine8f073122018-11-27 15:58:47 +0100769 msg "test: main suites (full config)" # ~ 5s
770 make test
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200771
Gilles Peskine8f073122018-11-27 15:58:47 +0100772 msg "test: ssl-opt.sh default, ECJPAKE, SSL async (full config)" # ~ 1s
773 if_build_succeeded tests/ssl-opt.sh -f 'Default\|ECJPAKE\|SSL async private'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200774
Andres Amaya Garciaac9c5222019-01-08 21:42:27 +0000775 msg "test: compat.sh RC4, DES, 3DES & NULL (full config)" # ~ 2 min
Andres Amaya Garcia37e0a8c2019-02-19 20:20:57 +0000776 if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" GNUTLS_CLI="$GNUTLS_LEGACY_CLI" GNUTLS_SERV="$GNUTLS_LEGACY_SERV" tests/compat.sh -e '^$' -f 'NULL\|DES\|RC4\|ARCFOUR'
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200777
Gilles Peskine8f073122018-11-27 15:58:47 +0100778 msg "test: compat.sh ARIA + ChachaPoly"
779 if_build_succeeded env OPENSSL_CMD="$OPENSSL_NEXT" tests/compat.sh -e '^$' -f 'ARIA\|CHACHA'
780}
Manuel Pégourié-Gonnard6b368922018-02-20 12:02:07 +0100781
Gilles Peskine8f073122018-11-27 15:58:47 +0100782component_build_deprecated () {
783 msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100784 scripts/config.pl full
785 scripts/config.pl set MBEDTLS_DEPRECATED_WARNING
786 # Build with -O -Wextra to catch a maximum of issues.
787 make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' lib programs
788 make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
Gilles Peskineb4ef45b2018-03-01 22:23:50 +0100789
Gilles Peskine8f073122018-11-27 15:58:47 +0100790 msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
791 # No cleanup, just tweak the configuration and rebuild
792 make clean
793 scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING
794 scripts/config.pl set MBEDTLS_DEPRECATED_REMOVED
795 # Build with -O -Wextra to catch a maximum of issues.
796 make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
797 make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
798}
Gilles Peskine0afe6242018-02-21 19:28:12 +0100799
Manuel Pégourié-Gonnarde73b2632014-07-12 04:00:00 +0200800
Gilles Peskine8f073122018-11-27 15:58:47 +0100801component_test_depends_curves () {
802 msg "test/build: curves.pl (gcc)" # ~ 4 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100803 record_status tests/scripts/curves.pl
804}
Manuel Pégourié-Gonnard1fe6bb92017-06-06 11:36:16 +0200805
Gilles Peskine8f073122018-11-27 15:58:47 +0100806component_test_depends_hashes () {
807 msg "test/build: depends-hashes.pl (gcc)" # ~ 2 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100808 record_status tests/scripts/depends-hashes.pl
809}
Manuel Pégourié-Gonnard43be6cd2017-06-20 09:53:42 +0200810
Gilles Peskine8f073122018-11-27 15:58:47 +0100811component_test_depends_pkalgs () {
812 msg "test/build: depends-pkalgs.pl (gcc)" # ~ 2 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100813 record_status tests/scripts/depends-pkalgs.pl
814}
Manuel Pégourié-Gonnard503a5ef2015-10-23 09:04:45 +0200815
Gilles Peskine8f073122018-11-27 15:58:47 +0100816component_build_key_exchanges () {
817 msg "test/build: key-exchanges (gcc)" # ~ 1 min
Gilles Peskine8f073122018-11-27 15:58:47 +0100818 record_status tests/scripts/key-exchanges.pl
819}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +0100820
Gilles Peskine8f073122018-11-27 15:58:47 +0100821component_build_default_make_gcc_and_cxx () {
822 msg "build: Unix make, -Os (gcc)" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100823 make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os'
Andrzej Kurek991f9fe2018-07-02 09:08:21 -0400824
Gilles Peskine8f073122018-11-27 15:58:47 +0100825 msg "test: verify header list in cpp_dummy_build.cpp"
826 record_status check_headers_in_cpp
Andrzej Kurek991f9fe2018-07-02 09:08:21 -0400827
Gilles Peskine8f073122018-11-27 15:58:47 +0100828 msg "build: Unix make, incremental g++"
829 make TEST_CPP=1
830}
Manuel Pégourié-Gonnarda71780e2015-02-13 13:56:55 +0000831
Gilles Peskinedcab2022019-06-12 16:05:50 +0200832component_test_check_params_functionality () {
833 msg "build+test: MBEDTLS_CHECK_PARAMS functionality"
834 scripts/config.pl full # includes CHECK_PARAMS
835 # Make MBEDTLS_PARAM_FAILED call mbedtls_param_failed().
836 scripts/config.pl unset MBEDTLS_CHECK_PARAMS_ASSERT
Gilles Peskinedcab2022019-06-12 16:05:50 +0200837 # Only build and run tests. Do not build sample programs, because
838 # they don't have a mbedtls_param_failed() function.
839 make CC=gcc CFLAGS='-Werror -O1' lib test
840}
841
Gilles Peskineb28636b2019-01-02 19:06:24 +0100842component_test_check_params_without_platform () {
843 msg "build+test: MBEDTLS_CHECK_PARAMS without MBEDTLS_PLATFORM_C"
844 scripts/config.pl full # includes CHECK_PARAMS
Gilles Peskinedcab2022019-06-12 16:05:50 +0200845 # Keep MBEDTLS_PARAM_FAILED as assert.
Gilles Peskineb28636b2019-01-02 19:06:24 +0100846 scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT
847 scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT
848 scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT
849 scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY
850 scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT
851 scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT
852 scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
853 scripts/config.pl unset MBEDTLS_PLATFORM_C
854 make CC=gcc CFLAGS='-Werror -O1' all test
855}
Manuel Pégourié-Gonnard009a2642015-05-29 10:31:13 +0200856
Gilles Peskineb28636b2019-01-02 19:06:24 +0100857component_test_check_params_silent () {
858 msg "build+test: MBEDTLS_CHECK_PARAMS with alternative MBEDTLS_PARAM_FAILED()"
859 scripts/config.pl full # includes CHECK_PARAMS
Gilles Peskinedcab2022019-06-12 16:05:50 +0200860 # Set MBEDTLS_PARAM_FAILED to nothing.
Gilles Peskineb28636b2019-01-02 19:06:24 +0100861 sed -i 's/.*\(#define MBEDTLS_PARAM_FAILED( cond )\).*/\1/' "$CONFIG_H"
862 make CC=gcc CFLAGS='-Werror -O1' all test
863}
Hanno Becker5175ac62017-09-18 15:36:25 +0100864
Gilles Peskine8f073122018-11-27 15:58:47 +0100865component_test_no_platform () {
866 # Full configuration build, without platform support, file IO and net sockets.
867 # This should catch missing mbedtls_printf definitions, and by disabling file
868 # IO, it should catch missing '#include <stdio.h>'
869 msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100870 scripts/config.pl full
871 scripts/config.pl unset MBEDTLS_PLATFORM_C
872 scripts/config.pl unset MBEDTLS_NET_C
873 scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY
874 scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT
875 scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT
876 scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT
877 scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT
878 scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT
879 scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
Gilles Peskine8f073122018-11-27 15:58:47 +0100880 scripts/config.pl unset MBEDTLS_FS_IO
881 # Note, _DEFAULT_SOURCE needs to be defined for platforms using glibc version >2.19,
882 # to re-enable platform integration features otherwise disabled in C99 builds
883 make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -O0 -D_DEFAULT_SOURCE' lib programs
884 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' test
885}
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200886
Gilles Peskine8f073122018-11-27 15:58:47 +0100887component_build_no_std_function () {
888 # catch compile bugs in _uninit functions
889 msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100890 scripts/config.pl full
891 scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
892 scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
893 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
894}
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200895
Gilles Peskine8f073122018-11-27 15:58:47 +0100896component_build_no_ssl_srv () {
897 msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100898 scripts/config.pl full
899 scripts/config.pl unset MBEDTLS_SSL_SRV_C
900 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
901}
Manuel Pégourié-Gonnard66b8e952015-05-20 11:13:56 +0200902
Gilles Peskine8f073122018-11-27 15:58:47 +0100903component_build_no_ssl_cli () {
904 msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100905 scripts/config.pl full
906 scripts/config.pl unset MBEDTLS_SSL_CLI_C
907 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
908}
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000909
Gilles Peskine8f073122018-11-27 15:58:47 +0100910component_build_no_sockets () {
911 # Note, C99 compliance can also be tested with the sockets support disabled,
912 # as that requires a POSIX platform (which isn't the same as C99).
913 msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100914 scripts/config.pl full
915 scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
916 scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
917 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0 -std=c99 -pedantic' lib
918}
Hanno Becker5175ac62017-09-18 15:36:25 +0100919
Andrzej Kurek1d070822019-09-05 09:27:47 -0400920component_test_memory_buffer_allocator_backtrace () {
921 msg "build: default config with memory buffer allocator and backtrace enabled"
Hanno Becker74b5e342019-02-26 14:34:13 +0000922 scripts/config.pl set MBEDTLS_MEMORY_BUFFER_ALLOC_C
Andrzej Kurek1d070822019-09-05 09:27:47 -0400923 scripts/config.pl set MBEDTLS_PLATFORM_MEMORY
Hanno Becker74b5e342019-02-26 14:34:13 +0000924 scripts/config.pl set MBEDTLS_MEMORY_BACKTRACE
Andrzej Kurek60ebd982019-09-10 02:58:34 -0400925 scripts/config.pl set MBEDTLS_MEMORY_DEBUG
Andrzej Kurek1d070822019-09-05 09:27:47 -0400926 CC=gcc cmake .
927 make
928
929 msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C and MBEDTLS_MEMORY_BACKTRACE"
930 make test
931}
932
933component_test_memory_buffer_allocator () {
934 msg "build: default config with memory buffer allocator"
935 scripts/config.pl set MBEDTLS_MEMORY_BUFFER_ALLOC_C
Hanno Beckerd130b982019-06-03 16:35:02 +0100936 scripts/config.pl set MBEDTLS_PLATFORM_MEMORY
Hanno Becker74b5e342019-02-26 14:34:13 +0000937 CC=gcc cmake .
938 make
939
940 msg "test: MBEDTLS_MEMORY_BUFFER_ALLOC_C"
941 make test
942
943 msg "test: ssl-opt.sh, MBEDTLS_MEMORY_BUFFER_ALLOC_C"
Andrzej Kurek1f5a5962019-09-05 10:09:37 -0400944 # MBEDTLS_MEMORY_BUFFER_ALLOC is slow. Skip tests that tend to time out.
945 if_build_succeeded tests/ssl-opt.sh -e '^DTLS proxy'
Hanno Becker74b5e342019-02-26 14:34:13 +0000946}
947
Gilles Peskine8f073122018-11-27 15:58:47 +0100948component_test_no_max_fragment_length () {
949 # Run max fragment length tests with MFL disabled
950 msg "build: default config except MFL extension (ASan build)" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +0100951 scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
952 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
953 make
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +0000954
Gilles Peskine8f073122018-11-27 15:58:47 +0100955 msg "test: ssl-opt.sh, MFL-related tests"
956 if_build_succeeded tests/ssl-opt.sh -f "Max fragment length"
957}
Angus Grattonc4dd0732018-04-11 16:28:39 +1000958
Gilles Peskine8f073122018-11-27 15:58:47 +0100959component_test_no_max_fragment_length_small_ssl_out_content_len () {
960 msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)"
Gilles Peskine8f073122018-11-27 15:58:47 +0100961 scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
962 scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384
963 scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
964 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
965 make
Angus Grattonc4dd0732018-04-11 16:28:39 +1000966
Gilles Peskine8f073122018-11-27 15:58:47 +0100967 msg "test: MFL tests (disabled MFL extension case) & large packet tests"
968 if_build_succeeded tests/ssl-opt.sh -f "Max fragment length\|Large buffer"
969}
Janos Follath06c54002016-06-09 13:57:40 +0100970
Gilles Peskine8f073122018-11-27 15:58:47 +0100971component_test_null_entropy () {
972 msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)"
Gilles Peskine8f073122018-11-27 15:58:47 +0100973 scripts/config.pl set MBEDTLS_TEST_NULL_ENTROPY
974 scripts/config.pl set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
975 scripts/config.pl set MBEDTLS_ENTROPY_C
976 scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
977 scripts/config.pl unset MBEDTLS_ENTROPY_HARDWARE_ALT
978 scripts/config.pl unset MBEDTLS_HAVEGE_C
Gilles Peskine5fa32a72019-01-06 19:48:30 +0000979 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan -D UNSAFE_BUILD=ON .
Gilles Peskine8f073122018-11-27 15:58:47 +0100980 make
Janos Follath06c54002016-06-09 13:57:40 +0100981
Gilles Peskine8f073122018-11-27 15:58:47 +0100982 msg "test: MBEDTLS_TEST_NULL_ENTROPY - main suites (inc. selftests) (ASan build)"
983 make test
984}
Hanno Beckere5fecec2018-10-11 11:02:52 +0100985
Gilles Peskine8f073122018-11-27 15:58:47 +0100986component_test_platform_calloc_macro () {
987 msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
Gilles Peskine8f073122018-11-27 15:58:47 +0100988 scripts/config.pl set MBEDTLS_PLATFORM_MEMORY
989 scripts/config.pl set MBEDTLS_PLATFORM_CALLOC_MACRO calloc
990 scripts/config.pl set MBEDTLS_PLATFORM_FREE_MACRO free
991 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
992 make
Hanno Beckere5fecec2018-10-11 11:02:52 +0100993
Gilles Peskine8f073122018-11-27 15:58:47 +0100994 msg "test: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
995 make test
996}
Hanno Becker83ebf782017-07-07 12:29:15 +0100997
Gilles Peskine8f073122018-11-27 15:58:47 +0100998component_test_aes_fewer_tables () {
999 msg "build: default config with AES_FEWER_TABLES enabled"
Gilles Peskine8f073122018-11-27 15:58:47 +01001000 scripts/config.pl set MBEDTLS_AES_FEWER_TABLES
1001 make CC=gcc CFLAGS='-Werror -Wall -Wextra'
Hanno Becker83ebf782017-07-07 12:29:15 +01001002
Gilles Peskine8f073122018-11-27 15:58:47 +01001003 msg "test: AES_FEWER_TABLES"
1004 make test
1005}
Hanno Becker83ebf782017-07-07 12:29:15 +01001006
Gilles Peskine8f073122018-11-27 15:58:47 +01001007component_test_aes_rom_tables () {
1008 msg "build: default config with AES_ROM_TABLES enabled"
Gilles Peskine8f073122018-11-27 15:58:47 +01001009 scripts/config.pl set MBEDTLS_AES_ROM_TABLES
1010 make CC=gcc CFLAGS='-Werror -Wall -Wextra'
Hanno Becker83ebf782017-07-07 12:29:15 +01001011
Gilles Peskine8f073122018-11-27 15:58:47 +01001012 msg "test: AES_ROM_TABLES"
1013 make test
1014}
Hanno Becker83ebf782017-07-07 12:29:15 +01001015
Gilles Peskine8f073122018-11-27 15:58:47 +01001016component_test_aes_fewer_tables_and_rom_tables () {
1017 msg "build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled"
Gilles Peskine8f073122018-11-27 15:58:47 +01001018 scripts/config.pl set MBEDTLS_AES_FEWER_TABLES
1019 scripts/config.pl set MBEDTLS_AES_ROM_TABLES
1020 make CC=gcc CFLAGS='-Werror -Wall -Wextra'
Hanno Becker83ebf782017-07-07 12:29:15 +01001021
Gilles Peskine8f073122018-11-27 15:58:47 +01001022 msg "test: AES_FEWER_TABLES + AES_ROM_TABLES"
1023 make test
1024}
1025
1026component_test_make_shared () {
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001027 msg "build/test: make shared" # ~ 40s
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001028 make SHARED=1 all check
Gilles Peskinedc25c322019-07-03 20:43:32 +02001029 ldd programs/util/strerror | grep libmbedcrypto
Gilles Peskine8f073122018-11-27 15:58:47 +01001030}
Manuel Pégourié-Gonnard9b06abe2015-06-25 09:56:07 +02001031
Gilles Peskine2c47ffc2019-07-03 20:43:05 +02001032component_test_cmake_shared () {
1033 msg "build/test: cmake shared" # ~ 2min
1034 cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On .
1035 make
Gilles Peskinedc25c322019-07-03 20:43:32 +02001036 ldd programs/util/strerror | grep libmbedcrypto
Gilles Peskine2c47ffc2019-07-03 20:43:05 +02001037 make test
1038}
1039
Gilles Peskine87bf1b52019-07-03 20:42:16 +02001040component_build_mbedtls_config_file () {
1041 msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s
1042 # Use the full config so as to catch a maximum of places where
1043 # the check of MBEDTLS_CONFIG_FILE might be missing.
1044 scripts/config.pl full
1045 sed 's!"check_config.h"!"mbedtls/check_config.h"!' <"$CONFIG_H" >full_config.h
1046 echo '#error "MBEDTLS_CONFIG_FILE is not working"' >"$CONFIG_H"
1047 make CFLAGS="-I '$PWD' -DMBEDTLS_CONFIG_FILE='\"full_config.h\"'"
1048 rm -f full_config.h
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +00001049}
1050
Gilles Peskine8f073122018-11-27 15:58:47 +01001051component_test_m32_o0 () {
Simon Butcher8e6a22a2018-07-20 21:27:33 +01001052 # Build once with -O0, to compile out the i386 specific inline assembly
1053 msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s
Simon Butcher7a6da6e2018-06-27 21:52:54 +01001054 scripts/config.pl full
Gilles Peskineff26b042019-10-21 17:11:33 +02001055 make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS"
Andres Amaya Garcia84e6ce82017-05-04 11:35:51 +01001056
Simon Butcher8e6a22a2018-07-20 21:27:33 +01001057 msg "test: i386, make, gcc -O0 (ASan build)"
1058 make test
Gilles Peskine8f073122018-11-27 15:58:47 +01001059}
Gilles Peskine878cf602019-01-06 20:50:38 +00001060support_test_m32_o0 () {
1061 case $(uname -m) in
1062 *64*) true;;
1063 *) false;;
1064 esac
1065}
Simon Butcher8e6a22a2018-07-20 21:27:33 +01001066
Gilles Peskine8f073122018-11-27 15:58:47 +01001067component_test_m32_o1 () {
Simon Butcher8e6a22a2018-07-20 21:27:33 +01001068 # Build again with -O1, to compile in the i386 specific inline assembly
1069 msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s
Simon Butcher8e6a22a2018-07-20 21:27:33 +01001070 scripts/config.pl full
Gilles Peskineff26b042019-10-21 17:11:33 +02001071 make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O1" LDFLAGS="-m32 $ASAN_CFLAGS"
Simon Butcher8e6a22a2018-07-20 21:27:33 +01001072
1073 msg "test: i386, make, gcc -O1 (ASan build)"
Andres Amaya Garciaf4fbdda2017-05-08 11:19:19 +01001074 make test
Gilles Peskine7dd44b22019-04-08 16:58:02 +02001075
1076 msg "test ssl-opt.sh, i386, make, gcc-O1"
1077 if_build_succeeded tests/ssl-opt.sh
Gilles Peskine8f073122018-11-27 15:58:47 +01001078}
Gilles Peskine878cf602019-01-06 20:50:38 +00001079support_test_m32_o1 () {
1080 support_test_m32_o0 "$@"
1081}
Andres Amaya Garciaf4fbdda2017-05-08 11:19:19 +01001082
Gilles Peskine8f073122018-11-27 15:58:47 +01001083component_test_mx32 () {
Andres Amaya Garciaf4fbdda2017-05-08 11:19:19 +01001084 msg "build: 64-bit ILP32, make, gcc" # ~ 30s
Simon Butcher7a6da6e2018-06-27 21:52:54 +01001085 scripts/config.pl full
Gilles Peskine8118e462019-06-07 14:50:09 +02001086 make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' LDFLAGS='-mx32'
Andres Amaya Garciaf4fbdda2017-05-08 11:19:19 +01001087
1088 msg "test: 64-bit ILP32, make, gcc"
1089 make test
Gilles Peskine8f073122018-11-27 15:58:47 +01001090}
Gilles Peskine878cf602019-01-06 20:50:38 +00001091support_test_mx32 () {
1092 case $(uname -m) in
1093 amd64|x86_64) true;;
1094 *) false;;
1095 esac
1096}
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +00001097
Peter Kolbus1e2aa722018-12-27 06:59:04 -06001098component_test_min_mpi_window_size () {
1099 msg "build: Default + MBEDTLS_MPI_WINDOW_SIZE=1 (ASan build)" # ~ 10s
1100 scripts/config.pl set MBEDTLS_MPI_WINDOW_SIZE 1
1101 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1102 make
1103
1104 msg "test: MBEDTLS_MPI_WINDOW_SIZE=1 - main suites (inc. selftests) (ASan build)" # ~ 10s
1105 make test
1106}
1107
Gilles Peskine8f073122018-11-27 15:58:47 +01001108component_test_have_int32 () {
1109 msg "build: gcc, force 32-bit bignum limbs"
Gilles Peskine8f073122018-11-27 15:58:47 +01001110 scripts/config.pl unset MBEDTLS_HAVE_ASM
1111 scripts/config.pl unset MBEDTLS_AESNI_C
1112 scripts/config.pl unset MBEDTLS_PADLOCK_C
1113 make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32'
Andres Amaya Garcia84e6ce82017-05-04 11:35:51 +01001114
Gilles Peskine8f073122018-11-27 15:58:47 +01001115 msg "test: gcc, force 32-bit bignum limbs"
1116 make test
1117}
Andres Amaya Garciafe843a32017-07-20 13:21:34 +01001118
Gilles Peskine8f073122018-11-27 15:58:47 +01001119component_test_have_int64 () {
1120 msg "build: gcc, force 64-bit bignum limbs"
Gilles Peskine8f073122018-11-27 15:58:47 +01001121 scripts/config.pl unset MBEDTLS_HAVE_ASM
1122 scripts/config.pl unset MBEDTLS_AESNI_C
1123 scripts/config.pl unset MBEDTLS_PADLOCK_C
1124 make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64'
Gilles Peskine14c3c062018-01-29 21:25:12 +01001125
Gilles Peskine8f073122018-11-27 15:58:47 +01001126 msg "test: gcc, force 64-bit bignum limbs"
1127 make test
1128}
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +00001129
Gilles Peskine8f073122018-11-27 15:58:47 +01001130component_test_no_udbl_division () {
1131 msg "build: MBEDTLS_NO_UDBL_DIVISION native" # ~ 10s
Gilles Peskine8f073122018-11-27 15:58:47 +01001132 scripts/config.pl full
Gilles Peskine8f073122018-11-27 15:58:47 +01001133 scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
1134 make CFLAGS='-Werror -O1'
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001135
Gilles Peskine8f073122018-11-27 15:58:47 +01001136 msg "test: MBEDTLS_NO_UDBL_DIVISION native" # ~ 10s
1137 make test
1138}
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001139
Gilles Peskine8f073122018-11-27 15:58:47 +01001140component_test_no_64bit_multiplication () {
1141 msg "build: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
Gilles Peskine8f073122018-11-27 15:58:47 +01001142 scripts/config.pl full
Gilles Peskine8f073122018-11-27 15:58:47 +01001143 scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
1144 make CFLAGS='-Werror -O1'
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001145
Gilles Peskine8f073122018-11-27 15:58:47 +01001146 msg "test: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
1147 make test
1148}
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001149
Gilles Peskine8f073122018-11-27 15:58:47 +01001150component_build_arm_none_eabi_gcc () {
1151 msg "build: arm-none-eabi-gcc, make" # ~ 10s
Manuel Pégourié-Gonnard6e6ae9b2019-04-29 12:44:12 +02001152 scripts/config.pl baremetal
Gilles Peskine8f073122018-11-27 15:58:47 +01001153 make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
1154}
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001155
Gilles Peskine560f3322019-08-09 16:05:05 +02001156component_build_arm_none_eabi_gcc_arm5vte () {
Gilles Peskinee07b9ff2019-08-08 16:09:02 +02001157 msg "build: arm-none-eabi-gcc -march=arm5vte, make" # ~ 10s
Gilles Peskine0bd284d2019-08-05 11:34:25 +02001158 scripts/config.pl baremetal
Gilles Peskine560f3322019-08-09 16:05:05 +02001159 # Build for a target platform that's close to what Debian uses
1160 # for its "armel" distribution (https://wiki.debian.org/ArmEabiPort).
1161 # See https://github.com/ARMmbed/mbedtls/pull/2169 and comments.
1162 # It would be better to build with arm-linux-gnueabi-gcc but
1163 # we don't have that on our CI at this time.
Gilles Peskinee07b9ff2019-08-08 16:09:02 +02001164 make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar CFLAGS='-Werror -Wall -Wextra -march=armv5te -O1' LDFLAGS='-march=armv5te' SHELL='sh -x' lib
Gilles Peskine0bd284d2019-08-05 11:34:25 +02001165}
1166
Gilles Peskine8f073122018-11-27 15:58:47 +01001167component_build_arm_none_eabi_gcc_no_udbl_division () {
1168 msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
Manuel Pégourié-Gonnard6e6ae9b2019-04-29 12:44:12 +02001169 scripts/config.pl baremetal
Gilles Peskine8f073122018-11-27 15:58:47 +01001170 scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
1171 make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
1172 echo "Checking that software 64-bit division is not required"
1173 if_build_succeeded not grep __aeabi_uldiv library/*.o
1174}
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001175
Gilles Peskine8f073122018-11-27 15:58:47 +01001176component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
1177 msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
Manuel Pégourié-Gonnard6e6ae9b2019-04-29 12:44:12 +02001178 scripts/config.pl baremetal
Gilles Peskine8f073122018-11-27 15:58:47 +01001179 scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
1180 make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
1181 echo "Checking that software 64-bit multiplication is not required"
1182 if_build_succeeded not grep __aeabi_lmul library/*.o
1183}
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001184
Gilles Peskine8f073122018-11-27 15:58:47 +01001185component_build_armcc () {
1186 msg "build: ARM Compiler 5, make"
Manuel Pégourié-Gonnard6e6ae9b2019-04-29 12:44:12 +02001187 scripts/config.pl baremetal
Manuel Pégourié-Gonnardedb2dc92015-02-10 14:36:31 +00001188
Gilles Peskine5331c6e2019-01-06 22:23:42 +00001189 make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
1190 make clean
Manuel Pégourié-Gonnard2adb3752018-06-07 10:51:44 +02001191
Gilles Peskine5331c6e2019-01-06 22:23:42 +00001192 # ARM Compiler 6 - Target ARMv7-A
1193 armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a"
Gilles Peskineed942f82017-06-08 15:19:20 +02001194
Gilles Peskine5331c6e2019-01-06 22:23:42 +00001195 # ARM Compiler 6 - Target ARMv7-M
1196 armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m"
Andres AG87bb5772016-09-27 15:05:15 +01001197
Gilles Peskine5331c6e2019-01-06 22:23:42 +00001198 # ARM Compiler 6 - Target ARMv8-A - AArch32
1199 armc6_build_test "--target=arm-arm-none-eabi -march=armv8.2-a"
Andres AG87bb5772016-09-27 15:05:15 +01001200
Gilles Peskine5331c6e2019-01-06 22:23:42 +00001201 # ARM Compiler 6 - Target ARMv8-M
1202 armc6_build_test "--target=arm-arm-none-eabi -march=armv8-m.main"
Simon Butcher940737f2017-07-23 13:42:36 +02001203
Gilles Peskine5331c6e2019-01-06 22:23:42 +00001204 # ARM Compiler 6 - Target ARMv8-A - AArch64
1205 armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a"
Gilles Peskine8f073122018-11-27 15:58:47 +01001206}
Simon Butcher940737f2017-07-23 13:42:36 +02001207
Gilles Peskine8f073122018-11-27 15:58:47 +01001208component_test_allow_sha1 () {
1209 msg "build: allow SHA1 in certificates by default"
Gilles Peskine8f073122018-11-27 15:58:47 +01001210 scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
1211 make CFLAGS='-Werror -Wall -Wextra'
1212 msg "test: allow SHA1 in certificates by default"
1213 make test
1214 if_build_succeeded tests/ssl-opt.sh -f SHA-1
1215}
Simon Butcher940737f2017-07-23 13:42:36 +02001216
Gilles Peskine8f073122018-11-27 15:58:47 +01001217component_build_mingw () {
1218 msg "build: Windows cross build - mingw64, make (Link Library)" # ~ 30s
Gilles Peskine8f073122018-11-27 15:58:47 +01001219 make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 lib programs
Gilles Peskine2a458da2017-05-12 15:26:58 +02001220
Gilles Peskine8f073122018-11-27 15:58:47 +01001221 # note Make tests only builds the tests, but doesn't run them
1222 make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDOWS_BUILD=1 tests
1223 make WINDOWS_BUILD=1 clean
Hanno Beckere963efa2018-01-03 10:03:43 +00001224
Gilles Peskine8f073122018-11-27 15:58:47 +01001225 msg "build: Windows cross build - mingw64, make (DLL)" # ~ 30s
1226 make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 lib programs
1227 make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall -Wextra' WINDOWS_BUILD=1 SHARED=1 tests
1228 make WINDOWS_BUILD=1 clean
1229}
Simon Butcher002bc622016-11-17 09:27:45 +00001230
Gilles Peskine8f073122018-11-27 15:58:47 +01001231component_test_memsan () {
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001232 msg "build: MSan (clang)" # ~ 1 min 20s
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001233 scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm
1234 CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
1235 make
Manuel Pégourié-Gonnard4a9dc2a2014-05-09 13:46:59 +02001236
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001237 msg "test: main suites (MSan)" # ~ 10s
1238 make test
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +01001239
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001240 msg "test: ssl-opt.sh (MSan)" # ~ 1 min
Gilles Peskine7c652162017-12-11 00:01:40 +01001241 if_build_succeeded tests/ssl-opt.sh
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +01001242
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001243 # Optional part(s)
Manuel Pégourié-Gonnard9bda9b32014-11-20 13:10:22 +01001244
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001245 if [ "$MEMORY" -gt 0 ]; then
1246 msg "test: compat.sh (MSan)" # ~ 6 min 20s
Gilles Peskine7c652162017-12-11 00:01:40 +01001247 if_build_succeeded tests/compat.sh
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001248 fi
Gilles Peskine8f073122018-11-27 15:58:47 +01001249}
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01001250
Gilles Peskine69f190e2019-01-10 00:11:42 +01001251component_test_valgrind () {
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001252 msg "build: Release (clang)"
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001253 CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release .
1254 make
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +00001255
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001256 msg "test: main suites valgrind (Release)"
1257 make memcheck
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +00001258
Gilles Peskine0a47c4f2019-04-08 17:00:56 +02001259 # Optional parts (slow; currently broken on OS X because programs don't
1260 # seem to receive signals under valgrind on OS X).
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001261 if [ "$MEMORY" -gt 0 ]; then
1262 msg "test: ssl-opt.sh --memcheck (Release)"
Gilles Peskine7c652162017-12-11 00:01:40 +01001263 if_build_succeeded tests/ssl-opt.sh --memcheck
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001264 fi
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +00001265
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001266 if [ "$MEMORY" -gt 1 ]; then
1267 msg "test: compat.sh --memcheck (Release)"
Gilles Peskine7c652162017-12-11 00:01:40 +01001268 if_build_succeeded tests/compat.sh --memcheck
Gilles Peskine7ad603e2017-12-10 23:22:20 +01001269 fi
Gilles Peskine8f073122018-11-27 15:58:47 +01001270}
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +00001271
Gilles Peskine8f073122018-11-27 15:58:47 +01001272component_test_cmake_out_of_source () {
1273 msg "build: cmake 'out-of-source' build"
Gilles Peskine8f073122018-11-27 15:58:47 +01001274 MBEDTLS_ROOT_DIR="$PWD"
1275 mkdir "$OUT_OF_SOURCE_DIR"
1276 cd "$OUT_OF_SOURCE_DIR"
1277 cmake "$MBEDTLS_ROOT_DIR"
1278 make
Manuel Pégourié-Gonnard392d3dd2015-01-26 14:03:56 +00001279
Gilles Peskine8f073122018-11-27 15:58:47 +01001280 msg "test: cmake 'out-of-source' build"
1281 make test
1282 # Test an SSL option that requires an auxiliary script in test/scripts/.
1283 # Also ensure that there are no error messages such as
1284 # "No such file or directory", which would indicate that some required
1285 # file is missing (ssl-opt.sh tolerates the absence of some files so
1286 # may exit with status 0 but emit errors).
1287 if_build_succeeded ./tests/ssl-opt.sh -f 'Fallback SCSV: beginning of list' 2>ssl-opt.err
1288 if [ -s ssl-opt.err ]; then
1289 cat ssl-opt.err >&2
1290 record_status [ ! -s ssl-opt.err ]
1291 rm ssl-opt.err
1292 fi
1293 cd "$MBEDTLS_ROOT_DIR"
1294 rm -rf "$OUT_OF_SOURCE_DIR"
1295 unset MBEDTLS_ROOT_DIR
1296}
Andres AGdc192212016-08-31 17:33:13 +01001297
Gilles Peskine8f073122018-11-27 15:58:47 +01001298component_test_zeroize () {
1299 # Test that the function mbedtls_platform_zeroize() is not optimized away by
1300 # different combinations of compilers and optimization flags by using an
1301 # auxiliary GDB script. Unfortunately, GDB does not return error values to the
1302 # system in all cases that the script fails, so we must manually search the
1303 # output to check whether the pass string is present and no failure strings
1304 # were printed.
Gilles Peskine4976e822019-01-06 19:52:22 +00001305
1306 # Don't try to disable ASLR. We don't care about ASLR here. We do care
1307 # about a spurious message if Gdb tries and fails, so suppress that.
1308 gdb_disable_aslr=
1309 if [ -z "$(gdb -batch -nw -ex 'set disable-randomization off' 2>&1)" ]; then
1310 gdb_disable_aslr='set disable-randomization off'
1311 fi
1312
Gilles Peskine8f073122018-11-27 15:58:47 +01001313 for optimization_flag in -O2 -O3 -Ofast -Os; do
Gilles Peskine55f7c942019-01-09 22:28:21 +01001314 for compiler in clang gcc; do
1315 msg "test: $compiler $optimization_flag, mbedtls_platform_zeroize()"
1316 make programs CC="$compiler" DEBUG=1 CFLAGS="$optimization_flag"
Gilles Peskine4976e822019-01-06 19:52:22 +00001317 if_build_succeeded gdb -ex "$gdb_disable_aslr" -x tests/scripts/test_zeroize.gdb -nw -batch -nx 2>&1 | tee test_zeroize.log
Gilles Peskine55f7c942019-01-09 22:28:21 +01001318 if_build_succeeded grep "The buffer was correctly zeroized" test_zeroize.log
1319 if_build_succeeded not grep -i "error" test_zeroize.log
1320 rm -f test_zeroize.log
1321 make clean
1322 done
Andres Amaya Garcia29673812017-10-25 10:35:51 +01001323 done
Gilles Peskine4976e822019-01-06 19:52:22 +00001324
1325 unset gdb_disable_aslr
Gilles Peskine8f073122018-11-27 15:58:47 +01001326}
Andres Amaya Garciad0d7bf62017-10-25 09:01:31 +01001327
Gilles Peskine7b9fcdc2019-02-25 20:26:06 +01001328support_check_python_files () {
1329 type pylint3 >/dev/null 2>/dev/null
1330}
Gilles Peskine8f073122018-11-27 15:58:47 +01001331component_check_python_files () {
1332 msg "Lint: Python scripts"
1333 record_status tests/scripts/check-python-files.sh
1334}
Gilles Peskine192c72f2017-12-21 15:59:21 +01001335
Gilles Peskine8f073122018-11-27 15:58:47 +01001336component_check_generate_test_code () {
1337 msg "uint test: generate_test_code.py"
1338 record_status ./tests/scripts/test_generate_test_code.py
1339}
Gilles Peskine192c72f2017-12-21 15:59:21 +01001340
1341################################################################
1342#### Termination
1343################################################################
1344
Gilles Peskine8f073122018-11-27 15:58:47 +01001345post_report () {
1346 msg "Done, cleaning up"
1347 cleanup
Manuel Pégourié-Gonnard80955ee2014-03-19 18:29:01 +01001348
Gilles Peskine8f073122018-11-27 15:58:47 +01001349 final_report
1350}
1351
1352
1353
1354################################################################
1355#### Run all the things
1356################################################################
1357
Gilles Peskinee48351a2018-11-27 16:06:30 +01001358# Run one component and clean up afterwards.
Gilles Peskine8f073122018-11-27 15:58:47 +01001359run_component () {
Gilles Peskine608953e2019-01-02 18:57:02 +01001360 # Back up the configuration in case the component modifies it.
1361 # The cleanup function will restore it.
1362 cp -p "$CONFIG_H" "$CONFIG_BAK"
Gilles Peskineffcdeff2018-12-04 12:49:28 +01001363 current_component="$1"
Gilles Peskine8f073122018-11-27 15:58:47 +01001364 "$@"
Gilles Peskinee48351a2018-11-27 16:06:30 +01001365 cleanup
Gilles Peskine8f073122018-11-27 15:58:47 +01001366}
1367
1368# Preliminary setup
1369pre_check_environment
1370pre_initialize_variables
1371pre_parse_command_line "$@"
Gilles Peskine348fb9a2018-11-27 17:04:29 +01001372
Gilles Peskine878cf602019-01-06 20:50:38 +00001373pre_check_git
1374build_status=0
1375if [ $KEEP_GOING -eq 1 ]; then
1376 pre_setup_keep_going
1377else
1378 record_status () {
1379 "$@"
1380 }
1381fi
1382pre_print_configuration
1383pre_check_tools
Gilles Peskine878cf602019-01-06 20:50:38 +00001384cleanup
Gilles Peskine8f073122018-11-27 15:58:47 +01001385
Gilles Peskinebeb3a812019-01-06 22:11:25 +00001386# Run the requested tests.
1387for component in $RUN_COMPONENTS; do
1388 run_component "component_$component"
1389done
Gilles Peskine8f073122018-11-27 15:58:47 +01001390
1391# We're done.
Gilles Peskine878cf602019-01-06 20:50:38 +00001392post_report